ArgumentOutOfRangeException occurs using ColorGrid

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
CourteousD
Newbie
Newbie
Posts: 4
Joined: Tue Feb 12, 2013 12:00 am

ArgumentOutOfRangeException occurs using ColorGrid

Post by CourteousD » Wed Feb 13, 2013 1:48 am

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
Attachments
GraphTest2.zip
(21.13 KiB) Downloaded 466 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: ArgumentOutOfRangeException occurs using ColorGrid

Post by Sandra » Thu Feb 14, 2013 10:34 am

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,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

CourteousD
Newbie
Newbie
Posts: 4
Joined: Tue Feb 12, 2013 12:00 am

Re: ArgumentOutOfRangeException occurs using ColorGrid

Post by CourteousD » Fri Feb 15, 2013 12:15 am

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

CourteousD
Newbie
Newbie
Posts: 4
Joined: Tue Feb 12, 2013 12:00 am

Re: ArgumentOutOfRangeException occurs using ColorGrid

Post by CourteousD » Fri Feb 15, 2013 12:17 am

Oops again. Apparently system doesn't accept xml files so I've zipped it.
Attachments
cmap.zip
(833 Bytes) Downloaded 456 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: ArgumentOutOfRangeException occurs using ColorGrid

Post by Sandra » Fri Feb 15, 2013 1:46 pm

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,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

CourteousD
Newbie
Newbie
Posts: 4
Joined: Tue Feb 12, 2013 12:00 am

Re: ArgumentOutOfRangeException occurs using ColorGrid

Post by CourteousD » Mon Feb 18, 2013 1:02 am

Thanks Sandra,

The additional three lines do appear to workaround the problem. I look forward to the next release.

Michael

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: ArgumentOutOfRangeException occurs using ColorGrid

Post by Sandra » Thu Feb 21, 2013 12:53 pm

Hello Michael,

I inform you that your problem is already fixed for next maintenance release of TeeChartFor.Net.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply