Hi,
I have a ColorGrid that I added a CursorTool to. I would like to display the x,y,z value of the cursor location. I implemented the cursorTool_Changed method and get the correct (x,y) values using e.XValue and e.YValue. However I do not know how to get the z value. I also noticed that Steema.TeeChart.Tools.CursorChangeEventArgs passes in an e.ValueIndex but it is always zero. How come the ValueIndex is not the same as in the cusor click method or why doesn't the following work:
double x = colorGrid1.XValues.Value[e.ValueIndex];
double y = colorGrid1.YValues.Value[e.ValueIndex];
double z = colorGrid1.ZValues.Value[e.ValueIndex];
Thanks
John Fraschilla
ColorGrid and CursorTool
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: ColorGrid and CursorTool
Hi John,
I'm afraid this is a bug (TF02014645) which I have added to the defect list to be investigated. In the meantime, a workaround is doing this:
Hope this helps!
I'm afraid this is a bug (TF02014645) which I have added to the defect list to be investigated. In the meantime, a workaround is doing this:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private Steema.TeeChart.Styles.ColorGrid colorGrid1;
private Steema.TeeChart.Tools.CursorTool cursor1;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
colorGrid1 = new Steema.TeeChart.Styles.ColorGrid(tChart1.Chart);
colorGrid1.FillSampleValues();
cursor1 = new Steema.TeeChart.Tools.CursorTool(tChart1.Chart);
cursor1.FollowMouse = true;
cursor1.Series = colorGrid1;
cursor1.Change += new Steema.TeeChart.Tools.CursorChangeEventHandler(cursor1_Change);
tChart1.MouseMove += new MouseEventHandler(tChart1_MouseMove);
}
void tChart1_MouseMove(object sender, MouseEventArgs e)
{
ShowSeriesValues(colorGrid1.Clicked(e.X, e.Y));
}
void cursor1_Change(object sender, Steema.TeeChart.Tools.CursorChangeEventArgs e)
{
//ShowSeriesValues(e.ValueIndex);
}
private void ShowSeriesValues(int i)
{
if (i != -1)
{
double x = colorGrid1.XValues.Value[i];
double y = colorGrid1.YValues.Value[i];
double z = colorGrid1.ZValues.Value[i];
tChart1.Header.Text = x.ToString() + "; " +
y.ToString() + "; " +
z.ToString();
}
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: ColorGrid and CursorTool
Narcis,
I am getting an IndexOutOfRangeException in the colorGrid1.Clicked(e.X, e.Y)) member function
John
I am getting an IndexOutOfRangeException in the colorGrid1.Clicked(e.X, e.Y)) member function
John
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: ColorGrid and CursorTool
Hi John,
Which is the exact TeeChart for .NET build you are using? It worked fine for me here using latest v2009 release available at the client area.
Thanks in advance.
Which is the exact TeeChart for .NET build you are using? It worked fine for me here using latest v2009 release available at the client area.
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: ColorGrid and CursorTool
Hi John,
Please notice that TF02014645 has been fixed for the next TeeChart for .NET 2009 maintenance release.
An alternative workaround can also be this:
Please notice that TF02014645 has been fixed for the next TeeChart for .NET 2009 maintenance release.
An alternative workaround can also be this:
Code: Select all
void cursor1_Change(object sender, Steema.TeeChart.Tools.CursorChangeEventArgs e)
{
ShowSeriesValues(colorGrid1.Clicked(e.x, e.y));
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |