Create Spline Chart

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
froggyware
Newbie
Newbie
Posts: 21
Joined: Tue Nov 15, 2011 12:00 am

Create Spline Chart

Post by froggyware » Wed Feb 01, 2012 10:19 am

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.

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Create Spline Chart

Post by Yeray » Wed Feb 01, 2012 12:36 pm

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

froggyware
Newbie
Newbie
Posts: 21
Joined: Tue Nov 15, 2011 12:00 am

Re: Create Spline Chart

Post by froggyware » Wed Feb 01, 2012 12:56 pm

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.

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Create Spline Chart

Post by Yeray » Thu Feb 02, 2012 9:45 am

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);
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

froggyware
Newbie
Newbie
Posts: 21
Joined: Tue Nov 15, 2011 12:00 am

Re: Create Spline Chart

Post by froggyware » Thu Feb 02, 2012 3:11 pm

Thanks, that did the trick!

Post Reply