Old problem with 'text' for point series Marks.
Posted: Thu Jun 15, 2006 11:24 pm
Hi,
This causes me some headache and some hint would be great:
There is no easy & reliable way to add text to point-marks. Let me demonstrate in an easy way a real problem with it:
1.
To show the text associated with a point-mark in a point series you have to do something like this (adding 4 points).
int iPoint = this.tChart2.Series[1].Add(1.0,3.33);
this.tChart2.Series[1].Marks.Items[iPoint].Text = "First";
iPoint = this.tChart2.Series[1].Add(2.0,4.44);
this.tChart2.Series[1].Marks.Items[iPoint].Text = "2nd";
iPoint = this.tChart2.Series[1].Add(3.0,5.55);
this.tChart2.Series[1].Marks.Items[iPoint].Text = "3rd";
iPoint = this.tChart2.Series[1].Add(4.0,6.66);
this.tChart2.Series[1].Marks.Items[iPoint].Text = "4th";
The "First", "2nd", etc appear properly IF you add ALSO the eventhandler:
private void points1_GetSeriesMark(Steema.TeeChart.Styles.Series series, Steema.TeeChart.Styles.GetSeriesMarkEventArgs e)
{
if(e.ValueIndex > -1)
{
e.MarkText = series.Marks.Items[e.ValueIndex].Text;
}
}
NOW COMES THE PROBLEM!
Exchange the x-coordiante for the 2nd and 3rd point (so their order
on the X-axis is switched) and the graph should show the text:
"First", "3rd", "2nd", 4th" but actually it shows the point-mark-text
incorrectly:
"First" "3rd", then there is NO text for the next point, then "4th"
Is there any way to associate text with the marks of a point series
when the points are NOT all ordered in respect to the X-value?
Many thanks!
fano
This causes me some headache and some hint would be great:
There is no easy & reliable way to add text to point-marks. Let me demonstrate in an easy way a real problem with it:
1.
To show the text associated with a point-mark in a point series you have to do something like this (adding 4 points).
int iPoint = this.tChart2.Series[1].Add(1.0,3.33);
this.tChart2.Series[1].Marks.Items[iPoint].Text = "First";
iPoint = this.tChart2.Series[1].Add(2.0,4.44);
this.tChart2.Series[1].Marks.Items[iPoint].Text = "2nd";
iPoint = this.tChart2.Series[1].Add(3.0,5.55);
this.tChart2.Series[1].Marks.Items[iPoint].Text = "3rd";
iPoint = this.tChart2.Series[1].Add(4.0,6.66);
this.tChart2.Series[1].Marks.Items[iPoint].Text = "4th";
The "First", "2nd", etc appear properly IF you add ALSO the eventhandler:
private void points1_GetSeriesMark(Steema.TeeChart.Styles.Series series, Steema.TeeChart.Styles.GetSeriesMarkEventArgs e)
{
if(e.ValueIndex > -1)
{
e.MarkText = series.Marks.Items[e.ValueIndex].Text;
}
}
NOW COMES THE PROBLEM!
Exchange the x-coordiante for the 2nd and 3rd point (so their order
on the X-axis is switched) and the graph should show the text:
"First", "3rd", "2nd", 4th" but actually it shows the point-mark-text
incorrectly:
"First" "3rd", then there is NO text for the next point, then "4th"
Is there any way to associate text with the marks of a point series
when the points are NOT all ordered in respect to the X-value?
Many thanks!
fano