com.sas.graphics.components.barlinechart
Class BarLineChartOLAPDataModel

com.sas.graphics.components.barlinechart.BarLineChartOLAPDataModel

public class BarLineChartOLAPDataModel

A BarLineChartOLAPDataModel assigns an OLAPDataSetInterface to a BarLineChart. The com.sas.storage.olap.OLAPDataSetInterface encapsulates the OLAP data structure, and the BarLineChartOLAPDataModel conveys that structure to a graph by automatically mapping the OLAP axis dimensions to appropriate graph elements. The following limitations apply to the mapping:

If the OLAP axis that supplies the category variable has more than one dimension, the BarLineChartOLAPDataModel's subgroupEnabled property can be used to display graph subgroups.

Topics:
Basic Requirements
Default Logic Used to Map OLAP Data
Selecting Measures in OLAP Data
BarLineChart Samples:
Swing-based Samples
Servlet-based Samples

Since:
SAS 9.1
See Also:
BarLineChart

Constructor Summary
BarLineChartOLAPDataModel()
          Constructs a BarLineChartOLAPDataModel that is used to assign OLAP data in the form of a com.sas.storage.olap.OLAPDataSetInterface to a BarLineChart.
BarLineChartOLAPDataModel(OLAPDataSetInterface newModel)
          Constructs a BarLineChartOLAPDataModel that is used to assign OLAP data in the form of a com.sas.storage.olap.OLAPDataSetInterface to a BarLineChart.
BarLineChartOLAPDataModel(OLAPDataSetInterface newModel, boolean newSubgroupEnabled)
          Constructs a BarLineChartOLAPDataModel that is used to assign OLAP data in the form of a com.sas.storage.olap.OLAPDataSetInterface to a BarLineChart with a flag to indicate whether or not subgrouped bars are desired.
 
Method Summary
 void apply(BarLineChartOLAPDataModel theOtherModel)
          Utility method to convey properties contained in "theOtherModel" to this object.
 boolean equals(java.lang.Object obj)
          Determines whether another object is equal to this BarLineChartOLAPDataModel.
 Variable[] getAuxiliaryVariable()
          Returns the array of data columns that was most recently set by the setAuxiliaryVariable() method.
 Variable getBarResponse2Variable()
          Returns the data measure that was most recently set in the BarResponse2 role by the setBarResponse2Variable() method.
 Variable getBarResponseVariable()
          Returns the data measure that was most recently set in the BarResponse role by the setBarResponseVariable() method.
 Variable[] getDataTipVariable()
          Returns the array of data columns that was most recently set by the setDataTipVariables() method.
 Variable getLineResponse2Variable()
          Returns the data measure that was most recently set in the LineResponse2 role by the setLineResponse2Variable() method.
 Variable getLineResponseVariable()
          Returns the data measure that was most recently set in the LineResponse role by the setLineResponseVariable() method.
 OLAPDataSetInterface getModel()
          Set the OLAP data source.
 javax.swing.ListSelectionModel getSelectionModel()
          Returns the ListSelectionModel that indicates which data values are selected.
 Variable getStyleByVariable()
          Returns the data measure that was most recently set in the StyleBy role by the setStyleByVariable() method.
 int hashCode()
          Computes the hash code for this BarLineChartOLAPDataModel.
 boolean isSubgroupEnabled()
          Returns whether or not the BarLineChart should attempt to subgroup its bar elements.
 void setAuxiliaryVariable(Variable[] newVariables)
          Specifies an array of Variables that are included among the variables that are passed in the events on the BarLineChart data elements.
 void setBarResponse2Variable(Variable newVariable)
          Sets which measures are to be displayed in the bar-line chart associated with the response2 axis (i.e. the secondary axis; the right axis for a vertical bar-line chart).
 void setBarResponseVariable(Variable newVariable)
          Sets which measures are to be displayed in the bar-line chart associated with the response axis (i.e. the primary axis; the left axis for a vertical bar-line chart).
 void setDataTipVariable(Variable[] newVariables)
          Specifies an array of Variables to be displayed in the data tip.
 void setLineResponse2Variable(Variable newVariable)
          Sets which measures are to be displayed in the bar-line chart associated with the response2 axis (i.e. the secondary axis; the right axis for a vertical bar-line chart).
 void setLineResponseVariable(Variable newVariable)
          Sets which measures are to be displayed in the bar-line chart associated with the response axis (i.e. the primary axis; the left axis for a vertical bar-line chart).
 void setModel(OLAPDataSetInterface newModel)
          Set the OLAP data source.
 void setSelectionModel(javax.swing.ListSelectionModel newModel)
          Sets the selection model that identifies which cells are selected.
 void setStyleByVariable(Variable newVariable)
          Sets which measure is used to determine the bar's fill color.
 void setSubgroupEnabled(boolean newSubgroupEnabled)
          Sets whether or not the BarLineChart should attempt to subgroup its bar elements.
 
