<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    廉頗老矣,尚能飯否

    java:從技術到管理

    常用鏈接

    統計

    最新評論

    jfreechart應用_例題_生成餅狀圖(不顯示,只生成文件)_可以直接運行

    package pkg;

    import java.awt.Color;
    import java.awt.Font;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.text.DecimalFormat;
    import java.text.NumberFormat;

    import org.jfree.chart.ChartFactory;
    import org.jfree.chart.ChartUtilities;
    import org.jfree.chart.JFreeChart;
    import org.jfree.chart.block.BlockContainer;
    import org.jfree.chart.block.BorderArrangement;
    import org.jfree.chart.labels.StandardPieSectionLabelGenerator;
    import org.jfree.chart.plot.PiePlot;
    import org.jfree.chart.title.LegendTitle;
    import org.jfree.data.general.DefaultPieDataset;
    import org.jfree.ui.HorizontalAlignment;
    import org.jfree.ui.RectangleEdge;

    /**
     * 生成餅狀圖(不顯示,只生成文件)
     *導入jar包 jaxen-1.1.1.jar,jcommon-1.0.12.jar,jfreechart-1.0.9.jar
     *
     * @author liudecai_zan@126.com
     *
     */
    public class Test {
     public static void main(String[] args) throws IOException {
      DefaultPieDataset pds = new DefaultPieDataset();
      int a = 25;
      int b = 35;
      int c = 15;
      int count = a + b + c;
      pds.setValue("超出實檢上限總捆數" + "\n" + a + "根\n", a);
      pds.setValue("實檢范圍內總捆數" + "\n" + b + "根\n", b);
      pds.setValue("超出實檢下限總捆數" + "\n" + c + "根\n", c);
      JFreeChart jfreechart = ChartFactory.createPieChart("棒材異常磅單超重捆數信息圖" + "\n" + a + "+"+ b + "+" + c + "=" + count, pds,
        false, true, false);
      PiePlot pieplot = (PiePlot) jfreechart.getPlot();
      pieplot.setLabelFont(new Font("宋體", 0, 12));
      pieplot.setNoDataMessage("無數據");
      pieplot.setCircular(true);
      pieplot.setLabelGap(0.02D);
      pieplot.setBackgroundPaint(new Color(199, 237, 204));

      pieplot.setLabelGenerator(new StandardPieSectionLabelGenerator(
        "{0} {2}", NumberFormat.getNumberInstance(), new DecimalFormat(
          "0.00%")));
      LegendTitle legendtitle = new LegendTitle(jfreechart.getPlot());
      BlockContainer blockcontainer = new BlockContainer(
        new BorderArrangement());
      BlockContainer blockcontainer1 = legendtitle.getItemContainer();
      blockcontainer1.setPadding(2D, 10D, 5D, 2D);
      blockcontainer.add(blockcontainer1);
      legendtitle.setWrapper(blockcontainer);
      legendtitle.setPosition(RectangleEdge.RIGHT);
      legendtitle.setHorizontalAlignment(HorizontalAlignment.LEFT);
      jfreechart.addSubtitle(legendtitle);
      jfreechart.setBackgroundPaint(new Color(199, 237, 204));
      FileOutputStream fos_jpg = null;
      try {
       fos_jpg = new FileOutputStream("F:\\steelBar.jpg");
       ChartUtilities
         .writeChartAsJPEG(fos_jpg, jfreechart, 1000, 800, null);
      } finally {
       try {
        fos_jpg.close();
       } catch (Exception e) {

       }
      }
      System.out.println("ok");
     }

    }



    柳德才
    13691193654
    18942949207
    QQ:422157370
    liudecai_zan@126.com
    湖北-武漢-江夏-廟山

    posted on 2009-01-09 00:34 liudecai_zan@126.com 閱讀(1872) 評論(0)  編輯  收藏 所屬分類: JFreeChart

    主站蜘蛛池模板: 亚洲AV日韩AV永久无码绿巨人| 一本色道久久88亚洲综合 | 亚洲国产成人片在线观看| 黄色一级视频免费观看| 亚洲国产综合无码一区二区二三区| 亚洲乱理伦片在线观看中字 | 国产精品嫩草影院免费| 亚洲av无码专区在线电影| 成人毛片免费在线观看| 亚洲色成人网站WWW永久四虎| 国产美女在线精品免费观看| 在线观看日本亚洲一区| 日韩a级毛片免费视频| 免费国产黄网站在线观看动图 | 国产综合激情在线亚洲第一页| 国产精品无码免费视频二三区| 免费一区二区无码视频在线播放| 亚洲日韩精品无码专区网站| 在线观看特色大片免费网站 | 亚洲影院天堂中文av色| 全免费一级午夜毛片| 九九九精品视频免费| 亚洲视频.com| 猫咪社区免费资源在线观看| 国产亚洲女在线线精品| 在线亚洲97se亚洲综合在线| 久久精品一本到99热免费| 一本色道久久88亚洲精品综合| 免费在线观看理论片| 国产精品免费AV片在线观看| 亚洲卡一卡2卡三卡4麻豆| 啊灬啊灬别停啊灬用力啊免费看| 天黑黑影院在线观看视频高清免费| 亚洲精品午夜在线观看| 免费一级毛片一级毛片aa| 一个人看的www免费视频在线观看| 亚洲成人福利在线| mm1313亚洲精品无码又大又粗| 日韩电影免费观看| 亚洲av无码专区青青草原| 日韩亚洲欧洲在线com91tv|