I did the coding to create a pie chart file in png format file,

the pie chart shows the percentage but in the bottom of the file,

I want the percentage to appear in the chart itself,

This is the codes I have used,

 String query = "SELECT name,flag from mawarid";

 JDBCPieDataset dataset = new JDBCPieDataset(
                         "jdbc:oracle:thin:@", "oracle.jdbc.OracleDriver",
                        "", "");


        JFreeChart chart = ChartFactory.createPieChart("Test", dataset, true,
                        true, false);
             PiePlot plot = (PiePlot) chart.getPlot();
 plot.setLegendLabelGenerator(new StandardPieSectionLabelGenerator("{0} {2}"));

            final ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());
            final File file1 = new File("Chart5.png");
            ChartUtilities.saveChartAsPNG(file1, chart,600 , 400,info);

        catch(Exception e)


Hmm... You are using a library which is not a standard library? You may need to look at JFreeChart site for any information. I am sorry that I cannot help you because I don't use the library.