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