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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations