SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

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.