Pre loader

Absolute Zoom in/out

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 am currently facing an issue related to our implementation.
We want the graph to zoom in whenever the user drags the y-axis upward, and conversely, zoom out when the user drags the y-axis downward. Importantly, this behavior should remain consistent regardless of whether the user drags the graph from the positive or negative side.

Version
v8.1
  • Lex
    • Lex
    • 2 months ago
    Hi Ziv, Thanks for your inquiry. I’ll discuss it with our team 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 Ziv,

We discussed your inquiry.
Unfortunately, SciChart doesn’t provide this behavior out of the box.

However, it can be implemented on the user side by overriding the PerformScale(Point currentPoint, Point lastPoint, bool isSecondHalf) method of the YAxisDragModifier.
This method is called on every MouseMove event and calculates a new VisibleRange for an Axis based on the dragged distance. Please take a look:
https://www.scichart.com/documentation/win/current/webframe.html#SciChart.Charting~SciChart.Charting.ChartModifiers.AxisDragModifierBase~PerformScale.html

The default implementation is straightforward:

        protected virtual void PerformScale(Point currentPoint, Point lastPoint, bool isSecondHalf)
    {
        var axis = CurrentAxis;
        var scaledRange = CalculateScaledRange(currentPoint, lastPoint, isSecondHalf, axis);
        axis.VisibleRange = scaledRange;
    }

so you should just calculate the VisibleRange according to your desired behavior and assign it to the axis.VisibleRange instead of the scaledRange.

Hope this helps.

With best regards,
Lex S., MSEE
SciChart Technical Support Engineer

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.