JFreeChart框架中生成饼状图上怎样显示数据 [问题点数:40分,结帖人GreenLawn]
2016-01-21 08:56
489 查看
我用JFreeChart框架生成饼状图,但想把数据信息在饼图上显示,是在饼图内部(即圆内)显示!怎样实现啊??
去掉lable
pieplot.setLabelGenerator(null);
去掉线
pieplot.setLabelLinksVisible(false);
饼图标签显示百分比方法
PiePlot pp = (PiePlot)chart.getPlot();
pp.setLabelGenerator(new StandardPieSectionLabelGenerator("{2}"));
如果百分比要包括一位小数,则使用
pp.setLabelGenerator(new StandardPieSectionLabelGenerator("{2}",new DecimalFormat("0.0"),new DecimalFormat("0.0%")));
显示实际数值
PiePlot pp = (PiePlot)chart.getPlot();
pp.setLabelGenerator(new StandardPieSectionLabelGenerator("{1}"));
去掉lable
pieplot.setLabelGenerator(null);
去掉线
pieplot.setLabelLinksVisible(false);
饼图标签显示百分比方法
PiePlot pp = (PiePlot)chart.getPlot();
pp.setLabelGenerator(new StandardPieSectionLabelGenerator("{2}"));
如果百分比要包括一位小数,则使用
pp.setLabelGenerator(new StandardPieSectionLabelGenerator("{2}",new DecimalFormat("0.0"),new DecimalFormat("0.0%")));
显示实际数值
PiePlot pp = (PiePlot)chart.getPlot();
pp.setLabelGenerator(new StandardPieSectionLabelGenerator("{1}"));
相关文章推荐
- http://nxlhero.blog.51cto.com/962631/1666250?plg_nld=1&plg_uin=1&plg_auth=1&plg_nld=1&plg_usr=1&plg_vkey=1&plg_dev=1
- 一份高级Java招聘要求
- 脱星摘帽刺激 ST板块表现出众
- found pre-existing rpmdb problem
- BZOJ 2597: [Wc2007]剪刀石头布|费用流
- 关于WindowsAPI常数的值
- http://www.ibm.com/developerworks/cn/java/j-lo-hotswapcls/
- Listen第二个参数的意义
- 关于git笔记学习
- 2016.01.20回顾
- Python爬虫:抓取手机APP的数据
- OCMOCM
- 在信号处理函数中调用非可重入函数getpwnam
- 友元函数和友元类
- gradle DSL method not found: android()
- 利用angular指令监听ng-repeat渲染完成后执行脚本
- 我一生认识的那几个人,几件事。
- 交叉测试的必要性和遇到的问题
- 避免常见的服务器机架问题
- MiZ702学习笔记11——如何使用vivado isim仿真