package org.jfree.chart.line;
import java.awt.Color;
import javax.swing.JPanel;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.ChartUtilities;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.AxisLocation;
import org.jfree.chart.axis.CategoryAxis;
import org.jfree.chart.axis.NumberAxis;
import org.jfree.chart.axis.NumberTickUnit;
import org.jfree.chart.axis.SymbolAxis;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.plot.XYPlot;
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer;
import org.jfree.chart.renderer.xy.XYSplineRenderer;
import org.jfree.data.RangeType;
import org.jfree.data.time.Minute;
import org.jfree.data.time.RegularTimePeriod;
import org.jfree.data.time.TimeSeries;
import org.jfree.data.time.TimeSeriesCollection;
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.RectangleInsets;
import org.jfree.ui.RefineryUtilities;
/**
*
* A demo showing a line chart drawn using spline curves.
*/
public class TemperatureChart extends ApplicationFrame {
private static float[] TemperatureData;
private static float nodata;
/**
* Creates a new instance of the demo application.
*
* @param title the frame title.
*/
public TemperatureChart(String title,float[] temperature,float nodata) {
super(title);
this.TemperatureData = temperature;
this.nodata = nodata;
JPanel content = createDemoPanel();
content.setPreferredSize(new java.awt.Dimension(300, 500));
getContentPane().add(content);
}
/**
* Creates a panel for the demo (used by SuperDemo.java).
*
* @return A panel.
*/
public static JPanel createDemoPanel() {
//轴线数值为给定数值
SymbolAxis ySymbolAxis1 = new SymbolAxis("hPa", new String[] {
"1000", "950", "920", "850", "780", "700", "620", "500", "400", "300",
"250", "200", "150", "100", "70", "50", "30", "20", "10", "5"
});
//给定数值的索引起始数值 0,1,2,3......
ySymbolAxi