<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 閱讀(1864) 評論(0)  編輯  收藏 所屬分類: JFreeChart

    主站蜘蛛池模板: 粉色视频免费入口| 亚洲AV无码久久精品成人| 国产精品亚洲四区在线观看| 日韩人妻无码精品久久免费一| 亚洲av伊人久久综合密臀性色| 免费看少妇高潮成人片| 亚洲欧洲日产国码无码久久99| 毛片在线全部免费观看| 亚洲视频日韩视频| 成人免费视频69| 亚洲欧美日韩自偷自拍| 国产a不卡片精品免费观看 | 日本一道一区二区免费看| 亚洲另类无码专区首页| 免费h黄肉动漫在线观看| av片在线观看永久免费| 国产亚洲福利精品一区| 国产精品亚洲综合专区片高清久久久 | 国产精品无码素人福利免费| 羞羞视频免费网站含羞草| 狠狠色婷婷狠狠狠亚洲综合| 免费看黄的成人APP| 亚洲人成网男女大片在线播放| 大学生高清一级毛片免费| 免费人人潮人人爽一区二区| 亚洲精品国产精品乱码视色 | 人妻无码中文字幕免费视频蜜桃 | 无码天堂亚洲国产AV| 国产成人99久久亚洲综合精品| 久久精品成人免费网站| 亚洲香蕉久久一区二区| 免费中文字幕在线观看| 久久免费视频99| 亚洲欧美日韩一区二区三区在线| 亚洲色偷偷狠狠综合网| 37pao成人国产永久免费视频| 亚洲AV无码专区在线电影成人| 99久久免费国产香蕉麻豆 | 亚洲性色AV日韩在线观看| 国产a v无码专区亚洲av| 精品国产sm捆绑最大网免费站|