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 chart
4
var chart = anychart.column();
5
6
// enable the scroller
7
chart.xScroller(true);
8
9
// autoHide the scroller
10
chart.xScroller().autoHide("true");
11
12
// set the fill color
13
chart.xScroller().fill("#33CC33");
14
15
// set the selected fill color
16
chart.xScroller().selectedFill("#339966");
17
18
// set the stroke of the bar
19
chart.xScroller().outlineStroke("#33CC33", 2);
20
21
// define zoom settings
22
chart.xZoom().setToPointsCount(15);
23
24
// create a series
25
var series = chart.column(getData());
26
series.name("Total support requests");
27
28
// define chart settings
29
chart.xAxis().title("Hours");
30
chart.yAxis().title("Support requests");
31
chart.title("Amount of support requests by hours");
32
33
// display a chart
34
chart.container("container");
35
chart.draw();
36
});
37
38
// get data function
39
function getData(){
40
return [
41
["00:00", 10],
42
["01:00", 4],
43
["02:00", 17],
44
["03:00", 20],
45
["04:00", 20],
46
["05:00", 16],
47
["06:00", 35],
48
["07:00", 6],
49
["08:00", 15],
50
["09:00", 19],
51
["10:00", 25],
52
["11:00", 34],
53
["12:00", 42],
54
["13:00", 14],
55
["14:00", 50],
56
["15:00", 25],
57
["16:00", 34],
58
["17:00", 40],
59
["18:00", 64],
60
["19:00", 48],
61
["20:00", 22],
62
["21:00", 37],
63
["22:00", 53],
64
["23:00", 62]
65
];
66
}