com.sas.graphics.components
Class AxisModel

java.lang.Object
  |
  +--com.sas.graphics.components.ModelBase
        |
        +--com.sas.graphics.components.ContentsModel
              |
              +--com.sas.graphics.components.AxisModel

public class AxisModel
extends ContentsModel

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 properites 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(Object obj)
          Determines whether another object is equal to this AxisModel.
 StrokeLineStyle getAxisLineStyle()
          Return the line style attributes for the axis line.
 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.
 BaseLength getEndOffset()
          Returns the length of the offset from the last major tick mark to the end of the axis line.
 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.
 ReferenceLineModel[] getReferenceLineModels()
          Return the properties for the reference lines.
 boolean getReverseDirection()
          Deprecated. As of SAS version 9.1.3, replaced by isReverseDirection().
 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 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 setAxisLineStyle(StrokeLineStyle axisLineStyle)
          Set the line style attributes for the axis line.
 void setCategories(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 setDrillIconVisible(boolean newVis)
          Set if a drill-down icon should appear next to the subgroup label (if present).
 void setEndOffset(BaseLength endOffset)
          Set the length of the offset from the last major tick mark to the end of the axis line.
 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 setReferenceLineModels(ReferenceLineModel[] newReferenceLineModels)
          Set the reference line definitions.
 void setReverseDirection(boolean reverse)
          Sets the axis values in reverse order.
 void setStartOffset(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, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AxisModel

public AxisModel()
Method Detail

apply

public final 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 final 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 final void setEndOffset(BaseLength endOffset)
Set the length of the offset from the last major tick mark to the end of the axis line.

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

getGridLineStyle

public final 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 final void setGridLineStyle(StrokeLineStyle newLineStyle)
                            throws IllegalArgumentException
Set the line style for grid lines.

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

isGridInFront

public final 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 final void setGridInFront(boolean inFront)
Sets grid lines in front or back of the graph elements.

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

getAxisLineStyle

public final 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 final void setAxisLineStyle(StrokeLineStyle axisLineStyle)
                            throws IllegalArgumentException
Set the line style attributes for the axis line.

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

getReferenceLineModels

public final 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 autmotically 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 final 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.

Returns:
an array of ReferenceLineModel[]
See Also:
getReferenceLineModels()

getStartOffset

public final 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 final void setStartOffset(BaseLength newStartOffset)
Sets the offset for the first axis tickmark.

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

getCategories

public final 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 final void setCategories(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 final 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 final void setContinuousMajorTickPositionPolicy(int newMajorTickPlacementType)
                                                throws 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:
int - Placement type value
Throws:
IllegalArgumentException - if newScaleType is not a valid value.
See Also:
getContinuousMajorTickPositionPolicy()

getContinuousMajorTickCount

public final 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 final void setContinuousMajorTickCount(int newContinuousMajorTickCount)
                                       throws 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:
the - major tick count
Throws:
IllegalArgumentException - if newContinuousMajorTickCount < 1.
See Also:
getContinuousMajorTickCount()

getContinuousMinorTickCount

public final 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 final void setContinuousMinorTickCount(int newContinuousMinorTickCount)
                                       throws 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:
the - continuousMinorTickCount
Throws:
IllegalArgumentException - if newContinuousMinorTickCount < 1.
See Also:
getContinuousMinorTickCount()

getContinuousMajorTickInterval

public final 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 final void setContinuousMajorTickInterval(double newMajorTickInterval)
                                          throws 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:
the - continuousMajorTickInterval
Throws:
IllegalArgumentException - if newMajorTickInterval < 1 or newMajorTickInterval = Double.POSITIVE_INFINITY.
See Also:
getContinuousMajorTickInterval()

getMajorTickTimeInterval

public final 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 final void setMajorTickTimeInterval(int newMajorTickTimeInterval)
                                    throws 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:
the - majorTickTimeInterval
Throws:
IllegalArgumentException - if newMajorTickTimeInterval is not one of the predefined values.
See Also:
getMajorTickTimeInterval()

getContinuousMajorTickAnchor

public final 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 final 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:
the - anchor value
Throws:
IllegalArgumentException - if newMajorTickAnchor is Double.NEGATIVE_INFINITY or Double.POSITIVE_INFINITY.
See Also:
getContinuousMajorTickAnchor()

getContinuousMajorTickValues

public final 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 final void setContinuousMajorTickValues(double[] newContinuousMajorTickValues)
                                        throws 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:
double[] - array of all user defined tick values.
Throws:
IllegalArgumentException - if newContinuousMajorTickValues is null.
See Also:
getContinuousMajorTickValues()

setMajorTickStyle

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

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

getMajorTickStyle

public final 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 final void setMinorTickStyle(TickStyle newMinorTickStyle)
                             throws IllegalArgumentException
Set the minor ticks appearance attributes.

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

getMinorTickStyle

public final 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 final 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 final void setLabelPlacementPolicy(int newLabelPlacementPolicy)
                                   throws 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:
the - labelPlacementPolicy
Throws:
IllegalArgumentException - if newLabelPlacementPolicy is not one of the predefined values.
See Also:
getLabelPlacementPolicy()

getValueFitPolicy

public final 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 final void setValueFitPolicy(int newValueFitPolicy)
                             throws 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:
the - valueFitPolicy
Throws:
IllegalArgumentException - if newValueFitPolicy is not one of the predefined values.
See Also:
getValueFitPolicy()

getMinimum

public final double getMinimum()
Returns the minimum value to display on the axis. Only valid for continuous axis.
Returns:
double minimun value for the axis.
See Also:
setMinimum(double), getMaximum()

setMinimum

public final 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:
IllegalArgumentException - if minValue is Double.NEGATIVE_INFINITY or Double.POSITIVE_INFINITY.
See Also:
getMinimum(), setMaximum(double)

getMaximum

public final double getMaximum()
Returns the maximum value to display on the axis. Only valid for continuous axis.
Returns:
double maximun value for the axis.
See Also:
setMaximum(double), getMinimum()

setMaximum

public final 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:
IllegalArgumentException - if maxValue is Double.NEGATIVE_INFINITY or Double.POSITIVE_INFINITY.
See Also:
getMaximum(), setMinimum(double)

isDrillIconVisible

public final 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 final 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:
newDir - Should the drill-down icon be displayed?
See Also:
isDrillIconVisible()

equals

public boolean equals(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 final 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 final boolean getReverseDirection()
Deprecated. As of SAS version 9.1.3, replaced by isReverseDirection().


isReverseDirection

public final 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)




Copyright © 2005 SAS Institute Inc. All Rights Reserved.
javadoc generated Thu, 16 Feb 2006 02:01:37