Pre loader

Center View Zoom

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

In a scenario where two numeric axis (X, Y) both have IsCenterAxis set to true, is it then possible to force MouseWheelZoomModifier to use center point of current view when zooming, rather than using mouse point as center point when zooming ?

Version
8
  • Lex
    Hi Arne, Thanks for your question. I’m going to discuss this with our developers and will get back to you with an update. With best regards, Lex S., MSEE, SciChart Technical Support Engineer
  • You must to post comments
0
0

Hi Arne,

We discussed your inquiry and prepared a custom Chart Modifier which will keep your chart centered while zooming. Please take a look:

    public class CustomMouseWheelZoomModifier : MouseWheelZoomModifier
{
    protected override void PerformZoom(Point point, double value)
    {
        var viewportPoint = new Point(ModifierSurface.ActualWidth / 2, ModifierSurface.ActualHeight / 2);

        PerformZoom(viewportPoint, value, value);
    }
}

You can find more info regarding the ModifierSurface area in the “Transforming Coordinates to the Viewport” section of the following documentation article:
Custom Modifiers – ChartModifierBase API

With best regards,

Lex S., MSEE
SciChart Technical Support Engineer

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.