![]() | Steema Issues DatabaseNote: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;otherwise you can use StackOverflow. Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy. |
| Summary: | ColorGrid Clicked method not working | ||
|---|---|---|---|
| Product: | .NET TeeChart | Reporter: | narcís calvet <narcis> |
| Component: | Series | Assignee: | Steema Issue Manager <issuemanager> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | chris, pch |
| Priority: | --- | ||
| Version: | TeeChart.NET 2014 4.1.2014.02060 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows | ||
| URL: | http://www.teechart.net/support/viewtopic.php?f=4&t=15329 | ||
| Chart Series: | --- | Delphi / C++ Builder RAD IDE Version: | |
| Attachments: | client project | ||
Below there's a simpler code snippet reproducing the problem, which occurs when IrregularGrid is set to true.
public Form1()
{
InitializeComponent();
InitializeChart();
}
ColorGrid series;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
series = new ColorGrid(tChart1.Chart);
series.Click += series_Click;
series.IrregularGrid = true;
Random rnd = new Random();
double x, y, z;
for (int i = 0; i < 10; i++)
{
z = i;
x = 0;
for (int j = 0; j < 20; j++)
{
y = rnd.Next(10, 100);
series.Add(x, y, z);
x += 0.25;
}
}
}
void series_Click(object sender, MouseEventArgs e)
{
ColorGrid series = sender as ColorGrid;
Chart chart = series.Chart;
int index = series.Clicked(e.X, e.Y);
chart.Header.Text = "Index = " + index.ToString();
}
now change x += 0.25 to x+=1 and IrregularGrid to false, the index should now work fine.
|
Created attachment 364 [details] client project The attached program draws two ColorGrids one with 640,000 data points and one with 640,800 data points. Both have a X axis of 0 to 200. The first Colour grid has one vertical and one horizontal line of values that are non-zero, with a Z range of 0 to 800. The first Colour grid has two vertical and two horizontal lines of values that are non-zero, with a Z range of 0 to 801. The mark text values on the first ColorGrid are incorrect, the vertical line demonstrates this, while the mark text values on the second ColorGrid are correct. I have changed the Z range on the second ColorGrid from 800, mark text incorrect, to 1600, mart text correct. And from other tests I have done on my application it seems to me that the correctness or otherwise of the mark text values is dependant on the number of data points plotted. Could you confirm that this is the case, or can you tell be if I am drawing the ColorGrid incorrectly. I'm afraid it's ColorGrid.Clicked which doesn't work correctly as the code snippet below doesn't work fine either. void _dataSeriesContour1_Click(object sender, MouseEventArgs e) { var colorGrid1 = (Steema.TeeChart.Styles.ColorGrid)sender; var index = colorGrid1.Clicked(e.X, e.Y); if (index != -1) { _plotChartContour1.Header.Text = colorGrid1.YValues[index].ToString() + ", " + colorGrid1.XValues[index].ToString() + ", " + colorGrid1.ZValues[index].ToString(); } else { _plotChartContour1.Header.Text = "no point clicked"; } }