HTMLcopy
1
<button onclick="data();">Apply changes (add pointers)</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.gauges.circular([0.4]);
4
chart.axis();
5
chart.needle();
6
chart.title('Disable redrawing of the chart after the changes. \n Use the buttons to apply the changes and draw them');
7
chart.container('container');
8
chart.draw();
9
10
// Disable chart redrawing.
11
chart.autoRedraw(false);
12
});
13
14
function autoRedraw() {
15
16
// Enable chart redrawing.
17
chart.autoRedraw(true);
18
}
19
20
var i = 0;
21
22
function data() {
23
var getData = chart.data();
24
var newData = getData.concat([Math.random()]);
25
chart.data(newData);
26
chart.needle(i++);
27
}