Creating a Contour Map. Very Slow

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Dave
Advanced
Posts: 139
Joined: Mon Sep 22, 2008 12:00 am

Creating a Contour Map. Very Slow

Post by Dave » Tue Jul 28, 2015 3:33 pm

Hi

Im creating a contour plot from 30 2D lines each of which have 1025 points. The code Im using looks something like as shown below.
It works and creates the contour OK. The problem is it takes over a minute to do it. Is there a quicker method?
Note Im using a fairly old version of Teechart (version 3.5.3187.15585). Perhaps a newer version of Teechart would be quicker??

-----------------------------------------------------------------------------------------------------------------------

newContour = new Contour(spectrumChart.Chart);
int numberOfSeries = spectrumChart.Series.Count;
double theNum = 0;


int a = 0;
while (a < numberOfSeries - 1)
{
int numberOfValues = spectrumChart.Series[a].Count;

int b = 0;
while (b < numberOfValues)
{

double y1 = spectrumChart.Series[a].YValues;
if (y1 == 0)
{
if (b > 0)
y1 = spectrumChart.Series[a].YValues;
else
{
y1 = 0.5;
}
}
theNum = theNum + 1;
newContour.Add(spectrumChart.Series[a].XValues, y1, theNum);
b = b + 1;
}
a = a + 1;
}


newContour.UsePalette = true;
newContour.UseColorRange = false;
newContour.IrregularGrid = true;
newContour.ClearPalette();

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Creating a Contour Map. Very Slow

Post by Narcís » Thu Jul 30, 2015 11:16 am

Hi Dave,

Contour series should be populated as described here. Setting IrregularGrid to true makes the chart calculation slower so please try to avoid it unless it's strictly necessary.

If you want us to look at the problem thoroughly, please attach a Short, Self Contained, Correct (Compilable), Example.

Thanks in advance.
Best Regards,
Narcís Calvet / 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