// add a reference line in the middle of the dataset
if (addReferenceLine) {
DefaultCategoryDataset referenceLineDataset = new DefaultCategoryDataset();
referenceLineDataset.addValue(1.0, "A", "B");
plot.setDataset(1, referenceLineDataset);
LayeredBarRenderer referenceLineRenderer = new LayeredBarRenderer();
referenceLineRenderer.setSeriesBarWidth(0, referenceLineWidth);
referenceLineRenderer.setSeriesFillPaint(0, referenceLineColor);
referenceLineRenderer.setSeriesPaint(0, referenceLineColor);
plot.setRenderer(1, referenceLineRenderer);
}
// set up the chart renderer
plot.setRenderer(0, renderer);