You must be logged in to post your query.
Home › Forums › Chart Support › Holding Memory
Tagged: memory leack
I have 17K datapoints. Every time i am calling makechart, heap is getting heavy. Only after 6 time calling makechart heap size 1mb. Any solution?
function makechart() { $.getJSON(‘project/getCanvasJSdata?’+$(“#form_1”).serialize(), function(_dataLoc) { createChart(“chartContainer_1”,_dataLoc);
}); } function createChart(_divId, _dataLoc) { new CanvasJS.Chart(_divId, { title: { text: “Sample report”, }, data: _dataLoc.D, legend: { verticalAlign: “bottom”, horizontalAlign: “center” }, toolTip: { enabled: false, }, axisX: { title: “”, labelAngle: 0, interval: 50, labelFontColor: “black”, labelFontSize: 10 }, axisY: { title: “”, interval: 60, labelFontSize: 10, labelFontColor: “black”, gridThickness: 0, } }).render(); }
Suman,
Looking at the code, I can say that the problem is because you are creating the an entirely new Chart every time – while previous chart is still there – check using firebug. Instead you should create only one Chart object and call chart.render() each time you want to update (after modifying the data).
Here is a section on creating Dynamic Charts.
You must be logged in to reply to this topic. Login/Register