I have this code ..
Code: Select all
DefaultPieDataset myServletPieChart = new DefaultPieDataset();
myServletPieChart.setValue("Maths", 74);
myServletPieChart.setValue("Physics", 87);
myServletPieChart.setValue("Chemistry", 62);
myServletPieChart.setValue("Biology", 92);
myServletPieChart.setValue("English", 51);
JFreeChart mychart = ChartFactory.createPieChart("",myServletPieChart,true,true,false);
mychart.setBack
response.setContentType("image/png"); /* Set the HTTP Response Type */
ChartUtilities.writeChartAsPNG(out, mychart, 400, 300);
I want to change the color of each slices of my choice.
Could you please tell how to achieve this ?
I dont like default color of slices.