Get a smooth line

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Richard
Newbie
Newbie
Posts: 40
Joined: Mon May 21, 2001 4:00 am

Get a smooth line

Post by Richard » Tue Jun 01, 2010 6:07 am

I want to get a chart like this picture..(the line is smooth)
Image

But I can't do it.
If I use smoothing function, I'll get this chart...
Image

Is there any way to get the chart like the first picture?
Please tell me, it's vary important to me.

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

Re: Get a smooth line

Post by Narcís » Tue Jun 01, 2010 2:00 pm

Hi Richard,

Have you tried increasing function's Factor property? If this doesn't help, can you please post a simple example project or a code snippet we can run "as-is" to reproduce the problem here?

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

Richard
Newbie
Newbie
Posts: 40
Joined: Mon May 21, 2001 4:00 am

Re: Get a smooth line

Post by Richard » Wed Jun 02, 2010 2:43 am

Hi Narcís

I've tried increasing function's factor property, but it didn't work.
This is an example that I made:https://docs.google.com/leaf?id=0B__elU ... NmEx&hl=en
The datasource of line2 is from line1, function's factor property is 40, and interpolate is true (because the line have to cross every points).
But it is still not straight between the second point and the third point.
I don't know what I can do. I am new...please tell me how to get the chart (like the picture that I post first time).

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

Re: Get a smooth line

Post by Narcís » Wed Jun 02, 2010 4:57 pm

Hi Richard,
I've tried increasing function's factor property, but it didn't work.
This is an example that I made:https://docs.google.com/leaf?id=0B__elU ... NmEx&hl=en
The datasource of line2 is from line1, function's factor property is 40, and interpolate is true (because the line have to cross every points).
But it is still not straight between the second point and the third point.
Thanks for the information but I don't have access to the google document you linked.
I don't know what I can do. I am new...please tell me how to get the chart (like the picture that I post first time).
TeeChart uses the sandard algorithm for computing natural cubic splines described in Wikipedia.

The cubic spline function from Wikipedia:

Image

is similar to SpLine.cs, line 350, for example:

Code: Select all

					double mix=(dist<1) ? (4.0/6.0)-(dist*dist)+(0.5*dist*dist*dist) : (2-dist)*(2-dist)*(2-dist)/6;
Clamping or not is what we call interpolated.

Do you know which algorithm the image you attached uses or any other more accurate Spline calculation algorithm, be it polynomiol or not?

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

Richard
Newbie
Newbie
Posts: 40
Joined: Mon May 21, 2001 4:00 am

Re: Get a smooth line

Post by Richard » Thu Jun 03, 2010 5:23 am

Hi Narcís,

I've reset the link.
https://docs.google.com/leaf?id=0B__elU ... NmEx&hl=en

I think it doesn't have any algorithm.
User key in coordinates then get a chart that I want.
For example, user key in 4 points (0,10), (1,5), (2,5), (3,1).
If I use smoothing function, then the line will like a wave between point2 and point3.
But I want that is straight between point2 and point3.

Thanks for your help.

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

Re: Get a smooth line

Post by Narcís » Thu Jun 03, 2010 8:58 am

Hi Richard,

Which charting package plots your data points the way you'd like them to be plotted? Which tool did you use to plot the chart in the first image you posted?

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

Richard
Newbie
Newbie
Posts: 40
Joined: Mon May 21, 2001 4:00 am

Re: Get a smooth line

Post by Richard » Thu Jun 03, 2010 9:25 am

Hi Narcís,

It is from "GEOFLTR MFC Application".
Can teecahrt get the chart?

Thanks your help again.

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

Re: Get a smooth line

Post by Narcís » Thu Jun 03, 2010 9:39 am

Hi Richard,
It is from "GEOFLTR MFC Application".
Could you please give us more detailed information or a URL about this application?
Can teecahrt get the chart?
I'm afraid not unless Smoothing function is enhanced to calculate Splines as you request. That's why we need to know which is the algorithm used for such calculations.

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