use of org.jfree.chart.labels.StandardPieToolTipGenerator in project cubrid-manager by CUBRID.
the class VolumeInformationEditor method createChart.
/**
*
* Create jfreechart
*
* @param dataset DefaultPieDataset
* @return JFreeChart
*/
private static JFreeChart createChart(DefaultPieDataset dataset) {
JFreeChart chart = // chart
ChartFactory.createPieChart3D(// chart
"", // data
dataset, // include legend
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.setLabelLinkStyle(PieLabelLinkStyle.QUAD_CURVE);
plot.setOutlinePaint(ChartColor.VERY_DARK_BLUE);
plot.setLabelGenerator(null);
plot.setLabelLinksVisible(false);
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%")));
// plot.setSectionPaint("", SWTResourceManager.getColor(230, 230, 230));
Color[] colors = { new Color(235, 139, 82), new Color(119, 119, 253) };
PieRenderer renderer = new PieRenderer(colors);
renderer.setColor(plot, dataset);
return chart;
}
use of org.jfree.chart.labels.StandardPieToolTipGenerator in project cubrid-manager by CUBRID.
the class VolumeFolderInfoEditor method createChart.
/**
*
* Creates a chart.
*
* @param dataset DefaultPieDataset
* @param dbSpaceInfo DbSpaceInfo
* @return jFreeChart
*/
private static JFreeChart createChart(DefaultPieDataset dataset, DbSpaceInfo dbSpaceInfo) {
JFreeChart chart = ChartFactory.createPieChart3D(// chart
dbSpaceInfo.getSpacename() + " Chart", // data
dataset, // include legend
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.setLabelLinkStyle(PieLabelLinkStyle.QUAD_CURVE);
plot.setOutlinePaint(ChartColor.VERY_DARK_BLUE);
plot.setToolTipGenerator(new StandardPieToolTipGenerator("{0}={1} pages {2}", new DecimalFormat("00.0"), new DecimalFormat("0.00%")));
// plot.setSectionPaint("", SWTResourceManager.getColor(230, 230, 230));
Color[] colors = { new Color(235, 139, 82), new Color(119, 119, 253) };
PieRenderer renderer = new PieRenderer(colors);
renderer.setColor(plot, dataset);
return chart;
}
use of org.jfree.chart.labels.StandardPieToolTipGenerator 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.labels.StandardPieToolTipGenerator in project EnrichmentMapApp by BaderLab.
the class ChartUtil method createRadialHeatMapLegend.
public static JFreeChart createRadialHeatMapLegend(List<EMDataSet> dataSets, ChartOptions options) {
// All the slices must have the same size
final DefaultPieDataset pieDataset = new DefaultPieDataset();
for (EMDataSet ds : dataSets) pieDataset.setValue(ds.getName(), 1);
JFreeChart chart = ChartFactory.createPieChart(// chart title
null, // data
pieDataset, // include legend
false, // tooltips
true, // urls
false);
chart.setAntiAlias(true);
chart.setBorderVisible(false);
chart.setBackgroundPaint(UIManager.getColor("Table.background"));
chart.setBackgroundImageAlpha(0.0f);
chart.setPadding(new RectangleInsets(0.0, 0.0, 0.0, 0.0));
final PiePlot plot = (PiePlot) chart.getPlot();
plot.setCircular(true);
plot.setOutlineVisible(false);
plot.setBackgroundPaint(UIManager.getColor("Table.background"));
plot.setInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0));
plot.setShadowPaint(TRANSPARENT_COLOR);
plot.setShadowXOffset(0.0);
plot.setShadowYOffset(0.0);
plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0}"));
plot.setLabelFont(UIManager.getFont("Label.font").deriveFont(LookAndFeelUtil.getSmallFontSize()));
plot.setLabelPaint(UIManager.getColor("Label.foreground"));
plot.setLabelBackgroundPaint(TRANSPARENT_COLOR);
plot.setLabelOutlinePaint(TRANSPARENT_COLOR);
plot.setLabelShadowPaint(TRANSPARENT_COLOR);
plot.setToolTipGenerator(new StandardPieToolTipGenerator("{0}"));
ColorScheme colorScheme = options != null ? options.getColorScheme() : null;
List<Color> colors = colorScheme != null ? colorScheme.getColors() : null;
if (// UP, ZERO, DOWN:
colors == null || colors.size() < 3)
colors = Arrays.asList(new Color[] { Color.LIGHT_GRAY, Color.WHITE, Color.DARK_GRAY });
int total = dataSets.size();
int v = total / -2;
for (EMDataSet ds : dataSets) {
plot.setSectionPaint(ds.getName(), ColorUtil.getColor(v, -total, total, colors.get(2), colors.get(1), colors.get(0)));
v++;
}
return chart;
}
use of org.jfree.chart.labels.StandardPieToolTipGenerator 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;
}
Aggregations