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
3
// set the data
4
table = anychart.data.table();
5
table.addData([
6
['2016-04-01', 19.36, 18.18],
7
['2016-04-02', 19.89, 19.00],
8
['2016-04-03', 19.15, 18.43],
9
['2016-04-06', 18.76, 18.27],
10
['2016-04-07', 19.14, 18.63],
11
['2016-04-08', 19.62, 18.96],
12
['2016-04-09', 19.70, 19.22],
13
['2016-04-13', 19.85, 19.37],
14
['2016-04-14', 19.55, 19.00],
15
['2016-04-15', 19.25, 18.51],
16
['2016-04-16', 19.78, 18.99],
17
['2016-04-17', 19.69, 19.00],
18
['2016-04-20', 18.95, 18.57],
19
['2016-04-21', 19.08, 18.57],
20
['2016-04-22', 19.19, 18.70],
21
['2016-04-23', 18.94, 18.47],
22
['2016-04-24', 21.20, 19.50],
23
['2016-04-27', 20.82, 20.28],
24
['2016-04-28', 20.27, 19.79],
25
['2016-04-29', 20.89, 20.06],
26
['2016-04-30', 21.10, 20.01],
27
['2016-05-01', 20.35, 19.86],
28
['2016-05-04', 20.40, 19.98],
29
['2016-05-05', 20.24, 19.64],
30
['2016-05-06', 20.07, 19.61],
31
['2016-05-07', 19.99, 19.14],
32
['2016-05-08', 19.64, 19.14],
33
['2016-05-11', 19.73, 19.01],
34
['2016-05-12', 20.06, 19.47],
35
['2016-05-13', 20.00, 19.67],
36
['2016-05-14', 20.23, 19.80],
37
['2016-05-15', 20.50, 19.98],
38
['2016-05-18', 20.60, 20.24],
39
['2016-05-19', 20.74, 20.25],
40
['2016-05-20', 20.69, 20.22],
41
['2016-05-21', 20.23, 19.51],
42
['2016-05-22', 20.17, 19.47],
43
['2016-05-26', 20.45, 19.45],
44
['2016-05-27', 20.60, 20.07],
45
['2016-05-28', 20.63, 20.05],
46
['2016-05-29', 20.94, 20.30],
47
['2016-06-01', 21.50, 20.86],
48
['2016-06-02', 21.98, 21.20],
49
['2016-06-03', 21.76, 21.29],
50
['2016-06-04', 21.90, 21.58],
51
['2016-06-05', 22.31, 21.81],
52
['2016-06-08', 22.32, 21.63],
53
['2016-06-09', 22.32, 21.88],
54
['2016-06-10', 22.62, 22.12],
55
['2016-06-11', 23.26, 22.57],
56
['2016-06-12', 23.38, 22.74],
57
['2016-06-15', 23.54, 23.02],
58
['2016-06-16', 24.11, 23.44],
59
['2016-06-17', 23.82, 23.17],
60
['2016-06-18', 23.69, 23.30],
61
['2016-06-19', 24.34, 23.75],
62
['2016-06-22', 23.95, 23.25],
63
['2016-06-23', 23.66, 23.21],
64
['2016-06-24', 23.75, 23.36],
65
['2016-06-25', 23.92, 23.20],
66
['2016-06-26', 23.69, 23.32],
67
['2016-06-29', 24.03, 23.55],
68
['2016-06-30', 24.24, 23.63],
69
['2016-07-01', 24.30, 23.96],
70
['2016-07-02', 24.04, 23.21]
71
]);
72
73
// map the data
74
mapping = table.mapAs();
75
mapping.addField('high', 1);
76
mapping.addField('low', 2);
77
78
// chart type
79
var chart = anychart.stock();
80
81
// set the series
82
var series = chart.plot(0).hilo(mapping);
83
series.name("ACME Corp. stock prices");
84
85
chart.title('Stock HiLo Demo: ACME Corp. Stock Prices \n(Array data notation)');
86
87
chart.container('container');
88
chart.draw();
89
});