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.cartesian();
3
4
var series1 = chart.marker([
5
{x: 1, value: 10},
6
{x: 2, value: 11},
7
{x: 3, value: 17},
8
{x: 4, value: 7},
9
{x: 5, value: 21},
10
{x: 6, value: 4}
11
]);
12
series1.hatchFill('zig-zag');
13
series1.size(20);
14
15
var series2 = chart.marker([
16
{x: 1, value: 5},
17
{x: 2, value: 16},
18
{x: 3, value: 25},
19
{x: 4, value: 30},
20
{x: 5, value: 15},
21
{x: 6, value: 4}
22
]);
23
series2.size(20);
24
25
// Get hatch fill of the first series.
26
var hatchFill = series1.hatchFill();
27
28
series2.hatchFill(hatchFill);
29
30
chart.title('Get and use hatch fill');
31
chart.container('container');
32
chart.draw();
33
});