07-14-2015 12:15 AM
Hello,
in the attached example I try to set the XPosition of an XYCursor. The SnapMode is ToPlot. When I set the XPosition on an valid x-value, the cursor is automatically set to an other x-value in the near of the point. When I zoom in the graph and there are not so many points on the screen, it works fine.
Best regards
Gerald
07-14-2015 03:06 PM
Hi, Gerald
I believe the behavior you are reporting is a bug, and I have filed bug ID 537212 to address it. I've also been able to work around the issue as follows:
private void numericUpDown1_ValueChanged(object sender, EventArgs e)
{
var xValue = ( double )numericUpDown1.Value;
var xData = this.scatterPlot1.GetXData( );
int xIndex = Array.FindIndex( xData, val => val == xValue );
// A value of -1 indicates the xValue was not found in xData.
// You may want to handle a value of -1 by finding a close match to xValue.
if ( xIndex != -1 )
this.xyCursor1.MoveCursor( xIndex );
}
Please let me know if you have any questions or if this work around doesn't fit your requirements.
07-15-2015 12:21 AM
Hello,
thank you for the fast answer. The workaround is perfect for me.
Best regards
Gerald