HTMLcopy
1
<button onclick="vertical();">Vertical</button>
2
<button onclick="horizontal();">Horizontal</button>
3
<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
var chart;
2
3
function vertical() {
4
// Enable vertical layout.
5
chart.isVertical(true);
6
}
7
8
function horizontal() {
9
10
// Disable vertical layout.
11
chart.isVertical(false);
12
}
13
anychart.onDocumentReady(function () {
14
chart = anychart.scatter();
15
chart.line([
16
{x: 1, value: 0},
17
{x: 2, value: 20},
18
{x: 3, value: 10},
19
{x: 4, value: 30},
20
{x: 5, value: 20},
21
{x: 6, value: 40},
22
{x: 7, value: 30},
23
{x: 8, value: 50},
24
{x: 9, value: 40},
25
{x: 1, value: 0}
26
]);
27
chart.title('Enable/Disable chart vertical layout');
28
chart.container('container');
29
chart.draw();
30
});