Package com.inet.report.chart.plot
Class CombinedPlot
java.lang.Object
com.inet.report.chart.plot.CombinedPlot
- All Implemented Interfaces:
ChartPlot
,Serializable
A general class for plotting data of different plots.
- Since:
- 8.0
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
This combine type allows show several charts side by side.static final int
This combine type allows show several charts side by side.static final int
This combine type allows show several charts in same plot.static final int
This combine type allows show several charts in same plot.static final String
XML token for a combined plot element. -
Constructor Summary
ConstructorDescriptionCreates a empty CombinedPlot.CombinedPlot
(int combineType) Creates a empty CombinedPlot. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPlot
(AbstractPlot plot) The list of plots contains either only one unspecified plot or more combinable plots.int
Returns the combine type.Returns nothing (null
).getPlot
(int index) Returns the chart plot at the specified position in this list.void
readProperties
(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.removePlot
(int index) Removes the chart plot at the specified position in this list.void
saveProperties
(PrintWriter out, int depth) Writes the properties of this chart plot toPrintWriter
.void
setCombineType
(int combineType) Sets the combine type.int
size()
Returns the number of chart plots in this list.
-
Field Details
-
TOKEN_COMBINED_PLOT
XML token for a combined plot element.- See Also:
-
COMBINE_ONE_PLOT_WITH_COMMON_GROUP_AXIS
public static final int COMBINE_ONE_PLOT_WITH_COMMON_GROUP_AXISThis combine type allows show several charts in same plot. The common axis is the category axis.- See Also:
-
COMBINE_ONE_PLOT_WITH_COMMON_DATA_AXIS
public static final int COMBINE_ONE_PLOT_WITH_COMMON_DATA_AXISThis combine type allows show several charts in same plot. The common axis is the data axis.- See Also:
-
COMBINE_MULTIPLE_PLOTS_WITH_COMMON_GROUP_AXIS
public static final int COMBINE_MULTIPLE_PLOTS_WITH_COMMON_GROUP_AXISThis combine type allows show several charts side by side. The common axis is the category axis.- See Also:
-
COMBINE_MULTIPLE_PLOTS_WITH_COMMON_DATA_AXIS
public static final int COMBINE_MULTIPLE_PLOTS_WITH_COMMON_DATA_AXISThis combine type allows show several charts side by side. The common axis is the data axis.- See Also:
-
-
Constructor Details
-
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:
-
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:
IllegalArgumentException
- by unknown combine type- Since:
- 8.0
- See Also:
-
-
Method Details
-
addPlot
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 asBarPlot
,LinePlot
,AreaPlot
orContinuousAreaPlot
,ContinuousBarPlot
,ContinuousLinePlot
.- Parameters:
plot
- the plot to be appended to this list- Throws:
IllegalArgumentException
- if this plot is not combinable or by unsupported combination of plots.- Since:
- 8.0
- See Also:
-
removePlot
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:
IndexOutOfBoundsException
- if index out of range(index < 0 || index >= size())
.- Since:
- 8.0
- See Also:
-
getPlot
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:
IndexOutOfBoundsException
- if index is out of range(index < 0 || index >= size())
.- Since:
- 8.0
- See Also:
-
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:
-
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
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:
IllegalArgumentException
- if unsupported combination of plots.- Since:
- 8.0
- See Also:
-
refreshAutoTitles
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 interfaceChartPlot
- Parameters:
chart
- the chart
-
saveProperties
Writes the properties of this chart plot toPrintWriter
.- Specified by:
saveProperties
in interfaceChartPlot
- Parameters:
out
- the outputdepth
- the depth of XML indent
-
getReferencedObject
- Specified by:
getReferencedObject
in interfaceChartPlot
- Returns:
- the list of objects.
-
readProperties
Reads the chart properties from the DOMParser Element.- Specified by:
readProperties
in interfaceChartPlot
- Parameters:
element
- the DOMParser Elementchart
- the chart
-
getDataset
Returns nothing (null
). To gets the datasets of this chart usegetPlot(int)
abdChartPlot.getDataset()
of each plot.- Specified by:
getDataset
in interfaceChartPlot
- Returns:
- the dataset.
- Since:
- 8.0
- See Also:
-