Home forums Using CanvasJS how can release resource?

This topic contains 1 reply, has 1 voice, and was last updated by  cndv3996 4 months ago.

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


    hi Guys,

    i’m new comer, and i have a question, could you help?

    i have a web page, which has a chart canvas & a slider,

    say the slider has 100 positions.

    when i pull the slider to another position,
    ajax will load a PHP script with some data for canvasjs.

    then i will new a chart, and fill in the new data:
    var chart = new CanvasJS.Chart(“chartContainer”

    and render.

    after a few times,
    memory usage of browser will keep increase,
    and browser reponse will be slower & slower,

    i think older data needs be released before i allocate a new chart?

    how could i do it?
    i just can’t find an answer in the document.

    thank you.




    my mistake,

    no need to release resource.

    my mistake, and solved.

    each time i pull slider, i add an “on” callback function repeatedly,
    this made memory usage increase and browser slower.

    not fault of canvasjs.

    thank you.

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

You must be logged in to reply to this topic.