JFreeChart chart = new JFreeChart("",JFreeChart.DEFAULT_TITLE_FONT, plot, true); //设置图片背景色 chart.setBackgroundPaint(java.awt.Color.white);
//设置图片标题属性 Font font = new Font("黑体",Font.CENTER_BASELINE,20); TextTitle _title = new TextTitle(title); _title.setFont(font); chart.setTitle(_title); plot.setToolTipGenerator(new StandardPieItemLabelGenerator()); //把生成的图片放到临时目录 StandardEntityCollection sec = new StandardEntityCollection(); ChartRenderingInfo info = new ChartRenderingInfo(sec);
TableSelect ts = new TableSelect(); String sql =""; // String sql = "select t.* from (select f_ctype,f_ctname,f_count,TO_CHAR(f_sum/10000,'999G999G999G999G999G999G999G999G999G999G999D9999MI') f_sum_wan," // +" case when nvl(f_sum,0) =0 or nvl(f_all,0)=0 then null when round((f_sum/f_all)*100,2) <1 then '0' ¦ ¦round((f_sum/f_all)*100,2) ¦ ¦'%'" // +" else round((f_sum/f_all)*100,2) ¦ ¦'%' end f_stat " // + " from vw_ctrsumbytype where F_MPID=21 )t left join cp_contracttype a on t.f_ctype = a.f_ctcode order by a.f_index"; if(id.equals("")) { sql = "select f_ctname,round(f_sum/10000,4) f_sum_wan" + " from vw_ctrsumbytype "; }else{ sql = "select f_ctname,round(f_sum/10000,4) f_sum_wan" + " from vw_ctrsumbytype where F_MPID= "+id; }