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
var chart = anychart.column();
3
4
chart.data({
5
header: ['#', 'Florida', 'Texas', 'Arizona', 'Nevada', 'Oregon', 'Idaho'],
6
rows: [
7
['Apples', 21, 99, 19, 72, 94, 71],
8
['Pears', 41, 7, 71, 10, 27, 79],
9
['Bananas', 9, 15, 77, 58, 97, 79],
10
['Grapes', 71, 34, 40, 21, 72, 6],
11
['Oranges', 6, 29, 11, 46, 19, 49]
12
]
13
});
14
chart.legend({position: 'left', itemsLayout: 'vertical'});
15
chart.container('container');
16
chart.draw();
17
18
// Converts the local coordinates to global coordinates.
19
var globalCoordinates = chart.localToGlobal(0, 0);
20
21
chart.title('Global coordinates [x: ' + globalCoordinates.x + ', y: ' + globalCoordinates.y + ']');
22
});