com.sas.graphics.components
Class AxisModel

com.sas.graphics.components.AxisModel

public class AxisModel

The AxisModel class stores general appearance settings for a graph axis, such as a category or response axis in a BarChart. For information on the appearance settings of an axis in the graph matrix that is generated by a Column or Row variable, see the GraphMatrixAxisModel class.

Usage

Since a default AxisModel is created along with a GraphModel, it is not needed to be instantiated. In a typical use, one needs to get the appropriate AxisModel from the GraphModel and then only modify its properties.
You can access a AxisModel in the chart by calling a getter method in the chart model for that axis. For example, to get the category axis model from a bar chart model, you should call the method getCategoryAxisModel().
Ex.
 BarChart barChart = new BarChart();
 BarChartModel barChartModel = barChart.getBarChartModel();
 AxisModel categoryAxisModel = barChartModel.getCategoryAxisModel();
 
Once you get the AxisModel, you can modify its properties. Continuing on our previous example, say we want to set the axis's title as "Revenue in Millions" and its range from 0.0 to 1000.0.
Ex.
 responseAxisModel.setLabel("Revenue in Millions");
 responseAxisModel.setMinimum(0.0);
 responseAxisModel.setMaximum(1000.0);
 
The labels placed along the axis are called tick values and the the little line to mark the place of the labels on the axis are called tickmarks or just ticks. These are controlled by MajorTickStyles and MinorTickStyles. For example, say you want to change axis major ticks such that they are anchored at zero and the major tick interval is 100.
 responseAxisModel.setContinuousMajorTickPositionPolicy(GraphConstants.TICK_POSITION_ANCHORED_INTERVAL);
 responseAxisModel.setContinuousMajorTickInterval(100.0);
 responseAxisModel.setContinuousMajorTickAnchor(0.0);
 
For some reason you are more interested in finding out what lies outside the range {225.0, 550.0}. That calls for adding reference lines. Building on the top of our current example: ReferenceLine Example:
  ReferenceLineModel[] references = new ReferenceLineModel[2];
  BasicStroke stroke = new BasicStroke(4f);
 
   // Set the reference line for the low level
  references[0] = new ReferenceLineModel();
  references[0].setPosition(225.0);
  references[0].setLineStyle( new StrokeLineStyle(stroke, java.awt.Color.green));
 
  // Set the appropriate label and its properties
  AdvancedTextStyle lowLabel = new AdvancedTextStyle();
  lowLabel.setColor(java.awt.Color.green);
  lowLabel..setFont(new java.awt.Font("Arial", java.awt.Font.PLAIN, 8));
  references[0].setTextStyle( lowLabel);
  references[0].setLabel("Low");
  references[0].setLabelPlacement(GraphConstants.PLACEMENT_OUTSIDE);
 
  // Set the higher reference line
  references[1] = new ReferenceLineModel();
  references[1].setPosition(550.0);
  AdvancedTextStyle highLabel = new AdvancedTextStyle();
  highLabel.setColor(java.awt.Color.red);
  highLabel..setFont(new java.awt.Font("Arial", java.awt.Font.PLAIN, 8));
  references[1].setTextStyle( highLabel);
  references[1].setLabel("High");
  references[1].setLabelPlacement(GraphConstants.PLACEMENT_OUTSIDE);
  references[1].setLineStyle( new StrokeLineStyle(stroke, java.awt.Color.red));
 
  // Attach the reference lines to axis
 responseAxisModel.setReferenceLineModels(references);
  
Changing a property in the AxisModel will cause a PropertyChangeEvent to be fired. Changing a property in any of the contained models will also cause the AxisModel to fire a PropertyChangeEvent. No matter how deep the contained model is the event will cascade up the containment chain to finally reach the AxisModel which will fire an event. Graph to which the AxisModel is attached, listens to these events and the changes are applied to the chart immediately.
Note: AxisModel stores the axis appearance properties only for the conventional axis like X axis, Y axis and Y2 axis in ScatterPlot and Category axis and Analysis axis in BarChart. It does not store the properties associated with the Row and Column axes in the charts. GraphMatrixAxisModel is used for Row and Column axis.

Tick Marks Display Policy:
There are times when a graph's size is too small to display all of the tick values that are needed on an axis. This can happen with a graph's default tick display, and also when you set an anchor and/or interval for the tick marks. If a graph is too small to display tick values, a fitting algorithm applies several techniques that attempt to fit tick values on the axis. If one technique fails, the next technique is attempted. The algorithm varies, depending on whether the axis values are string values or numeric values.

If the axis values are string values, the following techniques are attempted in the order that they are listed:

If the axis values are numeric values, the first and last tick values are always displayed, but the axis skips other values. At first attempt, axis skips every other tick value. If the remaining tick values still do not fit, then the axis tries skipping two values between each tick mark, and then three, and so on until the axis values fit on the axis.

Behavior

