HTMLcopy
1
<label><input onclick="verticalEnabled(false)" type="radio" name="orientation" checked>Horizontal Orientation</label>
2
<label><input onclick="verticalEnabled(true)" type="radio" name="orientation">Vertical Orientation</label>
3
<div id="container"></div>
CSScopy
16
1
html, body {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
7
label {
8
display: inline-block;
9
margin: 10px 0 0 10px;
10
}
11
#container {
12
position: absolute;
13
width: 100%;
14
top: 35px;
15
bottom: 0;
16
}
JavaScriptcopy
x
1
anychart.onDocumentReady(function () {
2
3
// data
4
var data = [
5
["John", 10000, 12500],
6
["Jake", 12000, 15000],
7
["Peter", 13000, 16500],
8
["James", 10000, 13000],
9
["Mary", 9000, 11000]
10
];
11
12
// create a chart
13
chart = anychart.column();
14
15
// set data
16
chart.data(data);
17
18
// set the chart title
19
chart.title("Vertical Charts: Changing On-the-Fly (Chart)");
20
21
// set the container id
22
chart.container("container");
23
24
// initiate drawing the chart
25
chart.draw();
26
});
27
28
// change the orientation of the chart
29
function verticalEnabled(enabled) {
30
chart.isVertical(enabled);
31
}