franta-hg@1: /* franta-hg@1: * Created on 13.04.2003 franta-hg@1: * franta-hg@1: * To change the template for this generated file go to franta-hg@1: * Window>Preferences>Java>Code Generation>Code and Comments franta-hg@1: */ franta-hg@1: package de.laures.cewolf.taglib; franta-hg@1: franta-hg@1: import java.io.Serializable; franta-hg@1: import java.util.ArrayList; franta-hg@1: import java.util.List; franta-hg@1: franta-hg@1: import org.jfree.chart.JFreeChart; franta-hg@1: import org.jfree.chart.plot.DefaultDrawingSupplier; franta-hg@1: import org.jfree.chart.plot.DrawingSupplier; franta-hg@1: franta-hg@1: import de.laures.cewolf.ChartValidationException; franta-hg@1: import de.laures.cewolf.DatasetProduceException; franta-hg@1: franta-hg@1: /** franta-hg@1: * @author guido franta-hg@1: * franta-hg@1: * To change the template for this generated type comment go to franta-hg@1: * Window>Preferences>Java>Code Generation>Code and Comments franta-hg@1: */ franta-hg@1: public class OverlaidChartDefinition extends AbstractChartDefinition implements Serializable { franta-hg@1: franta-hg@1: private int xAxisType = 0; franta-hg@1: private int yAxisType = 0; franta-hg@1: franta-hg@1: private List plotDefinitions = new ArrayList(); franta-hg@1: private transient DrawingSupplier drawingSupplier = new DefaultDrawingSupplier(); franta-hg@1: franta-hg@1: public Object getDataset() throws DatasetProduceException { franta-hg@1: return ((PlotDefinition)plotDefinitions.get(0)).getDataset(); franta-hg@1: } franta-hg@1: franta-hg@1: public void addPlot(PlotDefinition pd) { franta-hg@1: pd.setDrawingSupplier(drawingSupplier); franta-hg@1: plotDefinitions.add(pd); franta-hg@1: } franta-hg@1: franta-hg@1: protected JFreeChart produceChart() throws DatasetProduceException, ChartValidationException { franta-hg@1: log.debug("xAxisType = " + xAxisType); franta-hg@1: return CewolfChartFactory.getOverlaidChartInstance(type, title, xAxisLabel, yAxisLabel, xAxisType, yAxisType, plotDefinitions); franta-hg@1: } franta-hg@1: franta-hg@1: /** franta-hg@1: * Sets the xAxisType. franta-hg@1: * @param xAxisType The xAxisType to set franta-hg@1: */ franta-hg@1: public void setXAxisType(int xAxisType) { franta-hg@1: this.xAxisType = xAxisType; franta-hg@1: } franta-hg@1: franta-hg@1: /** franta-hg@1: * Sets the yAxisType. franta-hg@1: * @param yAxisType The yAxisType to set franta-hg@1: */ franta-hg@1: public void setYAxisType(int yAxisType) { franta-hg@1: this.yAxisType = yAxisType; franta-hg@1: } franta-hg@1: franta-hg@1: }