Source.stream timeseries line plot with pass/old/previous data

I’m tring to stream data after x_range.on_change.
The thing is, if the current plot is 2020/01/10 data, when I’m streaming 2020/01/09 data.
The line plot will draw a line between the oldest data point and the newest data point.
It will create a single line across the whole figure.

Stream is explicitly only for appending new data to to the end of a data array, and line is explicitly only for connecting points in the order they appear in a data array, so this is entirely the expected behaviour. There are really only two options:

  • Don’t use stream. You’ll have to sort all the data by the dates to be in the correct time-order, and then update the entire data whole, instead of just streaming new points to it.

  • Don’t use line. Use a scatter plot, then the ordering will not matter visually since there is no connected topology between points.

2 Likes

Very helpful.
5 stars. :grinning:

1 Like