If you do not get the axis model from the chart and just create your own instance, it will have all default values. These may not be same as the properties in the chart as they are modified according to the graph style. All the visual properties for the tick marks, values, axis line, title etc. comes from the GraphStyle. The range is obtained by extending the input data range to nice round numbers. Start and End offSets are computed such that tick values don't get clipped.

Since:
SAS 9.1
See Also:
ModelBase, TickStyle, StrokeLineStyle, TextStyle, AdvancedTextStyle, ReferenceLineModel, GraphMatrixAxisModel, BarChartModel, ScatterPlotModel, LinePlotModel, BaseLength

Constructor Summary
AxisModel()
           
 
Method Summary
 void apply(AxisModel theOtherObject)
          Utility method to convey properties contained in "theOtherObject" to this object.
 boolean equals(java.lang.Object obj)
          Determines whether another object is equal to this AxisModel.
 StrokeLineStyle getAxisLineStyle()
          Return the line style attributes for the axis line.
 java.lang.String[] getCategories()
          Return the user defined categories (also known as midpoint labels displayed on the axis) for use with a non-continuous axis.
 double getContinuousMajorTickAnchor()
          Returns the anchored location for the major ticks in the axis.
 int getContinuousMajorTickCount()
          Returns the number of the major tick count for the axis.
 double getContinuousMajorTickInterval()
          Returns the major tick interval for the axis.
 int getContinuousMajorTickPositionPolicy()
          Returns the continuous major tick placement policy.
 double[] getContinuousMajorTickValues()
          Return the positions of the anchors for major ticks on the axis.
 int getContinuousMinorTickCount()
          Returns the number of the minor tick count for the axis.
 int getContinuousValuePlacementPolicy()
          Returns the continuous value display placement policy.
 com.sas.measures.BaseLength getEndOffset()
          Returns the length of the offset from the last major tick mark to the end of the axis line.
 java.lang.String getFormat()
          Returns the user-specified SAS format applied to the values in the data column.
 StrokeLineStyle getGridLineStyle()
          Returns the line style for grid lines.
 int getLabelPlacementPolicy()
          Returns the label placement policy to determine the placement of the axis label.
 TickStyle getMajorTickStyle()
          Return the major ticks appearance attributes.
 int getMajorTickTimeInterval()
          Returns the major tick time interval for the time axis.
 double getMaximum()
          Returns the maximum value to display on the axis.
 double getMinimum()
          Returns the minimum value to display on the axis.
 TickStyle getMinorTickStyle()
          Returns the minor ticks appearance attributes.
 java.text.MessageFormat getRangeMessageFormat()
          Returns the MessageFormat applicable to the axis.
 ReferenceBandModel[] getReferenceBandModels()
          Returns the properties for the Reference Bands.
 ReferenceLineModel[] getReferenceLineModels()
          Return the properties for the reference lines.
 boolean getReverseDirection()
          Deprecated. As of SAS version 9.1.3, replaced by isReverseDirection().
 com.sas.measures.BaseLength getStartOffset()
          Returns the starting offset for the first tick on the axis.
 int getValueFitPolicy()
          Returns the value fit policy which identifies how the axis values are moved/sized and manipulated in order to make them fit in the available space.
 int hashCode()
          Computes the hash code for this AxisModel.
 boolean isAdjustValueMagnitudeEnabled()
           
 boolean isDrillIconVisible()
          Returns true if a drill-down icon should appear next to the subgroup label (if present).
 boolean isGridInFront()
          Returns true if the grid drawn in front of the graph elements.
 boolean isReverseDirection()
          Returns whether or not the values are placed in reverse order.
 void setAdjustValueMagnitudeEnabled(boolean adjustValueMagnitudeEnabled)
          Allow graph to adjust the magnitude of the values appearing on the continuous axis.
 void setAxisLineStyle(StrokeLineStyle axisLineStyle)
          Set the line style attributes for the axis line.
 void setCategories(java.lang.String[] newCategories)
          Set the user defined categories (also known as midpoint labels displayed on the axis) for use with a non-continuous axis.
 void setContinuousMajorTickAnchor(double newMajorTickAnchor)
          Sets the anchored location for the major ticks in the axis.
 void setContinuousMajorTickCount(int newContinuousMajorTickCount)
          Sets the number of the major tick counts for the axis.
 void setContinuousMajorTickInterval(double newMajorTickInterval)
          Sets the major tick interval for the axis.
 void setContinuousMajorTickPositionPolicy(int newMajorTickPlacementType)
          Sets the continuous major tick placement policy.
 void setContinuousMajorTickValues(double[] newContinuousMajorTickValues)
          Set the positions of the major ticks on the axis to these custom positions.
 void setContinuousMinorTickCount(int newContinuousMinorTickCount)
          Sets the number of the minor tick count for the axis.
 void setContinuousValuePlacementPolicy(int newValuePlacementType)
          Sets the continuous value placement policy.
 void setDrillIconVisible(boolean newVis)
          Set if a drill-down icon should appear next to the subgroup label (if present).
 void setEndOffset(com.sas.measures.BaseLength endOffset)
          Set the length of the offset from the last major tick mark to the end of the axis line.
 void setFormat(java.lang.String aFormat)
          Sets the user-specified SAS format.
 void setGridInFront(boolean inFront)
          Sets grid lines in front or back of the graph elements.
 void setGridLineStyle(StrokeLineStyle newLineStyle)
          Set the line style for grid lines.
 void setLabelPlacementPolicy(int newLabelPlacementPolicy)
          Sets the label placement policy to determine the placement of the axis label.
 void setMajorTickStyle(TickStyle newMajorTickStyle)
          Set the major ticks appearance attributes.
 void setMajorTickTimeInterval(int newMajorTickTimeInterval)
          Sets the major tick time interval for the time axis.
 void setMaximum(double maxValue)
          Sets the the maximum value to display on the axis.
 void setMinimum(double minValue)
          Sets the the minimum value to display on the axis.
 void setMinorTickStyle(TickStyle newMinorTickStyle)
          Set the minor ticks appearance attributes.
 void setRangeMessageFormat(java.text.MessageFormat rangeMessageFormat)
          Specifies the MessageFormat that is used to produce the string representation of the range.
 void setReferenceBandModels(ReferenceBandModel[] newReferenceBandModels)
          Set the Reference bands definition.
 void setReferenceLineModels(ReferenceLineModel[] newReferenceLineModels)
          Set the reference line definitions.
 void setReverseDirection(boolean reverse)
          Sets the axis values in reverse order.
 void setStartOffset(com.sas.measures.BaseLength newStartOffset)
          Sets the offset for the first axis tickmark.
 void setValueFitPolicy(int newValueFitPolicy)
          Sets the value fit policy which specifies how the axis values are moved/sized and manipulated in order to make them fit in the available space.
 
