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