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