资源简介

jfreechart demo 源代码 jfreechart demo 源代码 jfreechart demo 源代码

资源截图

代码片段和文件信息

/* --------------------
 * AnnotationDemo1.java
 * --------------------
 * (C) Copyright 2002-2007 by object Refinery Limited.
 *
 */

package demo;

import java.awt.Font;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;

import javax.swing.JPanel;

import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.annotations.XYTextAnnotation;
import org.jfree.chart.axis.NumberAxis;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.plot.XYPlot;
import org.jfree.chart.title.Texttitle;
import org.jfree.data.xy.XYDataset;
import org.jfree.data.xy.XYSeries;
import org.jfree.data.xy.XYSeriesCollection;
import org.jfree.ui.Applicationframe;
import org.jfree.ui.RefineryUtilities;
import org.jfree.ui.TextAnchor;

/**
 * A demo showing chart annotations in this case several instances of 
 * {@link XYTextAnnotation}.
 */
public class AnnotationDemo1 extends Applicationframe {

    /**
     * Creates a new demo application.
     *
     * @param title  the frame title.
     */
    public AnnotationDemo1(String title) {
        super(title);
        JPanel chartPanel = createDemoPanel();
        chartPanel.setPreferredSize(new java.awt.Dimension(360 500));
        setContentPane(chartPanel);
    }

    /**
     * Creates a dataset.
     *
     * @return a dataset.
     */
    private static XYSeriesCollection createDataset() {

        XYSeriesCollection result = new XYSeriesCollection();

        try {
            BufferedReader in = new BufferedReader(new InputStreamReader(
                    XYSeriesCollection.class.getClassLoader()
                    .getResourceAsStream(“demo/wtageinf.txt“)));
            String data = in.readLine();  // ignore first line
            data = in.readLine();  // ignore second line
            data = in.readLine();  // ignore third line
            data = in.readLine();  // headings

            XYSeries s3 = new XYSeries(“P3“ true false);
            XYSeries s5 = new XYSeries(“P5“ true false);
            XYSeries s10 = new XYSeries(“P10“ true false);
            XYSeries s25 = new XYSeries(“P25“ true false);
            XYSeries s50 = new XYSeries(“P50“ true false);
            XYSeries s75 = new XYSeries(“P75“ true false);
            XYSeries s90 = new XYSeries(“P90“ true false);
            XYSeries s95 = new XYSeries(“P95“ true false);
            XYSeries s97 = new XYSeries(“P97“ true false);

            data = in.readLine();
            while (data != null) {
                int sex = Integer.parseInt(data.substring(1 8).trim());
                float age = Float.parseFloat(data.substring(9 17).trim());
                float p3 = Float.parseFloat(data.substring(69 86).trim());
                float p5 = Float.parseFloat(data.substring(87 103).tri

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        468  2009-07-20 13:18  官网demo\jfreechart\.classpath

     文件        574  2009-07-21 09:01  官网demo\jfreechart\.project

     文件        454  2009-07-21 09:01  官网demo\jfreechart\.settings\.jsdtscope

     文件         49  2009-07-21 09:01  官网demo\jfreechart\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2009-07-21 09:01  官网demo\jfreechart\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件       1520  2010-08-10 10:37  官网demo\jfreechart\bin\demo\Animator.class

     文件       6862  2010-08-10 10:37  官网demo\jfreechart\bin\demo\AnnotationDemo1.class

     文件        234  2009-07-20 12:42  官网demo\jfreechart\bin\demo\AnnotationDemo1.html

     文件       6452  2010-08-10 10:37  官网demo\jfreechart\bin\demo\AnnotationDemo2.class

     文件        103  2009-07-20 12:42  官网demo\jfreechart\bin\demo\AnnotationDemo2.html

     文件       5521  2010-08-10 10:37  官网demo\jfreechart\bin\demo\AreaChartDemo1.class

     文件        181  2009-07-20 12:42  官网demo\jfreechart\bin\demo\AreaChartDemo1.html

     文件       4069  2010-08-10 10:37  官网demo\jfreechart\bin\demo\BarChart3DDemo1.class

     文件         94  2009-07-20 12:42  官网demo\jfreechart\bin\demo\BarChart3DDemo1.html

     文件       4247  2010-08-10 10:37  官网demo\jfreechart\bin\demo\BarChart3DDemo2.class

     文件         78  2009-07-20 12:42  官网demo\jfreechart\bin\demo\BarChart3DDemo2.html

     文件       3508  2010-08-10 10:37  官网demo\jfreechart\bin\demo\BarChart3DDemo3.class

     文件         83  2009-07-20 12:42  官网demo\jfreechart\bin\demo\BarChart3DDemo3.html

     文件       1131  2010-08-10 10:37  官网demo\jfreechart\bin\demo\BarChart3DDemo4$CustomBarRenderer3D.class

     文件       5392  2010-08-10 10:37  官网demo\jfreechart\bin\demo\BarChart3DDemo4.class

     文件        140  2009-07-20 12:42  官网demo\jfreechart\bin\demo\BarChart3DDemo4.html

     文件       4807  2010-08-10 10:37  官网demo\jfreechart\bin\demo\BarChartDemo1.class

     文件        151  2009-07-20 12:42  官网demo\jfreechart\bin\demo\BarChartDemo1.html

     文件       4991  2010-08-10 10:37  官网demo\jfreechart\bin\demo\BarChartDemo10.class

     文件         65  2009-07-20 12:42  官网demo\jfreechart\bin\demo\BarChartDemo10.html

     文件       4338  2010-08-10 10:37  官网demo\jfreechart\bin\demo\BarChartDemo11.class

     文件       3997  2010-08-10 10:37  官网demo\jfreechart\bin\demo\BarChartDemo2.class

     文件         71  2009-07-20 12:42  官网demo\jfreechart\bin\demo\BarChartDemo2.html

     文件        644  2010-08-10 10:37  官网demo\jfreechart\bin\demo\BarChartDemo3$CustomRenderer.class

     文件       5362  2010-08-10 10:37  官网demo\jfreechart\bin\demo\BarChartDemo3.class

............此处省略974个文件信息

评论

共有 条评论