java/cewolf-1.0/src/main/java/de/laures/cewolf/taglib/OverlaidChartDefinition.java
2 * Created on 13.04.2003
4 * To change the template for this generated file go to
5 * Window>Preferences>Java>Code Generation>Code and Comments
7 package de.laures.cewolf.taglib;
9 import java.io.Serializable;
10 import java.util.ArrayList;
11 import java.util.List;
13 import org.jfree.chart.JFreeChart;
14 import org.jfree.chart.plot.DefaultDrawingSupplier;
15 import org.jfree.chart.plot.DrawingSupplier;
17 import de.laures.cewolf.ChartValidationException;
18 import de.laures.cewolf.DatasetProduceException;
23 * To change the template for this generated type comment go to
24 * Window>Preferences>Java>Code Generation>Code and Comments
26 public class OverlaidChartDefinition extends AbstractChartDefinition implements Serializable {
28 private int xAxisType = 0;
29 private int yAxisType = 0;
31 private List plotDefinitions = new ArrayList();
32 private transient DrawingSupplier drawingSupplier = new DefaultDrawingSupplier();
34 public Object getDataset() throws DatasetProduceException {
35 return ((PlotDefinition)plotDefinitions.get(0)).getDataset();
38 public void addPlot(PlotDefinition pd) {
39 pd.setDrawingSupplier(drawingSupplier);
40 plotDefinitions.add(pd);
43 protected JFreeChart produceChart() throws DatasetProduceException, ChartValidationException {
44 log.debug("xAxisType = " + xAxisType);
45 return CewolfChartFactory.getOverlaidChartInstance(type, title, xAxisLabel, yAxisLabel, xAxisType, yAxisType, plotDefinitions);
50 * @param xAxisType The xAxisType to set
52 public void setXAxisType(int xAxisType) {
53 this.xAxisType = xAxisType;
58 * @param yAxisType The yAxisType to set
60 public void setYAxisType(int yAxisType) {
61 this.yAxisType = yAxisType;