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-24T12:00:00', 27],
7
['2015-12-25T12:00:00', 25.5],
8
['2015-12-26T12:00:00', 23.1],
9
['2015-12-27T12:00:00', 26.9],
10
['2015-12-28T12:00:00', 29.7],
11
['2015-12-29T12:00:00', 30.3],
12
['2015-12-30T12:00:00', 23.7],
13
['2015-12-31T12:00:00', 20.4],
14
['2016-01-01T12:00:00', 23],
15
['2016-01-02T12:00:00', 27.5],
16
['2016-01-03T12:00:00', 28.2],
17
['2016-01-04T12:00:00', 23.3],
18
['2016-01-05T12:00:00', 28.9],
19
['2016-01-06T12:00:00', 29.3],
20
['2016-01-07T12:00:00', 28.4],
21
['2016-01-08T12:00:00', 22.8],
22
['2016-01-09T12:00:00', 25],
23
['2016-01-10T12:00:00', 26.5],
24
['2016-01-11T12:00:00', 27],
25
['2016-01-12T12:00:00', 27.8],
26
['2016-01-13T12:00:00', 24.2],
27
['2016-01-14T12:00:00', 29.3],
28
['2016-01-15T12:00:00', 28.1],
29
['2016-01-16T12:00:00', 30.4],
30
['2016-01-17T12:00:00', 28.9],
31
['2016-01-18T12:00:00', 24.8],
32
['2016-01-19T12:00:00', 31.7],
33
['2016-01-20T12:00:00', 29.9],
34
['2016-01-21T12:00:00', 24.9],
35
['2016-01-22T12:00:00', 29.9],
36
['2016-01-23T12:00:00', 23.9],
37
['2016-01-24T12:00:00', 27.9],
38
['2016-01-25T12:00:00', 28.2],
39
['2016-01-26T12:00:00', 22.7],
40
['2016-01-27T12:00:00', 30.3],
41
['2016-01-28T12:00:00', 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
});