Methods inherited from class com.sas.graphics.components.ContentsModel
apply, getLabel, getLabelTextStyle, getValueTextStyle, isVisible, setLabel, setLabelTextStyle, setValueTextStyle, setVisible
 
Methods inherited from class com.sas.graphics.components.ModelBase
addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, setContainedModel
 

Constructor Detail

AxisModel

public AxisModel()
Method Detail

apply

public void apply(AxisModel theOtherObject)
Utility method to convey properties contained in "theOtherObject" 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:
theOtherObject - properties applied to this instance

getEndOffset

public com.sas.measures.BaseLength getEndOffset()
Returns the length of the offset from the last major tick mark to the end of the axis line.

Returns:
BaseLength object containing the offset length for last tickmark.
See Also:
setEndOffset(com.sas.measures.BaseLength)

setEndOffset

public void setEndOffset(com.sas.measures.BaseLength endOffset)
Set the length of the offset from the last major tick mark to the end of the axis line.

Parameters:
endOffset - offset for the last tickmark.
See Also:
getEndOffset()

getGridLineStyle

public StrokeLineStyle getGridLineStyle()
Returns the line style for grid lines.

Returns:
line style object for grid lines
See Also:
setGridLineStyle(com.sas.graphics.components.StrokeLineStyle)

setGridLineStyle

public void setGridLineStyle(StrokeLineStyle newLineStyle)
                      throws java.lang.IllegalArgumentException
Set the line style for grid lines.

Parameters:
newLineStyle - the new repository for the grid's line attributes
Throws:
java.lang.IllegalArgumentException - if newLineStyle is null.
See Also:
getGridLineStyle(), StrokeLineStyle.apply(com.sas.graphics.components.StrokeLineStyle)

isGridInFront

public boolean isGridInFront()
Returns true if the grid drawn in front of the graph elements.

Returns:
is grid drawn in front of the chart elements?
See Also:
setGridInFront(boolean)

setGridInFront

public void setGridInFront(boolean inFront)
Sets grid lines in front or back of the graph elements.

Parameters:
inFront - is grid drawn in front of the chart elements?
See Also:
isGridInFront()

getAxisLineStyle

public StrokeLineStyle getAxisLineStyle()
Return the line style attributes for the axis line.

Returns:
the line style attributes for the axis line.
See Also:
setAxisLineStyle(com.sas.graphics.components.StrokeLineStyle)

setAxisLineStyle

public void setAxisLineStyle(StrokeLineStyle axisLineStyle)
                      throws java.lang.IllegalArgumentException
Set the line style attributes for the axis line.

Parameters:
axisLineStyle - the new repository for the axis' line attributes
Throws:
java.lang.IllegalArgumentException - if axisLineStyle is null.
See Also:
getAxisLineStyle(), StrokeLineStyle.apply(com.sas.graphics.components.StrokeLineStyle)

getReferenceLineModels

