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 ?
- Arne Ryborg asked 6 months ago
-
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 login to post comments
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
- Lex answered 6 months ago
- last edited 6 months ago
- You must login to post comments
Please login first to submit.