Pre loader

How to detect when zoom Rubberband zoom opertion has occured

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 folks,

I need to recalculate a number of annotations after a rubberband zoom operation has occurred. I tried handling the chart’s Rendered() event, but this seems to happen too often.

I saw something in the documentation about subscribing to sciChartSurface.Services.GetService, but I’m not sure where or how to do this.

What’s the best way to detect zoom operations? (Ideally this would detect explicit setting of the axis visible ranges too, but since I trigger those manually I can call my routine manually there if necessary.)

Thanks,
–George

  • You must to post comments
0
0

Hi George,

As you are a source code customer, can you take & subclass RubberBandXyZoomModifier and see the method PerformZoom(). This is where the zoom operation occurs.

If you subclass this modifier, say call it NotifyRubberBandXyZoomModifier you can publish events on change. Modifiers are meant to be extensible – the PerformZoom method is not virtual so you can’t simply override it, but we can add this ourselves in future releases.

For axis changes, you can subscribe to IAxis.VisibleRangeChanged

Best regards,
Andrew

  • yefchak
    Thanks, I'll check this out. The issue with hooking onto IAxis.VisibleRangeChanged is that (I assume) this event can occur TWICE after a rubberband zoom -- once for each axis. This won't be huge problem since the routine I need to call isn't particularly slow. But my goal is to do calculations based on the current visible region, which depends on both axes.
  • Yuriy Zadereckiy
    Hi there, Another approach Andrew mentioned(subclass modifier and publish event) is demonstrated here. It's really simple, you could try it. Best regards, Yuriy
  • yefchak
    Thanks, I'll check this out.
  • You must to post comments
Showing 1 result
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