-
Notifications
You must be signed in to change notification settings - Fork 832
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve mouse interactions in controls #999
Comments
Hi @kirsan31,
At the moment this is impossible, but the idea is good, of course there will be problems with circles, but we can make something like notches directly on the axes. |
@StendProg
Overall, for now 1. is the main bloker to implement cursors (hiding on mouse leave) on ScottPlot. |
@kirsan31 I am not sure if this is related. I am using same version and setup. I just use the "Enter" and "Leave" events and it works great. I am not using Mouse_Enter and Mouse_Leave. However as far as I know. Enter and Leave do the same thing as the mouse events |
@breakwinz As I remember |
MouseEnter and MouseLeave
These probably are worth forwarding. I'll try to implement these in the next few days, with a demo. Hiding the crosshairs when the mouse exits the plot seems like a good demo. Keep in mind that for extreme custom mouse interaction is probably just for the programmer to make their own control and implement the features they want. The controls aren't very complicated, and it's much easier to start with the source code and modify it to meet your needs than to try to adapt the standard controls to meet every use case. https://github.com/ScottPlot/ScottPlot/blob/master/src/controls/ScottPlot.WinForms/FormsPlot.cs Option to ignore axis lines when calling AxisAuto()The video demonstrates this problem well. Thanks for sharing it! As @StendProg pointed out this question has been raised before. I can add a public field to axis lines so they are ignored when axis limits are determined automatically, which may be a simpler solution. Labeling crosshair coordinates on the axesRight now this is not possible, but it should be easy to create a special plot type that does this. I'll put this idea on the triage list (#1028). This type of behavior would be especially useful for financial charts, similar to https://www.tradingview.com/chart |
All 3 controls now forward enter/leave events and the mouse tracker demos were updated to demonstrate how to use these events. It seems to work no matter what is in focus. This functionality will be in the next release on NuGet, hopefully in a few days 👍 @bclehmann I noticed in the Avalonia control that
I'll leave this issue open while I work on the remaining tasks |
It should be replaced with |
Tasks
This section was added by @swharden
Original Question
Your Environment
net472
andnet5.0-windows
was checked.Simple Mdi Winforms app. Child form with only formsPlot1 on it.
MouseLeave
andMouseEnter
not working,MouseMove
is working.This is critical to implement some info on
MouseMove
(to hide it after we leave the plot).P.s. Related question:
How to properly implement axes cursor on
MouseMove
with ScottPlot?I was tring something like this:
And it's worked BUT. Because of
_HLine
and_VLine
are plots, ScottPlot autozoom and autoaxes always trying to consider their values. And this lead to whole wrong behavior. For example:sp.mp4
Cursors must be completely excluded from plotting logic.
Also, is it possible to display Cursor coordinates on the axes (red circles on screen above)?
The text was updated successfully, but these errors were encountered: