SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components
Hi all,
In my chart I have ZoomPanModifier. I should load historical data, when user dragged the chart backwards.
Best regards,
Arthur
Hi there,
public class ZoomPanModifierEx: ZoomPanModifier { public event EventHandler DragCompleted; public override void OnModifierMouseUp(ModifierMouseArgs modifierMouseArgs) { base.OnModifierMouseUp(modifierMouseArgs); OnDragComplete(); } private void OnDragComplete() { var handler = DragCompleted; if(handler != null) { handler(this, EventArgs.Empty); } } }
If you use SciStockChart, you need to replace the old modifier with this new:
var group = ((ModifierGroup) stockChart.ChartModifier); //Find and remove old ZoomPan var panModifier = group["ZoomPanModifier"]; group.ChildModifiers.Remove(panModifier); //Create new modifier and subscribe it var zoomPan = new ZoomPanModifierEx(); zoomPan.DragCompleted += OnDragCompleted; //Add to ModifierGroup group.ChildModifiers.Add(zoomPan);
Hope this is helpful!
Best regards,
Yuriy
Please login first to submit.