SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & 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 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.


Hi guys,

After adding a YAxis to the left of my SciChart I’ve noticed that this code no longer functions as I expect:

        public override void OnModifierMouseDown(ModifierMouseArgs e)

            if (ParentSurface.RenderableSeries.First().XAxis == null)

            if (!_mouseDragged && IsFunctional)
                _mouseDragged = true;
                _selectionStart = (DateTime) ParentSurface.RenderableSeries.First().HitTest(e.MousePoint).XValue;

_selectionStart should be a Date under the cursor where the user has just clicked. Instead it’s a Date approx. 40pixels to the right of where the user has just clicked because the Left YAxis is approx. 40 pixels, and the ModifierMouseArgs.MousePoint is considering the YAxis space into it’s X coordinate value.

So when I take that point and perform a HitTest, I am not getting the expected result here.

I will write a fix for this to take into account a Left Y Axis if one exists and modify the point’s X coordinate value, but I thought to give you a heads-up in case this is outside of expected functionality and is indeed a bug.


  • You must to post comments
Best Answer

Hi Miles,

This is because all mouse clicks are relative to the parent SciChartsurface. If you want to get the coordinates relative to the ModifierSurface itself, you have to perform a simple translation operation.

public override void OnModifierMouseMove(ModifierMouseArgs e)
   // gets the bounds of the ModifierSurface with respect to the RootGrid
   // which hosts the SciChartSurface
   var modifierRect = ModifierSurface.GetBoundsRelativeTo(RootGrid);

   // Translates the mouse point (from root grid coords) to ModifierSurface coords
   var mousePoint = base.GetPointRelativeTo(e.MousePoint, ModifierSurface);

Can you try the above translation and let me know if it works?

  • bstapylton
    Hi Andrew,This translation using GetPointRelativeTo works perfectly.Thank you and bravo, Miles
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.