HTMLcopy
1
<div id="container"></div>
CSScopy
8
1
html,
2
body,
3
#container {
4
width: 100%;
5
height: 100%;
6
margin: 0;
7
padding: 0;
8
}
JavaScriptcopy
x
1
anychart.onDocumentReady(function () {
2
// create column chart
3
var chart = anychart.area();
4
5
// set chart title text settings
6
chart.title('Min and Max Connection Timeout');
7
8
// create area series with passed data
9
var data = anychart.data.set(getRangesData());
10
11
// create series
12
var series = chart.rangeStepArea(data);
13
series.stroke(false);
14
// disable hover markers
15
series.hovered().markers(false);
16
// disable selected markers
17
series.selected().markers(false);
18
19
// name the axes
20
chart.xAxis().title('Day hours');
21
chart.yAxis().title('ms');
22
23
// set container id for the chart
24
chart.container('container');
25
// initiate chart drawing
26
chart.draw();
27
});
28
29
function getRangesData() {
30
return [
31
{ x: '0', low: 232, high: 542 },
32
{ x: '1', low: 393, high: 522 },
33
{ x: '2', low: 368, high: 602 },
34
{ x: '3', low: 419, high: 612 },
35
{ x: '4', low: 194, high: 1052 },
36
{ x: '5', low: 379, high: 639 },
37
{ x: '6', low: 332, high: 712 },
38
{ x: '7', low: 457, high: 622 },
39
{ x: '8', low: 493, high: 692 },
40
{ x: '9', low: 468, high: 802 },
41
{ x: '10', low: 419, high: 612 },
42
{ x: '11', low: 194, high: 1052 },
43
{ x: '12', low: 579, high: 839 },
44
{ x: '13', low: 532, high: 812 },
45
{ x: '14', low: 579, high: 839 },
46
{ x: '15', low: 532, high: 812 },
47
{ x: '16', low: 557, high: 922 },
48
{ x: '17', low: 593, high: 822 },
49
{ x: '18', low: 668, high: 902 },
50
{ x: '19', low: 619, high: 712 },
51
{ x: '20', low: 694, high: 952 },
52
{ x: '21', low: 679, high: 1039 },
53
{ x: '22', low: 632, high: 912 },
54
{ x: '23', low: 432, high: 712 }
55
];
56
}