Pre loader

Chart modifier for zooming to region of axis

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

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.

Version
4.2
  • You must to post comments
0
0

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

  • Hugoagogo
    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.
  • Andrew Burnett-Thompson
    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?
  • Hugoagogo
    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.
  • Hugoagogo
    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.
  • Andrew Burnett-Thompson
    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
Showing 1 result
Your Answer

Please first to submit.