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
- yefchak asked 11 years ago
- You must login to post comments
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
- Andrew Burnett-Thompson answered 11 years ago
-
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.
-
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
-
Thanks, I'll check this out.
- You must login to post comments
Please login first to submit.