i-net Clear Reports

com.inet.report.chart.plot
Class CombinedPlot

java.lang.Object
  extended by com.inet.report.chart.plot.CombinedPlot
All Implemented Interfaces:
ChartPlot, java.io.Serializable

public class CombinedPlot
extends java.lang.Object
implements ChartPlot

A general class for plotting data of different plots.

Since:
8.0
See Also:
Serialized Form

Field Summary
static int COMBINE_MULTIPLE_PLOTS_WITH_COMMON_DATA_AXIS
          This combine type allows show several charts side by side.
static int COMBINE_MULTIPLE_PLOTS_WITH_COMMON_GROUP_AXIS
          This combine type allows show several charts side by side.
static int COMBINE_ONE_PLOT_WITH_COMMON_DATA_AXIS
          This combine type allows show several charts in same plot.
static int COMBINE_ONE_PLOT_WITH_COMMON_GROUP_AXIS
          This combine type allows show several charts in same plot.
static java.lang.String TOKEN_COMBINED_PLOT
          XML token for a combined plot element.
 
Constructor Summary
CombinedPlot()
          Creates a empty CombinedPlot.
CombinedPlot(int combineType)
          Creates a empty CombinedPlot.
 
Method Summary
 void addPlot(AbstractPlot plot)
          The list of plots contains either only one unspecified plot or more combinable plots.
 int getCombineType()
          Returns the combine type.
 BaseDataset getDataset()
          Returns nothing (null).
 AbstractPlot getPlot(int index)
          Returns the chart plot at the specified position in this list.
 java.util.List getReferencedObject()
          Returns a list of referenced i-net Clear Reports objects: Field or Group
 void readProperties(org.w3c.dom.Element element, Chart2 chart)
          Reads the chart properties from the DOMParser Element.
 void refreshAutoTitles(Chart2 chart)
          Reads out the data column names from dataset and refreshes the chart labels.
 AbstractPlot removePlot(int index)
          Removes the chart plot at the specified position in this list.
 void saveProperties(java.io.PrintWriter out, int depth)
          Writes the properties of this chart plot to PrintWriter.
 void setCombineType(int combineType)
          Sets the combine type.
 int size()
          Returns the number of chart plots in this list.
 

Field Detail

TOKEN_COMBINED_PLOT

public static final java.lang.String TOKEN_COMBINED_PLOT
XML token for a combined plot element.

See Also:
Constant Field Values

COMBINE_ONE_PLOT_WITH_COMMON_GROUP_AXIS

public static final int COMBINE_ONE_PLOT_WITH_COMMON_GROUP_AXIS
This combine type allows show several charts in same plot. The common axis is the category axis.

See Also:
Constant Field Values

COMBINE_ONE_PLOT_WITH_COMMON_DATA_AXIS

public static final int COMBINE_ONE_PLOT_WITH_COMMON_DATA_AXIS
This combine type allows show several charts in same plot. The common axis is the data axis.

See Also:
Constant Field Values

COMBINE_MULTIPLE_PLOTS_WITH_COMMON_GROUP_AXIS

public static final int COMBINE_MULTIPLE_PLOTS_WITH_COMMON_GROUP_AXIS
This combine type allows show several charts side by side. The common axis is the category axis.

See Also:
Constant Field Values

COMBINE_MULTIPLE_PLOTS_WITH_COMMON_DATA_AXIS

public static final int COMBINE_MULTIPLE_PLOTS_WITH_COMMON_DATA_AXIS
This combine type allows show several charts side by side. The common axis is the data axis.

See Also:
Constant Field Values
Constructor Detail

CombinedPlot

public CombinedPlot()
Creates a empty CombinedPlot. The CombinedPlot is a container for CombinablePlot and CombinableContinuousPlot. This allows to display more than one chart in same plot. Sets the default combine type with all charts in one plot and with common category axis.

Since:
8.0
See Also:
setCombineType(int)

CombinedPlot

public CombinedPlot(int combineType)
Creates a empty CombinedPlot. The CombinedPlot is a container for CombinablePlot and CombinableContinuousPlot. This allows to display more than one chart in same plot.

Parameters:
combineType - the type of combining
Throws:
java.lang.IllegalArgumentException - by unknown combine type
Since:
8.0
See Also:
setCombineType(int), COMBINE_MULTIPLE_PLOTS_WITH_COMMON_GROUP_AXIS, COMBINE_MULTIPLE_PLOTS_WITH_COMMON_DATA_AXIS, COMBINE_ONE_PLOT_WITH_COMMON_GROUP_AXIS, COMBINE_ONE_PLOT_WITH_COMMON_DATA_AXIS
Method Detail

