我需要创建一个像这样的饼图,但是没有标签。
图表中不应显示“ Nokia Lumia”和“ IPhone 5s”之类的手机名称;仅在解释图例的底部才需要。
我正在Java中的jfreechart和apache poi的帮助下使用它。
我这样改变BarChartDemo1
:
显示传说。
JFreeChart chart = ChartFactory.createPieChart(
"Smart Phones Manufactured / Q3 2011", // chart title
dataset, // data
true, // legend <<<<<<<<<<
true, // tooltips
false // no URL generation
);
不显示标签。
// 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);
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句