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 chart
4
5
var chart = anychart.cartesian();
6
7
8
9
// data
10
var data = [
11
["A", 4],
12
["B", 3],
13
["C", 2],
14
["D", 1]
15
];
16
17
// add series
18
chart.column(data);
19
20
// position of y axis changer. Now y is on the right
21
chart.yAxis().orientation("right");
22
23
// position of x axis changer. Now x is on the top
24
chart.xAxis().orientation("top");
25
26
// inverts y scale. Now all elements has inverted (from right to left) direction
27
chart.yScale().inverted(true);
28
29
chart.container("container");
30
chart.draw();
31
});