-
Notifications
You must be signed in to change notification settings - Fork 601
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
Crosshair snapping #701
Crosshair snapping #701
Conversation
This looks amazing! thanks I will review it and let you know any observation. |
Yes, please do! I used FindHitPoints to get the closest ChartPoint, but I bet those calculations have already been done by the ToolTip finding logic. Maybe this functionality can be hooked into that. |
float crosshairX; | ||
if (CrosshairSnapEnabled) | ||
{ | ||
var axisIndex = Array.IndexOf(cartesianChart.XAxes, this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only thing I don't completely like, we do not need to calculate the index, instead I think that the library should expose a read only property where we can get this value, The library internally can assign this index, there is no need to go and find it every time the crosshair is invalidated.
We can build that in a new PR, for now this seems ok.
Created a way for making the crosshair "snap" to the closest available ChartPoint. Can be enabled/disabled on a per axis basis
crosshair_snap.mp4