com.sas.graphics.chart
Class AxisStyle

java.lang.Object
  |
  +--com.sas.Component
        |
        +--com.sas.graphics.chart.AxisStyle
All Implemented Interfaces:
ComponentInterface, LinkPropertiesInterface, ModelInterface, MultipleValueEventSourceInterface, com.sas.beans.PropertyChangeSource, VetoableChangeSource, ViewInterface

Deprecated. This class is deprecated as of version 3.0 of AppDev Studio. It has been replaced by classes in the com.sas.graphics.components package.

public class AxisStyle
extends com.sas.Component
implements java.io.Serializable

The AxisStyle class encapsulates visual attributes of an axis in a chart. The type, color, grid style, value style, and label style of the axis are defined by the AxisStyle class. Different axes in a chart may share a single AxisStyle object.

Creating an AxisStyle Object

A valid instance is created by instantiating an object of AxisStyle either using the default constructor or by instantiating a hard copy of a pre-existing AxisStyle object.

      // Default Constructor
      AxisStyle axisStyle = new AxisStyle();
 

// Hard copy of an existing AxisStyle Object AxisStyle axisStyle = new AxisStyle(AxisStyle oldStyle);

Usage

Setting up the type of the axis
The axis can be of various types. By default the axis type is AxisTypes.LINE. It can be modified by using the setAxisType() method. To turn off the axis, you can use

      axisStyle.setAxisType(AxisTypes.NONE);
 

Setting up the color of the axis
The axis color can be set by using the setColor() method. By default the color is black. Tickmarks also use this color.

      axisStyle.setAxisColor(java.awt.Color.red);
 

Setting up the grid style
Each axis in a chart has a gridStyle property associated with it. The grid can be turned on and off by using the setVisible() method of the grid style object. The color of the grid can also be modified. It is black by default.

      // Turn on the grid and set its color to white.
      GridStyle grid = axisStyle.getGridStyle();
      grid.setVisible(true);
      grid.setColor(java.awt.Color.white);
 

Setting up the label style
The labelStyle property defines the visual attributes for the axis label, such as color, font family, font size, font style (plain, bold, italic), and maximum number of characters which may be displayed. It is an instance of the TextStyle class. The following code will set the color to blue, font size to 12 point, font style to bold, and maxChars to 15:

      TextStyle style = axisStyle.getLabelStyle();
      style.setColor(java.awt.Color.blue);
      style.setSize(12.0);
      style.setBold(true);
      style.setMaxChars(15);
 

Hiding the label of the axis
The label of the axis can be hidden using the setHideLabel() method. By default the color is black and the label is visible.

      axisStyle.setHideLabel(true);
 

Setting up the value style
The valueStyle property defines visual attributes for the tickmark values. The following code will set the color to green and maxChars to 10:

      TextStyle style = axisStyle.getValueStyle();
      style.setColor(java.awt.Color.green);
      style.setMaxChars(10);
 

Setting up the number of rows for displaying tickmark values
You can set up the axis to display the tickmark values in one row or two rows. By default it will automatically adjust the number of rows based on the space available for tickmarks. The following code will force the chart to display tickmark values on the axis in one row:

      style.setNumRows(RowNumberTypes.ONE);
 

Setting up the number of the intervals
You can set up the axis to have a fixed number of intervals. By default, the number of intervals are based on the range of the data and it tries to divide the range into clean values for the tick values. The following code will force the chart to have 10 intervals:

      style.setFixedIntervals(true);
      style.setIntervals(10);
 

Setting up the data range
You can set up the minimum and maximum values to be used by the axis. By default, these values are picked dynamically from the data set. The following code will force the data range to be from 0.0 to 10.0:

      style.setMinDataValue(0.0);
      style.setMaxDataValue(10.0);
 

Properties

 o
Name labelStyle
Type TextStyle
Default value a TextStyle object
Short description Label's TextStyle
Description TextStyle used to draw axis label.
 o
Name hideLabel
Type boolean
Default value false
Short description Hide axis label.
Description Axis label is set to hide or visible.
 o
