* @param scatterPlot Scatter plot to modify
* @param enabled Indicates if lines have to be shown
*/
public static void setScatterPlotLinesEnabled(final JFreeChart scatterPlot, final boolean enabled) {
XYPlot plot = (XYPlot) scatterPlot.getPlot();
XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
if (enabled) {
renderer.setSeriesLinesVisible(0, true);
renderer.setSeriesShapesVisible(0, false);
} else {
renderer.setSeriesLinesVisible(0, false);
renderer.setSeriesShapesVisible(0, true);
renderer.setSeriesShape(0, new java.awt.geom.Ellipse2D.Double(0, 0, 1, 1));
}
renderer.setSeriesPaint(0, Color.RED);
plot.setRenderer(0, renderer);
}