Dear All
I would like to add something like the SurfaceNearestTool with a ColorGrid series. Is this possible? (I've tried to get it to work but program crashes when I select a cell on the ColorGrid). If not possible can someone suggest the best approach to achieve a similar effect (e.g. draw custom shape on the chart?). I would like to highlight just the selected cell, not the whole column and row. Also with the SurfaceNearestTool I couldn't find how to set the Column Color to clNone (I couldn't find where clNone is defined).
Regards
jenb
SurfaceNearestTool with ColorGrid
Hi Jenb
The SurfaceNearestTool doesn't work with ColorGrid Series, I've added it (TF02012323) in our wish list to be fixed for future release.
In the meantime, you can use the method clicked in the MouseMove event of the chart, as below code. But method clicked of the ColorGrid Series doesn't work to the perfection, I've added it (TF02012324) to our defect list to be fixed for future releases.
The SurfaceNearestTool doesn't work with ColorGrid Series, I've added it (TF02012323) in our wish list to be fixed for future release.
In the meantime, you can use the method clicked in the MouseMove event of the chart, as below code. But method clicked of the ColorGrid Series doesn't work to the perfection, I've added it (TF02012324) to our defect list to be fixed for future releases.
Code: Select all
private void Form1_Load(object sender, EventArgs e)
{
tChart1.Aspect.View3D = false;
colorGrid1.FillSampleValues(16);
}
private int tmpIndex;
private Color tmpColor;
private void tChart1_MouseMove(object sender, MouseEventArgs e)
{
int index = colorGrid1.Clicked(e.X, e.Y);
if (index != -1)
{
tmpColor = colorGrid1.Colors[index];
colorGrid1.Colors[index] = Color.Tomato;
colorGrid1.Colors[tmpIndex] = tmpColor;
tmpIndex = index;
}
colorGrid1.Repaint();
}