HTMLcopy
1
<button onclick="chart.marker([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.scatter([
4
{x: 0, value: 0.4},
5
{x: 1, value: 0.2},
6
{x: 2, value: 0.8},
7
{x: 3, value: 0.5}
8
]);
9
chart.xScale().minimum(-1);
10
chart.xGrid(true).yGrid(true);
11
chart.title('Disable redrawing of the chart after the changes. \n Use the buttons to apply the changes and draw them');
12
chart.container('container');
13
chart.draw();
14
15
// Disable chart redrawing.
16
chart.autoRedraw(false);
17
});
18
19
function autoRedraw() {
20
21
// Enable chart redrawing.
22
chart.autoRedraw(true);
23
}