在CewolfChartFactory都有定义,可以从这学习jreechart的使用,呵呵。
switch (getChartTypeConstant(chartType)) {
case XY :
check(data, XYDataset.class, chartType);
return ChartFactory.createXYLineChart(title, xAxisLabel, yAxisLabel, (XYDataset) data, PlotOrientation.VERTICAL, true, true, true);
case PIE :
check(data, PieDataset.class, chartType);
return ChartFactory.createPieChart(title, (PieDataset) data, true, true, true);
case AREA_XY :
check(data, XYDataset.class, chartType);
return ChartFactory.createXYAreaChart(title, xAxisLabel, yAxisLabel, (XYDataset) data, PlotOrientation.VERTICAL, true, false, false);
case SCATTER :
check(data, XYDataset.class, chartType);
return ChartFactory.createScatterPlot(title, xAxisLabel, yAxisLabel, (XYDataset) data, PlotOrientation.VERTICAL, true, false, false);
case AREA :
check(data, CategoryDataset.class, chartType);
return ChartFactory.createAreaChart(title, xAxisLabel, yAxisLabel, (CategoryDataset) data, PlotOrientation.VERTICAL, true, false, false);
case HORIZONTAL_BAR :
check(data, CategoryDataset.class, chartType);
return ChartFactory.createBarChart(title, xAxisLabel, yAxisLabel, (CategoryDataset) data, PlotOrientation.HORIZONTAL, true, false, false);
case HORIZONTAL_BAR_3D :
check(data, CategoryDataset.class, chartType);
return ChartFactory.createBarChart3D(title, xAxisLabel, yAxisLabel, (CategoryDataset) data, PlotOrientation.HORIZONTAL, true, false, false);
case LINE :
check(data, CategoryDataset.class, chartType);
return ChartFactory.createLineChart(title, xAxisLabel, yAxisLabel, (CategoryDataset) data, PlotOrientation.VERTICAL, true, false, false);
case STACKED_HORIZONTAL_BAR :
check(data, CategoryDataset.class, chartType);
return ChartFactory.createStackedBarChart(title, xAxisLabel, yAxisLabel, (CategoryDataset) data, PlotOrientation.HORIZONTAL, true, false, false);
case STACKED_VERTICAL_BAR :
check(data, CategoryDataset.class, chartType);
return ChartFactory.createStackedBarChart(title, xAxisLabel, yAxisLabel, (CategoryDataset) data, PlotOrientation.VERTICAL, true, false, false);
case STACKED_VERTICAL_BAR_3D :
check(data, CategoryDataset.class, chartType);
return ChartFactory.createStackedBarChart3D(title, xAxisLabel, yAxisLabel, (CategoryDataset) data, PlotOrientation.VERTICAL, true, false, false);
case VERTICAL_BAR :
check(data, CategoryDataset.class, chartType);
return ChartFactory.createBarChart(title, xAxisLabel, yAxisLabel, (CategoryDataset) data, PlotOrientation.VERTICAL, true, false, false);
case VERTICAL_BAR_3D :
check(data, CategoryDataset.class, chartType);
return ChartFactory.createBarChart3D(title, xAxisLabel, yAxisLabel, (CategoryDataset) data, PlotOrientation.VERTICAL, true, false, false);
case TIME_SERIES :
check(data, XYDataset.class, chartType);
return ChartFactory.createTimeSeriesChart(title, xAxisLabel, yAxisLabel, (XYDataset) data, true, false, false);
case CANDLE_STICK :
check(data, OHLCDataset.class, chartType);
return ChartFactory.createCandlestickChart(title, xAxisLabel, yAxisLabel, (OHLCDataset) data, true);
case HIGH_LOW :
check(data, OHLCDataset.class, chartType);
return ChartFactory.createHighLowChart(title, xAxisLabel, yAxisLabel, (OHLCDataset) data, true);
case GANTT :
check(data, IntervalCategoryDataset.class, chartType);
return ChartFactory.createGanttChart(title, xAxisLabel, yAxisLabel, (IntervalCategoryDataset) data, true, false, false);
case WIND :
check(data, WindDataset.class, chartType);
return ChartFactory.createWindPlot(title, xAxisLabel, yAxisLabel, (WindDataset) data, true, false, false);
//case SIGNAL :
// check(data, SignalsDataset.class, chartType);
// return ChartFactory.createSignalChart(title, xAxisLabel, yAxisLabel, (SignalsDataset) data, true);
case VERRTICAL_XY_BAR :
check(data, IntervalXYDataset.class, chartType);
return ChartFactory.createXYBarChart(title, xAxisLabel, true,yAxisLabel, (IntervalXYDataset) data, PlotOrientation.VERTICAL, true, false, false);
case PIE_3D :
check(data, PieDataset.class, chartType);
return ChartFactory.createPieChart3D(title, (PieDataset) data, true, false, false);
case METER :
check(data, ValueDataset.class, chartType);
MeterPlot plot = new MeterPlot((ValueDataset) data);
JFreeChart chart = new JFreeChart(title, plot);
return chart;
case STACKED_AREA :
check(data, CategoryDataset.class, chartType);
return ChartFactory.createStackedAreaChart(title, xAxisLabel, yAxisLabel, (CategoryDataset) data, PlotOrientation.VERTICAL, true, false, false);
case BUBBLE :
check(data, XYZDataset.class, chartType);
return ChartFactory.createBubbleChart(title, xAxisLabel, yAxisLabel, (XYZDataset) data, PlotOrientation.VERTICAL, true, false, false);
default :
throw new UnsupportedChartTypeException(chartType + " is not supported.");
}