HTMLcopy
1
<button onclick="chart.line([Math.random(), Math.random(), Math.random(), Math.random()]);">Apply changes (add series)</button>
2
<button onclick="autoRedraw();">Draw changes on the chart</button>
3
<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
var chart;
2
anychart.onDocumentReady(function () {
3
chart = anychart.line([0.1, 0.3, 0.2, 0.4]);
4
5
chart.title('Disable redrawing of the chart after the changes. Use the buttons to apply the changes and draw them');
6
chart.legend(true);
7
chart.width('100%').height('95%');
8
chart.container('container');
9
chart.draw();
10
11
// Disable chart redrawing.
12
chart.autoRedraw(false);
13
});
14
15
function autoRedraw() {
16
17
// Enable chart redrawing.
18
chart.autoRedraw(true);
19
}