public ReferenceLineModel[] getReferenceLineModels()
Return the properties for the reference lines. If a model is added/removed/replaced from the local copy of ReferenceLineModels, the axis will not automatically update. It is required to pass the referenceLineModels through the setRefereceLineModels to apply the change to the axis. But as long as all the array elements points to original referenceLinemodels and only the their attributes are modified, that will be picked by the axis automatically.

Note: A copy of the array parameter is made when this method is called. Thus changing the array values after the set will have no effect on the set of reference lines maintained by this axis model. To affect that it would be necessary to call this method again with the appropriate settings.

Also Note: Modifying a property on any of the ReferencLineModels maintained by this axis model will affect the reference line appearance.

Returns:
reference line models
See Also:
setReferenceLineModels(com.sas.graphics.components.ReferenceLineModel[])

setReferenceLineModels

public void setReferenceLineModels(ReferenceLineModel[] newReferenceLineModels)
Set the reference line definitions.

A copy of the passed array is made so any modifications made to the passed array will not affect the chart.

Note: Modifying a property on any of the ReferencLineModels in the array will affect the reference line appearance. However modifying the array will have no effect on the set of reference lines maintained by the axis. To affect the the set of reference lines maintained by the axis it is necessary to call setReferenceLineModels with the appropriate settings.

Note: null is an acceptable parameter and means no reference lines.

See Also:
getReferenceLineModels()

getStartOffset

public com.sas.measures.BaseLength getStartOffset()
Returns the starting offset for the first tick on the axis.

Returns:
BaseLength associated with the starting offset for the axis ticks.
See Also:
setStartOffset(com.sas.measures.BaseLength)

setStartOffset

public void setStartOffset(com.sas.measures.BaseLength newStartOffset)
Sets the offset for the first axis tickmark.

Parameters:
newStartOffset - offset for first axis tick.
See Also:
getStartOffset()

getCategories

public java.lang.String[] getCategories()
Return the user defined categories (also known as midpoint labels displayed on the axis) for use with a non-continuous axis. These values are only applicable to non-continuous axes such as the BarChart's category axis.

If this AxisModel is associated with a continuous axis (such as an axis that is displaying a numeric range) then this setting will not be applicable and is simply ignored at that time.

A value of null indicates that the chart will adhere to its default behavior of determining the axis categories (a.k.a. midpoints) based upon the applicable data values used by the chart.

Note: Modifying the returned array will have no effect on the axis behavior. To affect a change in the axis's category setting it is necessary to call setCategories.

Returns:
array of Strings
See Also:
setCategories(java.lang.String[])

setCategories

public void setCategories(java.lang.String[] newCategories)
Set the user defined categories (also known as midpoint labels displayed on the axis) for use with a non-continuous axis. These values are only applicable to non-continuous axes such as the BarChart's category axis.

If this AxisModel is associated with a continuous axis (such as an axis that is displaying a numeric range) then this setting will not be applicable and is simply ignored at that time.

A value of null indicates that the chart should adhere to its default behavior of determining the axis categories (a.k.a. midpoints) based upon the applicable data values used by the chart.

Note: If the array is applicable and non-null then only those values in the array will appear on the axis. If the chart has a category that is not in this list then that category will not be displayed. Ex. If the BarChart has bars for categories "A", "B" and "C" but the BarChart's category axis "categories" property is set to ["B","C","D"] then the BarChart's category axis will display "B","C" and "D". That is, no "A" bar will appear.

Please don't confuse the property name "categories" with only being applicable to a "Category" axis (as in the BarChart example). The same behavior is applicable to the Scatter and line plot axes when they are non-continuous.

Also Note: a copy of the array parameter is made when this method is called. Thus changing the array values after the set will have no effect on the chart. To affect a change in the chart it is necessary to call this method again.

Parameters:
newCategories - new Categories to be set on axis
See Also:
getCategories()

getContinuousMajorTickPositionPolicy

public int getContinuousMajorTickPositionPolicy()
Returns the continuous major tick placement policy. Possible values are:
   GraphConstants.TICK_POSITION_DEFAULT: 
                     Place tickmarks by computing the appropriate 
                     interval based on data range. 
   GraphConstants.TICK_POSITION_COUNT, 
                     Divide the data range by count to get the interval
                     and then place the ticks at the increment of 
                     interval starting at the beginning of the axis.
   GraphConstants.TICK_POSITION_INTERVAL, 
                     Place the ticks at the increment of interval starting
                     at the beginning of the axis.
   GraphConstants.TICK_POSITION_ANCHORED_INTERVAL, 
                     Place a tick at the anchor and then place additional
                     ticks at the increment of interval in both directions.
   GraphConstants.TICK_POSITION_USER_DEFINED 
                     Place a ticks at the values given in the 
                     majorTickUserDefinedValue property.
 

Returns:
int Placement type value
See Also:
setContinuousMajorTickPositionPolicy(int)

setContinuousMajorTickPositionPolicy

