private static JFreeChart createLineChart(){
  Number[][] data=new Integer[][]{{new Integer(-3),new Integer(-2)},{new Integer(-1),new Integer(1)},{new Integer(2),new Integer(3)}};
  CategoryDataset dataset=DatasetUtilities.createCategoryDataset("S","C",data);
  return ChartFactory.createLineChart("Line Chart","Domain","Range",dataset);
}

private static JFreeChart createLineChart ( ) { Number [ ] [ ] data = new Integer [ ] [ ] { { new Integer ( - 3 ) , new Integer ( - 2 ) } , { new Integer ( - 1 ) , new Integer ( 1 ) } , { new Integer ( 2 ) , new Integer ( 3 ) } } ; CategoryDataset dataset = DatasetUtilities . createCategoryDataset ( "S" , "C" , data ) ; return ChartFactory . createLineChart ( "Line Chart" , "Domain" , "Range" , dataset ) ; }
create a line chart with sample data in the range - 3 to + 3 .
