Package com.inet.report.chart.dataset
Class TwoGroupsDataset
java.lang.Object
com.inet.report.chart.dataset.AbstractDataset
com.inet.report.chart.dataset.TwoGroupsDataset
- All Implemented Interfaces:
BaseDataset,StandardDataset,Serializable
public class TwoGroupsDataset
extends com.inet.report.chart.dataset.AbstractDataset
implements StandardDataset
This is a dataset used by standard (bar, line, area) charts.
This evaluates data sorted by two groups for one data field.
- Since:
- 8.0
- See Also:
-
Field Summary
Fields inherited from interface com.inet.report.chart.dataset.BaseDataset
TOKEN_DATASET -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the category group.getChart()Returns the parent chart of this dataset.Returns the data field.getDataField(String name) Returns the summary field with the specified name ornullif the summary field with this name not found in the list.Returns the data fields of this dataset as list.com.inet.report.chart.dataset.LabelProviderReturns the LabelProvider responsible for providing the title, footnote, and axis labelsprotected StringgetName()FOR INTERNAL USE ONLYReturns the series group.voidRemoves the category group.voidRemoves the data field.voidRemoves the series group.protected voidsaveGroups(PrintWriter out, int depth) voidsetCategoryGroup(Field field) Creates a category group on this field.voidsetDataField(int summaryOperation, Field field, Field field2nd, int nth) Sets the data field which values will be calculated by the summary operation and shown in the chart as i.e. bar length.voidsetSeriesGroup(Field field) Creates a series group on this field.voidFOR INTERNAL USE ONLY.verify(ChartStyle style) Verifies the group and sum properties of current dataset.Methods inherited from class com.inet.report.chart.dataset.AbstractDataset
saveProperties, saveSummaryFields
-
Constructor Details
-
TwoGroupsDataset
Creates a new empty dataset.- Parameters:
chart- the chart (nullnot permitted)- Since:
- 8.0
-
-
Method Details
-
getChart
Returns the parent chart of this dataset.- Specified by:
getChartin interfaceBaseDataset- Returns:
- the chart.
-
getCategoryGroup
Returns the category group. The category group is the first group of chart.- Returns:
- the group or
nullif this group was not initialized. - Since:
- 8.0
- See Also:
-
setCategoryGroup
Creates a category group on this field. This group is for sorting and consolidating records with same values on the group axis, i.e. the x axis byPlotOrientation.VERTICAL. To change the sort order of the data in this group get this withgetCategoryGroup()and use the Group properties.SummaryField,SpecialFieldandGroupFieldare unsupported field types.- Parameters:
field- the group field (nullnot permitted)- Throws:
IllegalArgumentException- if field isnullor has an unsupported field type.- Since:
- 8.0
- See Also:
-
removeCategoryGroup
public void removeCategoryGroup()Removes the category group. Note: this dataset is incomplete without a category group and cannot be used by the chart in this case.- Since:
- 8.0
- See Also:
-
getSeriesGroup
Returns the series group. The series group is the second group of chart.- Returns:
- the group or
nullif this group was not initialized. - Since:
- 8.0
- See Also:
-
setSeriesGroup
Creates a series group on this field. This group is for sorting and consolidating records with same values on the group axis, i.e. the x axis byPlotOrientation.VERTICAL. The series group gets a own group axis by a chart with three axis (i.e. 3D chart) or it handles data grouped by category group. To change the sort order of the data in this group get this withgetSeriesGroup()and use the Group properties.SummaryField,SpecialFieldandGroupFieldare unsupported field types.- Parameters:
field- (nullnot permitted)- Throws:
IllegalArgumentException- if field isnullor has an unsupported field type.- Since:
- 8.0
- See Also:
-
removeSeriesGroup
public void removeSeriesGroup()Removes the series group. Note: this dataset is incomplete without a series group and cannot be used by the chart in this case.- Since:
- 8.0
- See Also:
-
getDataField
Returns the data field. This field is a data or summary field of chart.- Returns:
- the field of type
SummaryField. - Since:
- 8.0
- See Also:
-
getDataField
Returns the summary field with the specified name ornullif the summary field with this name not found in the list. Testing for equality using the case sensitiveequalsmethod.- Specified by:
getDataFieldin interfaceBaseDataset- Parameters:
name- the searched name of summary field (nullnot permitted)- Returns:
- the summary field with the specified name or
null. - See Also:
-
getDataFields
Returns the data fields of this dataset as list.- Specified by:
getDataFieldsin interfaceBaseDataset- Returns:
- the list of data fields
- See Also:
-
setDataField
Sets the data field which values will be calculated by the summary operation and shown in the chart as i.e. bar length. Creates a newSummaryFieldwith this field, operation and parameters.
For more information to supported value type of field and using of parameters 'field2nd' and 'nth' seeSummaryField.- Parameters:
summaryOperation- the summary operationfield- the data fieldfield2nd- the second data field, used for example for weights in weighted averageSummaryField.WEIGHTED_AVERAGE.nth- the nth parameter, used for example by summary operationSummaryField.NTH_LARGEST- Throws:
IllegalArgumentException- if the first or second field are required andnullor have an unsupported value type.IllegalArgumentException- if nth is less than zero.- Since:
- 8.0
- See Also:
-
removeDataField
public void removeDataField()Removes the data field. Note: this dataset is incomplete without a data field and cannot be used by the chart in this case.- Since:
- 8.0
- See Also:
-
verify
Verifies the group and sum properties of current dataset.- Specified by:
verifyin interfaceBaseDataset- Parameters:
style- the chart style- Returns:
- the error message or empty string if all properties are correct.
-
getReferencedObject
FOR INTERNAL USE ONLY- Specified by:
getReferencedObjectin interfaceBaseDataset- Overrides:
getReferencedObjectin classcom.inet.report.chart.dataset.AbstractDataset- Returns:
- FOR INTERNAL USE ONLY
-
updateReferences
public void updateReferences()FOR INTERNAL USE ONLY. Updates the references of this dataset.- Specified by:
updateReferencesin interfaceBaseDataset
-
saveGroups
- Overrides:
saveGroupsin classcom.inet.report.chart.dataset.AbstractDataset
-
getName
-
getLabelProvider
public com.inet.report.chart.dataset.LabelProvider getLabelProvider()Returns the LabelProvider responsible for providing the title, footnote, and axis labels- Specified by:
getLabelProviderin interfaceBaseDataset- Returns:
- the LabelProvider responsible for providing the title, footnote, and axis labels
-