public void setContinuousMajorTickPositionPolicy(int newMajorTickPlacementType)
                                          throws java.lang.IllegalArgumentException
Sets the continuous major tick placement policy.

Note: An IllegalArgumentException is thrown if an invalid value is passed in.

Possible values are:

   GraphConstants.TICK_POSITION_DEFAULT: 
                     Place tickmarks by computing the appropriate 
                     interval based on data range. 
   GraphConstants.TICK_POSITION_COUNT, 
                     Divide the data range by count given by the property
                     continuousMajorTickCount  to get the interval
                     and then place the ticks at the increment of 
                     interval starting at the beginning of the axis.
                     If no continuousMajorTickCount  is set, then default
                     value, which is 5, is used.
   GraphConstants.TICK_POSITION_INTERVAL, 
                     Place the ticks at the increment of interval starting
                     at the beginning of the axis.  If no interval is assigned
                     using continuousMajorTickInterval, then an error message
                     is produced and there will be no major tick value.
   GraphConstants.TICK_POSITION_ANCHORED_INTERVAL, 
                     Place a tick at the anchor and then place additional
                     ticks at the increment of interval in both directions.  
                     If no interval is assigned using continuousMajorTickInterval, 
                     then an error message is produced and there will be no 
                     major tick value.
   GraphConstants.TICK_POSITION_USER_DEFINED 
                     Place a ticks at the values given in the 
                     continuousMajorTickValues property.
                     If no values are assigned using continuousMajorTickValues, 
                     then an error message is produced and there will be no 
                     major tick value.
 
For GraphConstants.TICK_POSITION_INTERVAL and GraphConstants.TICK_POSITION_ANCHORED_INTERVAL values, continuousMajorTickInterval should be set to positive value, otherwise a error message will be produced and there will be no major tick values.

Parameters:
newMajorTickPlacementType - Placement type value
Throws:
java.lang.IllegalArgumentException - if newScaleType is not a valid value.
See Also:
getContinuousMajorTickPositionPolicy()

setRangeMessageFormat

public void setRangeMessageFormat(java.text.MessageFormat rangeMessageFormat)
Specifies the MessageFormat that is used to produce the string representation of the range.
Note:- This property allows the user to specify a MessageFormat that will suffice to render the range values as desired(ex."0-10" vs " 0 to 10" vs "(0,10)" etc) This is different then typical SAS Format behavior as defined by the Variable class. The following parameters, in the following order, will be passed the the rangeMessageFormat to create the necessary label

  1. the unformatted start value
  2. the unformatted end value
  3. the formatted start value
  4. the formatted end value
  5. the default range representation


Throws:
java.lang.IllegalArgumentException - if messageFormat is null;
See Also:
newDefaultRangeMessageFormat(), getRangeMessageFormat()

getRangeMessageFormat

public java.text.MessageFormat getRangeMessageFormat()
Returns the MessageFormat applicable to the axis. This method in turn calls the createDefaultRangeMessageFormat()which will return the default MessageFormat. if the MessageFormat is null, it will create the default MessageFormat.

Returns:
MessageFormat
See Also:
setRangeMessageFormat(MessageFormat rangeMessageFormat)

setFormat

public void setFormat(java.lang.String aFormat)
Sets the user-specified SAS format.

Parameters:
aFormat - String with a valid SAS format
See Also:
getFormat()

getFormat

public java.lang.String getFormat()
Returns the user-specified SAS format applied to the values in the data column.

Returns:
user-specified SAS format
See Also:
setFormat(java.lang.String)

getContinuousValuePlacementPolicy

public int getContinuousValuePlacementPolicy()
Returns the continuous value display placement policy. Possible values are:
   GraphConstants.CONTINUOUS_VALUE_PLACEMENT_AUTOMATIC:
                     Place tickmarks by computing the current state of graph.           
   GraphConstants.CONTINUOUS_VALUE_PLACEMENT_RANGE:
                     Place the range values between the major tickmarks.  
   GraphConstants.CONTINUOUS_VALUE_PLACEMENT_MAJOR_TICK:
                     Display the major tickmarks only.
 

Returns:
int Placement type value
See Also:
setContinuousValuePlacementPolicy(int)

setContinuousValuePlacementPolicy

public void setContinuousValuePlacementPolicy(int newValuePlacementType)
                                       throws java.lang.IllegalArgumentException
Sets the continuous value placement policy.
   GraphConstants.CONTINUOUS_VALUE_PLACEMENT_AUTOMATIC:
                     Place tickmarks by computing the current state of graph.                   
   GraphConstants.CONTINUOUS_VALUE_PLACEMENT_RANGE:
                     Place the range values between the major tickmarks.  
   GraphConstants.CONTINUOUS_VALUE_PLACEMENT_MAJOR_TICK:
                     Display the major tickmarks only.
 

Parameters:
newValuePlacementType - Placement type value
Throws:
java.lang.IllegalArgumentException - if an invalid value is passed .
See Also:
getContinuousValuePlacementPolicy()

