public static JFreeChart createScatterPlot(String title, String xAxisLabel, String yAxisLabel, XYDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) {
if(orientation == null) {
throw new IllegalArgumentException("Null \'orientation\' argument.");
} else {
NumberAxis xAxis = new NumberAxis(xAxisLabel);
xAxis.setAutoRangeIncludesZero(false);
NumberAxis yAxis = new NumberAxis(yAxisLabel);
yAxis.setAutoRangeIncludesZero(false);
XYItemRenderer render=new StandardXYItemRenderer();
render.setBaseItemLabelsVisible(false);
XYPlot plot = new XYPlot(dataset, xAxis, yAxis, render);
StandardXYToolTipGenerator toolTipGenerator = null;
if(tooltips) {
toolTipGenerator = new StandardXYToolTipGenerator();
}
StandardXYURLGenerator urlGenerator = null;
if(urls) {
urlGenerator = new StandardXYURLGenerator();
}
XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(false, true);
renderer.setSeriesItemLabelFont(0,FontUtil.getFont(Font.PLAIN,14));
renderer.setBaseItemLabelsVisible(false);
renderer.setBaseToolTipGenerator(toolTipGenerator);
renderer.setURLGenerator(urlGenerator);
plot.setRenderer(renderer);
plot.setOrientation(orientation);
JFreeChart chart = new JFreeChart(title, FontUtil.getFont(Font.PLAIN,18), plot, legend);
return chart;
}
}