Not able to load contour chart for some data

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
VarUser
Newbie
Newbie
Posts: 23
Joined: Mon Sep 15, 2008 12:00 am

Not able to load contour chart for some data

Post by VarUser » Wed Sep 23, 2009 4:44 am

Hi

We are using license number ***.

We are facing a problem to load some data in the contour plot.

I am not able to attach sample application on the site http://steema.net/upload/. Caan you please let me know if there is some other way to upload the attachments.

Regards
- Jeevan

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Not able to load contour chart for some data

Post by Yeray » Wed Sep 23, 2009 9:37 am

Hi Jeevan,

Excuse me, I've edited you message to hide your license number. Since you are posting messages at this forums, we know that you are a customer and we even can see the license number related to each forums user.

Please try to attach the files (into a zip or rar file) directly here in the forums
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

VarUser
Newbie
Newbie
Posts: 23
Joined: Mon Sep 15, 2008 12:00 am

Re: Not able to load contour chart for some data

Post by VarUser » Wed Sep 23, 2009 10:46 am

Hi Yeray

Sorry for putting license number and thanks for hiding it.
I am not able to upload application on the forum because of restriction of size. I need to attach sample data file whose size is around 3-4 mb

Regards
- Jeevan

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Not able to load contour chart for some data

Post by Yeray » Wed Sep 23, 2009 11:35 am

Hi Jeevan,

A project with a code as big as that (or with an amount of data as that) won't be easy for us to debug or to find the heart of the problem. So it would be really helpful if you could try to reduce the size of the application.

If it's still too big for the forums limitation, you can still send it to us sending a mail with the project attached to sales@steema.com or at news://www.steema.net/steema.public.attachments newsgroup.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

VarUser
Newbie
Newbie
Posts: 23
Joined: Mon Sep 15, 2008 12:00 am

Re: Not able to load contour chart for some data

Post by VarUser » Thu Sep 24, 2009 6:59 am

Hi Yeray

I have sent the sample application on sales@steema.com.

Thanks and regards
- Jeevan

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Not able to load contour chart for some data

Post by Yeray » Thu Sep 24, 2009 8:24 am

Hi Jeevan,

Thanks for the project. I think that your data hasn't the correct structure for this series. Please, take a look at the explanation from Narcis here
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

VarUser
Newbie
Newbie
Posts: 23
Joined: Mon Sep 15, 2008 12:00 am

Re: Not able to load contour chart for some data

Post by VarUser » Sat Sep 26, 2009 4:57 am

Hi Yeray

From the post I found two important things
1. Irregular grid should be true
2. x and z Data should be equidistant.

And the data which we are using in the application staisfies the two conditions.
Can you please give me more details on what we are missing.

Regards
- Jeevan

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Not able to load contour chart for some data

Post by Yeray » Mon Sep 28, 2009 3:05 pm

Hi VarUser,
VarUser wrote:From the post I found two important things
1. Irregular grid should be true
2. x and z Data should be equidistant.
Well, that's not very exact. It depends on the case. What was written was:
Narcís wrote:TSurfaceSeries needs to be populated having a grid structure where columns are determined by X values and rows are defined by Z values. Each cell value is defined by Y values. Considering this you should be able to populate a surface series using a for nested loop, for example:

Code: Select all

  for x:=0 to 10 do
    for  z:=0 to 5 do
      Series1.AddXYZ(x,random,z);
Also there are some variants to this allowed by IrregularGrid property:

Code: Select all

  Series1.IrregularGrid := true;
You need to set IrregularGrid property to true (by default set to false) in the following cases:

1. When X and Z intervals are not equidistant.
2. When X or Z intervals ire different from 1.
3. When X or Z intervals have negative values.

Considering this your series may be populated like this:

Code: Select all

  series1.addxyz(0,0,0.5);
  series1.addxyz(10,0,0.5);
  series1.addxyz(25,0,0.5);

  series1.addxyz(0,1.1,0.6);
  series1.addxyz(10,1.5,0.6);
  series1.addxyz(25,1.3,0.6);

  series1.addxyz(0,2,0.75);
  series1.addxyz(10,2,0.75);
  series1.addxyz(25,2,0.75);

  Series1.IrregularGrid:=true;
