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 data
4
var data = [
5
{x: "January", low: 0.7, high: 6.1},
6
{x: "February", low: 0.6, high: 6.3},
7
{x: "March", low: 1.9, high: 8.5},
8
{x: "April", low: 3.1, high: 10.8},
9
{x: "May", low: 5.7, high: 14.4,
10
normal: {
11
fill: "#5cd65c",
12
stroke: null,
13
label: {enabled: true}
14
},
15
hovered: {
16
fill: "#5cd65c",
17
stroke: null,
18
label: {enabled: true},
19
},
20
selected: {
21
fill: "#5cd65c",
22
stroke: null,
23
label: {enabled: true},
24
}
25
}
26
];
27
28
// create a chart
29
var chart = anychart.bar();
30
31
// create a range bar series and set the data
32
var series = chart.rangeBar(data);
33
34
// set the chart title
35
chart.title("Range Bar Chart: Appearance (Individual Points)");
36
37
// set the titles of the axes
38
chart.xAxis().title("Month");
39
chart.yAxis().title("Temperature, \xb0C");
40
41
// set the container id
42
chart.container("container");
43
44
// initiate drawing the chart
45
chart.draw();
46
});