本文整理匯總了Java中org.jfree.chart.plot.PiePlot.setShadowPaint方法的典型用法代碼示例。如果您正苦於以下問題:Java PiePlot.setShadowPaint方法的具體用法?Java PiePlot.setShadowPaint怎麽用?Java PiePlot.setShadowPaint使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jfree.chart.plot.PiePlot
的用法示例。
在下文中一共展示了PiePlot.setShadowPaint方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setPieRender
import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
public static void setPieRender(Plot plot) {
plot.setNoDataMessage(NO_DATA_MSG);
plot.setInsets(new RectangleInsets(10, 10, 5, 10));
PiePlot piePlot = (PiePlot) plot;
piePlot.setInsets(new RectangleInsets(0, 0, 0, 0));
piePlot.setCircular(true);
piePlot.setLabelGap(0.01);
piePlot.setInteriorGap(0.05D);
piePlot.setLegendItemShape(new Rectangle(10, 10));
piePlot.setIgnoreNullValues(true);
piePlot.setLabelBackgroundPaint(null);
piePlot.setLabelShadowPaint(null);
piePlot.setLabelOutlinePaint(null);
piePlot.setShadowPaint(null);
// 0:category 1:value:2 :percentage
piePlot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0}:{2}"));
}
示例2: generatePieChart
import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
public static JFreeChart generatePieChart()
{
DefaultPieDataset dataSet = new DefaultPieDataset();
dataSet.setValue("China", 30);
dataSet.setValue("India", 30);
dataSet.setValue("United States", 40);
JFreeChart chart = ChartFactory.createPieChart("", dataSet, false, true, false);
PiePlot piePlot = (PiePlot) chart.getPlot();
piePlot.setBackgroundPaint(Color.WHITE); // set background color white
piePlot.setOutlineVisible(false); // remove background border
piePlot.setLabelGenerator(null); // remove pie section labels
piePlot.setSectionPaint("China", Color.GRAY);
piePlot.setSectionPaint("India", Color.GREEN);
piePlot.setSectionPaint("United States", Color.BLUE);
piePlot.setShadowPaint(Color.WHITE);
return chart;
}
示例3: setBackground
import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
private void setBackground(JFreeChart chart, Plot plot) {
//Color bg = backgroundcolor==null?databackgroundcolor:backgroundcolor;
chart.setBackgroundPaint(backgroundcolor);
plot.setBackgroundPaint(databackgroundcolor);
chart.setBorderPaint(databackgroundcolor);
plot.setOutlineVisible(false);
// Pie
if(plot instanceof PiePlot) {
PiePlot pp=(PiePlot) plot;
pp.setLabelOutlinePaint(backgroundcolor);
pp.setLabelBackgroundPaint(backgroundcolor);
pp.setLabelShadowPaint(backgroundcolor);
pp.setShadowPaint(backgroundcolor);
}
// Bar
/*if(plot instanceof CategoryPlot) {
CategoryPlot cp=(CategoryPlot) plot;
}*/
}
示例4: createPieChart
import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
@Override
protected JFreeChart createPieChart() throws JRException
{
JFreeChart jfreeChart = super.createPieChart();
PiePlot piePlot = (PiePlot)jfreeChart.getPlot();
JRPiePlot jrPiePlot = (JRPiePlot)getPlot();
boolean isShowLabels = jrPiePlot.getShowLabels() == null ? true : jrPiePlot.getShowLabels().booleanValue();
if (isShowLabels && piePlot.getLabelGenerator() != null)
{
piePlot.setLabelBackgroundPaint(ChartThemesConstants.TRANSPARENT_PAINT);
piePlot.setLabelShadowPaint(ChartThemesConstants.TRANSPARENT_PAINT);
piePlot.setLabelOutlinePaint(ChartThemesConstants.TRANSPARENT_PAINT);
}
piePlot.setShadowXOffset(5);
piePlot.setShadowYOffset(10);
piePlot.setShadowPaint(new GradientPaint(0, getChart().getHeight() / 2, new Color(41, 120, 162), 0, getChart().getHeight(), Color.white));
PieDataset pieDataset = piePlot.getDataset();
if (pieDataset != null)
{
for (int i = 0; i < pieDataset.getItemCount(); i++)
{
piePlot.setSectionOutlinePaint(pieDataset.getKey(i), ChartThemesConstants.TRANSPARENT_PAINT);
//makes pie colors darker
//piePlot.setSectionPaint(pieDataset.getKey(i), GRADIENT_PAINTS[i]);
}
}
piePlot.setCircular(true);
return jfreeChart;
}
示例5: updatePlotter
import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
public void updatePlotter() {
int categoryCount = prepareData();
String maxClassesProperty = ParameterService.getParameterValue(MainFrame.PROPERTY_RAPIDMINER_GUI_PLOTTER_LEGEND_CLASSLIMIT);
int maxClasses = 20;
try {
if (maxClassesProperty != null)
maxClasses = Integer.parseInt(maxClassesProperty);
} catch (NumberFormatException e) {
//LogService.getGlobal().log("Pie Chart plotter: cannot parse property 'rapidminer.gui.plotter.colors.classlimit', using maximal 20 different classes.", LogService.WARNING);
LogService.getRoot().log(Level.WARNING, "com.rapidminer.gui.plotter.charts.AbstractPieChartPlotter.pie_chart_plotter_parsing_error");
}
boolean createLegend = categoryCount > 0 && categoryCount < maxClasses;
if (categoryCount <= MAX_CATEGORIES) {
JFreeChart chart = createChart(pieDataSet, createLegend);
// set the background color for the chart...
chart.setBackgroundPaint(Color.white);
PiePlot plot = (PiePlot) chart.getPlot();
plot.setBackgroundPaint(Color.WHITE);
plot.setSectionOutlinesVisible(true);
plot.setShadowPaint(new Color(104, 104, 104, 100));
int size = pieDataSet.getKeys().size();
for (int i = 0; i < size; i++) {
Comparable key = pieDataSet.getKey(i);
plot.setSectionPaint(key, getColorProvider().getPointColor(i / (double) (size - 1)));
boolean explode = false;
for (String explosionGroup : explodingGroups) {
if (key.toString().startsWith(explosionGroup) || explosionGroup.startsWith(key.toString())) {
explode = true;
break;
}
}
if (explode) {
plot.setExplodePercent(key, this.explodingAmount);
}
}
plot.setLabelFont(LABEL_FONT);
plot.setNoDataMessage("No data available");
plot.setCircular(false);
plot.setLabelGap(0.02);
plot.setOutlinePaint(Color.WHITE);
// legend settings
LegendTitle legend = chart.getLegend();
if (legend != null) {
legend.setPosition(RectangleEdge.TOP);
legend.setFrame(BlockBorder.NONE);
legend.setHorizontalAlignment(HorizontalAlignment.LEFT);
legend.setItemFont(LABEL_FONT);
}
if (panel instanceof AbstractChartPanel) {
panel.setChart(chart);
} else {
panel = new AbstractChartPanel(chart, getWidth(), getHeight() - MARGIN);
final ChartPanelShiftController controller = new ChartPanelShiftController(panel);
panel.addMouseListener(controller);
panel.addMouseMotionListener(controller);
}
// ATTENTION: WITHOUT THIS WE GET SEVERE MEMORY LEAKS!!!
panel.getChartRenderingInfo().setEntityCollection(null);
} else {
//LogService.getGlobal().logNote("Too many columns (" + categoryCount + "), this chart is only able to plot up to " + MAX_CATEGORIES + " different categories.");
LogService.getRoot().log(Level.INFO, "com.rapidminer.gui.plotter.charts.AbstractPieChartPlotter.too_many_columns",
new Object[] {categoryCount, MAX_CATEGORIES});
}
}