JFreeChart的优缺点

优点:目前最好的java图表解决方案,功能强大,基本涵盖了各种图表;java实现,扩展性强,API较完善,支持多种输出方式。

缺点:类及接口较多,需花较长时间研究;如果以文件或响应流输出则缺少交互功能,为实现交互功能需借助Frame或Applet等,各有一定弊端。

总的来说,使用JFreeChart技术能够按需求定制各种图表,通过某种方式也能够实现多样的人机交互功能,JFreeChart是一个以java为基础的,值得深入研究的开源图表技术。我不会~~~但还是要微笑~~~:)

jfreechart

在eclipse下怎么使用jfreechart,详细步骤是什么啊?

有个jfreechart-1.0.12.jar要放到JRE中,jfreechart的版本可能不一样吧。看你是什么版本的,反正要放进去。

以下是示例程序:

import java.awt.Font;

import org.jfree.chart.JFreeChart;

import org.jfree.chart.ChartFactory;

import org.jfree.chart.ChartFrame;

import org.jfree.chart.plot.PiePlot;

import org.jfree.chart.title.TextTitle;

import org.jfree.data.general.DefaultPieDataset;

public class JFreeChartTest {

public static void main(String[] args) {

DefaultPieDataset dpd = new DefaultPieDataset();

dpd.setValue("管理人员", 25);

dpd.setValue("市场人员", 25);

dpd.setValue("开发人员", 45);

dpd.setValue("其他人员", 5);

JFreeChart chart = ChartFactory.createPieChart("公司组织架构图", dpd, true, true, false);

Font font = new Font("SimSun", 10, 20);

TextTitle txtTitle = null;

txtTitle = chart.getTitle();

txtTitle.setFont(font);

PiePlot pieplot = (PiePlot) chart.getPlot();

pieplot.setLabelFont(font);

chart.getLegend().setItemFont(font);

ChartFrame pieFrame = new ChartFrame("公司组织架构图", chart);

pieFrame.pack();

pieFrame.setFont(font);

pieFrame.setVisible(true);

}查看一些接口的用处,或者直接查看jfreechart中自带的demo,应该比较容易。剩下的要看LZ自己了。你好!

查看一些接口的用处,或者直接查看jfreechart中自带的demo,应该比较容易。剩下的要看LZ自己了。

仅代表个人观点,不喜勿喷,谢谢。