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!
- tecman234 asked 11 years ago
- You must login to post comments
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
- Andrew Burnett-Thompson answered 11 years ago
- You must login to post comments
Please login first to submit.