Name valueStyle
Type TextStyle
Default value a TextStyle object
Short description Values' TextStyle
Description TextStyle used to draw axis (tickmark) values.
 o
Name gridStyle
Type GridStyle
Default value a GridStyle object
Short description Grid's GridStyle
Description GridStyle used to draw axis grid.
 o
Name axisType
Type AxisTypes
Default value AxisTypes.LINE
Short description Axis type
Description Type of axis.
 o
Name axisColor
Type Color
Default value Color.black
Short description Axis color.
Description Color used to draw the axis.
 o
Name numRows
Type RowNumberTypes
Default value RowNumberTypes.AUTOMATIC
Short description Number of rows to display tickmark values.
Description Number of rows to display tickmark values.
 o
Name minDataValue
Type double
Default value Minimum value from the data
Short description Minimum Value.
Description Minimum value for the data range to be used.
 o
Name maxDataValue
Type double
Default value Maximum value from the data
Short description Maximum Value.
Description Maximum value for the data range to be used.
 o
Name fixedIntervals
Type boolean
Default value false
Short description Fixed intervals.
Description Number of intervals are fixed or dynamic.
 o
Name intervals
Type int
Default value 10
Short description Number of intervals.
Description Number of intervals if fixedIntervals attribute is set to true.

See Also:
Serialized Form

Field Summary
protected  AxisStyle axisStyle
          Deprecated.  
static String RB_KEY
          Deprecated.  
 
Constructor Summary
AxisStyle()
          Deprecated. Default constructor.
AxisStyle(AxisStyle styleIn)
          Deprecated. Create a hard copy of the input instance.
 
Method Summary
 boolean equals(Object obj)
          Deprecated.  
 Color getAxisColor()
          Deprecated. Return the java Color for the axis.
 com.sas.graphics.chart.AxisTypes getAxisType()
          Deprecated. Return the type of the axis.
 double getDataMaxValue()
          Deprecated. Return the maximum value in the data range set by the user.
 double getDataMinValue()
          Deprecated. Return the minimum value in the data range set by the user.
static ExtendedBeanInfo getExtendedBeanInfo()
          Deprecated.  
 GridStyle getGridStyle()
          Deprecated. Return the GridStyle object used for the axis grid.
 int getIntervals()
          Deprecated. Return the number of intervals for axis labelling.
 TextStyle getLabelStyle()
          Deprecated. Return the TextStyle object used for the label in the axis.
 com.sas.graphics.chart.RowNumberTypes getNumRows()
          Deprecated. Return the number of the rows used to display tickmark values.
 TextStyle getValueStyle()
          Deprecated. Return the TextStyle object used for the tickmark values in the axis.
 boolean isFixedDataRange()
          Deprecated. Return true if the data range of the (numeric) axis is set by the user.
 boolean isFixedIntervals()
          Deprecated. Return true if the number of intervals for axis labelling is set by the user.
 boolean isHideLabel()
          Deprecated. Return the visibility of the label.
 boolean isValuesVisible()
          Deprecated. Return the visibility of the values.
 void propertyChange(PropertyChangeEvent pce)
          Deprecated.  
 void setAxisColor(Color color)
          Deprecated. Set the java color for the axis including tickmarks.
 void setAxisType(com.sas.graphics.chart.AxisTypes type)
          Deprecated. Set the type of the axis.
 void setDataMaxValue(double max)
          Deprecated. Set the maximum value in the data range for axis labelling.
 void setDataMinValue(double min)
          Deprecated. Set the minimum value in the data range for axis labelling.
 void setFixedDataRange(boolean fixed)
          Deprecated. Set true if the data range of the (numeric) axis is set by the user.
 void setFixedIntervals(boolean fixed)
          Deprecated. Set true if the number of intervals for axis labelling is set by the user.
 void setGridStyle(GridStyle gs)
          Deprecated. Set the GridStyle object used for the axis grid.
 void setHideLabel(boolean hide)
          Deprecated. Set the visibility of the label.
 void setIntervals(int count)
          Deprecated. Set the number of intervals for axis labelling.
 void setLabelStyle(TextStyle ts)
          Deprecated. Set the TextStyle object used for the label in the axis.
 void setNumRows(com.sas.graphics.chart.RowNumberTypes num)
          Deprecated. Set the number of the rows used to display values.
 void setValueStyle(TextStyle ts)
          Deprecated. Set the TextStyle object used for the values in the axis.
 void setValuesVisible(boolean hide)
          Deprecated. Set the visibility of the values.
 
