author | František Kučera <franta-hg@frantovo.cz> |
Sat, 28 Feb 2009 21:31:02 +0100 | |
changeset 1 | 639991d0808a |
permissions | -rw-r--r-- |
franta-hg@1 | 1 |
/* |
franta-hg@1 | 2 |
* Created on 13.04.2003 |
franta-hg@1 | 3 |
* |
franta-hg@1 | 4 |
* To change the template for this generated file go to |
franta-hg@1 | 5 |
* Window>Preferences>Java>Code Generation>Code and Comments |
franta-hg@1 | 6 |
*/ |
franta-hg@1 | 7 |
package de.laures.cewolf.taglib; |
franta-hg@1 | 8 |
|
franta-hg@1 | 9 |
import java.io.Serializable; |
franta-hg@1 | 10 |
import java.util.ArrayList; |
franta-hg@1 | 11 |
import java.util.List; |
franta-hg@1 | 12 |
|
franta-hg@1 | 13 |
import org.jfree.chart.JFreeChart; |
franta-hg@1 | 14 |
import org.jfree.chart.plot.DefaultDrawingSupplier; |
franta-hg@1 | 15 |
import org.jfree.chart.plot.DrawingSupplier; |
franta-hg@1 | 16 |
|
franta-hg@1 | 17 |
import de.laures.cewolf.ChartValidationException; |
franta-hg@1 | 18 |
import de.laures.cewolf.DatasetProduceException; |
franta-hg@1 | 19 |
|
franta-hg@1 | 20 |
/** |
franta-hg@1 | 21 |
* @author guido |
franta-hg@1 | 22 |
* |
franta-hg@1 | 23 |
* To change the template for this generated type comment go to |
franta-hg@1 | 24 |
* Window>Preferences>Java>Code Generation>Code and Comments |
franta-hg@1 | 25 |
*/ |
franta-hg@1 | 26 |
public class OverlaidChartDefinition extends AbstractChartDefinition implements Serializable { |
franta-hg@1 | 27 |
|
franta-hg@1 | 28 |
private int xAxisType = 0; |
franta-hg@1 | 29 |
private int yAxisType = 0; |
franta-hg@1 | 30 |
|
franta-hg@1 | 31 |
private List plotDefinitions = new ArrayList(); |
franta-hg@1 | 32 |
private transient DrawingSupplier drawingSupplier = new DefaultDrawingSupplier(); |
franta-hg@1 | 33 |
|
franta-hg@1 | 34 |
public Object getDataset() throws DatasetProduceException { |
franta-hg@1 | 35 |
return ((PlotDefinition)plotDefinitions.get(0)).getDataset(); |
franta-hg@1 | 36 |
} |
franta-hg@1 | 37 |
|
franta-hg@1 | 38 |
public void addPlot(PlotDefinition pd) { |
franta-hg@1 | 39 |
pd.setDrawingSupplier(drawingSupplier); |
franta-hg@1 | 40 |
plotDefinitions.add(pd); |
franta-hg@1 | 41 |
} |
franta-hg@1 | 42 |
|
franta-hg@1 | 43 |
protected JFreeChart produceChart() throws DatasetProduceException, ChartValidationException { |
franta-hg@1 | 44 |
log.debug("xAxisType = " + xAxisType); |
franta-hg@1 | 45 |
return CewolfChartFactory.getOverlaidChartInstance(type, title, xAxisLabel, yAxisLabel, xAxisType, yAxisType, plotDefinitions); |
franta-hg@1 | 46 |
} |
franta-hg@1 | 47 |
|
franta-hg@1 | 48 |
/** |
franta-hg@1 | 49 |
* Sets the xAxisType. |
franta-hg@1 | 50 |
* @param xAxisType The xAxisType to set |
franta-hg@1 | 51 |
*/ |
franta-hg@1 | 52 |
public void setXAxisType(int xAxisType) { |
franta-hg@1 | 53 |
this.xAxisType = xAxisType; |
franta-hg@1 | 54 |
} |
franta-hg@1 | 55 |
|
franta-hg@1 | 56 |
/** |
franta-hg@1 | 57 |
* Sets the yAxisType. |
franta-hg@1 | 58 |
* @param yAxisType The yAxisType to set |
franta-hg@1 | 59 |
*/ |
franta-hg@1 | 60 |
public void setYAxisType(int yAxisType) { |
franta-hg@1 | 61 |
this.yAxisType = yAxisType; |
franta-hg@1 | 62 |
} |
franta-hg@1 | 63 |
|
franta-hg@1 | 64 |
} |