Pre loader

ZoomPanModifier and History

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

Hi all,

In my chart I have ZoomPanModifier. I should load historical data, when user dragged the chart backwards.

  1. How can I catch event when chart drag is completed?
  2. Is there any easy way to fill the gaps in the data series? (the gaps are defined in the series as “”)

Best regards,
Arthur

  • You must to post comments
0
0

Hi there,

  1. Please, try out this:
    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);
  1. You should use Update(x, y) or FindIndex(oldValue)/RemoveAt(index)/Insert(index, newValue)

Hope this is helpful!

Best regards,
Yuriy

  • Arthur Romanov
    Hi, Thank you, I'll change it for MVVM. Thanks, Arthur
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies