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
['2015-12-24', 27],
7
['2015-12-25', 25.5],
8
['2015-12-26', 23.1],
9
['2015-12-27', 26.9],
10
['2015-12-28', 29.7],
11
['2015-12-29', 30.3],
12
['2015-12-30', 23.7],
13
['2015-12-31', 20.4],
14
['2016-01-01', 23],
15
['2016-01-02', 27.5],
16
['2016-01-03', 28.2],
17
['2016-01-04', 23.3],
18
['2016-01-05', 28.9],
19
['2016-01-06', 29.3],
20
['2016-01-07', 28.4],
21
['2016-01-08', 22.8],
22
['2016-01-09', 25],
23
['2016-01-10', 26.5],
24
['2016-01-11', 27],
25
['2016-01-12', 27.8],
26
['2016-01-13', 24.2],
27
['2016-01-14', 29.3],
28
['2016-01-15', 28.1],
29
['2016-01-16', 30.4],
30
['2016-01-17', 28.9],
31
['2016-01-18', 24.8],
32
['2016-01-19', 31.7],
33
['2016-01-20', 29.9],
34
['2016-01-21', 24.9],
35
['2016-01-22', 29.9],
36
['2016-01-23', 23.9],
37
['2016-01-24', 27.9],
38
['2016-01-25', 28.2],
39
['2016-01-26', 22.7],
40
['2016-01-27', 30.3],
41
['2016-01-28', 28.7]
42
]);
43
44
// map the data
45
mapping = table.mapAs();
46
mapping.addField('value', 1);
47
48
// chart type
49
var chart = anychart.stock();
50
51
// set the series
52
var series = chart.plot(0).column(mapping);
53
series.name("Alice's Springs");
54
55
chart.title('Stock Demo: daily temperature \n(Array data notation)');
56
chart.container('container');
57
58
chart.draw();
59
});