Page 1 of 1

Create Spline Chart

Posted: Wed Feb 01, 2012 10:19 am
by 17060769
Hi,

Is it possible in anyway to create a Spline Chart (line this http://upload.wikimedia.org/wikipedia/c ... ne.svg.png)

At the moment I find no way to create a Spline Chart.

I have found a Spline Java Class in the SDK, but actually I have no idea what to do with this class. Seems to float around....

Thanks!
Steven.

Re: Create Spline Chart

Posted: Wed Feb 01, 2012 12:36 pm
by yeray
Hi Steven,

Being line1 a Line series, it's as simple as setting:

Code: Select all

line1.setSmoothed(true);
TeeChart will create the SpLine and will do the necessary calculations internally.

Re: Create Spline Chart

Posted: Wed Feb 01, 2012 12:56 pm
by 17060769
Hi,

Thanks for your Reply,

I am using Java for Android. Seems the method setSmooth() does not exist. This is what I currently do, instead (I kind of assume this is the same):

Line line = new Line(chart.getChart);
Smoothing s = new Smoothing();
line.setFunction(s);
line.setDataSourcce(line0); // line0 is my reference non-spline line
line.checkDataSource();


However, the line is not very "curvey". just looks like the reference line, with a little tiny bit of a curve. I want to create a wave type curve line. (not the zig-zag type).

Thanks!!
Steven.

Re: Create Spline Chart

Posted: Thu Feb 02, 2012 9:45 am
by yeray
Hi Steven,

Right, that's a new feature for the coming v2012. Excuse me for the confusion generated.
By default, the Smoothing function has a factor=4. You can set a higher factor to have more points and draw a more curved line. For example:

Code: Select all

s.setFactor(8);

Re: Create Spline Chart

Posted: Thu Feb 02, 2012 3:11 pm
by 17060769
Thanks, that did the trick!