hi
i am working on colorgrid for heat map.is there any way to show actual value when the user clicks on one of the cells in the colorGrid ?
thanks&Regards
color grid cell value
Re: color grid cell value
Hello Amol,
I have made a simple code that calculate using Event MouseClick the values X and Y of ColorGrid Series when you do click, I think you can do something us next:
Could you tell us if previous code works as you want?
I hope will helps.
Thanks,
I have made a simple code that calculate using Event MouseClick the values X and Y of ColorGrid Series when you do click, I think you can do something us next:
Code: Select all
private void InitializeChart()
{
Steema.TeeChart.Styles.ColorGrid colorgrid = new Steema.TeeChart.Styles.ColorGrid(tChart1.Chart);
colorgrid.FillSampleValues(5);
tChart1.MouseClick += new MouseEventHandler(tChart1_MouseClick);
}
void tChart1_MouseClick(object sender, MouseEventArgs e)
{
Steema.TeeChart.Styles.ColorGrid color = (tChart1[0] as Steema.TeeChart.Styles.ColorGrid);
int index = color.Clicked(e.X,e.Y);
if (index != -1)
{
this.Text = "Value X: " + color.XValues[index].ToString() + " " + " Value Y: " + color.YValues[index].ToString();
}
}
I hope will helps.
Thanks,
Best Regards,
Sandra Pazos / 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: color grid cell value
thanks for code its working but i want to show the value which is getting on mouse click.
please tell me method by which i can show the value.
thanks & Regards
please tell me method by which i can show the value.
thanks & Regards
Re: color grid cell value
Hello Amol,
Sorry, I understanood that you needed the XValues and YValues of series instead of values in pixels; so if you want get mouseClick values it is very easy, you have only use e.X and e.Y. You can do something as next:
Can you confirm us,if previous code works as you expected?
I hope will helps.
Thanks
Sorry, I understanood that you needed the XValues and YValues of series instead of values in pixels; so if you want get mouseClick values it is very easy, you have only use e.X and e.Y. You can do something as next:
Code: Select all
void tChart1_MouseClick(object sender, MouseEventArgs e)
{
Steema.TeeChart.Styles.ColorGrid color = (tChart1[0] as Steema.TeeChart.Styles.ColorGrid);
int index = color.Clicked(e.X,e.Y);
if (index != -1)
{
this.Text = "Value X: " + e.X.ToString() + " " + " Value Y: " + e.Y.ToString();
}
}
I hope will helps.
Thanks
Best Regards,
Sandra Pazos / 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 |