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.cartesian();
3
chart.line([
4
{x: 0, value: 10},
5
{x: 1, value: 4},
6
{x: 2, value: 17},
7
{x: 3, value: 20},
8
{x: 4, value: 16},
9
{x: 5, value: 35},
10
{x: 6, value: 6},
11
{x: 7, value: 15},
12
{x: 8, value: 19},
13
{x: 9, value: 25},
14
{x: 10, value: 34},
15
{x: 11, value: 42},
16
{x: 12, value: 14},
17
{x: 13, value: 64},
18
{x: 14, value: 55},
19
{x: 15, value: 34},
20
{x: 16, value: 40},
21
{x: 17, value: 25}
22
]);
23
24
var scroller = chart.xScroller();
25
scroller.enabled(true);
26
27
// Get scroller orientation.
28
var scrollerOrientation = scroller.orientation();
29
30
chart.title('Scroller orientation is ' + scrollerOrientation);
31
chart.container('container');
32
chart.draw();
33
});