Methods inherited from class com.sas.graphics.components.DataModel
apply, getLocale, getRulesContext, getSortStrategy, setLocale, setRulesContext, setSortStrategy
 
Methods inherited from class com.sas.graphics.components.ModelBase
addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, setContainedModel
 

Constructor Detail

BarLineChartOLAPDataModel

public BarLineChartOLAPDataModel()
Constructs a BarLineChartOLAPDataModel that is used to assign OLAP data in the form of a com.sas.storage.olap.OLAPDataSetInterface to a BarLineChart.


BarLineChartOLAPDataModel

public BarLineChartOLAPDataModel(OLAPDataSetInterface newModel)
Constructs a BarLineChartOLAPDataModel that is used to assign OLAP data in the form of a com.sas.storage.olap.OLAPDataSetInterface to a BarLineChart.

Parameters:
newModel - the OLAP data

BarLineChartOLAPDataModel

public BarLineChartOLAPDataModel(OLAPDataSetInterface newModel,
                                 boolean newSubgroupEnabled)
Constructs a BarLineChartOLAPDataModel that is used to assign OLAP data in the form of a com.sas.storage.olap.OLAPDataSetInterface to a BarLineChart with a flag to indicate whether or not subgrouped bars are desired.

Parameters:
newModel - the OLAP data
newSubgroupEnabled - a flag, true means try to subgroup the bar elements
Method Detail

apply

public void apply(BarLineChartOLAPDataModel theOtherModel)
Utility method to convey properties contained in "theOtherModel" to this object.

Note: Contained "models" (i.e. properties that are subclasses of ModelBase) will in turn be called on to convey their properties to the like contained models in the other object. In that respect this can be considered a "tree" type copy.

Also Note: This is a deep copy. Thus after the copy, mutable properties will not be shared by the two instances.

Parameters:
theOtherModel - properties applied to this instance

equals

public boolean equals(java.lang.Object obj)
Determines whether another object is equal to this BarLineChartOLAPDataModel.

The result is true if and only if the argument is not null and is a BarLineChartOLAPDataModel object that has the same property values as this object.

Overrides:
equals in class DataModel
Parameters:
obj - the object to test for equality with this BarLineChartOLAPDataModel
Returns:
true if the objects are the same; false otherwise.

hashCode

public int hashCode()
Computes the hash code for this BarLineChartOLAPDataModel.

Overrides:
hashCode in class DataModel
Returns:
a hash code value for this object.

setModel

public void setModel(OLAPDataSetInterface newModel)
Set the OLAP data source.

Parameters:
newModel - a handle to the data source or null
See Also:
getModel()

getModel

public OLAPDataSetInterface getModel()
Set the OLAP data source.

Returns:
the handle to the data source or null
See Also:
setModel(com.sas.storage.olap.OLAPDataSetInterface)

setSelectionModel

public void setSelectionModel(javax.swing.ListSelectionModel newModel)
Sets the selection model that identifies which cells are selected. The graph will highlight the selected elements as well as enable selection on the graph elements via mouse clicks and brushing. To create a brush, click and drag in the element area. To move the brush (represented as a rectangle) click inside the brush area and drag.

Parameters:
newModel - the selection model identifying selected cells
Throws:
java.lang.IllegalArgumentException - if newModel is null.
See Also:
getSelectionModel()

getSelectionModel

public javax.swing.ListSelectionModel getSelectionModel()
Returns the ListSelectionModel that indicates which data values are selected.

Returns:
the ListSelectionModel containing the indicies of the selected data values.
See Also:
setSelectionModel(javax.swing.ListSelectionModel)

setSubgroupEnabled

public void setSubgroupEnabled(boolean newSubgroupEnabled)
Sets whether or not the BarLineChart should attempt to subgroup its bar elements.

See Also:
isSubgroupEnabled()

isSubgroupEnabled

