NearestPoint.Point = -1
Posted: Thu May 12, 2011 2:17 pm
Hi,
What will make NearestPoint.Point equals -1?
In my
Steema.TeeChart.Tools.NearestPoint Change
event handler most of my series works perfect, but for some series NearestPoint.Point always = -1
Also NearestPoint.GetNearestPoint(cursorPosition); returns -1.
My event handler look like this:
Thanks a lot in advance
Christian
What will make NearestPoint.Point equals -1?
In my
Steema.TeeChart.Tools.NearestPoint Change
event handler most of my series works perfect, but for some series NearestPoint.Point always = -1
Also NearestPoint.GetNearestPoint(cursorPosition); returns -1.
My event handler look like this:
Code: Select all
private Steema.TeeChart.Tools.NearestPoint tNearestPoint;
private EventHandler _steemaTeeChartToolsNearestPointEventHandler = null;
_steemaTeeChartToolsNearestPointEventHandler = new EventHandler(tNearestPoint_Change);
tNearestPoint.Change += _steemaTeeChartToolsNearestPointEventHandler;
private void tNearestPoint_Change(object sender, EventArgs e)
{
try
{
if (NearestPointChangeDelegate != null)
{
if (tNearestPoint.Point != -1)
{
NearestPointChangeEventArgs nearestPointChangeEventArgs = new NearestPointChangeEventArgs(
tNearestPoint.Series.XValues[tNearestPoint.Point],
tNearestPoint.Series.YValues[tNearestPoint.Point]);
NearestPointChangeDelegate(this, nearestPointChangeEventArgs);
}
else
{
Point cursorPosition = ((System.Windows.Forms.Control)Chart).PointToClient(System.Windows.Forms.Cursor.Position);
int point = tNearestPoint.GetNearestPoint(cursorPosition); //Also always = -1;
}
}
}
catch (Exception ex)
{
Ellab.Debug.GlobalDebug.debugForm.WriteText(ex);
}
}
Christian