Hi
I would like to do some logic after zooming in but can not find to witch event I should subscribe or overwrite ?
- You must login to post comments
Hm…OK, what about checking modifiers state in OnModifierMouseUp? Like that:
public override void OnModifierMouseUp(ModifierMouseArgs e) { if (!IsDragging) return; base.OnModifierMouseUp(e); }
This should help, but anyway, please, feel free to ask if you need further assistance or have more questions!
Best regards,
Yuriy
- Yuriy Zadereckiy answered 11 years ago
- You must login to post comments
Hi,
Please try to override OnModifierMouseUp method, for zooming is handled there. Let us know if this helps,
Best regards,
Yuriy
- Yuriy Zadereckiy answered 11 years ago
-
Hi Yuriy I also tried OnModifierMouseUp, but it also occurs in the same way MouseDown. Though I don't select zoom area I get this event called. I guess there is some logic where it's checking x1,y1 : 2x,y2 area. So it wouldn't try to zoom if there is nowhere to zoom in. Because I wouldn't like to change chart status from Normal to ZoomedIn only on mouse click (without actually zooming in).
- You must login to post comments
Strange IsDragging was always false and another property IsStylusOver was also false.
But then I started to play with Point coordinates. I guess there is a better solution than this, but it works:
private Point point = new Point();
public event EventHandler OnZoomIn;
public override void OnModifierMouseUp(ModifierMouseArgs e)
{
base.OnModifierMouseUp(e);
if (point.X != e.MousePoint.X && point.Y != e.MousePoint.Y)
{
Console.WriteLine("Zoomed in");
if (OnZoomIn != null)
OnZoomIn(this, null);
}
}
public override void OnModifierMouseDown(ModifierMouseArgs e)
{
point.X = e.MousePoint.X;
point.Y = e.MousePoint.Y;
Console.WriteLine("RubberBandZoomModifier: mouse down");
base.OnModifierMouseDown(e);
}
- Unisense A/S Tueager answered 11 years ago
-
Hi, Glad you sorted it out! Your solution is good enough as well, though it's strange that IsDragging is false everytime, we'll try to investigate. Best regards, Yuriy
- You must login to post comments
Hi there,
You could subscribe to IAxis.VisibleRangeChanged(you can get new/old visible range from args) or extend RubberBandZoomModifier in such a way, so it fire event every time when zoom operation performed, take a look at Zoom including annotation post, where similar behavior was implemented for ZoomExtentsModifier.
Is any of the above suitable for you?
Best regards,
Yuriy
- Yuriy Zadereckiy answered 11 years ago
-
I would like to extend RubberBandZoomModifier but don't find which method to override. Tried OnModifierMouseDown but this event occurs when I just press on chart, without even marking the area to zoom. IAxis.VisibleRangeChanged don't use it because I manually update axis visible ranges so it would occur without zooming.
- You must login to post comments
Please login first to submit.