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 chart = anychart.pie([
3
{x: 'Cycling', value: 10},
4
{x: 'Swimming', value: 12},
5
{x: 'Run', value: 18},
6
{x: 'Hiking', value: 11},
7
]);
8
9
chart.hatchFill(true);
10
11
var palette = anychart.palettes.hatchFills();
12
palette.items(['divot', 'grid', 'forward-diagonal', 'horizontal']);
13
14
// Get hatch fills.
15
var items = palette.items();
16
17
items.reverse();
18
19
chart.hatchFillPalette(palette);
20
chart.title('Get and modify hatch fills');
21
chart.container('container');
22
chart.draw();
23
});