简体   繁体   中英

Pie Chart without labels in JFreeChart

I need to create a pie chart like this, but without the labels.

图片

The mobile names like "Nokia Lumia" and "IPhone 5s" should not be shown in the chart; it's required only in the bottom part of explaining the legends.

I am using this with the help of and apache in Java.

I changed BarChartDemo1 like this:

  • Show legends.

     JFreeChart chart = ChartFactory.createPieChart( "Smart Phones Manufactured / Q3 2011", // chart title dataset, // data true, // legend <<<<<<<<<< true, // tooltips false // no URL generation ); 
  • Don't show labels.

     // customise the section label appearance // plot.setLabelFont(new Font("Courier New", Font.BOLD, 20)); // plot.setLabelLinkPaint(Color.WHITE); // plot.setLabelLinkStroke(new BasicStroke(2.0f)); // plot.setLabelOutlineStroke(null); // plot.setLabelPaint(Color.WHITE); // plot.setLabelBackgroundPaint(null); plot.setLabelGenerator(null); 

图片

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM