隨筆-21  評論-29  文章-0  trackbacks-0
          先給出我測試類的代碼 該類的編碼已經(jīng)設(shè)置為GBK了

          package com.test.jfreechart;

          import org.jfree.chart.ChartFactory;
          import org.jfree.chart.ChartFrame;
          import org.jfree.chart.JFreeChart;
          import org.jfree.data.general.DefaultPieDataset;

          public class JFreeChartTest {
              
          public static void main(String[] args) {
                  
          // 定義數(shù)據(jù)集
                  DefaultPieDataset dpd = new DefaultPieDataset();

                  
          // 往數(shù)據(jù)集里面加入數(shù)據(jù)
                  dpd.setValue("管理人員"25);
                  dpd.setValue(
          "市場人員"20);
                  dpd.setValue(
          "開發(fā)人員"45);
                  dpd.setValue(
          "其他人員"10);

                  
          // 用工廠類創(chuàng)建餅圖
                  JFreeChart chart = ChartFactory.createPieChart("公司人員結(jié)構(gòu)圖", dpd, true,
                          
          truefalse);

                  
          // 在Swing中顯示該餅圖
                  ChartFrame chartFrame = new ChartFrame("公司人員結(jié)構(gòu)圖", chart);

                  chartFrame.pack();

                  chartFrame.setVisible(
          true);
              }

          }


          運行結(jié)果:
          posted on 2009-06-01 17:02 特立獨行 閱讀(489) 評論(0)  編輯  收藏 所屬分類: Struts框架
          主站蜘蛛池模板: 图片| 雷波县| 安宁市| 泰宁县| 若尔盖县| 北票市| 正镶白旗| 福清市| 鄂托克前旗| 天台县| 建平县| 丘北县| 长葛市| 阳曲县| 兴海县| 夏邑县| 和田市| 龙岩市| 临漳县| 清新县| 大名县| 钦州市| 和政县| 沅陵县| 富宁县| 深泽县| 怀来县| 永和县| 亳州市| 宁国市| 桐庐县| 扬州市| 松原市| 交口县| 迁西县| 甘孜县| 阳江市| 南昌县| 策勒县| 美姑县| 庄河市|