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
// creat series
15
chart.column(data);
16
17
// inverts y scale. Now all elements has inverted (from top to bottom) direction
18
chart.yScale().inverted(true);
19
20
// set y axis position. This position is set by default
21
chart.yAxis().orientation("left");
22
23
// set x axis position. This position is set by default
24
chart.xAxis().orientation("bottom");
25
26
chart.container("container");
27
chart.draw();
28
});