XY Line series

An XY Line series is basically the same as an XY series, introduced in the previous topic. The only difference is that the data points are connected by lines.

The class used to generate an XY line series is com.jinsight.jetchart.XYLineSerie.

import javax.swing.*;
import java.awt.*;
import com.jinsight.jetchart.*;

public class Main extends JFrame {

   public Main() { 

        ScatterGraph graph=new ScatterGraph();

        Container ct=getContentPane();

        ct.add("Center",graph);
        
	XYLineSerie xyLine=new XYLineSerie();
        xyLine.setTitle("XY line series");
	xyLine.setColor(Color.red);

        double[][] values={{35.2,10.1},{37.3,10.85},{44.9,12.48},{17.68,12.63},{63.55,24.58},
  		           {103.8,25.6},{250.2,39.7},{81.98,43.1},{126.1,48.4},{85.5,74.6}};
	
	// The method setValues(double[] values) is not
	// used with XY line series.
        xyLine.setMultipleValues(values);

        graph.addSerie(xyLine);

	// Enables tooltips display. Move mouse cursor over
	// a data point to see the xy values.
	graph.getToolTip().setEnabled(true);

        
        setSize(400,300);

        setVisible(true);


  }

  public static void main(String[] args) {
        new Main();
  }

}