Search in sources :

Example 6 with PiePlot3D

use of org.jfree.chart.plot.PiePlot3D in project SIMVA-SoS by SESoS.

the class ChartFactory method createMultiplePieChart3D.

/**
 * Creates a chart that displays multiple pie plots.  The chart object
 * returned by this method uses a {@link MultiplePiePlot} instance as the
 * plot.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param dataset  the dataset (<code>null</code> permitted).
 * @param order  the order that the data is extracted (by row or by column)
 *               (<code>null</code> not permitted).
 * @param legend  include a legend?
 * @param tooltips  generate tooltips?
 * @param urls  generate URLs?
 *
 * @return A chart.
 */
public static JFreeChart createMultiplePieChart3D(String title, CategoryDataset dataset, TableOrder order, boolean legend, boolean tooltips, boolean urls) {
    ParamChecks.nullNotPermitted(order, "order");
    MultiplePiePlot plot = new MultiplePiePlot(dataset);
    plot.setDataExtractOrder(order);
    plot.setBackgroundPaint(null);
    plot.setOutlineStroke(null);
    JFreeChart pieChart = new JFreeChart(new PiePlot3D(null));
    TextTitle seriesTitle = new TextTitle("Series Title", new Font("SansSerif", Font.BOLD, 12));
    seriesTitle.setPosition(RectangleEdge.BOTTOM);
    pieChart.setTitle(seriesTitle);
    pieChart.removeLegend();
    pieChart.setBackgroundPaint(null);
    plot.setPieChart(pieChart);
    if (tooltips) {
        PieToolTipGenerator tooltipGenerator = new StandardPieToolTipGenerator();
        PiePlot pp = (PiePlot) plot.getPieChart().getPlot();
        pp.setToolTipGenerator(tooltipGenerator);
    }
    if (urls) {
        PieURLGenerator urlGenerator = new StandardPieURLGenerator();
        PiePlot pp = (PiePlot) plot.getPieChart().getPlot();
        pp.setURLGenerator(urlGenerator);
    }
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
    currentTheme.apply(chart);
    return chart;
}
Also used : TextTitle(org.jfree.chart.title.TextTitle) StandardPieURLGenerator(org.jfree.chart.urls.StandardPieURLGenerator) PieURLGenerator(org.jfree.chart.urls.PieURLGenerator) StandardPieURLGenerator(org.jfree.chart.urls.StandardPieURLGenerator) PiePlot3D(org.jfree.chart.plot.PiePlot3D) PieToolTipGenerator(org.jfree.chart.labels.PieToolTipGenerator) StandardPieToolTipGenerator(org.jfree.chart.labels.StandardPieToolTipGenerator) StandardPieToolTipGenerator(org.jfree.chart.labels.StandardPieToolTipGenerator) MultiplePiePlot(org.jfree.chart.plot.MultiplePiePlot) PiePlot(org.jfree.chart.plot.PiePlot) MultiplePiePlot(org.jfree.chart.plot.MultiplePiePlot) Font(java.awt.Font)

Example 7 with PiePlot3D

use of org.jfree.chart.plot.PiePlot3D in project pentaho-platform by pentaho.

the class JFreeChartEngine method createPieDatasetChart.

private static JFreeChart createPieDatasetChart(final PieDatasetChartDefinition chartDefinition) {
    // TODO Make the following accessible from the chartDefinition
    boolean tooltips = true;
    boolean urls = true;
    // -----------------------------------------------------------
    String title = chartDefinition.getTitle();
    boolean legend = chartDefinition.isLegendIncluded();
    PiePlot plot = null;
    plot = chartDefinition.isThreeD() ? new PiePlot3D(chartDefinition) : new PiePlot(chartDefinition);
    JFreeChartEngine.updatePlot(plot, chartDefinition);
    JFreeChart pieChart = new JFreeChart(title, chartDefinition.getTitleFont(), plot, legend);
    // $NON-NLS-1$ //$NON-NLS-2$
    TextTitle seriesTitle = new TextTitle("Series Title", new Font("SansSerif", Font.BOLD, 12));
    seriesTitle.setPosition(RectangleEdge.BOTTOM);
    pieChart.setTitle(title);
    pieChart.setBackgroundPaint(chartDefinition.getChartBackgroundPaint());
    if (tooltips) {
        PieToolTipGenerator tooltipGenerator = new StandardPieToolTipGenerator();
        plot.setToolTipGenerator(tooltipGenerator);
    }
    if (urls) {
        PieURLGenerator urlGenerator = new StandardPieURLGenerator();
        plot.setURLGenerator(urlGenerator);
    }
    return pieChart;
}
Also used : TextTitle(org.jfree.chart.title.TextTitle) StandardPieURLGenerator(org.jfree.chart.urls.StandardPieURLGenerator) PieURLGenerator(org.jfree.chart.urls.PieURLGenerator) StandardPieURLGenerator(org.jfree.chart.urls.StandardPieURLGenerator) PiePlot3D(org.jfree.chart.plot.PiePlot3D) PieToolTipGenerator(org.jfree.chart.labels.PieToolTipGenerator) StandardPieToolTipGenerator(org.jfree.chart.labels.StandardPieToolTipGenerator) StandardPieToolTipGenerator(org.jfree.chart.labels.StandardPieToolTipGenerator) PiePlot(org.jfree.chart.plot.PiePlot) MultiplePiePlot(org.jfree.chart.plot.MultiplePiePlot) JFreeChart(org.jfree.chart.JFreeChart) Font(java.awt.Font)

