highfestiva / finplot

Performant and effortless finance plotting for Python
MIT License
925 stars 187 forks source link

[QUESTION]Moving the crosshairs while updating the view causes stalling #533

Open ethanwanggg opened 1 month ago

ethanwanggg commented 1 month ago

Hello,

My question is,

  1. When I refer to [dockable.py] to draw multiple graphs using DockArea, crosshairs will be displayed on each graph instead of the only one. image Maybe I'm using it the wrong way, if so, please tell me how ax created with create_plot instead of create_plot_widget works on qwidget, or dockarea. My requirement is to display three graphs in one qwidget, with drag-and-drop resizing support, and a unique crosshair.

  2. Use create_plot_widget to draw multiple graphs on the DockArea, and then update them through the Live method. When the dynamic update data and the moving crosshair occur at the same time, the crosshair will have obvious stalls. But when I run [animate.py], I don't feel the stutch. Is it because [animate.py] doesn't use create_plot_widget and doesn't draw multiple dockareas? I don't know why

The above has troubled me for a long time, but it has not been solved. If you have time, please give me some instructions, I will be very grateful.

highfestiva commented 1 week ago

I had a go at trying to fix this, but unfortunately I'm not sure how to do it. Possibly I've gone down the wrong path when using pyqtgraph.SignalProxy for handling the mouse. It might be as simple as having each viewbox call _mouse_moved, but I don't have time to try it. Let me know if you find a way, and if so please send me a pull request.