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 stage = anychart.graphics.create("container");
3
4
var chart = anychart.line();
5
chart.line([49, 45, 9, 4, 17, 13]);
6
chart.line([41, 23, 15, 45, 39, 27]);
7
chart.title(true);
8
chart.legend({position: "left", itemsLayout: "vertical"});
9
chart.container(stage);
10
chart.draw();
11
12
// Converts the local coordinates to global coordinates.
13
var globalCoordinates = chart.localToGlobal(0, 0);
14
15
chart.title("Global coordinates [x: " + globalCoordinates.x + ", y: " + globalCoordinates.y + "]");
16
});