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("month");
5
table.addData([
6
{'month': '2010-01-01', 'low': 5.8, 'high': 7.9},
7
{'month': '2010-02-01', 'low': 4.6, 'high': 6.1},
8
{'month': '2010-03-01', 'low': 5.9, 'high': 8.1},
9
{'month': '2010-04-01', 'low': 7.8, 'high': 10.7},
10
{'month': '2010-05-01', 'low': 10.5, 'high': 13.7},
11
{'month': '2010-06-01', 'low': 13.8, 'high': 17},
12
{'month': '2010-07-01', 'low': 16.5, 'high': 18.5},
13
{'month': '2010-08-31', 'low': 17.8, 'high': 19},
14
{'month': '2010-09-01', 'low': 15.4, 'high': 17.8},
15
{'month': '2010-10-01', 'low': 12.7, 'high': 15.3},
16
{'month': '2010-11-01', 'low': 9.8, 'high': 13},
17
{'month': '2010-12-01', 'low': 9, 'high': 10.1},
18
{'month': '2010-01-01', 'low': 5.7, 'high': 8},
19
{'month': '2011-02-01', 'low': 6, 'high': 8.4},
20
{'month': '2011-03-01', 'low': 6, 'high': 9.5},
21
{'month': '2011-04-01', 'low': 7.7, 'high': 10},
22
{'month': '2011-05-01', 'low': 8.9, 'high': 11.1},
23
{'month': '2011-06-01', 'low': 10.2, 'high': 16.3},
24
{'month': '2011-07-01', 'low': 14.3, 'high': 19},
25
{'month': '2011-08-01', 'low': 16, 'high': 20.1},
26
{'month': '2011-09-01', 'low': 15.8, 'high': 18.9},
27
{'month': '2011-10-01', 'low': 11.4, 'high': 13.2},
28
{'month': '2011-11-01', 'low': 8.3, 'high': 10},
29
{'month': '2011-12-01', 'low': 6.5, 'high': 8.7},
30
{'month': '2012-01-01', 'low': 7.2, 'high': 8.6},
31
{'month': '2012-02-01', 'low': 5.3, 'high': 7.4},
32
{'month': '2012-03-01', 'low': 6.1, 'high': 9.4},
33
{'month': '2012-04-01', 'low': 8.7, 'high': 11.2},
34
{'month': '2012-05-21', 'low': 10.4, 'high': 14.3},
35
{'month': '2012-06-22', 'low': 13.5, 'high': 17.1},
36
{'month': '2012-07-23', 'low': 15.8, 'high': 19.7},
37
{'month': '2012-08-24', 'low': 17.8, 'high': 21},
38
{'month': '2012-09-25', 'low': 15.1, 'high': 17.3},
39
{'month': '2012-10-26', 'low': 12.6, 'high': 15.9},
40
{'month': '2012-11-27', 'low': 10.2, 'high': 13.8},
41
{'month': '2012-12-28', 'low': 8.3, 'high': 9.6}
42
]);
43
44
// map the data
45
mapping = table.mapAs({'low':'low', 'high':'high', 'value':'month'});
46
47
// set the chart type
48
var chart = anychart.stock();
49
50
// define the series
51
var series = chart.plot(0).rangeColumn(mapping);
52
series.name("Water temperature in London in 2010-2012");
53
54
chart.title('Water Temperature');
55
56
chart.container('container');
57
chart.draw();
58
});