Note that I inverted Y and Z values and set IrregularGrid to true.
So here it is a simple example of a regular contour:

Code: Select all

            Steema.TeeChart.Styles.Contour cont1 = new Steema.TeeChart.Styles.Contour(tChart1.Chart);

            cont1.Add(0, 0, 0);
            cont1.Add(1, 1, 0);

            cont1.Add(0, 0, 1);
            cont1.Add(1, 1, 1);

            cont1.Add(0, 1, 2);
            cont1.Add(1, 0, 2);

            cont1.Add(0, 1, 3);
            cont1.Add(1, 0, 3);
And an example of an irregular contour could be the following:

Code: Select all

            Steema.TeeChart.Styles.Contour cont1 = new Steema.TeeChart.Styles.Contour(tChart1.Chart);

            cont1.IrregularGrid = true;

            cont1.Add(0, 0, 0.1);
            cont1.Add(1, 1, 0.1);

            cont1.Add(0, 0, 1);
            cont1.Add(1, 1, 1);

            cont1.Add(0, 1, 2);
            cont1.Add(1, 0, 2);

            cont1.Add(0, 1, 3);
            cont1.Add(1, 0, 3);
But not the following:

Code: Select all

            Steema.TeeChart.Styles.Contour cont1 = new Steema.TeeChart.Styles.Contour(tChart1.Chart);

            cont1.IrregularGrid = true;

            cont1.Add(0, 0, 0.1);
            cont1.Add(1, 1, 0);

            cont1.Add(0, 0, 1);
            cont1.Add(1, 1, 1);

            cont1.Add(0, 1, 2);
            cont1.Add(1, 0, 2);

            cont1.Add(0, 1, 3);
            cont1.Add(1, 0, 3);
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

VarUser
Newbie
Newbie
Posts: 23
Joined: Mon Sep 15, 2008 12:00 am

Re: Not able to load contour chart for some data

Post by VarUser » Wed Sep 30, 2009 10:45 am

Hi Yeray

Thanks for your inputs.
I have given below a few lines in our data. This data fits in the format which you have mentioned. Also if we try to load some data out of it. We are getting contours. So I still have my question that why it is not able to load entire data. Are there performance issues? or the problem is with data itself.

0*0.3623695*0
0*0.02778029*0.0001
0*0.4598486*0.0002
0*0.134282*0.0003
0*0.1761414*0.0004
0*-0.1315097*0.0005

0.0002*-0.1091576*0
0.0002*0.008821033*0.0001
0.0002*0.0120225*0.0002
0.0002*-0.3109717*0.0003
0.0002*0.08610128*0.0004
0.0002*0.3344768*0.0005

Regards
- Jeevan

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Not able to load contour chart for some data

Post by Yeray » Fri Oct 02, 2009 8:22 am

Hi Jeevan,

I've been able to load the data in your file in a new Wpf application. Note that it takes a while due to the big amount of data. Here is the code used and the image result:

Code: Select all

        private void InitilizeChart()
        {
            tChart1.Aspect.View3D = false;

            Steema.TeeChart.WPF.Styles.Contour contour1 = new Steema.TeeChart.WPF.Styles.Contour(tChart1.Chart);
            contour1.IrregularGrid = true;

            Steema.TeeChart.WPF.Data.TextSource textSource1 = new Steema.TeeChart.WPF.Data.TextSource();

            try
            {
                textSource1.HeaderLines = 0;
                textSource1.DecimalSeparator = '.';
                textSource1.Separator = '*';
                textSource1.Series = contour1;
                textSource1.Fields.Add(0, "X");
                textSource1.Fields.Add(1, "Y");
                textSource1.Fields.Add(2, "Z");
                textSource1.LoadFromFile(@"c:\tmp\data");
            }
            finally
            { }

            tChart1.Header.Text = contour1.Count.ToString();
        }
Image

So it seems that there is no problem with your data. Probably there is something in your chart setup that makes the data not to be loaded successfully or the series not to be drawn.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply