SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy

We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

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
    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
    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.