Methods inherited from class com.sas.Component
addLink, addPropertyChangeListener, addVetoableChangeListener, anyPropertyChangeListeners, attachModel, attachView, beansIsDesignTime, beansSetDesignTime, clone, clone, detachModel, detachView, dumpComponent, firePropertyChange, firePropertyChange, fireVetoableChange, getComponentDescription, getComponentSupportInfo, getEventMethod, getEventValues, getLinkInfo, getModelInterface, getRequiredInterfaces, getResources, getStringResource, getViewInterfaceSupportInfo, initialize, initializeComponent, isDesignTime, isLinked, queryLinks, queryLinks, refresh, removeAllLinks, removeInterfaceTraps, removeLink, removePropertyChangeListener, removeVetoableChangeListener, setComponentDescription, setComponentSupportInfo, setDefaultValues, setLinkInfo, setModelInterface, setRequiredInterfaces, setViewInterfaceSupportInfo, supportsListenerInterface, supportsRequiredInterfaces, trapInterfaceEvents, validateObject
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RB_KEY

public static final String RB_KEY
Deprecated. 

axisStyle

protected AxisStyle axisStyle
Deprecated. 
Constructor Detail

AxisStyle

public AxisStyle()
Deprecated. 
Default constructor.

AxisStyle

public AxisStyle(AxisStyle styleIn)
Deprecated. 
Create a hard copy of the input instance.
Method Detail

getExtendedBeanInfo

public static ExtendedBeanInfo getExtendedBeanInfo()
Deprecated. 

propertyChange

public void propertyChange(PropertyChangeEvent pce)
Deprecated. 
Overrides:
propertyChange in class com.sas.Component

getLabelStyle

public TextStyle getLabelStyle()
Deprecated. 
Return the TextStyle object used for the label in the axis.
Returns:
text style for the axis label (default values: fontFamily=Serif, size=12, Style=Plain, maximum characters=12, color=black)
See Also:
setLabelStyle(com.sas.graphics.chart.TextStyle)

setLabelStyle

public void setLabelStyle(TextStyle ts)
Deprecated. 
Set the TextStyle object used for the label in the axis.
Parameters:
ts - text style for the axis label
See Also:
getLabelStyle()

getValueStyle

public TextStyle getValueStyle()
Deprecated. 
Return the TextStyle object used for the tickmark values in the axis.
Returns:
text style for the axis values (default values: fontFamily=Serif, size=10, Style=Plain, maximum characters=8, color=black)
See Also:
setValueStyle(com.sas.graphics.chart.TextStyle)

setValueStyle

public void setValueStyle(TextStyle ts)
Deprecated. 
Set the TextStyle object used for the values in the axis.
Parameters:
ts - text style object for the axis values
See Also:
getValueStyle()

getGridStyle

public GridStyle getGridStyle()
Deprecated. 
Return the GridStyle object used for the axis grid.
Returns:
style for the axis grid (default values: visibe=false, color=black)
See Also:
getGridStyle()

setGridStyle

public void setGridStyle(GridStyle gs)
Deprecated. 
Set the GridStyle object used for the axis grid.
Parameters:
gs - style for the axis grid
See Also:
getGridStyle()

getAxisType

public com.sas.graphics.chart.AxisTypes getAxisType()
Deprecated. 
Return the type of the axis.
Returns:
axis type
See Also:
setAxisType(com.sas.graphics.chart.AxisTypes)

setAxisType

