HTMLcopy
1
<div id="container"></div>
CSScopy
6
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
JavaScriptcopy
x
1
anychart.onDocumentReady(function () {
2
var stage = anychart.graphics.create('container');
3
4
var barChart = anychart.bar3d();
5
barChart.bounds(0, 10, '50%', '100%');
6
7
var barSeries1 = barChart.bar([10, 4, 17, 20]);
8
barSeries1.hatchFill(true);
9
var barSeries2 = barChart.bar([5, 16, 10, 3]);
10
barSeries2.hatchFill(true);
11
var barSeries3 = barChart.bar([25, 4, 28, 11]);
12
barSeries3.hatchFill(true);
13
14
barChart.hatchFillPalette(['divot', 'zig-zag', 'weave']);
15
barChart.container(stage);
16
barChart.draw();
17
18
var columnChart = anychart.column3d();
19
columnChart.bounds('50%', 10, '50%', '100%');
20
21
var columnSeries1 = columnChart.column([10, 4, 17, 20]);
22
columnSeries1.hatchFill(true);
23
var columnSeries2 = columnChart.column([5, 16, 10, 3]);
24
columnSeries2.hatchFill(true);
25
var columnSeries3 = columnChart.column([25, 4, 28, 11]);
26
columnSeries3.hatchFill(true);
27
28
// Get hatch fill palette of the bar chart.
29
var barChartHatchFillPalette = barChart.hatchFillPalette();
30
31
columnChart.hatchFillPalette(barChartHatchFillPalette);
32
columnChart.container(stage);
33
columnChart.draw();
34
35
var title = anychart.standalones.title();
36
title.text('Get and use hatchFill palette');
37
title.container(stage);
38
title.draw();
39
});