getContinuousMajorTickCount

public int getContinuousMajorTickCount()
Returns the number of the major tick count for the axis. continuousMajorTickCount is used only if the continuousMajorTickPositionPolicy is set to GraphConstants.TICK_POSITION_COUNT.

Default value for continuousMajorTickCount is 5.

Returns:
the major tick count
See Also:
setContinuousMajorTickCount(int)

setContinuousMajorTickCount

public void setContinuousMajorTickCount(int newContinuousMajorTickCount)
                                 throws java.lang.IllegalArgumentException
Sets the number of the major tick counts for the axis. Only non-zero positive values are accepted. continuousMajorTickCount is used only if the continuousMajorTickPositionPolicy is set to GraphConstants.TICK_POSITION_COUNT.

Default value for continuousMajorTickCount is 5.

If the axis size is smaller than its preferred size then some tick mark values are omitted. This will result in different number of ticks than the count set here. See tick marks display policy for detail.

Parameters:
newContinuousMajorTickCount - the major tick count
Throws:
java.lang.IllegalArgumentException - if newContinuousMajorTickCount < 1.
See Also:
getContinuousMajorTickCount()

getContinuousMinorTickCount

public int getContinuousMinorTickCount()
Returns the number of the minor tick count for the axis.

Default value for continuousMinorTickCount is 5.

Returns:
the continuousMinorTickCount
See Also:
setContinuousMinorTickCount(int)

setContinuousMinorTickCount

public void setContinuousMinorTickCount(int newContinuousMinorTickCount)
                                 throws java.lang.IllegalArgumentException
Sets the number of the minor tick count for the axis. Only non-zero positive values are accepted.

Default value is 4.

Note: Set visibility TRUE in MinorTickStyle to make minor ticks visible. By default they are turned off.

Parameters:
newContinuousMinorTickCount - the continuous Minor Tick Count
Throws:
java.lang.IllegalArgumentException - if newContinuousMinorTickCount < 1.
See Also:
getContinuousMinorTickCount()

getContinuousMajorTickInterval

public double getContinuousMajorTickInterval()
Returns the major tick interval for the axis. It is used only if the continuousMajorTickPositionPolicy is set to GraphConstants.TICK_POSITION_INTERVAL or GraphConstants.TICK_POSITION_ANCHORED_INTERVAL.

Default value is Double.MAX_VALUE, which basically implies that there are no major ticks except at the anchor.

Returns:
the continuousMajorTickInterval
See Also:
setContinuousMajorTickInterval(double)

setContinuousMajorTickInterval

public void setContinuousMajorTickInterval(double newMajorTickInterval)
                                    throws java.lang.IllegalArgumentException
Sets the major tick interval for the axis. It is used only if the continuousMajorTickPositionPolicy is set to GraphConstants.TICK_POSITION_INTERVAL or GraphConstants.TICK_POSITION_ANCHORED_INTERVAL. If interval is not set and continuousMajorTickPositionPolicy is set to one of the two values, then an error message will be produced and there will be no major tick value. Only non-zero positive values are accepted.

If the axis size is smaller than its preferred size then some tick mark values are omitted. This will result in different interval than the value set here. See tick marks display policy for detail.

Parameters:
newMajorTickInterval - the continuous Major Tick Interval
Throws:
java.lang.IllegalArgumentException - if newMajorTickInterval < 1 or newMajorTickInterval = Double.POSITIVE_INFINITY.
See Also:
getContinuousMajorTickInterval()

getMajorTickTimeInterval

public int getMajorTickTimeInterval()
Returns the major tick time interval for the time axis.

Default value is TIME_INTERVAL_NONE, which basically implies that time interval is based on the time values.

Returns:
the majorTickTimeInterval
See Also:
setMajorTickTimeInterval(int)

setMajorTickTimeInterval

public void setMajorTickTimeInterval(int newMajorTickTimeInterval)
                              throws java.lang.IllegalArgumentException
Sets the major tick time interval for the time axis. Only predefined values are accepted.

Default value is TIME_INTERVAL_NONE, which basically implies that time interval is based on the time values.

Parameters:
newMajorTickTimeInterval - the major Tick Time Interval
Throws:
java.lang.IllegalArgumentException - if newMajorTickTimeInterval is not one of the predefined values.
See Also:
getMajorTickTimeInterval()

getContinuousMajorTickAnchor

public double getContinuousMajorTickAnchor()
Returns the anchored location for the major ticks in the axis. It is used only if the continuousMajorTickPositionPolicy is set to GraphConstants.TICK_POSITION_ANCHORED_INTERVAL

Default is 0.

If the anchor value does not lie in the data range, it won't be visible on screen but visible ticks will be still placed as if it was an anchor.

Returns:
the continuousMajorTickAnchor
See Also:
setContinuousMajorTickAnchor(double)

setContinuousMajorTickAnchor