public boolean isSubgroupEnabled()
Returns whether or not the BarLineChart should attempt to subgroup its bar elements.

See Also:
setSubgroupEnabled(boolean)

setBarResponseVariable

public void setBarResponseVariable(Variable newVariable)
Sets which measures are to be displayed in the bar-line chart associated with the response axis (i.e. the primary axis; the left axis for a vertical bar-line chart).
Note: this is an optional property.
If none of the following properties have been specified (the typical case) then the bar-line chart will display all of the measures defined in the OLAP model associated them with the response axis:

This property should only be used to do one of the following operations: to re-arrange the display order, to prevent some measures from being displayed or to define which measures are to be associated with the response axis when some measures are associated with the response2 axis.

This role also recognizes the highColumn, lowColumn and targetColumn AnalysisVaraible properties.

Also Note: the variable's informat property is ignored. Advanced: Use a VariableList to assign multiple measures to this property.
Multiple measures result in multiple bar elements per category.

Parameters:
newVariable - the variable identifying the OLAP measure with associated properties
See Also:
getBarResponseVariable(), setBarResponse2Variable(com.sas.graphics.components.Variable)

getBarResponseVariable

public Variable getBarResponseVariable()
Returns the data measure that was most recently set in the BarResponse role by the setBarResponseVariable() method. Returns a null pointer exception if the variable role was automatically assigned by the component.

Returns:
the variable identifying the OLAP measures with associated properties
See Also:
setBarResponseVariable(com.sas.graphics.components.Variable), getBarResponse2Variable()

setBarResponse2Variable

public void setBarResponse2Variable(Variable newVariable)
Sets which measures are to be displayed in the bar-line chart associated with the response2 axis (i.e. the secondary axis; the right axis for a vertical bar-line chart).
Note: this is an optional property.
If none of the following properties have been specified (the typical case) then the bar-line chart will display all of the measures defined in the OLAP model associated them with the response axis:

This property should only be used to do one of the following operations: to re-arrange the display order, to prevent some measures from being displayed or to define which measures are to be associated with the response2 axis when some measures are associated with the response axis.

This role also recognizes the highColumn, lowColumn and targetColumn AnalysisVaraible properties.

Also Note: the variable's informat property is ignored since it is only applicable to string values. Advanced: Use a VariableList to assign multiple measures to this property.
Multiple measures result in multiple bar elements per category.

Parameters:
newVariable - the variable identifying the OLAP measure with associated properties
See Also:
getBarResponse2Variable(), setBarResponseVariable(com.sas.graphics.components.Variable)

getBarResponse2Variable

public Variable getBarResponse2Variable()
Returns the data measure that was most recently set in the BarResponse2 role by the setBarResponse2Variable() method. Returns a null pointer exception if the variable role was not set.

Returns:
the variable identifying the OLAP measures with associated properties
See Also:
setBarResponse2Variable(com.sas.graphics.components.Variable), getBarResponseVariable()

setLineResponseVariable

public void setLineResponseVariable(Variable newVariable)
Sets which measures are to be displayed in the bar-line chart associated with the response axis (i.e. the primary axis; the left axis for a vertical bar-line chart).
Note: this is an optional property.
If none of the following properties have been specified (the typical case) then the bar-line chart will display all of the measures defined in the OLAP model associated them with the response axis:

This property should only be used to do one of the following operations: to re-arrange the display order, to prevent some measures from being displayed or to define which measures are to be associated with the response axis when some measures are associated with the response2 axis.

Also Note: the variable's informat property is ignored. Advanced: Use a VariableList to assign multiple measures to this property.
Multiple measures result in multiple line elements per category.

Parameters:
newVariable - the variable identifying the OLAP measure with associated properties
See Also:
getLineResponseVariable(), setBarResponseVariable(com.sas.graphics.components.Variable)

getLineResponseVariable

public Variable getLineResponseVariable()
Returns the data measure that was most recently set in the LineResponse role by the setLineResponseVariable() method. Returns a null pointer exception if the variable role was automatically assigned by the component.

Returns:
the variable identifying the OLAP measures with associated properties
See Also:
setLineResponseVariable(com.sas.graphics.components.Variable), getBarResponseVariable()

setLineResponse2Variable

public void setLineResponse2Variable(Variable newVariable)
Sets which measures are to be displayed in the bar-line chart associated with the response2 axis (i.e. the secondary axis; the right axis for a vertical bar-line chart).
Note: this is an optional property.
If none of the following properties have been specified (the typical case) then the bar-line chart will display all of the measures defined in the OLAP model associated them with the response axis:

