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
// setting data
7
var data = [
8
["A", 4],
9
["B", 3],
10
["C", 2],
11
["D", 1]
12
];
13
14
// set x axis position. This position is set by default
15
chart.xAxis().orientation("bottom");
16
17
// set y axis position. This position is set by default
18
chart.yAxis().orientation("left");
19
20
chart.xScale().inverted(false);
21
chart.yScale().inverted(false);
22
23
// add series
24
chart.column(data);
25
26
chart.container("container");
27
chart.draw();
28
});