public void setContinuousMajorTickAnchor(double newMajorTickAnchor)
Sets the anchored location for the major ticks in the axis. It is used only if the continuousMajorTickPositionPolicy is set to GraphConstants.TICK_POSITION_ANCHORED_INTERVAL

Default is 0.

If the anchor value does not lie in the data range, it won't be visible on screen but visible ticks will be still placed as if it was an anchor.

If the axis size is smaller than its preferred size then anchor values may be omitted. See tick marks display policy for detail.

Parameters:
newMajorTickAnchor - the anchor value
Throws:
java.lang.IllegalArgumentException - if newMajorTickAnchor is Double.NEGATIVE_INFINITY or Double.POSITIVE_INFINITY.
See Also:
getContinuousMajorTickAnchor()

getContinuousMajorTickValues

public double[] getContinuousMajorTickValues()
Return the positions of the anchors for major ticks on the axis. It is used only if the continuousMajorTickPositionPolicy is set to GraphConstants.TICK_POSITION_USER_DEFINED

Note: Modifying the array will have no effect on the chart. To affect a change in the chart's user defined MajorTick layout it is necessary to call "setMajorTickUserDefinedValues" with the desired settings.

Default value is null.

Note: If placement is GraphConstants.TICK_POSITION_USER_DEFINED and there is no value inside MajorTickUserDefinedValues which is inside the axis range, then there won't be any major ticks. This may happen either MajorTickValues were left to default(null) or all the values in the array lie outside the data range of axis.

Default value is null.

Returns:
double[] array of all user defined tick values
See Also:
setContinuousMajorTickValues(double[])

setContinuousMajorTickValues

public void setContinuousMajorTickValues(double[] newContinuousMajorTickValues)
                                  throws java.lang.IllegalArgumentException
Set the positions of the major ticks on the axis to these custom positions. These information is only applied if the continuousMajorTickPositionPolicy is set to "GraphConstants.TICK_POSITION_USER_DEFINED".

Note: a copy of the array is made when it is set here. Modifying the array after the set will have no effect on the chart. To affect a change in the chart's user defined MajorTick layout it will be necessary to call this method again with the desired settings.

Note: If placement is GraphConstants.TICK_POSITION_USER_DEFINED and there is no value which is inside the axis range, then there won't be any major ticks. This may happen either MajorTickValues were left to default which is null or all the values in the array lie outside the range.

Default value is null.

If the axis size is smaller than its preferred size then some of tick mark values are omitted. See tick marks display policy for detail.

Parameters:
newContinuousMajorTickValues - double[] array of all user defined tick values.
Throws:
java.lang.IllegalArgumentException - if newContinuousMajorTickValues is null.
See Also:
getContinuousMajorTickValues()

setMajorTickStyle

public void setMajorTickStyle(TickStyle newMajorTickStyle)
                       throws java.lang.IllegalArgumentException
Set the major ticks appearance attributes.

Parameters:
newMajorTickStyle - the new repository for the major tick mark attributes
Throws:
java.lang.IllegalArgumentException - if newMajorTickStyle is null.
See Also:
getMajorTickStyle(), TickStyle.apply(com.sas.graphics.components.TickStyle)

getMajorTickStyle

public TickStyle getMajorTickStyle()
Return the major ticks appearance attributes.

By default, major ticks are visible.

Returns:
TickStyle Visible properties for the ticks
See Also:
setMajorTickStyle(com.sas.graphics.components.TickStyle)

setMinorTickStyle

public void setMinorTickStyle(TickStyle newMinorTickStyle)
                       throws java.lang.IllegalArgumentException
Set the minor ticks appearance attributes.

Parameters:
newMinorTickStyle - the new repository for the minor tick mark attributes
Throws:
java.lang.IllegalArgumentException - if newMinorTickStyle is null.
See Also:
getMinorTickStyle(), TickStyle.apply(com.sas.graphics.components.TickStyle)

getMinorTickStyle

public TickStyle getMinorTickStyle()
Returns the minor ticks appearance attributes.

By default, minor ticks are invisible.

Returns:
TickStyle Visible properties for the ticks
See Also:
setMinorTickStyle(com.sas.graphics.components.TickStyle)

getLabelPlacementPolicy

public int getLabelPlacementPolicy()
Returns the label placement policy to determine the placement of the axis label.

Default value is GraphConstants.PLACEMENT_AUTOMATIC.

Returns:
int the labelPlacementPolicy
See Also:
setLabelPlacementPolicy(int)

setLabelPlacementPolicy

public void setLabelPlacementPolicy(int newLabelPlacementPolicy)
                             throws java.lang.IllegalArgumentException
Sets the label placement policy to determine the placement of the axis label. Only predefined values are accepted.

Default value is GraphConstants.PLACEMENT_AUTOMATIC.

