Java Code Examples for org.jfree.chart.plot.PiePlot#setSectionOutlinePaint()

The following examples show how to use org.jfree.chart.plot.PiePlot#setSectionOutlinePaint() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EyeCandySixtiesChartTheme.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
@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();

	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;
}
 
Example 2
Source File: AegeanChartTheme.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
@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();

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