Page 1 of 1

Get a smooth line

Posted: Tue Jun 01, 2010 6:07 am
by 6919081
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.

Re: Get a smooth line

Posted: Tue Jun 01, 2010 2:00 pm
by narcis
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.

Re: Get a smooth line

Posted: Wed Jun 02, 2010 2:43 am
by 6919081
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).

Re: Get a smooth line

Posted: Wed Jun 02, 2010 4:57 pm
by narcis
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!

Re: Get a smooth line

Posted: Thu Jun 03, 2010 5:23 am
by 6919081
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.

Re: Get a smooth line

Posted: Thu Jun 03, 2010 8:58 am
by narcis
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.

Re: Get a smooth line

Posted: Thu Jun 03, 2010 9:25 am
by 6919081
Hi Narcís,

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

Thanks your help again.

Re: Get a smooth line

Posted: Thu Jun 03, 2010 9:39 am
by narcis
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.