Example 8 with PiePlot3D

use of org.jfree.chart.plot.PiePlot3D in project cubrid-manager by CUBRID.

the class DatabaseStatusEditor method createChart.

/**
	 * Create the jfreeChart of pie
	 *
	 * @param dataset the dataset
	 * @param dbSpaceInfo the DbSpaceInfo
	 * @return the chart
	 */
private static JFreeChart createChart(DefaultPieDataset dataset, DbSpaceInfo dbSpaceInfo) {
    JFreeChart chart = ChartFactory.createPieChart3D(dbSpaceInfo.getType(), dataset, true, true, false);
    PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setSectionOutlinesVisible(false);
    plot.setLabelFont(new java.awt.Font("SansSerif", java.awt.Font.PLAIN, 12));
    plot.setDirection(Rotation.ANTICLOCKWISE);
    plot.setCircular(false);
    plot.setLabelLinkMargin(0.0);
    plot.setLabelGap(0.0);
    plot.setLabelLinksVisible(false);
    plot.setOutlinePaint(ChartColor.VERY_DARK_BLUE);
    plot.setLabelGenerator(null);
    plot.setLegendLabelGenerator(new org.jfree.chart.labels.StandardPieSectionLabelGenerator("{0}:{1} Mbyte", new DecimalFormat("0.00"), new DecimalFormat("0.00")));
    plot.setToolTipGenerator(new StandardPieToolTipGenerator("{0}={1}Mbyte {2}", new DecimalFormat("0.00"), new DecimalFormat("0.00%")));
    java.awt.Color[] colors = { new java.awt.Color(235, 139, 82), new java.awt.Color(119, 119, 253) };
    PieRenderer renderer = new PieRenderer(colors);
    renderer.setColor(plot, dataset);
    return chart;
}
Also used : PiePlot3D(org.jfree.chart.plot.PiePlot3D) DecimalFormat(java.text.DecimalFormat) ChartColor(org.jfree.chart.ChartColor) Color(org.eclipse.swt.graphics.Color) JFreeChart(org.jfree.chart.JFreeChart) StandardPieToolTipGenerator(org.jfree.chart.labels.StandardPieToolTipGenerator) PieRenderer(com.cubrid.cubridmanager.ui.cubrid.database.control.PieRenderer)

Example 9 with PiePlot3D

use of org.jfree.chart.plot.PiePlot3D in project watchdog by TestRoots.

the class WatchDogView method createPieChart.

private JFreeChart createPieChart(final PieDataset dataset, String title) {
    JFreeChart chart = ChartFactory.createPieChart3D(title, dataset, true, true, false);
    PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(FOREGROUND_TRANSPARENCY);
    return chart;
}
Also used : PiePlot3D(org.jfree.chart.plot.PiePlot3D) JFreeChart(org.jfree.chart.JFreeChart)

Example 10 with PiePlot3D

use of org.jfree.chart.plot.PiePlot3D in project SIMVA-SoS by SESoS.

the class ChartFactory method createPieChart3D.

/**
 * Creates a 3D pie chart using the specified dataset.  The chart object
 * returned by this method uses a {@link PiePlot3D} instance as the
 * plot.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param legend  a flag specifying whether or not a legend is required.
 * @param tooltips  configure chart to generate tool tips?
 * @param urls  configure chart to generate URLs?
 *
 * @return A pie chart.
 */
public static JFreeChart createPieChart3D(String title, PieDataset dataset, boolean legend, boolean tooltips, boolean urls) {
    PiePlot3D plot = new PiePlot3D(dataset);
    plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0));
    if (tooltips) {
        plot.setToolTipGenerator(new StandardPieToolTipGenerator());
    }
    if (urls) {
        plot.setURLGenerator(new StandardPieURLGenerator());
    }
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
    currentTheme.apply(chart);
    return chart;
}
Also used : StandardPieURLGenerator(org.jfree.chart.urls.StandardPieURLGenerator) PiePlot3D(org.jfree.chart.plot.PiePlot3D) StandardPieToolTipGenerator(org.jfree.chart.labels.StandardPieToolTipGenerator) RectangleInsets(org.jfree.ui.RectangleInsets)

Aggregations

PiePlot3D (org.jfree.chart.plot.PiePlot3D)10 StandardPieToolTipGenerator (org.jfree.chart.labels.StandardPieToolTipGenerator)7 JFreeChart (org.jfree.chart.JFreeChart)6 PieRenderer (com.cubrid.cubridmanager.ui.cubrid.database.control.PieRenderer)3 Color (java.awt.Color)3 DecimalFormat (java.text.DecimalFormat)3 ChartColor (org.jfree.chart.ChartColor)3 StandardPieURLGenerator (org.jfree.chart.urls.StandardPieURLGenerator)3 RectangleInsets (org.jfree.ui.RectangleInsets)3 Font (java.awt.Font)2 PieToolTipGenerator (org.jfree.chart.labels.PieToolTipGenerator)2 MultiplePiePlot (org.jfree.chart.plot.MultiplePiePlot)2 PiePlot (org.jfree.chart.plot.PiePlot)2 TextTitle (org.jfree.chart.title.TextTitle)2 PieURLGenerator (org.jfree.chart.urls.PieURLGenerator)2 Color (org.eclipse.swt.graphics.Color)1 DefaultPieDataset (org.jfree.data.general.DefaultPieDataset)1