Pre loader

Zoom slider

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

Hi,
I would like to be able to mimic the MouseWheelZoomModifier behavior programatically.

I have a slider control that I would like to zoom into the map. The same as the mouse wheel delta changes. I have a chart that has multiple Yaxis bound to the YAxes property of the SciChartSurface.

The mousewheezoommodifier works correctly, I just don’t know how to access the same functionality.

Thanks,

  • You must to post comments
0
0

Hi there,

There are a number of ways to zoom the chart:

SciChartSurface.ZoomExtents() – programmatic zoom to extents
SciChartSurface.AnimateZoomExtents(TimeSpan duration) – programmatic animated zoom to extents
SciChartSurface.ZoomExtentsX/Y() – programmatic zoom to extents in the X/Y direction only
SciChartSurface.AnimateZoomExtentsX/Y(TimeSpan duration) – programmatic animated zoom to extents in the X/Y direction only
SciChartSurface.ZoomExtentsX/Y() – programmatic zoom to extents in the X/Y direction only
AxisBase.ZoomBy(double minFraction, double maxFraction) – programmatic zoom in/out on an axis
AxisBase.ZoomBy(double minFraction, double maxFraction, TimeSpan duration) – programmatic animated zoom in/out on an axis
AxisBase.ScrollBy(double pixelsToScroll, ClipMode clipping, TimeSpan duration) – programmatic animated scroll by amount of pixels
AxisBase.VisibleRange = … – set a VisibleRange to a specified amount
AxisBase.AnimatedVisibleRange = … – animate a VisibleRange to a specified amount over 500ms

These are just a few. For full details please see the documentation for AxisBase.

UPDATE 2014:
Please, refer to this article in our Knowledgebase: How to create zoom slider.

Best regards,
Andrew

  • Martin Long
    Thanks for the quick reply. What method does the MouseWheelZoomModifier use to zoom because this is the behavior I am after. I had tried a few of the methods above but was never able to duplicate the MouseWheelZoomModifier. Thanks
  • You must to post comments
0
0

Hi,

The MouseWheelZoomModifier uses these methods internally to perform zoom:

 AxisBase.ZoomBy(double minFraction, double maxFraction) – programmatic zoom in/out on an axis
 AxisBase.ZoomBy(double minFraction, double maxFraction, TimeSpan duration) – programmatic animated zoom in/out on an axis

Each fraction is calculated based on the mouse cursor position.

Alternatively, you could consider calling MouseWheelZoomModifier.OnModifierMouseWheel(..) with the mouse point set to chart’s ActualWidth/2, ActualHeight/2 and Delta set correspondingly to an offset of the Slider.

Also, we’ve had a few similar requests earlier, so we consider adding inbuilt way to do this in further versions.

Hope this helps!

Best regards,
Yuriy

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies