final ValueAxis timeAxis = new DateAxis(timeAxisLabel);
timeAxis.setLowerMargin(0.02); // reduce the default margins
timeAxis.setUpperMargin(0.02);
final NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
valueAxis.setAutoRangeIncludesZero(false); // override default
final XYPlot plot = new XYPlot(dataset, timeAxis, valueAxis, null);
// XYToolTipGenerator toolTipGenerator = null;
// if (tooltips) {
// toolTipGenerator = StandardXYToolTipGenerator
// .getTimeSeriesInstance();
// }
//
// XYURLGenerator urlGenerator = null;
// if (urls) {
// urlGenerator = new StandardXYURLGenerator();
// }
final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(
true, false);
// renderer.setBaseToolTipGenerator(toolTipGenerator);
// renderer.setURLGenerator(urlGenerator);
plot.setRenderer(renderer);
final Chart chart = new Chart(plot, legend);
chart.setTitle(title);
return chart;