Displaying/Updating Contour using DataSource
-
- Newbie
- Posts: 15
- Joined: Mon Sep 15, 2008 12:00 am
Displaying/Updating Contour using DataSource
Hi,
By looking properties of Contour class it seems that we can Display contours using DataSource Property.
Please let me know that how to prepare a DataTable or any other DataSource to Display the Contours.
The points on countour will go upto 1024x1024
I need to frequently update the Contours with high performance.
Using contour.Clear() and calls to Add() methods may be performance hit to the application.
so I think use of DataSource property will help and I will use CheckDataSource() method to update the contour on the chart, when ever data source changes.
Regards,
Rajesh Dhiman
By looking properties of Contour class it seems that we can Display contours using DataSource Property.
Please let me know that how to prepare a DataTable or any other DataSource to Display the Contours.
The points on countour will go upto 1024x1024
I need to frequently update the Contours with high performance.
Using contour.Clear() and calls to Add() methods may be performance hit to the application.
so I think use of DataSource property will help and I will use CheckDataSource() method to update the contour on the chart, when ever data source changes.
Regards,
Rajesh Dhiman
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Displaying/Updating Contour using DataSource
Hi Rajesh,
Contour series should be populated as described here:
http://www.teechart.net/support/viewtop ... quidistant
Having that structure in mind you can a dataset at runtime as shown here:
http://www.teechart.net/support/viewtopic.php?t=8206
Hope this helps!
Contour series should be populated as described here:
http://www.teechart.net/support/viewtop ... quidistant
Having that structure in mind you can a dataset at runtime as shown here:
http://www.teechart.net/support/viewtopic.php?t=8206
In that case I recommend you that you set TChart's AutoRepaint property to false before updating the chart, set it back to true when all changes are made and finally call TChart's Refresh method for it to be updated.I need to frequently update the Contours with high performance.
Using contour.Clear() and calls to Add() methods may be performance hit to the application.
Hope this helps!
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 15
- Joined: Mon Sep 15, 2008 12:00 am
Re: Displaying/Updating Contour using DataSource
Hi,
Thanks for reply,
On reviewing T chart's code i found that using DataSource Property has no performance gain to call of Add() methods while displaying 1024x1024 points on contour. Because TChart internally performs the Contour.Clear() and making calls to Add() methods, with overheads of creating various dataviews from the Datatable.
Is there any other way to show 1024x1024 points on contour without making my application sluggish?
My application getting jerks when i am updating the contour data . When using checkdatasource() method for update, despite of setting the Autorepaint property to false and then to true.
Rajesh Dhiman
Thanks for reply,
On reviewing T chart's code i found that using DataSource Property has no performance gain to call of Add() methods while displaying 1024x1024 points on contour. Because TChart internally performs the Contour.Clear() and making calls to Add() methods, with overheads of creating various dataviews from the Datatable.
Is there any other way to show 1024x1024 points on contour without making my application sluggish?
My application getting jerks when i am updating the contour data . When using checkdatasource() method for update, despite of setting the Autorepaint property to false and then to true.
Rajesh Dhiman
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Displaying/Updating Contour using DataSource
Hi Rajesh,
Yes, you can assing an array of doubles to Contour's ValueLists. You'll find an example of this at All Features\Welcome !\Speed\Fast Line Speed DrawAll in the features demo, available at TeeChart's program group.
Yes, you can assing an array of doubles to Contour's ValueLists. You'll find an example of this at All Features\Welcome !\Speed\Fast Line Speed DrawAll in the features demo, available at TeeChart's program group.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 15
- Joined: Mon Sep 15, 2008 12:00 am
Re: Displaying/Updating Contour using DataSource
Hi Is that correct way to populate a contour;
double[1024] xData = {1,2,3.....1024}
double[1024] zData = {1,2,3.....1024}
double[1024] [1024] yData = { {1,2,3.....1024},
{1,2,3.....1024},
{1,2,3.....1024},
.......
}
Contour contour = new Contour();
contour.XValues.Count= xData.Length;
contour.XValues.Values =xData;
contour.YValues.Count= yData.Length;
contour.YValues.Values =yData;
contour.ZValues.Count= zData.Length;
contour.ZValues.Values =zData;
Regards,
Rajesh
double[1024] xData = {1,2,3.....1024}
double[1024] zData = {1,2,3.....1024}
double[1024] [1024] yData = { {1,2,3.....1024},
{1,2,3.....1024},
{1,2,3.....1024},
.......
}
Contour contour = new Contour();
contour.XValues.Count= xData.Length;
contour.XValues.Values =xData;
contour.YValues.Count= yData.Length;
contour.YValues.Values =yData;
contour.ZValues.Count= zData.Length;
contour.ZValues.Values =zData;
Regards,
Rajesh
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Displaying/Updating Contour using DataSource
Hi Rajesh
Yes, that seems find to me. However you may need to add the Contour series to the chart if you are not doing it already, for example:
or:
Yes, that seems find to me. However you may need to add the Contour series to the chart if you are not doing it already, for example:
Code: Select all
Contour contour = new Contour(tChart1.Chart);
Code: Select all
Contour contour = new Contour();
tChart1.Series.Add(contour);
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 15
- Joined: Mon Sep 15, 2008 12:00 am
Re: Displaying/Updating Contour using DataSource
hi,
But in the above code compiler doesnot allow me to do the following statement
contour.YValues.Values =yData
error is I cannot asssign multi dimension array ([][]yData) to contour.YValues which is single dimension array
I am stuck up
But in the above code compiler doesnot allow me to do the following statement
contour.YValues.Values =yData
error is I cannot asssign multi dimension array ([][]yData) to contour.YValues which is single dimension array
I am stuck up
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Displaying/Updating Contour using DataSource
Hi Rajesh,
Oh yes, sorry, I missed that one. You need to provide an array for Y values similar to the ones you provide for X and Z values. You should follow principles I described in the forums thread I pointed, so, for example, if you plot a 3x3 grid you should have arrays like this:
X={1,1,1,2,2,2,3,3,3}
Y={5,6,1,7,2,9,3,4,8}
Z={1,2,3,1,2,3,1,2,3}
Oh yes, sorry, I missed that one. You need to provide an array for Y values similar to the ones you provide for X and Z values. You should follow principles I described in the forums thread I pointed, so, for example, if you plot a 3x3 grid you should have arrays like this:
X={1,1,1,2,2,2,3,3,3}
Y={5,6,1,7,2,9,3,4,8}
Z={1,2,3,1,2,3,1,2,3}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 15
- Joined: Mon Sep 15, 2008 12:00 am
Re: Displaying/Updating Contour using DataSource
Hi Narcís,
Thanks it worked, but it did not solved my original intention of increasing the performance of loading 1024x1024 points on the contour.
The only solution i think now is to reduce the number of points from my original dataset and give that decimated points to chart.
But sadly Tchart does not provide decimation for contour data.
If you could provide me any refernce or code for algorithms for contour data decimation that will be great. so that I can implement on my application.
I think with current performance of loading 1024x1024 points (Around 2mins on 2GB Ram m/c.) , my application will not pass acceptance test.
Regards,
Rajesh Dhiman
Thanks it worked, but it did not solved my original intention of increasing the performance of loading 1024x1024 points on the contour.
The only solution i think now is to reduce the number of points from my original dataset and give that decimated points to chart.
But sadly Tchart does not provide decimation for contour data.
If you could provide me any refernce or code for algorithms for contour data decimation that will be great. so that I can implement on my application.
I think with current performance of loading 1024x1024 points (Around 2mins on 2GB Ram m/c.) , my application will not pass acceptance test.
Regards,
Rajesh Dhiman
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Displaying/Updating Contour using DataSource
Hi Rajesh,
I'm not sure about what do you mean here, can you please elaborate on that? Contour series admits decimal values provided they are in a grid structure as explained in the thread I told you. Also, in such cases you'll need to set IrregularGrid=true.But sadly Tchart does not provide decimation for contour data.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 15
- Joined: Mon Sep 15, 2008 12:00 am
Re: Displaying/Updating Contour using DataSource
No No.. not that way..
I mean from decimation is Downsampling of contour data.
like in Fastline series downsamples data if we provide Downsampling object to functions property to reduce the number of points in series.
But Contour doesnot provides downsampling.
Rajesh
I mean from decimation is Downsampling of contour data.
like in Fastline series downsamples data if we provide Downsampling object to functions property to reduce the number of points in series.
But Contour doesnot provides downsampling.
Rajesh
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Displaying/Updating Contour using DataSource
Hi Rajesh
Ok, thanks for the info. I'm afraid Contour series and such series styles are not designed to work with such a big ammount of data. 1024x1024 grid would mean having over 1 million cells, 1048576 exactly. I'll add your request to the wish-list to be considered for inclusion in future releases.
Ok, thanks for the info. I'm afraid Contour series and such series styles are not designed to work with such a big ammount of data. 1024x1024 grid would mean having over 1 million cells, 1048576 exactly. I'll add your request to the wish-list to be considered for inclusion in future releases.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 15
- Joined: Mon Sep 15, 2008 12:00 am
Re: Displaying/Updating Contour using DataSource
Exactly you got right now.
Is there any possibilty that you can provide downsampling algorithms to me so that i can implement by my way in my application.
or you can provide any references to it.
Thanks,
Rajesh
Is there any possibilty that you can provide downsampling algorithms to me so that i can implement by my way in my application.
or you can provide any references to it.
Thanks,
Rajesh
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Displaying/Updating Contour using DataSource
Hi Rajesh,
You can use Red Gate's .NET reflector with TeeChart.dll to see which algorithms DownSampling function uses.
You can use Red Gate's .NET reflector with TeeChart.dll to see which algorithms DownSampling function uses.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |