renderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator(StandardCategoryItemLabelGenerator.DEFAULT_LABEL_FORMAT_STRING, new DecimalFormat(valuePattern))); renderer.setBaseItemLabelsVisible(Boolean.TRUE); if (!customRangeMaxValue) { chart.getCategoryPlot().getRangeAxis().zoomRange(0, 1.1);
/** * @param showLabels <code>true</code> if labels are to be shown. */ public void setShowLabels(boolean showLabels) { this.showLabels = showLabels; Plot plot = chart.getPlot(); if(plot instanceof MultiplePiePlot) { PiePlot pieplot = (PiePlot)((MultiplePiePlot)plot).getPieChart().getPlot(); // ???? ChartLabelGenerator generator = new ChartLabelGenerator(ChartLabelGenerator.DEFAULT_ITEM_LABEL_FORMAT); generator.setDefaultRenderer(Component.class, new AgentKeyRenderer()); pieplot.setLabelGenerator(showLabels ? generator : null); } if(plot instanceof CategoryPlot) { ((CategoryPlot)plot).getRenderer().setBaseItemLabelsVisible(showLabels); } }