Hi,
Is there an option in TeeChart fro drawing smooth lines for data series ?
In my application all series points are connected with straight lines.
(I remember splines are doing a great job for drawing smooth lines)
In the TeeChart documentation I went thru all the different line options (fastline, bezier) but I did not come across something about smooth lines.
Some help would be nice.
Thanks,
Antoon Koster
Netherlands
Smooth lines
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Antoon,
You can use the smoothing function, creating a line series and setting it's datasource to a smoothing function with another line series as source. Then you can hide the source line series if you wish.
You can use the smoothing function, creating a line series and setting it's datasource to a smoothing function with another line series as source. Then you can hide the source line series if you wish.
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: 35
- Joined: Wed Feb 25, 2004 5:00 am
- Location: WL| Delft Hydraulics, Holland
- Contact:
Hi,
Thanks for your reply. I studied the TeeChart examples, and tried the following, but no smooth lines ....
Any idea what might be wrong ...
My code looks like:
internal void SetLocationSeries()
{
Steema.TeeChart.Styles.Line line;
int iSeries=0;
for (int iPar=0;iPar<noPars;iPar++)
{
for (int iTime=0;iTime<noTimes;iTime++)
{
float[] xValues = new float[noLocs];
float[] yValues = new float[noLocs];
line = new Steema.TeeChart.Styles.Line();
line.CustomVertAxis = customAxis[iPar];
// populating series
line.XValues.DateTime = false;
// line.Marks.Visible = true;
line.Pointer.Visible = true;
line.Pointer.Style = pointerStyles[iPar];
line.Color = lineColors[iSeries];
line.LinePen.Width = 1;
// Smooth lines
Steema.TeeChart.Styles.Line
smoothLine = new Steema.TeeChart.Styles.Line();
Steema.TeeChart.Functions.Smoothing
smoothing = new Steema.TeeChart.Functions.Smoothing();
smoothing.Interpolate = true;
smoothing.Period = 1;
smoothing.Factor = 10;
smoothLine.Function = smoothing;
smoothLine.DataSource = line;
smoothLine.Visible = true;
tChart1.Series.Add(smoothLine); // add smooth line
for (int iLoc=0;iLoc<noLocs;iLoc++)
{
smoothLine.Labels.Add(gsLocations[iLoc]);
xValues[iLoc] = iLoc;
yValues[iLoc] = gsSeries[iPar,iLoc,iTime];
}
tChart1.Series[iSeries].Add(xValues,yValues);
tChart1.Series[iSeries].Title =
gsParameters[iPar] + this.dateTimes[iTime];
tChart1.BackColor = Color.White;
iSeries++;
}
}
noSeries = iSeries;
}
I am using 8 data points per series. That's enough for proper smooting I guess.
Some help would be nice.
Best regards,
Antoon Koster
Thanks for your reply. I studied the TeeChart examples, and tried the following, but no smooth lines ....
Any idea what might be wrong ...
My code looks like:
internal void SetLocationSeries()
{
Steema.TeeChart.Styles.Line line;
int iSeries=0;
for (int iPar=0;iPar<noPars;iPar++)
{
for (int iTime=0;iTime<noTimes;iTime++)
{
float[] xValues = new float[noLocs];
float[] yValues = new float[noLocs];
line = new Steema.TeeChart.Styles.Line();
line.CustomVertAxis = customAxis[iPar];
// populating series
line.XValues.DateTime = false;
// line.Marks.Visible = true;
line.Pointer.Visible = true;
line.Pointer.Style = pointerStyles[iPar];
line.Color = lineColors[iSeries];
line.LinePen.Width = 1;
// Smooth lines
Steema.TeeChart.Styles.Line
smoothLine = new Steema.TeeChart.Styles.Line();
Steema.TeeChart.Functions.Smoothing
smoothing = new Steema.TeeChart.Functions.Smoothing();
smoothing.Interpolate = true;
smoothing.Period = 1;
smoothing.Factor = 10;
smoothLine.Function = smoothing;
smoothLine.DataSource = line;
smoothLine.Visible = true;
tChart1.Series.Add(smoothLine); // add smooth line
for (int iLoc=0;iLoc<noLocs;iLoc++)
{
smoothLine.Labels.Add(gsLocations[iLoc]);
xValues[iLoc] = iLoc;
yValues[iLoc] = gsSeries[iPar,iLoc,iTime];
}
tChart1.Series[iSeries].Add(xValues,yValues);
tChart1.Series[iSeries].Title =
gsParameters[iPar] + this.dateTimes[iTime];
tChart1.BackColor = Color.White;
iSeries++;
}
}
noSeries = iSeries;
}
I am using 8 data points per series. That's enough for proper smooting I guess.
Some help would be nice.
Best regards,
Antoon Koster
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Antoon,
You should use when populating your input series manually.
You should use
Code: Select all
smoothLine.CheckDataSource();
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 |
Hi Antoon,
have you seen the example of this Function type in the Demo Features project (included with the TeeChart for Net v1 installation ) under :
What's New -> Welcome ! -> New Functions -> Smoothing SpLine ?
It shows how to do this.
have you seen the example of this Function type in the Demo Features project (included with the TeeChart for Net v1 installation ) under :
What's New -> Welcome ! -> New Functions -> Smoothing SpLine ?
It shows how to do this.
Pep Jorge
http://support.steema.com
http://support.steema.com
-
- Newbie
- Posts: 35
- Joined: Wed Feb 25, 2004 5:00 am
- Location: WL| Delft Hydraulics, Holland
- Contact:
Hi,
Yes, I walked thru that example many times, and copied some code from it, but I don't get the smooth spline even after 2 days working ....
I must say, I (and my boss) will be VERY PLEASED if you could send me a complete Visual Studio .NET solution (so a *.sln file) with all the files included for that demo, so that I can check if I get the smooth spline.
Maybe there is something wrong with the installation, In that case I can check that.
My email is: [email protected]
Kind regards,
Antoon Koster
Netherlands
Yes, I walked thru that example many times, and copied some code from it, but I don't get the smooth spline even after 2 days working ....
I must say, I (and my boss) will be VERY PLEASED if you could send me a complete Visual Studio .NET solution (so a *.sln file) with all the files included for that demo, so that I can check if I get the smooth spline.
Maybe there is something wrong with the installation, In that case I can check that.
My email is: [email protected]
Kind regards,
Antoon Koster
Netherlands
Hi Antoon,
te sources of the Demo Features project are included in the TeeChart for Net installation, you can find them under :
F:\Program Files\Steema Software\TeeChart for .NET v1\Examples\DemoProject
te sources of the Demo Features project are included in the TeeChart for Net installation, you can find them under :
F:\Program Files\Steema Software\TeeChart for .NET v1\Examples\DemoProject
Pep Jorge
http://support.steema.com
http://support.steema.com