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();
Creating a Contour Map. Very Slow
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Creating a Contour Map. Very Slow
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.
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 |
Instructions - How to post in this forum |