Home Forums Chart Support Holding Memory

Holding Memory

Viewing 2 posts - 1 through 2 (of 2 total)
  • #4612

    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();
    }

    #4613

    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.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.