t.setHorizontalAlignment(HorizontalAlignment.RIGHT);
t.setMargin(4.0, 0.0, 2.0, 4.0);
chart.addSubtitle(t);
// get a reference to the plot for further customisation...
CategoryPlot plot = (CategoryPlot) chart.getPlot();
LegendItemCollection items = new LegendItemCollection();
items.add(new LegendItem("Against all torture", null, null, null,
new Rectangle2D.Double(-6.0, -3.0, 12.0, 6.0), Color.green));
items.add(new LegendItem("Some degree permissible", null, null, null,
new Rectangle2D.Double(-6.0, -3.0, 12.0, 6.0), Color.red));
plot.setFixedLegendItems(items);
plot.setInsets(new RectangleInsets(5, 5, 5, 20));
LegendTitle legend = new LegendTitle(plot);
legend.setPosition(RectangleEdge.BOTTOM);
chart.addSubtitle(legend);
plot.setBackgroundPaint(Color.lightGray);
plot.setDomainGridlinePaint(Color.white);
plot.setDomainGridlinesVisible(true);
plot.setRangeGridlinePaint(Color.white);
// set the range axis to display integers only...
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
rangeAxis.setUpperMargin(0.0);
// disable bar outlines...
BarRenderer renderer = (BarRenderer) plot.getRenderer();
renderer.setDrawBarOutline(false);
// set up gradient paints for series...
GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, Color.green, 0.0f, 0.0f, new Color(0, 64, 0));
Paint gp1 = new Color(0, 0, 0, 0);