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

I have 3 charts in my stock trading application. Each chart show a different time frame of data. I want to move the mouse on one chart, and have the other two charts put their cursors on the bar that represents the same DateTime and value of the chart that has the mouse. I have this logic working with my current charting software(not Scichart).

In Scichart, it seems I need to either be able to set the position of the cursor modifier programatically, or create a horizontal & vertical line annotation on the charts that don’t contain the mouse.
Is there a way to set the cursor modifier coordinates?

thanks!

  • You must to post comments
0
0

Hello there,

No there isn’t a way to do this programmatically, but you can always create custom modifiers to do pretty much anything. Do you have a source-code license? If so this process is greatly simplified. The modifiers have methods like OnModifierMouseMove, OnModifierMouseUp, OnModifierMouseDown.

The CursorModifier specifically responds to OnModifierMouseMove. It is possible you could create a derived class of CursorModifier and override OnModifierMouseMove and by-pass it, but this would disable mouse-movement.

For instance:

public class CursorModifierEx : CursorModifier
{
    public bool IsManualMode { get; set; } // Todo: Make dependency property

    public Point MoveToPoint 
    { 
       get { return _moveToPoint; }
       set 
       { 
          _moveToPoint = value; 
          OnMoveToChanged(_moveToPoint); 
       }
    } // Todo: Make DependencyProperty 

    public void OnModifierMouseMove(ModifierMouseArgs e)
    {
       if (!IsManualMode) 
         base.OnModifierMouseMove(e); // Prevent MouseMove from going to base class
    }

    private void OnMoveToChanged(Point manualPoint)
    {
       if (IsManualMode) 
         base.OnModifierMouseMove(new ModifierMouseArgs()); // Todo, pass in mouse point here
    }
}

I haven’t compiled the above but it should give you an idea of how you can modify the behaviour of the ChartModifierBase derived classes.

Best regards,
Andrew

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.