Skip to content Skip to sidebar Skip to footer

The Fastest Way To Add A New Data Bar With Pyqtgraph

I'd like to refresh a candle graph in the fastest way. But following the modified sample, I've got to draw whole chart every time even when I add just one new bar. The reason is th

Solution 1:

Here are a couple of options:

  • Make your custom item draw only one bar, and simply add a new item for each new data point. This would avoid the need to regenerate the entire picture, but might have slower performance with interactive zoom / pan when you are displaying many items.

  • Use a hybrid approach where you add new bars to CandleStickItem until it reaches some maximum size, and then start a new CandleStickItem (but keep the old ones as well). That way, each new bar will only cause a small amount of effort in generatePicture(), but you keep the total number of calls to paint() smaller.

Post a Comment for "The Fastest Way To Add A New Data Bar With Pyqtgraph"