1 7 package de.laures.cewolf.taglib; 8 9 import java.io.Serializable ; 10 import java.util.ArrayList ; 11 import java.util.List ; 12 13 import org.jfree.chart.JFreeChart; 14 import org.jfree.chart.plot.DefaultDrawingSupplier; 15 import org.jfree.chart.plot.DrawingSupplier; 16 17 import de.laures.cewolf.ChartValidationException; 18 import de.laures.cewolf.DatasetProduceException; 19 20 26 public class OverlaidChartDefinition extends AbstractChartDefinition implements Serializable { 27 28 private int xAxisType = 0; 29 private int yAxisType = 0; 30 31 private List plotDefinitions = new ArrayList (); 32 private transient DrawingSupplier drawingSupplier = new DefaultDrawingSupplier(); 33 34 public Object getDataset() throws DatasetProduceException { 35 return ((PlotDefinition)plotDefinitions.get(0)).getDataset(); 36 } 37 38 public void addPlot(PlotDefinition pd) { 39 pd.setDrawingSupplier(drawingSupplier); 40 plotDefinitions.add(pd); 41 } 42 43 protected JFreeChart produceChart() throws DatasetProduceException, ChartValidationException { 44 log.debug("xAxisType = " + xAxisType); 45 return CewolfChartFactory.getOverlaidChartInstance(type, title, xAxisLabel, yAxisLabel, xAxisType, yAxisType, plotDefinitions); 46 } 47 48 52 public void setXAxisType(int xAxisType) { 53 this.xAxisType = xAxisType; 54 } 55 56 60 public void setYAxisType(int yAxisType) { 61 this.yAxisType = yAxisType; 62 } 63 64 } 65 | Popular Tags |