About echart dynamic drawing points

I would like to ask echart to dynamically draw points, how to exceed ten points, do not display the previous points. That is, the chart shows only 10 points, followed by a point, and before the deletion of a point.
this is how I added points:
chart.series [0] .data.push (2)

ask for help

Mar.31,2021

after push, if the length exceeds 10 shift, it will be fine
Array.prototype.shift ()

Menu