use of org.jfree.util.TableOrder in project pentaho-platform by pentaho.
the class JFreeChartEngine method createMultiplePieChart.
private static JFreeChart createMultiplePieChart(final CategoryDatasetChartDefinition chartDefinition) {
// TODO Make the following accessible from the chartDefinition
TableOrder order = TableOrder.BY_ROW;
// boolean tooltips = true;
// boolean urls = true;
// -----------------------------------------------------------
String title = chartDefinition.getTitle();
boolean legend = chartDefinition.isLegendIncluded();
if (order == null) {
throw new IllegalArgumentException(Messages.getInstance().getString(// $NON-NLS-1$
"JFreeChartEngine.ERROR_0001_NULL_ORDER_ARGUMENT"));
}
MultiplePiePlot plot = new MultiplePiePlot(chartDefinition);
JFreeChartEngine.updatePlot(plot, chartDefinition);
plot.setDataExtractOrder(order);
JFreeChart pieCharts = new JFreeChart(title, chartDefinition.getTitleFont(), plot, legend);
JFreeChart pieChart = plot.getPieChart();
// $NON-NLS-1$ //$NON-NLS-2$
TextTitle seriesTitle = new TextTitle("Series Title", new Font("SansSerif", Font.BOLD, 12));
seriesTitle.setPosition(RectangleEdge.BOTTOM);
pieChart.setTitle(seriesTitle);
pieChart.setBackgroundPaint(chartDefinition.getChartBackgroundPaint());
plot.setPieChart(pieChart);
return pieCharts;
}
Aggregations