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
// create a data set
4
var data = anychart.data.set([
5
["January", 0.7, 6.1, 8.1, 12.6],
6
["February", 0.6, 6.3, 8.5, 12.2],
7
["March", 1.9, 8.5, 10.3, 13.1],
8
["April", 3.1, 10.8, 13.4, 15.9],
9
["May", 5.7, 14.4, 14.9, 16.4]
10
]);
11
12
// map the data
13
var seriesData_1 = data.mapAs({x: [0], low: [1], high: [2]});
14
var seriesData_2 = data.mapAs({x: [0], low: [3], high: [4]});
15
16
// create a chart
17
var chart = anychart.column();
18
19
// create the first series, set the data and name
20
var series1 = chart.rangeColumn(seriesData_1);
21
series1.name("2004");
22
23
// configure the visual settings of the first series
24
series1.fill("#00cc99", 0.3);
25
series1.hoverFill("#00cc99", 0.3);
26
series1.selectFill("#00cc99", 0.5);
27
series1.stroke("#00cc99", 1, "10 5", "round");
28
series1.hoverStroke("#00cc99", 2, "10 5", "round");
29
series1.selectStroke("#00cc99", 4, "10 5", "round");
30
31
// create the second series, set the data and name
32
var series2 = chart.rangeColumn(seriesData_2);
33
series2.name("2005");
34
35
// configure the visual settings of the second series
36
series2.fill("#0066cc", 0.3);
37
series2.hoverFill("#0066cc", 0.3);
38
series2.selectFill("#0066cc", 0.5);
39
series2.hatchFill("zigzag", "#808080", 1, 15);
40
series2.stroke("#0066cc");
41
series2.hoverStroke("#0066cc", 2);
42
series2.selectStroke("#0066cc", 4);
43
44
// set the chart title
45
chart.title("Range Column Chart: Appearance");
46
47
// set the titles of the axes
48
var xAxis = chart.xAxis();
49
xAxis.title("Month");
50
var yAxis = chart.yAxis();
51
yAxis.title("Temperature, ?C");
52
53
// set the container id
54
chart.container("container");
55
56
// initiate drawing the chart
57
chart.draw();
58
});