Parameters:
newLabelPlacementPolicy -
Throws:
java.lang.IllegalArgumentException - if newLabelPlacementPolicy is not one of the predefined values.
See Also:
getLabelPlacementPolicy()

getValueFitPolicy

public int getValueFitPolicy()
Returns the value fit policy which identifies how the axis values are moved/sized and manipulated in order to make them fit in the available space. The fit algorithm is only applied if there is not enough space available for the values to appear without some adjustment.

Default value is GraphConstants.FIT_AUTOMATIC.

Returns:
int the valueFitPolicy
See Also:
setValueFitPolicy(int)

setValueFitPolicy

public void setValueFitPolicy(int newValueFitPolicy)
                       throws java.lang.IllegalArgumentException
Sets the value fit policy which specifies how the axis values are moved/sized and manipulated in order to make them fit in the available space. The fit algorithm is only applied if there is not enough space available for the values to appear without some adjustment. Only predefined values are accepted.

Default value is GraphConstants.FIT_AUTOMATIC.

Parameters:
newValueFitPolicy - the value Fit Policy
Throws:
java.lang.IllegalArgumentException - if newValueFitPolicy is not one of the predefined values.
See Also:
getValueFitPolicy()

getMinimum

public double getMinimum()
Returns the minimum value to display on the axis. Only valid for continuous axis.

Returns:
double minimum value for the axis.
See Also:
setMinimum(double), getMaximum()

setMinimum

public void setMinimum(double minValue)
Sets the the minimum value to display on the axis. Valid only for the continuous axis. The default value is Double.NaN. In this case minimum is computed from the minimum value in the data.

Throws:
java.lang.IllegalArgumentException - if minValue is Double.NEGATIVE_INFINITY or Double.POSITIVE_INFINITY.
See Also:
getMinimum(), setMaximum(double)

getMaximum

public double getMaximum()
Returns the maximum value to display on the axis. Only valid for continuous axis.

Returns:
double maximum value for the axis.
See Also:
setMaximum(double), getMinimum()

setMaximum

public void setMaximum(double maxValue)
Sets the the maximum value to display on the axis. Valid only for the continuous axis. The default value is Double.NaN. In this case maximum is computed from the maximum value in the data.

Throws:
java.lang.IllegalArgumentException - if maxValue is Double.NEGATIVE_INFINITY or Double.POSITIVE_INFINITY.
See Also:
getMaximum(), setMinimum(double)

isDrillIconVisible

public boolean isDrillIconVisible()
Returns true if a drill-down icon should appear next to the subgroup label (if present).

Returns:
Should the drill-down icon be displayed?
See Also:
setDrillIconVisible(boolean)

setDrillIconVisible

public void setDrillIconVisible(boolean newVis)
Set if a drill-down icon should appear next to the subgroup label (if present). The default value is false.

Parameters:
newVis - Should the drill-down icon be displayed?
See Also:
isDrillIconVisible()

equals

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

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

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

hashCode

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

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

setReverseDirection

public void setReverseDirection(boolean reverse)
Sets the axis values in reverse order.

Parameters:
reverse - true is reverse ordering for values is desired, else false.
See Also:
isReverseDirection()

getReverseDirection

public boolean getReverseDirection()
Deprecated. As of SAS version 9.1.3, replaced by isReverseDirection().


isReverseDirection

public boolean isReverseDirection()
Returns whether or not the values are placed in reverse order.

Returns:
true if values are placed in reverse order, else false.
See Also:
setReverseDirection(boolean)

isAdjustValueMagnitudeEnabled

public boolean isAdjustValueMagnitudeEnabled()
Returns:
Returns the adjustValueMagnitudeEnabled.

setAdjustValueMagnitudeEnabled

public void setAdjustValueMagnitudeEnabled(boolean adjustValueMagnitudeEnabled)
Allow graph to adjust the magnitude of the values appearing on the continuous axis. Promotes readability and allows more space to display the graph. The axis label will be appended to reflect the magnitude that the values were adjusted if an adjustment was done. The magnitude is restricted to Thousands, Millions, Billions, Trillions or Thousandths, Millionths, Billionths, Trillionths.

Parameters:
adjustValueMagnitudeEnabled - The adjustValueMagnitudeEnabled to set.
See Also:
isAdjustValueMagnitudeEnabled()

setReferenceBandModels

public void setReferenceBandModels(ReferenceBandModel[] newReferenceBandModels)
Set the Reference bands definition. Note: null is an acceptable parameter and means no bands will be drawn. Note: Currently reference bands set on this AxisModel are only supported on BarChart, BarLineChart, LineChart, WaterfallChart category axes.

See Also:
getReferenceBandModels()

getReferenceBandModels

public ReferenceBandModel[] getReferenceBandModels()
Returns the properties for the Reference Bands.

Returns:
Reference Band attributes
See Also:
setReferenceBandModels(com.sas.graphics.components.ReferenceBandModel[])



Copyright © 2009 SAS Institute Inc. All Rights Reserved.