I have the value of stocks from an API and I want to plot it against the timestamp in x axis using canvas.js and Angular. I want the data to be dynamic and the old value of the graph must be flushed out as the data is huge. How to go about the implementation for this?
Thank you.
You can shift the datapoints array so that datapoints with old value gets removed like
this.dataPoints.shift();
. Check out this Stackblitz project for complete working code.