下载了jfreechart后,将jfreechart-0.9.6.zip下载后解压,然后将jfreechart-0.9.6.jar和lib里面的jcommon-0.7.2.jar两个文件加入到Classpath中,接着就可以利用jfreechart进行开发了。
你可以自己看一下里面的demo,不是很难!
good luck!

解决方案 »

  1.   

    将解压后的jfreechart放在那个目录啊?
    我下的是jfreechart-0.9.8
      

  2.   

    运行VerticalBarChartDemo.java怎么出错呢
    说could not find the main class,program will exit
      

  3.   

    jfreechart随便放在哪里,classpath中加了吗?
    你看看verticalbarchartdemo中有main吗?
      

  4.   

    随便放在哪里了,要把它加到classpath中去就行了
      

  5.   

    加了阿,那个文件里也有main
    真不知为什么?
      

  6.   

    在jbuilder的工程->工程属性->general->...忘记了。反正你要把这个包加入你的‘所需类包’中去。
      

  7.   

    在jbuilder的工程->工程属性->general->...忘记了。反正你要把这个包加入你的‘所需类包’中去。
      

  8.   

    /* ======================================
     * JFreeChart : a free Java chart library
     * ======================================
     *
     * Project Info:  http://www.jfree.org/jfreechart/index.html
     * Project Lead:  David Gilbert ([email protected]);
     *
     * (C) Copyright 2000-2003, by Simba Management Limited and Contributors.
     *
     * This library is free software; you can redistribute it and/or modify it under the terms
     * of the GNU Lesser General Public License as published by the Free Software Foundation;
     * either version 2.1 of the License, or (at your option) any later version.
     *
     * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
     * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     * See the GNU Lesser General Public License for more details.
     *
     * You should have received a copy of the GNU Lesser General Public License along with this
     * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
     * Boston, MA 02111-1307, USA.
     *
     * -------------------------
     * VerticalBarChartDemo.java
     * -------------------------
     * (C) Copyright 2002, 2003, by Simba Management Limited and Contributors.
     *
     * Original Author:  David Gilbert (for Simba Management Limited);
     * Contributor(s):   -;
     *
     * $Id: VerticalBarChartDemo.java,v 1.1 2003/04/23 09:58:51 mungady Exp $
     *
     * Changes
     * -------
     * 11-Jun-2002 : Version 1 (DG);
     * 25-Jun-2002 : Removed redundant imports (DG);
     * 09-Oct-2002 : Added frame centering (DG);
     * 18-Nov-2002 : Changed from DefaultCategoryDataset to DefaultTableDataset (DG);
     *
     */package org.jfree.chart.demo;import java.awt.Color;import org.jfree.chart.ChartFactory;
    import org.jfree.chart.ChartPanel;
    import org.jfree.chart.JFreeChart;
    import org.jfree.chart.axis.HorizontalCategoryAxis;
    import org.jfree.chart.axis.NumberAxis;
    import org.jfree.chart.plot.CategoryPlot;
    import org.jfree.data.DefaultCategoryDataset;
    import org.jfree.ui.ApplicationFrame;
    import org.jfree.ui.RefineryUtilities;/**
     * A simple demonstration application showing how to create a vertical bar chart.
     *
     * @author David Gilbert
     */
    public class VerticalBarChartDemo extends ApplicationFrame {    /**
         * Creates a new demo instance.
         *
         * @param title  the frame title.
         */
        public VerticalBarChartDemo(String title) {        super(title);        // row keys...
            String series1 = "First";
            String series2 = "Second";
            String series3 = "Third";        // column keys...
            String category1 = "Category 1";
            String category2 = "Category 2";
            String category3 = "Category 3";
            String category4 = "Category 4";
            String category5 = "Category 5";
            String category6 = "Category 6";
            String category7 = "Category 7";
            String category8 = "Category 8";        // create the dataset...
            DefaultCategoryDataset dataset = new DefaultCategoryDataset();        dataset.addValue(1.0, series1, category1);
            dataset.addValue(4.0, series1, category2);
            dataset.addValue(3.0, series1, category3);
            dataset.addValue(5.0, series1, category4);
            dataset.addValue(5.0, series1, category5);
            dataset.addValue(7.0, series1, category6);
            dataset.addValue(7.0, series1, category7);
            dataset.addValue(8.0, series1, category8);        dataset.addValue(5.0, series2, category1);
            dataset.addValue(7.0, series2, category2);
            dataset.addValue(6.0, series2, category3);
            dataset.addValue(8.0, series2, category4);
            dataset.addValue(4.0, series2, category5);
            dataset.addValue(4.0, series2, category6);
            dataset.addValue(2.0, series2, category7);
            dataset.addValue(1.0, series2, category8);        dataset.addValue(4.0, series3, category1);
            dataset.addValue(3.0, series3, category2);
            dataset.addValue(2.0, series3, category3);
            dataset.addValue(3.0, series3, category4);
            dataset.addValue(6.0, series3, category5);
            dataset.addValue(3.0, series3, category6);
            dataset.addValue(4.0, series3, category7);
            dataset.addValue(3.0, series3, category8);        // create the chart...
            JFreeChart chart = ChartFactory.createVerticalBarChart(
                                                         "Vertical Bar Chart",  // chart title
                                                         "Category",            // domain axis label
                                                         "Value",               // range axis label
                                                         dataset,               // data
                                                         true,                  // include legend
                                                         true,
                                                         false
                                                     );        // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...        // set the background color for the chart...
            chart.setBackgroundPaint(new Color(0xBBBBDD));        // get a reference to the plot for further customisation...
            CategoryPlot plot = chart.getCategoryPlot();        // skip some labels if they overlap...
            HorizontalCategoryAxis domainAxis = (HorizontalCategoryAxis) plot.getDomainAxis();
            domainAxis.setSkipCategoryLabelsToFit(true);        // set the range axis to display integers only...
            NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
            rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());        // OPTIONAL CUSTOMISATION COMPLETED.        // add the chart to a panel...
            ChartPanel chartPanel = new ChartPanel(chart);
            chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
            setContentPane(chartPanel);    }    /**
         * Starting point for the demonstration application.
         *
         * @param args  ignored.
         */
        public static void  main(String[] args) {        VerticalBarChartDemo demo = new VerticalBarChartDemo("Vertical Bar Chart Demo");
            demo.pack();
            RefineryUtilities.centerFrameOnScreen(demo);
            demo.setVisible(true);    }}
    错误提示
    cannot access class org.jfree.chart.axis
    总之那几个import都出错
    我把整个org文件夹都放到我的工程目录里了,也不行
      

  9.   

    "VerticalBarChartDemo.java": Error #: 302 : cannot access class org.jfree.chart.ChartFactory; java.io.IOException: class not found: class org.jfree.chart.ChartFactory at line 45, column 24
    "VerticalBarChartDemo.java": Error #: 302 : cannot access class org.jfree.chart.ChartPanel; java.io.IOException: class not found: class org.jfree.chart.ChartPanel at line 46, column 24
      

  10.   

    用jb的话,在工程的需要的库中把上面两个文件添加进去,而且你可以仿照demo中的package建好路径,把demo中的java文件全部拷到该路径下,在试试!
      

  11.   

    哪里有jfreechart-0.9.6.zip的下载
      

  12.   

    我不知道你有没有引入过包?你在这里就是要用到这种方法.在jbuilder的工程->工程属性->general->...忘记了。反正你要把这个包加入你的‘所需类包’中去。具体的,晚上在写给你.
      

  13.   

    对了,哪里有jfreechart-0.9.6.zip的下载给个网址吧.
      

  14.   

    http://www.jfree.org/jfreechart/
    这个地方可以下载jfreechart-0.9.8.zip
      

  15.   

    可能仅仅把org包考进来不行,在做上角的相应包下不显示,应该象newman0708(nch)所说的先导进来,但我不知啊,告诉我啊,多谢
      

  16.   

    jbuilder中使用方法:
    1.tools->configure libraries.
    点new...,在name栏写一个有意义的名字.再点add...,增加一个jar,找到你要加的jar文件,ok.
    2.在当前工程的properties中,paths->Required Libraries,点add...,选择你给的"有意义的名字",ok.在jbuilder中,你import com.xxx,等时,应能见到你的jar package 信息.
      

  17.   

    import com.xxx你的包是org,那么就这样用import org.xxx,
      

  18.   

    应该导进来了
    打import org.时后面有提示啊
    真不知为什么?
      

  19.   

    应该可以了,
    import org.jfree.chart.*;有提示吗?
    若有的话,那我就不知道该怎么办了。
    若没有的话,那就是上面的配置不正确,别急,多来几次就熟练了。
      

  20.   

    jfreechart-0.9.8/jfreechart-0.9.8.jar
    jfreechart-0.9.8/jfreechart-0.9.8-demo.jar
    jfreechart-0.9.8/lib/gnujaxp.jar
    jfreechart-0.9.8/lib/jcommon-0.8.0.jar
    jfreechart-0.9.8/lib/servlet.jar
    全部加入到库中,就OK。