本文整理汇总了Java中org.jfree.chart.plot.PiePlot.setSectionOutlinePaint方法的典型用法代码示例。如果您正苦于以下问题:Java PiePlot.setSectionOutlinePaint方法的具体用法?Java PiePlot.setSectionOutlinePaint怎么用?Java PiePlot.setSectionOutlinePaint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.plot.PiePlot
的用法示例。
在下文中一共展示了PiePlot.setSectionOutlinePaint方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setPiePlotColours
import org.jfree.chart.plot.PiePlot; //导入方法依赖的package包/类
public static void setPiePlotColours(JFreeChart chart, int numberOfSections, Color baseColor) {
Color color = baseColor;
PiePlot plot = (PiePlot) chart.getPlot();
for (int i = 0; i < numberOfSections; i++) {
try {
plot.setSectionOutlinePaint(plot.getDataset().getKey(i), baseColor.darker().darker().darker());
color = darken(color);
plot.setSectionPaint(plot.getDataset().getKey(i), color);
} catch (java.lang.IndexOutOfBoundsException ex) {
// not data for all the categories - that is fine
Logger.getLogger(TopNChartTableBuilder.class.getName()).log(Level.INFO, null, ex);
}
}
}
示例2: 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;
}
示例3: 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(0);
piePlot.setShadowYOffset(0);
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;
}