用JFreeChart生成3D饼图怎么能让每块之间分离呀?DefaultPieDataset dataset = new DefaultPieDataset();
ReportService service = ServiceLoader.getReportService();
List<Report> list = service.getSexRatio(endDate);
for (Report item : list) {
if(!"合计".equals(item.getString("NAME",""))) {
dataset.setValue(item.getString("NAME",""),item.getInteger("TOTAL",0));
}
} chart = ChartFactory.createPieChart3D("总人数性别结构比", dataset, true, true, false);
PiePlot pieplot = (PiePlot)chart.getPlot();
pieplot.setLabelFont(new Font("宋体", 0, 12));
pieplot.setNoDataMessage("无数据");
pieplot.setCircular(true);
//设置标签距离
pieplot.setLabelGap(0.02D); //设置图片透明度
pieplot.setForegroundAlpha(0.5f); pieplot.setBackgroundPaint(new Color(199,237,204));
pieplot.setLabelGenerator(new StandardPieSectionLabelGenerator(
"{0} {2}",
NumberFormat.getNumberInstance(),
new DecimalFormat("0.00%")));
ReportService service = ServiceLoader.getReportService();
List<Report> list = service.getSexRatio(endDate);
for (Report item : list) {
if(!"合计".equals(item.getString("NAME",""))) {
dataset.setValue(item.getString("NAME",""),item.getInteger("TOTAL",0));
}
} chart = ChartFactory.createPieChart3D("总人数性别结构比", dataset, true, true, false);
PiePlot pieplot = (PiePlot)chart.getPlot();
pieplot.setLabelFont(new Font("宋体", 0, 12));
pieplot.setNoDataMessage("无数据");
pieplot.setCircular(true);
//设置标签距离
pieplot.setLabelGap(0.02D); //设置图片透明度
pieplot.setForegroundAlpha(0.5f); pieplot.setBackgroundPaint(new Color(199,237,204));
pieplot.setLabelGenerator(new StandardPieSectionLabelGenerator(
"{0} {2}",
NumberFormat.getNumberInstance(),
new DecimalFormat("0.00%")));
解决方案 »
- 本人在使用struts上传的时候,由于文件太大,导致内存溢出,怎么办
- 有一个构造函数,我已经在bean中赋值了,我想在另一个bean中获取,该如何做呢
- HTTP method POST is not supported by this URL
- 新手问题:struts里如何使用<html:button>标签实现页面跳转?
- 如何实现重定向到另一个页面,而又可以弹出java脚本
- 如何才能只让一个人使用一个帐号登录网站??
- myeclipse6调试java类时 不能监视变量
- 请大虾对SOLARIS下支持JSP提出建议或文档
- 请问哪里有jbuilder的教程下载,最好中文,我想知道那些combollist怎么用。
- Tomcat 老报Socket Write Error错误?何故?
- 使用hibernate后获得一个实体对象,该对象有个Set类型的属性对象用struts标签怎么把该Set循环出来
- 有关数据库连接问题
PiePlot piePlot = (PiePlot) pieChart.getPlot();
//设置扇区分离显示
pieplot.setExplodePercent("篮球火", 0.2D); http://sktoo.javaeye.com/blog/249087