Replies: 9 comments 10 replies
-
Excuse me: that should be line 788 and 792 |
Beta Was this translation helpful? Give feedback.
-
Hello, You can reproduce it by using your own dockable.py example (https://github.com/highfestiva/finplot/blob/master/finplot/examples/dockable.py). After line 37 add: Then run and draw a line by holding the ctrl-button and the mousebutton and dragging the mouse. The line will start shifted to the right. Kind regards, |
Beta Was this translation helpful? Give feedback.
-
Hello Highfestiva, I checked-out the latest version and saw the changes you've made to circumvent the issue. Thank you for that, ,but I think the bug is still there. You can still reproduce it by using your own dockable.py example (https://github.com/highfestiva/finplot/blob/master/finplot/examples/dockable.py). After line 37 add: Then run and draw a line by holding the ctrl-button and the mousebutton and dragging the mouse. In the previous 'bug report' I said the line starts to the right but after the changes the line starts 1 window size too far to the left (at least that's what I think after playing around with it). The example starts with the ticker AMRK, the price is around 80 dollar at the moment. If you, just for the experiment, start drawing the line just a bit to the right of the y-axis label '80', you see the line appear on the left side of the screen. So for the experiment, start drawing on the extreme right side of dock_0. I hope this helps you find the bug. Have a good weekend. |
Beta Was this translation helpful? Give feedback.
-
Hello Highfestiva, Yes I installed the update. But: When drawing a line by CTRL + Left-mouse-drag the line is shifted a window size to the left. In your function mapClickToView(self, pos) (line 883) you shift the position width() to the right to prevent this (line 888). The function mapClickToView is used in mouseClickEvent (line 868) so when I add a point to a line by clicking this is correct. But, and I think this is still missing, this is not used in mouseLeftDrag (line 792) when I start a new line. In short: Line 806 is: p1 = self.mapToView(ev.pos()) Line 810 is: p0 = self.mapToView(ev.lastPos()) Hope this helps, if not please say so, I will try to create a gif but I do not yet know how. Kind regards, |
Beta Was this translation helpful? Give feedback.
-
Sorry for the spam but it is maybe best to tackle these related issues at once. The same bug is there with right drag. Example dockable.py Right drag in dock_1 does show a ‘zoom area’ at the correct position Right drag in dock_0 does not show a ‘zoom area’ at the correct position You can see the window appear on the left when the mouse is on the right |
Beta Was this translation helpful? Give feedback.
-
Yes indeed that's strange. I installend the init.py file by downloading the zip-file from github page: https://github.com/highfestiva/finplot (Code -> download zip). Unpack the zip and paste the init file in a directory of a pycharm project where I use it. But if you do not have the same error i might try to reinstall pyqtgraph or pyQt. Are you sure you added the line to draw gridlines in the example code? If I leave it out it works flawless. |
Beta Was this translation helpful? Give feedback.
-
PyQt5 5.15.6 I will update PyQt5-sip and pyqtgraph |
Beta Was this translation helpful? Give feedback.
-
Well I could have tried that before. With: |
Beta Was this translation helpful? Give feedback.
-
Hello Highfestiva,
Thank you for the fantastic plotting tool!
When drawing a line with ctrl&mousedrag I would expect the line to start at the position of the crosshair, but it is shifted a bit along the x-axis. Is this intentional?
By changing the text on line 810 and 817 in the__init__.py file from mapToView to mapSceneToView this is solved. That feels more logical to me.
Kind regards,
Herman
Beta Was this translation helpful? Give feedback.
All reactions