public void setAxisType(com.sas.graphics.chart.AxisTypes type)
Deprecated. 
Set the type of the axis.
Parameters:
type - axis type
See Also:
getAxisType()

getAxisColor

public Color getAxisColor()
Deprecated. 
Return the java Color for the axis.
Returns:
axis color
See Also:
setAxisColor(java.awt.Color)

setAxisColor

public void setAxisColor(Color color)
Deprecated. 
Set the java color for the axis including tickmarks.
Parameters:
color - axis color
See Also:
getAxisColor()

getNumRows

public com.sas.graphics.chart.RowNumberTypes getNumRows()
Deprecated. 
Return the number of the rows used to display tickmark values.
Returns:
number of rows (RowNumberTypes.AUTOMATIC by default)
See Also:
setNumRows(com.sas.graphics.chart.RowNumberTypes)

setNumRows

public void setNumRows(com.sas.graphics.chart.RowNumberTypes num)
Deprecated. 
Set the number of the rows used to display values.
Parameters:
num - how many rows should the values be displayed
See Also:
getNumRows()

isFixedDataRange

public boolean isFixedDataRange()
Deprecated. 
Return true if the data range of the (numeric) axis is set by the user.
Returns:
true if the data range of the (numeric) axis is set by the user (false by default)
See Also:
setFixedDataRange(boolean)

setFixedDataRange

public void setFixedDataRange(boolean fixed)
Deprecated. 
Set true if the data range of the (numeric) axis is set by the user.
Parameters:
fixed - true if the data range of the (numeric) axis is set by the user
See Also:
isFixedDataRange()

getDataMinValue

public double getDataMinValue()
Deprecated. 
Return the minimum value in the data range set by the user.
Returns:
the minimum value in the data range
See Also:
setDataMinValue(double)

setDataMinValue

public void setDataMinValue(double min)
Deprecated. 
Set the minimum value in the data range for axis labelling.
Parameters:
min - the minimum value in the data range
See Also:
getDataMinValue()

getDataMaxValue

public double getDataMaxValue()
Deprecated. 
Return the maximum value in the data range set by the user.
Returns:
the maximum value in the data range
See Also:
setDataMaxValue(double)

setDataMaxValue

public void setDataMaxValue(double max)
Deprecated. 
Set the maximum value in the data range for axis labelling.
Parameters:
max - the maximum value in the data range
See Also:
getDataMaxValue()

getIntervals

public int getIntervals()
Deprecated. 
Return the number of intervals for axis labelling.
Returns:
the number of intervals
See Also:
setIntervals(int)

setIntervals

public void setIntervals(int count)
Deprecated. 
Set the number of intervals for axis labelling.
Parameters:
count - the number of intervals
See Also:
getIntervals()

isFixedIntervals

public boolean isFixedIntervals()
Deprecated. 
Return true if the number of intervals for axis labelling is set by the user.
Returns:
true if the number of intervals for axis labelling is set by the user (false by default)
See Also:
setFixedIntervals(boolean)

setFixedIntervals

public void setFixedIntervals(boolean fixed)
Deprecated. 
Set true if the number of intervals for axis labelling is set by the user.
Parameters:
fixed - true if the number of intervals for axis labelling is set by the user
See Also:
isFixedIntervals()

isHideLabel

public boolean isHideLabel()
Deprecated. 
Return the visibility of the label.
Returns:
true if label is hidden
See Also:
setHideLabel(boolean)

setHideLabel

public void setHideLabel(boolean hide)
Deprecated. 
Set the visibility of the label.
Parameters:
visible - true if visible
See Also:
isHideLabel()

isValuesVisible

public boolean isValuesVisible()
Deprecated. 
Return the visibility of the values.
Returns:
true if values are hidden
See Also:
setHideLabel(boolean)

setValuesVisible

public void setValuesVisible(boolean hide)
Deprecated. 
Set the visibility of the values.
Parameters:
visible - true if visible
See Also:
isValuesVisible()

equals

public boolean equals(Object obj)
Deprecated. 
Overrides:
equals in class Object




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