Page 1 of 1
GetPointerStyle - bug
Posted: Wed May 05, 2010 5:41 am
by 15655333
Have bug with GetPointerStyle. I want draw only first points in some series. I have two charts with some series, series on different charts have same DataSource.
Result - first chart draw two first points, second chart don't draw first point in first series.
What do i wrong?
- problems.JPG (41.86 KiB) Viewed 5184 times
my code:
Code: Select all
private void lineSeries_GetPointerStyle(Steema.TeeChart.Styles.CustomPoint series,
Steema.TeeChart.Styles.GetPointerStyleEventArgs e)
{
e.Style = Steema.TeeChart.Styles.PointerStyles.Nothing;
if (series.DataSource == null)
return;
DataTable chartTable = series.DataSource as DataTable;
if (chartTable.Rows.Count > 0 &&
e.ValueIndex == 0)
{
e.Style = Steema.TeeChart.Styles.PointerStyles.Circle;
e.Color = clPointColor;
}
}
Re: GetPointerStyle - bug
Posted: Wed May 05, 2010 10:25 am
by 10050769
Hello petroV,
I couldn't reproduce your problem with last version of TeeChart .Net. Please, you could send us a simple project, because we can reproduce it here? You could make a DataSource to runtime as explain in this
thread.
Thanks,
Re: GetPointerStyle - bug
Posted: Wed May 05, 2010 11:20 am
by 15655333
i found proplem - it happen, when Left axe inverted
in attach sample project
Re: GetPointerStyle - bug
Posted: Thu May 06, 2010 11:04 am
by 10050769
Hello petroV,
I could reproduce your problem, and I think that you didn’t draw first points to series, because your code only works with points of first series:
Code: Select all
void line_GetPointerStyle(Steema.TeeChart.Styles.CustomPoint series, Steema.TeeChart.Styles.GetPointerStyleEventArgs e)
{
int i = tChart2.Series.IndexOf(series);
if (i == 0 && e.ValueIndex == index)
e.Style = Steema.TeeChart.Styles.PointerStyles.Circle;
else
e.Style = Steema.TeeChart.Styles.PointerStyles.Nothing;
}
I modify your code and work correctly with last version of TeeChart .Net. Please, check next code works as you want
Code: Select all
public Form1()
{
InitializeComponent();
}
private void Form1_Shown(object sender, EventArgs e)
{
Random rnd = new Random();
double x = 0;
double y = 0;
double z = 0;
tChart2.Axes.Left.Inverted = false;
tChart2.Aspect.View3D = false;
for (int i = 0; i < 4; i++)
{
Steema.TeeChart.Styles.Points3D points = new Steema.TeeChart.Styles.Points3D(tChart1.Chart) { Visible = true };
Steema.TeeChart.Styles.HorizLine line = new Steema.TeeChart.Styles.HorizLine(tChart2.Chart);
line.GetPointerStyle += new Steema.TeeChart.Styles.CustomPoint.GetPointerStyleEventHandler(line_GetPointerStyle);
line.Pointer.Visible = true;
line.Visible = true;
for (int k = 0; k < 50; k++)
{
points.Add(x, y, z);
line.Add(x, y);
x++; y++; z++;
}
x--; y--; z--;
}
}
void line_GetPointerStyle(Steema.TeeChart.Styles.CustomPoint series, Steema.TeeChart.Styles.GetPointerStyleEventArgs e)
{
if ((e.ValueIndex == 0) || (e.ValueIndex == 1))
e.Style = Steema.TeeChart.Styles.PointerStyles.Circle;
else
e.Style = Steema.TeeChart.Styles.PointerStyles.Nothing;
}
i found proplem - it happen, when Left axe inverted
Ok, I can reproduce it and I have added in bug Report list with number [TF02014856]. We will try to fix for next versions of TeeChart .Net.
On the other hand, I recommend change property Inverted= true, to Inverted=false, for now.
I hope will helps.
Thanks,
Re: GetPointerStyle - bug
Posted: Thu May 06, 2010 11:48 am
by 15655333
Thanks, will wait next version