addPlot

public void addPlot(AbstractPlot plot)
The list of plots contains either only one unspecified plot or more combinable plots. Appends the current plot to the end of this list. Note: you can combine only 2D plot as BarPlot, LinePlot, AreaPlot or ContinuousAreaPlot, ContinuousBarPlot, ContinuousLinePlot.

Parameters:
plot - the plot to be appended to this list
Throws:
java.lang.IllegalArgumentException - if this plot is not combinable or by unsupported combination of plots.
Since:
8.0
See Also:
getPlot(int), removePlot(int), size(), AbstractPlot

removePlot

public AbstractPlot removePlot(int index)
Removes the chart plot at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices).

Parameters:
index - the index of the plot to removed
Returns:
the plot that was removed from the list.
Throws:
java.lang.IndexOutOfBoundsException - if index out of range (index < 0 || index >= size()).
Since:
8.0
See Also:
addPlot(AbstractPlot), getPlot(int), size(), AbstractPlot

getPlot

public AbstractPlot getPlot(int index)
Returns the chart plot at the specified position in this list.

Parameters:
index - index of plot to return
Returns:
the chart plot at the specified position in this list.
Throws:
java.lang.IndexOutOfBoundsException - if index is out of range (index < 0 || index >= size()).
Since:
8.0
See Also:
addPlot(AbstractPlot), removePlot(int), size(), AbstractPlot

size

public int size()
Returns the number of chart plots in this list.

Returns:
the number of plots in this list.
Since:
8.0
See Also:
addPlot(AbstractPlot), removePlot(int), getPlot(int)

getCombineType

public int getCombineType()
Returns the combine type. Several charts side by side or several charts in a same plot.

Returns:
the combine type.
Since:
8.0
See Also:
setCombineType(int), COMBINE_MULTIPLE_PLOTS_WITH_COMMON_GROUP_AXIS, COMBINE_MULTIPLE_PLOTS_WITH_COMMON_DATA_AXIS, COMBINE_ONE_PLOT_WITH_COMMON_GROUP_AXIS, COMBINE_ONE_PLOT_WITH_COMMON_DATA_AXIS

setCombineType

public void setCombineType(int combineType)
Sets the combine type. This flag controls the charts displayed side by side or in a same plot and the common axis of all charts.

Parameters:
combineType - the type.
Throws:
java.lang.IllegalArgumentException - if unsupported combination of plots.
Since:
8.0
See Also:
getCombineType(), COMBINE_MULTIPLE_PLOTS_WITH_COMMON_GROUP_AXIS, COMBINE_MULTIPLE_PLOTS_WITH_COMMON_DATA_AXIS, COMBINE_ONE_PLOT_WITH_COMMON_GROUP_AXIS, COMBINE_ONE_PLOT_WITH_COMMON_DATA_AXIS

refreshAutoTitles

public void refreshAutoTitles(Chart2 chart)
Reads out the data column names from dataset and refreshes the chart labels. Please use this function to refresh the chart labels if the data was be changed.

Specified by:
refreshAutoTitles in interface ChartPlot
Parameters:
chart - the chart

saveProperties

public void saveProperties(java.io.PrintWriter out,
                           int depth)
Writes the properties of this chart plot to PrintWriter.

Specified by:
saveProperties in interface ChartPlot
Parameters:
out - the output
depth - the depth of XML indent

getReferencedObject

public java.util.List getReferencedObject()
Returns a list of referenced i-net Clear Reports objects: Field or Group

Specified by:
getReferencedObject in interface ChartPlot
Returns:
the list of objects.

readProperties

public void readProperties(org.w3c.dom.Element element,
                           Chart2 chart)
Reads the chart properties from the DOMParser Element.

Specified by:
readProperties in interface ChartPlot
Parameters:
element - the DOMParser Element
chart - the chart

getDataset

public BaseDataset getDataset()
Returns nothing (null). To gets the datasets of this chart use getPlot(int) abd ChartPlot.getDataset() of each plot.

Specified by:
getDataset in interface ChartPlot
Returns:
the dataset.
Since:
8.0
See Also:
ChartPlot.getDataset()

i-net Clear Reports

Copyright © 1999-2015 by i-net software GmbH