JFC是一个轻量级第三方开源组件,不依赖其他组件,使用Project即可。
作用:以图表方式展示数据
网址:www.jfree.org
类库:JFreeChart、JCommon(JFreeReport和JFreeChart的公共类库)
指南: jfreechart-1.0.13-install.pdf
API: jfreechart-1.0.13-javadocs.zip
压缩包:jfreechart-1.0.13
ant 蚂蚁
checkstyle 检查风格
docfiles 文档文件:图表图片
experimental 试验的
lib 类库
source 源代码(打包成.zip在eclipse查看)
swt Standard Widget(构件) Toolkit(工具箱)
tests 测试: 示例
示例:第一个图表程序
- import org.jfree.chart.ChartFactory;
- import org.jfree.chart.ChartFrame;
- import org.jfree.chart.JFreeChart;
- import org.jfree.data.general.DefaultPieDataset;
- /**
- * A simple introduction to using JFreeChart. This demo is described in the
- * JFreeChart Developer Guide.
- */
- public class First {
- /**
- * The starting point for the demo.
- *
- * @param args
- * ignored.
- */
- public static void main(String[] args) {
- // create a dataset... 创建饼图指定数据
- DefaultPieDataset data = new DefaultPieDataset();
- data.setValue("Category 1", 43.2); // 类别,比例
- data.setValue("Category 2", 27.9);
- data.setValue("Category 3", 79.5);
- // create a chart... 创建饼图图表
- JFreeChart chart = ChartFactory.createPieChart(
- "Sample Pie Chart", // 标题
- data, // 饼图指定数据
- true, // legend? 图例
- true, // tooltips? 工具提示
- false // URLs? 统一资源定位器
- );
- // create and display a frame... 创建并显示框架
- ChartFrame frame = new ChartFrame("First", chart);
- frame.pack(); // 包裹子部件
- frame.setVisible(true); // 显示
- }
- }