nagix / chartjs-plugin-streaming

Chart.js plugin for live streaming data
MIT License
547 stars 135 forks source link

Continue drawing line from most recent data to chart edge? #157

Open swemoney opened 2 years ago

swemoney commented 2 years ago

If I have data that isn't updated in regular intervals (a heart rate for instance), is there a way to make the chart continue to draw a straight line to the edge of the graph and then replace it when new data arrives? Right now, if I try this I just have a huge gap from the last point on the graph until a new piece of data comes through. If my heart rate stays fairly stable, it could be 5-20 seconds before my watch sends an update. Currently, the way I'm working around it is just pushing the old heart rate into the data at each 1 second interval onRefresh but then when the rate moves, the line jumps from the 1 seconds ago point straight to the new heart rate. I think it looks better when you have the line sloping from the last different data point that was different instead.