Steema Issues Database

Note: 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.



Bug 636 - An exception is thrown while applying data to a ColorGrid series.
Summary: An exception is thrown while applying data to a ColorGrid series.
Status: RESOLVED NOTABUG
Alias: None
Product: .NET TeeChart
Classification: Unclassified
Component: Chart (show other bugs)
Version: TeeChart for .NET 4.1.2013.11080
Hardware: PC Windows
: --- major
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-14 08:08 EDT by sdgr
Modified: 2014-04-02 08:59 EDT (History)
2 users (show)

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments
Screenshot + data file. (286.26 KB, application/x-zip-compressed)
2014-03-14 08:09 EDT, sdgr
Details
ColorGridWithTextSource (17.98 KB, application/x-zip-compressed)
2014-03-17 07:33 EDT, sandra pazos
Details
Screenshot (59.04 KB, application/x-zip-compressed)
2014-03-20 05:36 EDT, sdgr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sdgr 2014-03-14 08:08:51 EDT
Hi,
I was using the TeeChart Feature demo application, especially the Color Grid.
Please find attached my result in a snapshot and the data file I used to try to visualize the color grid.
I know that the data is looking weird, but I did not expect this exception:

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.Collections.ArrayList.get_Item(Int32 index)
   at Steema.TeeChart.Styles.Custom3DGrid.get_Item(Int32 x, Int32 z)
   at Steema.TeeChart.Styles.ColorGrid.DrawGrid(Rectangle r)
   at Steema.TeeChart.Styles.ColorGrid.Draw()
   at Steema.TeeChart.Styles.Series.DrawSeries()
   at Steema.TeeChart.Chart.DoDraw(Graphics3D g, Int32 First, Int32 Last, Int32 Inc)
   at Steema.TeeChart.Chart.DrawAllSeries(Graphics3D g)
   at Steema.TeeChart.Chart.InternalDraw(Graphics g, Boolean noTools)
   at Steema.TeeChart.TChart.Draw(Graphics g)
   at Steema.TeeChart.TChart.OnPaint(PaintEventArgs pe)
   at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18063 built by: FX45RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
TeeChartNetExamples
    Assembly Version: 4.1.2013.11082
    Win32 Version: 4.1.2013.11082
    CodeBase: file:///C:/Program%20Files%20(x86)/Steema%20Software/Steema%20TeeChart%20for%20.NET%202013%204.1.2013.11080/Examples/DemoProject/bin/ExecutableDemo/TeeChartNetExamples.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18036 built by: FX45RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18021 built by: FX45RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18021 built by: FX45RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Accessibility
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
TeeChart
    Assembly Version: 4.1.2013.11082
    Win32 Version: 4.1.2013.11082
    CodeBase: file:///C:/Program%20Files%20(x86)/Steema%20Software/Steema%20TeeChart%20for%20.NET%202013%204.1.2013.11080/Examples/DemoProject/bin/ExecutableDemo/TeeChart.DLL
----------------------------------------
System.Design
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Design/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Design.dll
----------------------------------------
System.Data
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18060 built by: FX45RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Web
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18067 built by: FX45RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_64/System.Web/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Web.dll
----------------------------------------
System.Numerics
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Comment 1 sdgr 2014-03-14 08:09:52 EDT
Created attachment 115 [details]
Screenshot + data file.
Comment 2 sandra pazos 2014-03-17 07:33:51 EDT
Created attachment 119 [details]
ColorGridWithTextSource

The attached project reproduces the problem.
Comment 3 christopher ireland 2014-03-19 13:14:22 EDT
The problem can be resolved by changing:

ts.Separator = ' ';

to

ts.Separator = Convert.ToChar(9);
or
ts.Separator = '\t';
Comment 4 sdgr 2014-03-20 05:30:19 EDT
Hi,
Sorry, but I am not convinced with your solution.
I have modified your sample provided, with the data I use and a crash happens.
See the attached screenshot.
Stefan.
Comment 5 christopher ireland 2014-03-20 05:34:13 EDT
Stefan,

Can you please add the data you use as a text file that we can drop into the example project (ColorGridWithTextSource) so that we can reproduce the problem here?

There is no doubt that using the present ColorGridWithTextSource and the data provided that the solution suggested is effective.
Comment 6 sdgr 2014-03-20 05:36:37 EDT
Created attachment 128 [details]
Screenshot
Comment 7 christopher ireland 2014-04-02 08:59:37 EDT
Hi Stefan,

Okay, I can see what's happening here. The problem is the type of data - in order for ColorGrid to work, it must be in the form of an Y(X, Z) grid, e.g.

    ColorGrid series;

    private void InitializeChart()
    {
      tChart1.Aspect.View3D = false;
      series = new Steema.TeeChart.Styles.ColorGrid(tChart1.Chart);
      series.IrregularGrid = true;

      Random rnd = new Random();
      for (double x = 0.15; x <= 0.60; x += 0.15)
      {
        for (double z = 1387076.33; z <= 1387076.645; z += 0.063)
        {
          series.Add(x, rnd.NextDouble(), z);
        }
      }
    }

I see that the data in Book1.txt is not of this format - this is why the ColorGrid fails to render it.