This property should only be used to do one of the following operations: to re-arrange the display order, to prevent some measures from being displayed or to define which measures are to be associated with the response2 axis when some measures are associated with the response axis.

Also Note: the variable's informat property is ignored since it is only applicable to string values. Advanced: Use a VariableList to assign multiple measures to this property.
Multiple measures result in multiple line elements per category.

Parameters:
newVariable - the variable identifying the OLAP measure with associated properties
See Also:
getLineResponse2Variable(), setLineResponseVariable(com.sas.graphics.components.Variable)

getLineResponse2Variable

public Variable getLineResponse2Variable()
Returns the data measure that was most recently set in the LineResponse2 role by the setLineResponse2Variable() method. Returns a null pointer exception if the variable role was not set.

Returns:
the variable identifying the OLAP measures with associated properties
See Also:
setLineResponse2Variable(com.sas.graphics.components.Variable), getLineResponseVariable()

setStyleByVariable

public void setStyleByVariable(Variable newVariable)
Sets which measure is used to determine the bar's fill color. Note: the bar's fill cannot be based upon a style by variable and a subgroup variable so these properties are mutually exclusive. A Subgroup takes priority over stylebyVariable so to use this property, the subgroupEnabled property should be false.

Parameters:
newVariable - the variable identifying the TableModel data column and associated properties
See Also:
getStyleByVariable()

getStyleByVariable

public Variable getStyleByVariable()
Returns the data measure that was most recently set in the StyleBy role by the setStyleByVariable() method. Returns a null pointer exception if the variable role was not set. Note: the bar's fill cannot be based upon a style by variable and a subgroup variable so these properties are mutually exclusive.

Returns:
the variable identifying the TableModel data column and associated properties
See Also:
setStyleByVariable(com.sas.graphics.components.Variable)

setAuxiliaryVariable

public void setAuxiliaryVariable(Variable[] newVariables)
Specifies an array of Variables that are included among the variables that are passed in the events on the BarLineChart data elements. Auxiliary variables are not represented in the chart. By default, they are not displayed in the datatip, although they can be included in the array of variables set by setDataTipVariable().

Parameters:
newVariables - contains Variables for GraphActionEvent return.
Throws:
java.lang.IllegalArgumentException - if a non-null array of zero length is passed in.
See Also:
getAuxiliaryVariable(), setDataTipVariable(com.sas.graphics.components.Variable[])

getAuxiliaryVariable

public Variable[] getAuxiliaryVariable()
Returns the array of data columns that was most recently set by the setAuxiliaryVariable() method. Returns null if the auxiliary variables were not set.

Returns:
variables for Auxiliary values
See Also:
setAuxiliaryVariable(com.sas.graphics.components.Variable[]), setDataTipVariable(com.sas.graphics.components.Variable[])

setDataTipVariable

public void setDataTipVariable(Variable[] newVariables)
Specifies an array of Variables to be displayed in the data tip. By default, the variables specified on setDataTipVariable() are appended to the end of the default data tip display. To replace the default display with the list of variables in the Variable[] array, use the GraphModel to get the DataTipModel , and the call the DataTipModel's setContent() method with the value GraphConstants.DATA_TIP_REPLACE.

The following code fragment specifies two variables for the data tip display and uses them to replace the default data tip display:


 // Create an array of variables to set in the data tip display
 Variable dataTipVars[]=new Variable[2];
 dataTipVars[0]=new Variable("Task");
 dataTipVars[1]=new Variable("Duration");
 barLineChart.getGraphModel().getDataTipModel().setContent(
                GraphConstants.DATA_TIP_REPLACE);
 

Parameters:
newVariables - array of Variables to display in data tip
Throws:
java.lang.IllegalArgumentException - if a non-null array of zero length is passed in.
See Also:
getDataTipVariable(), setAuxiliaryVariable(com.sas.graphics.components.Variable[])

getDataTipVariable

public Variable[] getDataTipVariable()
Returns the array of data columns that was most recently set by the setDataTipVariables() method. Returns null if the data tip variables were not set.

Returns:
variables for data tip values
See Also:
setDataTipVariable(com.sas.graphics.components.Variable[])



Copyright © 2009 SAS Institute Inc. All Rights Reserved.