- mouseEventArgs.GetPosition(ChartControl) versus
- ChartControl.MouseDownPoint.
I found that when all indicators have their Scale justification set to Right, the values are the same. However, if an indicator is switched so it's Scale justification is set to Left, then the X value returned is different by quite a bit.
To demonstrate this issue, I have attached two indicators. One prints the x/y coordinates of mouse clicks on the chart. The other plots the Close value as a line.
Open the output window.
To see things work correctly, load both indicators on a chart and click somewhere in the chart. Observe the output window. There should be two lines printed showing the x/y coordinates, one set obtained from GetPosition, the next set obtained from MouseDownPoint.
To see the bug, Change the Scale justification of GTestIndicatorShowingOnLeftMargin to be Left.
Now when you click on the chart, the X values of the two sets of coordinates are different.
I assume ChartPanel.MouseDownPoint is the ninja supported way of determining mouse click coordinates. If GetPosition is not a supported technique, then it should be clearly documented with warnings.
New Feature request:
If ChartPanel is the only correct way to determine the mouse coordinates, then there needs to be a new public property/method added to track the coordinates of a MouseMove event (since there is no down click in this event, the MouseDownPoint provided by Ninja does not help).
Gary
Comment