We are transitioning from using oxyplot to sci-chart for the increased performance it offers.
In oxyplot you are able to configure the plot to allow you to click and drag on an axis to zoom only that axis.
I have found RubberBandXyZoomModifier, and can see how it can be set up to only zoom the x or y axis, but cant see any way to allow zooming a specific x or y axis when the click and drag occurs on that axis.
Before I dive into the modifiers API and start to figure out how to do this from scratch, am I missing something, or do you have any pointers on how to achieve this functionality as I believe it is a pretty common use case.
- Hugoagogo asked 8 years ago
- You must login to post comments
Hello!
It sounds like what you need is the X/YAxisDragModifier. This has the ability to pan, or zoom, a single axis on drag.
You can see it demonstrated here: Drag Axis to Scale or Pan Example
Let me know if this helps!
Best regards,
Andrew
- Andrew Burnett-Thompson answered 8 years ago
-
I have this all working nicely, except for some edge cases if leaving the plot when dragging, is there any reason why the MouseButtons Property is always None for the mousemove event.
-
You need to capture MouseButton in the OnModifierMouseDown handler. It’s also worth using ChartModifierBase.ParentSurface.CaptureMouse and ReleaseMouseCapture in MouesDown/Up to help with the issues like when mouse leaves the plot. Fancy sharing your solution?
-
Ok I will look into capture mouse. I do look at the mouse button in the mouse down event I would still have through that the mouse button on the drag event would just show what buttons were down at the time of the move. I will share it when I have tidied it up a bit and commented, it will still have a bunch of stuff hard coded through.
-
I haven’t posted this yet as we have now purchased scichart (instead of using the trial) since we now have the source I have been writing my own modifier based on the source code of RuberBandXyZoomModifier is it still ok if I post this there.
-
I can’t say without seeing it – but I would say not to be on the safe side. If you’re simply inheriting a modifier with some small modifications it is OK
- 2 more comments
- You must login to post comments
Please login first to submit.