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.area();
3
4
var firstSeries = chart.rangeArea([
5
{x: "January", low: 3093, high: 12522},
6
{x: "February", low: 4205, high: 14622},
7
{x: "March", low: 4019, high: 10612},
8
{x: "April", low: 4920, high: 9752},
9
{x: "May", low: 5795, high: 8839},
10
{x: "June", low: 8327, high: 9842},
11
{x: "July", low: 7933, high: 9812},
12
{x: "August", low: 13573, high: 16922},
13
{x: "September", low: 14924, high: 15052},
14
{x: "October", low: 12684, high: 15917}
15
]);
16
firstSeries.selectHatchFill("zigZag");
17
18
// Selects series.
19
firstSeries.select();
20
21
var secondSeries = chart.rangeArea([
22
{x: "January", high: 3093, low: 493},
23
{x: "February", high: 4205, low: 205},
24
{x: "March", high: 4019, low: 119},
25
{x: "April", high: 4920, low: 920},
26
{x: "May", high: 5795, low: 795},
27
{x: "June", high: 8327, low: 327},
28
{x: "July", high: 7933, low: 933},
29
{x: "August", high: 13573, low: 3573},
30
{x: "September", high: 14924, low: 3924},
31
{x: "October", high: 12684, low: 1684}
32
]);
33
34
// Selects series.
35
secondSeries.select();
36
37
// Get select hatch fill.
38
var selectedHatchFill = firstSeries.selectHatchFill();
39
40
secondSeries.selectHatchFill(selectedHatchFill);
41
42
chart.title("Get and use select hatch fill");
43
chart.container("container");
44
chart.draw();
45
});