Quote:
XYSeriesCollection dataset = new XYSeriesCollection();
dataset.addSeries(s1);
JFreeChart chart = ChartFactory.createXYLineChart("Your chart", "X", "Y", dataset,PlotOrientation.VERTICAL, false, false, false);
chart.setBackgroundPaint(Color.white);
plot = chart.getXYPlot();
plot.setBackgroundPaint(Color.lightGray);
plot.setDomainGridlinePaint(Color.white);
plot.setRangeGridlinePaint(Color.white);
final NumberAxis xAxis = (NumberAxis)plot.getDomainAxis();
xAxis.setStandardTickUnits(NumberAxis.createIntege rTickUnits());
xAxis.setAutoRange(true);
final NumberAxis yAxis = new NumberAxis();
yAxis.setAutoRange(true);
plot.setDomainAxis(xAxis);
plot.setRangeAxis(yAxis);
final ChartPanel chartPanel = new ChartPanel(chart);
jfrm.add(chartPanel);