i-net Clear Reports

com.inet.report.chart.dataset
Class TwoGroupsDataset

java.lang.Object
  extended by com.inet.report.chart.dataset.AbstractDataset
      extended by com.inet.report.chart.dataset.TwoGroupsDataset
All Implemented Interfaces:
BaseDataset, StandardDataset, java.io.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:
Serialized Form

Field Summary
 
Fields inherited from interface com.inet.report.chart.dataset.BaseDataset
TOKEN_DATASET
 
Constructor Summary
TwoGroupsDataset(Chart2 chart)
          Creates a new empty dataset.
 
Method Summary
 Group getCategoryGroup()
          Returns the category group.
 Chart2 getChart()
          Returns the parent chart of this dataset.
 SummaryField getDataField()
          Returns the data field.
 SummaryField getDataField(java.lang.String name)
          Returns the summary field with the specified name or null if the summary field with this name not found in the list.
 java.util.List getDataFields()
          Returns the data fields of this dataset as list.
 com.inet.report.chart.dataset.LabelProvider getLabelProvider()
          Returns the LabelProvider responsible for providing the title, footnote, and axis labels
protected  java.lang.String getName()
          FOR INTERNAL USE ONLY Returns the XML attribute name for this dataset.
 Group getSeriesGroup()
          Returns the series group.
 void removeCategoryGroup()
          Removes the category group.
 void removeDataField()
          Removes the data field.
 void removeSeriesGroup()
          Removes the series group.
protected  void saveGroups(java.io.PrintWriter out, int depth)
          Writes the groups properties to output.
 void setCategoryGroup(Field field)
          Creates a category group on this field.
 void setDataField(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.
 void setSeriesGroup(Field field)
          Creates a series group on this field.
 java.lang.String verify(ChartStyle style)
          Verifies the group and sum properties of current dataset.
 

Constructor Detail

TwoGroupsDataset

public TwoGroupsDataset(Chart2 chart)
Creates a new empty dataset.

Parameters:
chart - the chart (null not permitted)
Since:
8.0
Method Detail

getChart

public Chart2 getChart()
Returns the parent chart of this dataset.

Specified by:
getChart in interface BaseDataset
Returns:
the chart.

getCategoryGroup

public Group getCategoryGroup()
Returns the category group. The category group is the first group of chart.

Returns:
the group or null if this group was not initialized.
Since:
8.0
See Also:
setCategoryGroup(Field), removeCategoryGroup()

setCategoryGroup

public void setCategoryGroup(Field field)
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 by PlotOrientation.VERTICAL. To change the sort order of the data in this group get this with getCategoryGroup() and use the Group properties. SummaryField, SpecialField and GroupField are unsupported field types.

Parameters:
field - the group field (null not permitted)
Throws:
java.lang.IllegalArgumentException - if field is null or has an unsupported field type.
Since:
8.0
See Also:
Group, getCategoryGroup(), removeCategoryGroup()

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:
setCategoryGroup(Field), getCategoryGroup()

getSeriesGroup

public Group getSeriesGroup()
Returns the series group. The series group is the second group of chart.

Returns:
the group or null if this group was not initialized.
Since:
8.0
See Also:
setSeriesGroup(Field), removeSeriesGroup()

setSeriesGroup

public void setSeriesGroup(Field field)
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 by PlotOrientation.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 with getSeriesGroup() and use the Group properties. SummaryField, SpecialField and GroupField are unsupported field types.

Parameters:
field - (null not permitted)
Throws:
java.lang.IllegalArgumentException - if field is null or has an unsupported field type.
Since:
8.0
See Also:
Group, getSeriesGroup(), removeSeriesGroup()

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:
setSeriesGroup(Field), getSeriesGroup()

getDataField

public SummaryField 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:
setDataField(int, Field, Field, int)

getDataField

public SummaryField getDataField(java.lang.String name)
Returns the summary field with the specified name or null if the summary field with this name not found in the list. Testing for equality using the case sensitive equals method.

Specified by:
getDataField in interface BaseDataset
Parameters:
name - the searched name of summary field (null not permitted)
Returns:
the summary field with the specified name or null.
See Also:
BaseDataset.getDataFields()

getDataFields

public java.util.List getDataFields()
Returns the data fields of this dataset as list.

Specified by:
getDataFields in interface BaseDataset
Returns:
the list of data fields
See Also:
BaseDataset.getDataField(String)

setDataField

public void setDataField(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. Creates a new SummaryField with this field, operation and parameters.
For more information to supported value type of field and using of parameters 'field2nd' and 'nth' see SummaryField.

Parameters:
summaryOperation - the summary operation
field - the data field
field2nd - the second data field, used for example for weights in weighted average SummaryField.WEIGHTED_AVERAGE.
nth - the nth parameter, used for example by summary operation SummaryField.NTH_LARGEST
Throws:
java.lang.IllegalArgumentException - if the first or second field are required and null or have an unsupported value type.
java.lang.IllegalArgumentException - if nth is less than zero.
Since:
8.0
See Also:
getDataField(), SummaryField.setSummaryOperation(int), SummaryField.setField(Field), SummaryField.setField2nd(Field), SummaryField.setSummaryNth(int)

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:
setDataField(int, Field, Field, int), getDataField()

verify

public java.lang.String verify(ChartStyle style)
Verifies the group and sum properties of current dataset.

Specified by:
verify in interface BaseDataset
Parameters:
style - the chart style
Returns:
the error message or empty string if all properties are correct.

saveGroups

protected void saveGroups(java.io.PrintWriter out,
                          int depth)
Writes the groups properties to output. Overwrites this to save intern properties direct to PrintWriter without building a StringBuffer.

Overrides:
saveGroups in class com.inet.report.chart.dataset.AbstractDataset
Parameters:
out - the output
depth - the depth of XML indent

getName

protected java.lang.String getName()
FOR INTERNAL USE ONLY Returns the XML attribute name for this dataset.

Specified by:
getName in class com.inet.report.chart.dataset.AbstractDataset
Returns:
the name.

getLabelProvider

public com.inet.report.chart.dataset.LabelProvider getLabelProvider()
Returns the LabelProvider responsible for providing the title, footnote, and axis labels

Specified by:
getLabelProvider in interface BaseDataset
Returns:
the LabelProvider responsible for providing the title, footnote, and axis labels

i-net Clear Reports

Copyright © 1999-2015 by i-net software GmbH