com.sas.graphics.components
Class PlotVariable

com.sas.graphics.components.PlotVariable
Direct Known Subclasses:
PlotVariableList

public class PlotVariable

An PlotVariable is used by a plot to assign data values to the plot points.

Usage

PlotVariable class is immutable, so all the values should be assigned at the time of construction. If the column assigned to PlotVariable is numerical, then two additional numerical columns can be assigned as low and high. The PlotVariable subtracts low column value from its data value to compute its low extend and adds high column value to get its high extend. If the column assigned to PlotVariable is not numerical then low and high values are ignored.

Example

You can apply low and high values to the ScatterPlots y values to get a high-low plot by:

 ScatterPlot scatterPlot = new ScatterPlot();
 TableModel tableModel = myTableModel();
 // <...set up tableModel...>
 
 // create the graph's data model (contains a handle to the data source and 
 // variables describing how to interpret the data)
 ScatterPlotTableDataModel scatterPlotTableDataModel = new ScatterPlotTableDataModel(tableModel);

 // set the variable on the data model
 scatterPlotTableDataModel.setXVariable(new PlotVariable("x", null, null, "xLabel");
 scatterPlotTableDataModel.setYVariable(new PlotVariable("y", null, null, "yLabel", "high", "highLabel", "low", "lowLabel");
 
 // set data model on the scatter plot
 scatterPlot.setDataModel( scatterPlotTableDataModel ); 
 

Behavior

PlotVariable provides low and high properties associated with the data column specification.

Since:
SAS 9.1
See Also:
Variable, VariableList, PlotVariableList

Constructor Summary
PlotVariable(int columnIndex)
          Constructor designating data column by index.
PlotVariable(int columnIndex, java.lang.String format, java.lang.String informat, java.lang.String label)
          Constructor designating data column by index along with the names of the SAS format and SAS informat and label to be applied.
PlotVariable(int columnIndex, java.lang.String format, java.lang.String informat, java.lang.String label, int highColumnIndex, java.lang.String highLabel, int lowColumnIndex, java.lang.String lowLabel)
          Constructor designating data column, high column and low column by index along with the names of the SAS format and SAS informat and labels to be applied.
PlotVariable(PlotVariable pv)
          Constructor with PlotVariable
PlotVariable(java.lang.String columnName)
          Constructor designating data column by name.
PlotVariable(java.lang.String columnName, java.lang.String format)
          Constructor designating data column by name along with the name of the SAS format to be applied.
PlotVariable(java.lang.String columnName, java.lang.String format, java.lang.String informat, java.lang.String label)
          Constructor designating data column by name.
PlotVariable(java.lang.String columnName, java.lang.String format, java.lang.String informat, java.lang.String label, java.lang.String highColumnName, java.lang.String highLabel, java.lang.String lowColumnName, java.lang.String lowLabel)
          Constructor designating data column, high column and low column by name along with the names of the SAS format and SAS informat and labels to be applied.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Determines whether another object is equal to this PlotVariable.
 int hashCode()
          Computes the hash code for this PlotVariable.
 
Methods inherited from class com.sas.graphics.components.RangeVariable
getHighColumnIndex, getHighColumnName, getHighLabel, getLowColumnIndex, getLowColumnName, getLowLabel, getTargetColumnIndex, getTargetColumnName, getTargetLabel
 
Methods inherited from class com.sas.graphics.components.Variable
getCategorizationModel, getColumnIndex, getColumnName, getFormat, getInformat, getLabel, getSegmentedRangeStyle
 
Methods inherited from class com.sas.graphics.components.ModelBase
addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, setContainedModel
 

Constructor Detail

PlotVariable

public PlotVariable(java.lang.String columnName)
Constructor designating data column by name.

Parameters:
columnName - the name identifying the data column

PlotVariable

public PlotVariable(java.lang.String columnName,
                    java.lang.String format)
Constructor designating data column by name along with the name of the SAS format to be applied.

Parameters:
columnName - the name identifying the data column
format - the name of the SAS format applied (by the graph) on the values found in this variable's data column

PlotVariable

public PlotVariable(java.lang.String columnName,
                    java.lang.String format,
                    java.lang.String informat,
                    java.lang.String label)
Constructor designating data column by name.

Parameters:
columnName - the name identifying the data column
format - the name of the SAS format applied (by the graph) on the values found in this variable's data column
informat - the name of the SAS informat applied (by the graph) on the values found in this variable's data column
label - the label the chart will display via data tips, axis labels and legend labels (where applicable)

The supported informats are:

  • DATE5. - "ddMMM"
  • DATE7. - "ddMMMyy"
  • DATE9. - "ddMMMyyyy"
  • DATETIME13. - "ddMMMyy:HH:mm"
  • DATETIME16. - "ddMMMyy:HH:mm:ss"
  • DATETIME18. - "ddMMMyyyy:HH:mm:ss"
  • DATETIME20. - "ddMMMyy:HH:mm:ss.SSS"
  • DATETIME22. - "ddMMMyyyy:HH:mm:ss.SSS"
  • TIME5. - "HH:mm"
  • TIME8. - "HH:mm:ss""
  • TIME12. - "HH:mm:ss.SSS"

PlotVariable

public PlotVariable(int columnIndex)
Constructor designating data column by index.

Parameters:
columnIndex - the index identifying the data column

PlotVariable

public PlotVariable(int columnIndex,
                    java.lang.String format,
                    java.lang.String informat,
                    java.lang.String label)
Constructor designating data column by index along with the names of the SAS format and SAS informat and label to be applied.

Parameters:
columnIndex - the column index identifying the data column
format - the name of the SAS format applied (by the graph) on the values found in this variable's data column
informat - the name of the SAS informat applied (by the graph) on the values found in this variable's data column
label - the label the chart will display via data tips, axis labels and legend labels (where applicable)

The supported informats are:

  • DATE5. - "ddMMM"
  • DATE7. - "ddMMMyy"
  • DATE9. - "ddMMMyyyy"
  • DATETIME13. - "ddMMMyy:HH:mm"
  • DATETIME16. - "ddMMMyy:HH:mm:ss"
  • DATETIME18. - "ddMMMyyyy:HH:mm:ss"
  • DATETIME20. - "ddMMMyy:HH:mm:ss.SSS"
  • DATETIME22. - "ddMMMyyyy:HH:mm:ss.SSS"
  • TIME5. - "HH:mm"
  • TIME8. - "HH:mm:ss""
  • TIME12. - "HH:mm:ss.SSS"

PlotVariable

public PlotVariable(java.lang.String columnName,
                    java.lang.String format,
                    java.lang.String informat,
                    java.lang.String label,
                    java.lang.String highColumnName,
                    java.lang.String highLabel,
                    java.lang.String lowColumnName,
                    java.lang.String lowLabel)
Constructor designating data column, high column and low column by name along with the names of the SAS format and SAS informat and labels to be applied.

Parameters:
columnName - the name identifying the data column
format - the name of the SAS format applied (by the graph) on the values found in this variable's data column
informat - the name of the SAS informat applied (by the graph) on the values found in this variable's data column
label - the label the chart will display via data tips, axis labels and legend labels (where applicable)
highColumnName - the name identifying the high data column
highLabel - the label the chart will display via data tips.
lowColumnName - the name identifying the low data column
lowLabel - the label the chart will display via data tips.

The supported informats are:

  • DATE5. - "ddMMM"
  • DATE7. - "ddMMMyy"
  • DATE9. - "ddMMMyyyy"
  • DATETIME13. - "ddMMMyy:HH:mm"
  • DATETIME16. - "ddMMMyy:HH:mm:ss"
  • DATETIME18. - "ddMMMyyyy:HH:mm:ss"
  • DATETIME20. - "ddMMMyy:HH:mm:ss.SSS"
  • DATETIME22. - "ddMMMyyyy:HH:mm:ss.SSS"
  • TIME5. - "HH:mm"
  • TIME8. - "HH:mm:ss""
  • TIME12. - "HH:mm:ss.SSS"

PlotVariable

public PlotVariable(int columnIndex,
                    java.lang.String format,
                    java.lang.String informat,
                    java.lang.String label,
                    int highColumnIndex,
                    java.lang.String highLabel,
                    int lowColumnIndex,
                    java.lang.String lowLabel)
Constructor designating data column, high column and low column by index along with the names of the SAS format and SAS informat and labels to be applied.

Parameters:
columnIndex - the column index identifying the data column
format - the name of the SAS format applied (by the graph) on the values found in this variable's data column
informat - the name of the SAS informat applied (by the graph) on the values found in this variable's data column
label - the label the chart will display via data tips, axis labels and legend labels (where applicable)
highColumnIndex - the index identifying the high data column
highLabel - the label the chart will display via data tips.
lowColumnIndex - the index identifying the low data column
lowLabel - the label the chart will display via data tips.

The supported informats are:

  • DATE5. - "ddMMM"
  • DATE7. - "ddMMMyy"
  • DATE9. - "ddMMMyyyy"
  • DATETIME13. - "ddMMMyy:HH:mm"
  • DATETIME16. - "ddMMMyy:HH:mm:ss"
  • DATETIME18. - "ddMMMyyyy:HH:mm:ss"
  • DATETIME20. - "ddMMMyy:HH:mm:ss.SSS"
  • DATETIME22. - "ddMMMyyyy:HH:mm:ss.SSS"
  • TIME5. - "HH:mm"
  • TIME8. - "HH:mm:ss""
  • TIME12. - "HH:mm:ss.SSS"

PlotVariable

public PlotVariable(PlotVariable pv)
Constructor with PlotVariable

Parameters:
pv - the variable which supplies all properties for the new variable.
Method Detail

equals

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

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

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

hashCode

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

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



Copyright © 2009 SAS Institute Inc. All Rights Reserved.