About clearing the cache in highchart data

makes a chart of dynamically plotting points. The data is 20 array objects taken from the background, inserting one point per second. Click the clear button, and the chart still draws points with the original data taken from the background. But at the moment, there is a problem with drawing points because there is a data cache in highchart. I would like to ask the god how to clear the highchart internal data cache has been drawn. It seems that the processedXData,points and other fields in chart.series have the data cache of the previously added points.

none of these methods can be tried: chart.series [0] .remove (), chart.update ({

)
    series: [{
        name: "",
        data: [],
      }],
 })

chart.chart.options.series [0] .data.length = 0; none of the above is allowed. Ask God for help

Mar.20,2021

Please refer to the following example

//  point
...

//  20 
var series = chart.series[0],
    shift = series.data.length > 20;
    
// add the point
chart.series[0].addPoint(point, true, shift);

is excerpted from
https://www.highcharts.com/do.

Menu