Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: How to use arrays in this?  (Read 3612 times)

0 Members and 1 Guest are viewing this topic.

chaits

    Topic Starter


    Rookie

    How to use arrays in this?
    « on: December 04, 2008, 02:39:10 AM »
    In place of the series, how to use arrays? And ChartPanel if possible.

    import org.jfree.chart.*;
    import org.jfree.chart.plot.PlotOrientation;
    import org.jfree.data.category.DefaultCategory Dataset;
    import org.jfree.data.general.DefaultPieDatase t;
    import org.jfree.data.xy.*;
    import org.jfree.data.*;

    public class xyLine{
    public static void main(String arg[]){
      XYSeries series = new XYSeries("Average Weight");
      series.add(20.0, 20.0);
      series.add(40.0, 25.0);
      series.add(55.0, 50.0);
      series.add(70.0, 65.0);
      XYDataset xyDataset = new XYSeriesCollection(series);
      JFreeChart chart = ChartFactory.createXYLineChart
              ("XYLine Chart using JFreeChart", "Age", "Weight",
     xyDataset, PlotOrientation.VERTICAL, true, true, false);
      ChartFrame frame1=new ChartFrame("XYLine Chart",chart);
      frame1.setVisible(true);
      frame1.setSize(300,300);
      }
    }