sinusoidal curve mit JFreeChart ???

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
kalissow
Posts: 4
Joined: Thu Dec 21, 2006 10:08 am

sinusoidal curve mit JFreeChart ???

Post by kalissow » Thu Dec 21, 2006 10:10 am

Hi,

i want to draw my curves (sin, cos, ...) sinusoidal. That means, i need a method like creatScatterPlot, or createLineChart of the class ChartFactory to do that.
Is there such a thing?

when no, how can i do that mit JFreeChart?

Thanks

kalissow

hugues
Posts: 18
Joined: Tue Jul 04, 2006 8:59 am
Contact:

Post by hugues » Thu Dec 21, 2006 10:55 am

Hi,

We are using a a class that extends "AbstractXYDataset" combined with a XYPlot to draw our curves (like sin or cos). see post "low values in a XYPlot, axis range limitation" to see the results.

does it help ?
Hugues.
SAMTECH, Integrating CAE towards Professional Solutions : www.samcef.com

kalissow
Posts: 4
Joined: Thu Dec 21, 2006 10:08 am

Post by kalissow » Thu Dec 21, 2006 12:05 pm

Okk,

i´ll try that now.

thanks

kalissow

kalissow
Posts: 4
Joined: Thu Dec 21, 2006 10:08 am

Post by kalissow » Thu Dec 21, 2006 12:31 pm

Hi Huges,

can you send to me an example (simple code) of the sin / cos curve?

Thanks
kalissow

hugues
Posts: 18
Joined: Tue Jul 04, 2006 8:59 am
Contact:

Post by hugues » Thu Dec 21, 2006 3:16 pm

this is our java class to store the values.
public class FunctionViewerData extends AbstractXYDataset{
private Vector<double[]> myXDataVector;
private Vector<double[]> myYDataVector;
with methods like :
/*
* get the number of point in a function
*/
public int getItemCount(int n){

...



/**
* get the ith X value
*/
public double getXValue(int theSeries,int theItem){
then a frame with :
myXYPlot = new XYPlot();
myXYPlot.setDataset("aninstanceofFunctionViewerData );
myChart = new JFreeChart(myTitle, myFont, myXYPlot, true);
SAMTECH, Integrating CAE towards Professional Solutions : www.samcef.com

Locked