Search in sources :

Example 1 with TableOrder

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;
}
Also used : TextTitle(org.jfree.chart.title.TextTitle) TableOrder(org.jfree.util.TableOrder) MultiplePiePlot(org.jfree.chart.plot.MultiplePiePlot) JFreeChart(org.jfree.chart.JFreeChart) Font(java.awt.Font)

Aggregations

Font (java.awt.Font)1 JFreeChart (org.jfree.chart.JFreeChart)1 MultiplePiePlot (org.jfree.chart.plot.MultiplePiePlot)1 TextTitle (org.jfree.chart.title.TextTitle)1 TableOrder (org.jfree.util.TableOrder)1