Page 1 of 1
ArgumentOutOfRangeException occurs using ColorGrid
Posted: Wed Feb 13, 2013 1:48 am
by 15664980
Hi,
Using ColorGrid, with the latest version of TeeChart .NET (4.1.2012.01310), the first time I display data I have no problems. If I clear the data and add new data with less than or equal to the same number of points, it displays fine. If I add more points than the original set, I get the ArgumentOutOfRangeException, and the chart will not display.
I've attached an example solution for replication. When executed, it will automatically display 200 rows of a test pattern. If you change the value to 201 and click the button, the exception will occur. This does not occur with at least one earlier version of the package (I think it was 4.1.2012.07130).
If there is a workaround/solution to this problem I would appreciate it, as I'd really like to take advantage of one of the fixes in this latest version.
Thanks,
Michael
Re: ArgumentOutOfRangeException occurs using ColorGrid
Posted: Thu Feb 14, 2013 10:34 am
by 10050769
Hello Michael,
I have realized that you haven't sent us the file cmap.xml. I have made the some tests using a custom palette created by me and I cannot reproduce the exception. Would be very helpful if you can send the cmap.xml because we can continue the tests and try to find for the problem appears.
Thanks,
Re: ArgumentOutOfRangeException occurs using ColorGrid
Posted: Fri Feb 15, 2013 12:15 am
by 15664980
Hi Sandra,
Oops, I had meant to send that. Though I wouldn't have thought that it were critical to reproducing the issue. It is now attached.
Regards,
Michael
Re: ArgumentOutOfRangeException occurs using ColorGrid
Posted: Fri Feb 15, 2013 12:17 am
by 15664980
Oops again. Apparently system doesn't accept xml files so I've zipped it.
Re: ArgumentOutOfRangeException occurs using ColorGrid
Posted: Fri Feb 15, 2013 1:46 pm
by 10050769
Hello Michael,
Thanks for the file. Finally I can reproduce your problem and I have added it in bug list report with number[TF02016513]. We will try to fix it to upcoming version of TeeChartFor.Net. On the other hand, I recommend use TChart1.Series.Clear() as a workaround to solve your problem at the moment:
Code: Select all
private void InitializeChart()
{
tChart1.Series.Clear();
colorGrid1 = new Steema.TeeChart.Styles.ColorGrid(tChart1.Chart);
colorGrid1.Pen.Visible = false;
colourPalette = new ColourPalette();
colourPalette.Load(@"C:\Users\Sandra\Downloads\GraphTest2\cmap.xml");
double maxrate = 255;
double minrate = 0;
if (maxrate != minrate)
{
colourScale = colourPalette.Colours.Count / (maxrate - minrate);
}
else
{
colourScale = 0;
}
// Configure ColorGrid's palette
colorGrid1.PaletteSteps = colourPalette.Colours.Count;
colorGrid1.ClearPalette();
for (int colouri = 0; colouri < colourPalette.Colours.Count; colouri++)
{
colorGrid1.AddPalette(minrate + colouri / colourScale,
colourPalette.Colours[colouri]);
}
colorGrid1.UseColorRange = false;
colorGrid1.UsePalette = true;
colorGrid1.Clear();
for (int i = 0; i < 1024; i++)
{
int j;
double val = (double)numericUpDown1.Value;
for (j = 0; j < val; j++)
{
colorGrid1.Add(i, (i * j) % 255, j);
}
}
}
Could you tell us if previous code works in your end?
Thanks,
Re: ArgumentOutOfRangeException occurs using ColorGrid
Posted: Mon Feb 18, 2013 1:02 am
by 15664980
Thanks Sandra,
The additional three lines do appear to workaround the problem. I look forward to the next release.
Michael
Re: ArgumentOutOfRangeException occurs using ColorGrid
Posted: Thu Feb 21, 2013 12:53 pm
by 10050769
Hello Michael,
I inform you that your problem is already fixed for next maintenance release of TeeChartFor.Net.
Thanks,