throw new IllegalArgumentException("Null 'orientation' argument.");
}
final CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);
final ValueAxis valueAxis = new NumberAxis(valueAxisLabel);
final BarRenderer renderer = new BarRenderer();
if (orientation == PlotOrientation.HORIZONTAL) {
final ItemLabelPosition position1 = new ItemLabelPosition(
ItemLabelAnchor.OUTSIDE3, TextAnchor.CENTER_LEFT);
renderer.setBasePositiveItemLabelPosition(position1);
final ItemLabelPosition position2 = new ItemLabelPosition(
ItemLabelAnchor.OUTSIDE9, TextAnchor.CENTER_RIGHT);
renderer.setBaseNegativeItemLabelPosition(position2);
} else if (orientation == PlotOrientation.VERTICAL) {
final ItemLabelPosition position1 = new ItemLabelPosition(
ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER);
renderer.setBasePositiveItemLabelPosition(position1);
final ItemLabelPosition position2 = new ItemLabelPosition(
ItemLabelAnchor.OUTSIDE6, TextAnchor.TOP_CENTER);
renderer.setBaseNegativeItemLabelPosition(position2);
}
if (tooltips) {
renderer
.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());
}
final CategoryPlot plot = new CategoryPlot(dataset, categoryAxis,
valueAxis, renderer);