chart.js load totally new data

前端 未结 20 1407
有刺的猬
有刺的猬 2020-11-28 21:12

The API for chart.js allows one to edit points of the datasets loaded into it, for example:

.update( )

Calling update() on

20条回答
  •  Happy的楠姐
    2020-11-28 21:36

    You need to destroy:

    myLineChart.destroy();
    

    Then re-initialize the chart:

    var ctx = document.getElementById("myChartLine").getContext("2d");
    myLineChart = new Chart(ctx).Line(data, options);
    

提交回复
热议问题