Page 1 of 1

Stackoverflow with Cursors and annotation tool

Posted: Thu Oct 05, 2006 11:11 pm
by 9637279
Hi,
users told me that when they use the cursors tool to see values for about
5 fastlines they sometimes get an exception. I use a cursor tool and show
the values in an annotation. Basically I used the code I saw in an example or some other reference. See below. The exception says:
"An unhandled exception of type System.StackOverflowException occured in mscorlib.dll". Is there a known problem? Or did I use
the example code incorrectly?
Thanks for any idea or hint!

private void cursorTool2_Change(object sender, Steema.TeeChart.Tools.CursorChangeEventArgs e)
{
if (m_Settings.ShowCursorValues)
{
m_tTopChartx_Val = e.XValue;
double yValue = 0.0;
int iPoint = 0;
DateTime myDT;

//Initialize text for annoation to empty string
this.annotationCursorTop.Text = "";
for (int i=0; i< NUM_SERIES_DATASET_GEARED; i++)
{
if( (this.tChartAffinity.Series.Count > 0) && this.tChartAffinity.Series.Visible)
{
this.cursorTool2.Series = this.tChartAffinity.Series;
iPoint = this.cursorTool2.NearestPoint(Steema.TeeChart.Tools.CursorToolStyles.Vertical,out yValue);
//Build the text for the annoation with the values.
this.annotationCursorTop.Text += this.tChartAffinity.Series.Title + ": Y = " + this.tChartAffinity.Series.YValues[iPoint].ToString("0.000")+ "\r\n";
}
}//for

myDT = Steema.TeeChart.Utils.DateTime(e.XValue);
//At the next line the progam stopped with the stackoverflow.
this.annotationCursorTop.Text += "Time = " + myDT.Hour.ToString() + ":" + myDT.Minute.ToString() + ":" + myDT.Second.ToString("00");
}

}

Posted: Fri Oct 06, 2006 8:11 am
by narcis
Hi fano,

Could you please send us an example we can run "as-is" to reproduce the problem here and let us know which TeeChart version are you using?

You can post your files at news://www.steema.net/steema.public.attachments newsgroup.

Thanks in advance.