CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);
ValueAxis valueAxis = new NumberAxis(valueAxisLabel);
BarRenderer renderer = new BarRenderer();
if (orientation == PlotOrientation.HORIZONTAL) {
ItemLabelPosition position1 = new ItemLabelPosition(
ItemLabelAnchor.OUTSIDE3, TextAnchor.CENTER_LEFT);
renderer.setBasePositiveItemLabelPosition(position1);
ItemLabelPosition position2 = new ItemLabelPosition(
ItemLabelAnchor.OUTSIDE9, TextAnchor.CENTER_RIGHT);
renderer.setBaseNegativeItemLabelPosition(position2);
}
else if (orientation == PlotOrientation.VERTICAL) {
ItemLabelPosition position1 = new ItemLabelPosition(
ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER);
renderer.setBasePositiveItemLabelPosition(position1);
ItemLabelPosition position2 = new ItemLabelPosition(
ItemLabelAnchor.OUTSIDE6, TextAnchor.TOP_CENTER);
renderer.setBaseNegativeItemLabelPosition(position2);
}
if (tooltips) {
renderer.setBaseToolTipGenerator(