SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & 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!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

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