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
isAsync = false;
3
4
var stage = anychart.graphics.create("container");
5
6
chart = anychart.pie([15, 16, 30]);
7
8
stage.listenOnce('stagerendered', function() {
9
if (isAsync) chart.title("Is Async");
10
});
11
12
chart.container(stage);
13
14
// set rendering to asynchronous mode
15
chart.draw(true);
16
17
// In async mode your code will be executed before chart draw.
18
isAsync = true;
19
20
});