I used method setSectionPaint in cycle, but it's not right(excess program code). Why setBaseSectionPaint doesn't work?
Code: Select all
private JFreeChart createPieChart(PieDataset piedataset){
JFreeChart jfreechart = ChartFactory.createPieChart("Select the desired dictionary:", piedataset,true, true, false);
PiePlot pieplot = (PiePlot) jfreechart.getPlot();
for (int i=0;i<piedataset.getItemCount();i++){ //excess program code
pieplot.setSectionPaint(piedataset.getKey(i),new Color(54, 95, 196));
}
pieplot.setBaseSectionPaint(new Color(54, 95, 196)); //doesn't work
return jfreechart;
}