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
var chart = anychart.line([
3
{x: 0, value: 10},
4
{x: 1, value: 4},
5
{x: 2, value: 17},
6
{x: 3, value: 20},
7
{x: 4, value: 16},
8
{x: 5, value: 35},
9
{x: 6, value: 6},
10
{x: 7, value: 15},
11
{x: 8, value: 19},
12
{x: 9, value: 25},
13
{x: 10, value: 34},
14
{x: 11, value: 42},
15
{x: 12, value: 14},
16
{x: 13, value: 64},
17
{x: 14, value: 55},
18
{x: 15, value: 34},
19
{x: 16, value: 40},
20
{x: 17, value: 25}
21
]);
22
23
var zoom = chart.xZoom();
24
25
// Zooms series by passed points count.
26
zoom.setToPointsCount(10, true);
27
28
chart.title('Zooms series by passed points count');
29
chart.container('container');
30
chart.draw();
31
});