Hello,
I’ve written a simple function to hide all data series on a graph (after a click on a link); this is what it does:
for(var key in chart.options.data) {
if (chart.options.data[key].visible)
chart.options.data[key].visible = false;
}
the problem is that it’s very very slow and I don’t understand why (it take 5-6 seconds, much more then disabling the single lines individually by clicking on them). Moreover very often I get this error after hiding the lines:
Uncaught TypeError: Cannot set property ‘dataSeries’ of null
at Y._updateToolTip (jquery.canvasjs.min.js:807)
at Y.mouseMoveHandler (jquery.canvasjs.min.js:801)
at q._plotAreaMouseMove (jquery.canvasjs.min.js:249)
at q._mouseEventHandler (jquery.canvasjs.min.js:239)
at HTMLCanvasElement.<anonymous> (jquery.canvasjs.min.js:114)
Y._updateToolTip @ jquery.canvasjs.min.js:807
Y.mouseMoveHandler @ jquery.canvasjs.min.js:801
q._plotAreaMouseMove @ jquery.canvasjs.min.js:249
q._mouseEventHandler @ jquery.canvasjs.min.js:239
(anonymous) @ jquery.canvasjs.min.js:114
Please note that I’ve a function adding every few seconds new points to the dataseries using jquery and then calling the render method chart.render();
Any idea?
tnx!