隨筆-21  評(píng)論-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);
              }

          }


          運(yùn)行結(jié)果:
          posted on 2009-06-01 17:02 特立獨(dú)行 閱讀(492) 評(píng)論(0)  編輯  收藏 所屬分類: Struts框架
          主站蜘蛛池模板: 水城县| 克拉玛依市| 合作市| 信丰县| 兴安盟| 玛曲县| 洛隆县| 滦平县| 连南| 德清县| 仁布县| 综艺| 东辽县| 重庆市| 鄂尔多斯市| 久治县| 休宁县| 许昌市| 大悟县| 山东省| 保靖县| 惠州市| 赤峰市| 台南县| 汉阴县| 保山市| 抚州市| 苏尼特右旗| 阿荣旗| 四川省| 乾安县| 聂拉木县| 通榆县| 会宁县| 沙坪坝区| 潞西市| 多伦县| 象山县| 安丘市| 那坡县| 孟村|