com.sas.graphics.components.radarchart
Class RadarChartModel

com.sas.graphics.components.radarchart.RadarChartModel

public class RadarChartModel

A RadarChartModel encapsulates most of a RadarChart's visual display properties. This contrasts with the RadarChart's data model, which determines the number and organization of data elements (stars) and the use of axes and a legend.

A RadarChartModel contains RadarChart-specific properties, common graph properties, and a collection of models that control the appearance of the graph's peripheral elements, such as its axes and legends.

A RadarChartModel does not allow null values for properties in its contained models. Passing a null parameter to the set method for a contained model property results in an IllegalArgumentException. Guaranteeing non-null properties for a contained model simplifies access to the display properties and ensures that the RadarChart's display state is unambiguous.

Topics:
Area Fills
Display Properties
Starting Angle for Spokes
Radar Types
Line Styles
Behavior
Samples:
Swing-based Samples
Servlet-based Samples

Since:
SAS 9.1
See Also:
Graph, GraphConstants, RadarChart

Field Summary
static ConstantCollection RADAR_TYPE
          RADAR_TYPE enables a set of static actions associated with the public RADAR_TYPE_ constants.
static int RADAR_TYPE_CALENDAR
          Sectors have equal radii, and the color is determined by the response
static int RADAR_TYPE_CHORD
          Similar to sector, but the end is not an arc
static int RADAR_TYPE_CORONA
          Similar to wedge, but a bisecting vertex is added between axes and the minimum value to give more of a star appearance
static int RADAR_TYPE_POLYGON
          Similar to RADAR_TYPE_WEDGE, but without axes.
static int RADAR_TYPE_RADIAL
          Axis lengths determined by response values.
static int RADAR_TYPE_SECTOR
          Wedges are drawn for each category value
static int RADAR_TYPE_SPOKE
          A circle at the minimum value, with radiating axis lengths determined by response value.
static int RADAR_TYPE_WEDGE
          Axes are displayed and points from each axis are connected.
static java.lang.String RB_KEY
           
 
Constructor Summary
RadarChartModel()
          Constructs a new RadarChartModel.
 
Method Summary
 void apply(RadarChartModel theOtherModel)
          Utility method to convey properties contained in "theOtherModel" to this object.
 void applyFlorenceSettings()
          Sets the appropriate settings such to match a server side florence/sector radar chart.
 void applyWindroseSettings()
          Sets the appropriate settings such to match a server side WindoseRose radar chart.
 boolean equals(java.lang.Object obj)
          Determines whether another object is equal to this RadarChartModel.
 AxisModel getAxisModel()
          Returns the RadarChart's axis model, a repository for axis appearance preferences.
 LegendModel getColorLegendModel()
          Get the RadarChart's color legend model, a compilataion of legend appearance preferences.
 GraphMatrixAxisModel getColumnAxisModel()
          Returns the Graph's column axis model, which contains axis' appearance preferences.
 int getMissingPolicy()
          Returns the graph behavior for displaying missing values.
 int getRadarType()
          Get the display presentation for the radar elements.
 GraphMatrixAxisModel getRowAxisModel()
          Returns the Graph's row axis model, which contains axis' appearance preferences.
 double getSectorWidth()
          Returns the sector width
 double getStartAngle()
          Return the current starting angle of the radar chart in degrees.
 int hashCode()
          Computes the hash code for this RadarChartModel.
 boolean isDrawSectorOnAxis()
          Return whether the sector elements are drawn on top of their axis.
 boolean isFillEnabled()
          Return whether the radar elements are filled.
 boolean isLineEnabled()
          Return whether or not the radar polygon outline styles will be controlled by the LineStyles set in DataElementStyles.
 boolean isUniformAxes()
          Returns a boolean that says whether or not the axes will be uniform.
 void setAxisModel(AxisModel newAxisModel)
          Sets the RadarChart's axis model, which encapsulates the axis appearance preferences.
 void setColorLegendModel(LegendModel newModel)
          Set the RadarChart's color legend model, a compilataion of legend appearance preferences.
 void setColumnAxisModel(GraphMatrixAxisModel newAxis)
          Set the Graph's column axis model, which contains axis' appearance preferences.
 void setDrawSectorOnAxis(boolean newDrawSectorOnAxis)
          Set whether sector elements should be drawn on top of their axis as opposed to beside it.
 void setFillEnabled(boolean fill)
          Set whether radar elements should be filled polygons.
 void setLineEnabled(boolean line)
          If true, then the radar polygon outline styles will be controlled by the LineStyles set in DataElementStyles.
 void setMissingPolicy(int newMissingPolicy)
          Sets the graph behavior for displaying missing values.
 void setRadarType(int newRadarType)
          Set the display presentation for the radar elements.
 void setRowAxisModel(GraphMatrixAxisModel newAxis)
          Set the Graph's row axis model, which contains axis' appearance preferences.
 void setSectorWidth(double newSectorWidth)
          Sets the sector width when type is set to RADAR_TYPE_SECTOR The width is expressed as a percentage of the available space to draw the sector Should be in the range 0<=sectorWidth<=1
 void setStartAngle(double newAngle)
          Set the angle where the radar should place the first axis.
 void setUniformAxes(boolean uniform)
          Sets whether or not the Axes will all have the same range represented.
 
Methods inherited from class com.sas.graphics.components.GraphModel
apply, getBackgroundFillStyle, getBrushModel, getDataElementStyles, getDataTipModel, getFrameLineStyle, getLogo, getLogoJustification, isAntialiasedGraphics, isAntialiasedText, setAntialiasedGraphics, setAntialiasedText, setBackgroundFillStyle, setBrushModel, setDataElementStyles, setDataTipModel, setFrameLineStyle, setLogo, setLogoJustification
 
Methods inherited from class com.sas.graphics.components.ModelBase
addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, setContainedModel
 

Field Detail

RB_KEY

public static final java.lang.String RB_KEY
See Also:
Constant Field Values

RADAR_TYPE_RADIAL

public static final int RADAR_TYPE_RADIAL
Axis lengths determined by response values.

See Also:
Constant Field Values

RADAR_TYPE_SPOKE

public static final int RADAR_TYPE_SPOKE
A circle at the minimum value, with radiating axis lengths determined by response value.

See Also:
Constant Field Values

RADAR_TYPE_POLYGON

public static final int RADAR_TYPE_POLYGON
Similar to RADAR_TYPE_WEDGE, but without axes.

See Also:
Constant Field Values

RADAR_TYPE_WEDGE

public static final int RADAR_TYPE_WEDGE
Axes are displayed and points from each axis are connected. Default.

See Also:
Constant Field Values

RADAR_TYPE_SECTOR

public static final int RADAR_TYPE_SECTOR
Wedges are drawn for each category value

See Also:
Constant Field Values

RADAR_TYPE_CHORD

public static final int RADAR_TYPE_CHORD
Similar to sector, but the end is not an arc

See Also:
Constant Field Values

RADAR_TYPE_CALENDAR

public static final int RADAR_TYPE_CALENDAR
Sectors have equal radii, and the color is determined by the response

See Also:
Constant Field Values

RADAR_TYPE_CORONA

public static final int RADAR_TYPE_CORONA
Similar to wedge, but a bisecting vertex is added between axes and the minimum value to give more of a star appearance

See Also:
Constant Field Values

RADAR_TYPE

public static final ConstantCollection RADAR_TYPE
RADAR_TYPE enables a set of static actions associated with the public RADAR_TYPE_ constants. These actions include: (1) validation (2) translation between constant value and string value (3) translation between constant value and JSP string value (4) translation between constant value and localized string value (5) generation of constant int or string arrays

Constructor Detail

RadarChartModel

public RadarChartModel()
Constructs a new RadarChartModel.

Method Detail

apply

public void apply(RadarChartModel theOtherModel)
Utility method to convey properties contained in "theOtherModel" to this object.
Note: Contained "models" (i.e. properties that are subclasses of ModelBase) will in turn be called on to convey their properties to the like contained models in the other object. In that respect this can be considered a "tree" type copy.
Also Note: This is a deep copy. Thus after the copy, mutable properties will not be shared by the two instances.

Parameters:
theOtherModel - properties applied to this instance
Throws:
java.lang.IllegalArgumentException - if theOtherModel is null.

setRowAxisModel

public void setRowAxisModel(GraphMatrixAxisModel newAxis)
                     throws java.lang.IllegalArgumentException
Set the Graph's row axis model, which contains axis' appearance preferences. The row axis appears when the Graph's "Row" variable is assigned to a valid data column. The row Axis manages groups of rows.

Parameters:
newAxis - row axis display attributes
Throws:
java.lang.IllegalArgumentException - if newAxis is null.
See Also:
getRowAxisModel(), GraphMatrixAxisModel.apply(com.sas.graphics.components.GraphMatrixAxisModel)

getRowAxisModel

public GraphMatrixAxisModel getRowAxisModel()
Returns the Graph's row axis model, which contains axis' appearance preferences. The row axis appears when the Graph's "Row" variable is assigned to a valid data column. The row Axis manages groups of rows.

Returns:
GraphMatrixAxisModel
See Also:
setRowAxisModel(com.sas.graphics.components.GraphMatrixAxisModel), getColumnAxisModel()

setColumnAxisModel

public void setColumnAxisModel(GraphMatrixAxisModel newAxis)
                        throws java.lang.IllegalArgumentException
Set the Graph's column axis model, which contains axis' appearance preferences. The column axis appears when the Graph's "Column" variable is assigned to a valid data column. The column Axis manages groups of columns.

Parameters:
newAxis - the column axis display attributes
Throws:
java.lang.IllegalArgumentException - if newAxis is null.
See Also:
getColumnAxisModel(), GraphMatrixAxisModel.apply(com.sas.graphics.components.GraphMatrixAxisModel)

getColumnAxisModel

public GraphMatrixAxisModel getColumnAxisModel()
Returns the Graph's column axis model, which contains axis' appearance preferences. The column axis appears when the Graph's "Column" variable is assigned to a valid data column. The column Axis manages groups of columns.

Returns:
GraphMatrixAxisModel
See Also:
setColumnAxisModel(com.sas.graphics.components.GraphMatrixAxisModel), getRowAxisModel()

setRadarType

public void setRadarType(int newRadarType)
                  throws java.lang.IllegalArgumentException
Set the display presentation for the radar elements.

Valid values are :
  RadarChartModel.RADAR_TYPE_WEDGE (the default)
  RadarChartModel.RADAR_TYPE_POLYGON
  RadarChartModel.RADAR_TYPE_RADIAL
  RadarChartModel.RADAR_TYPE_SPOKE
  RadarChartModel.RADAR_TYPE_SECTOR
  RadarChartModel.RADAR_TYPE_CHORD
  RadarChartModel.RADAR_TYPE_CALENDAR
  RadarChartModel.RADAR_TYPE_CORONA

Parameters:
newRadarType - the new type of radar display
Throws:
java.lang.IllegalArgumentException - if newRadarType is invalid.
See Also:
getRadarType()

getRadarType

public int getRadarType()
Get the display presentation for the radar elements.

Returns:
the type of radar display
See Also:
setRadarType(int)

setColorLegendModel

public void setColorLegendModel(LegendModel newModel)
                         throws java.lang.IllegalArgumentException
Set the RadarChart's color legend model, a compilataion of legend appearance preferences. By default, the Radar chart displays a legend if a subgroup varaible is specified.

Parameters:
newModel - the new repository for the legend display attributes
Throws:
java.lang.IllegalArgumentException - if newModel is null.
See Also:
getColorLegendModel(), LegendModel.apply(com.sas.graphics.components.LegendModel)

getColorLegendModel

public LegendModel getColorLegendModel()
Get the RadarChart's color legend model, a compilataion of legend appearance preferences. By default, the Radar chart displays a legend if a subgroup varaible is specified.

Returns:
color legend model
See Also:
setColorLegendModel(com.sas.graphics.components.LegendModel)

setAxisModel

public void setAxisModel(AxisModel newAxisModel)
                  throws java.lang.IllegalArgumentException
Sets the RadarChart's axis model, which encapsulates the axis appearance preferences. The RadarChart creates an axis for each unique category value. This model is used \ for all the axes the radar creates.

This axis model is also used to determine the positioning of reference lines. Reference lines appear as circles on the radar chart. Their position is expressed as a fraction of the total diameter of the radar. Therefore, the value for the reference lines must be between 0 and 1. For example, a value of .5 would draw a reference circle half the diameter of the radar chart. Values less than zero or greater than one are ignored.

Parameters:
newAxisModel - the new repository for the axis display attributes
Throws:
java.lang.IllegalArgumentException - if newAxisModel is null.
See Also:
getAxisModel(), AxisModel.apply(com.sas.graphics.components.AxisModel)

getAxisModel

public AxisModel getAxisModel()
Returns the RadarChart's axis model, a repository for axis appearance preferences. The RadarChart creates an axis for each unique category value. This model is used for all the axes the radar creates.

Returns:
AxisModel
See Also:
setAxisModel(com.sas.graphics.components.AxisModel)

setStartAngle

public void setStartAngle(double newAngle)
Set the angle where the radar should place the first axis. Zero degrees is 12 o-clock and the angle progresses clockwise.

Parameters:
newAngle - The desired start angle in degrees.
See Also:
getStartAngle()

getStartAngle

public double getStartAngle()
Return the current starting angle of the radar chart in degrees.

See Also:
setStartAngle(double)

setFillEnabled

public void setFillEnabled(boolean fill)
Set whether radar elements should be filled polygons. This only applies to the following radar types: WEDGE, POLYGON, CORONA

Parameters:
fill - The desired value.
See Also:
isFillEnabled()

isFillEnabled

public boolean isFillEnabled()
Return whether the radar elements are filled. This only applies to the following radar types: WEDGE, POLYGON, CORONA

See Also:
setFillEnabled(boolean)

setLineEnabled

public void setLineEnabled(boolean line)
If true, then the radar polygon outline styles will be controlled by the LineStyles set in DataElementStyles. Otherwise, the outline will match the fill color. This only applies to the following radar types: WEDGE, POLYGON, CORONA

Parameters:
line - The desired value.
See Also:
isLineEnabled()

isLineEnabled

public boolean isLineEnabled()
Return whether or not the radar polygon outline styles will be controlled by the LineStyles set in DataElementStyles. This only applies to the following radar types: WEDGE, POLYGON, CORONA

See Also:
setLineEnabled(boolean)

setUniformAxes

public void setUniformAxes(boolean uniform)
Sets whether or not the Axes will all have the same range represented.

Parameters:
uniform - the boolean that determines if the range will be uniform
See Also:
isUniformAxes()

isUniformAxes

public boolean isUniformAxes()
Returns a boolean that says whether or not the axes will be uniform.

Returns:
boolean
See Also:
setUniformAxes(boolean)

setSectorWidth

public void setSectorWidth(double newSectorWidth)
                    throws java.lang.IllegalArgumentException
Sets the sector width when type is set to RADAR_TYPE_SECTOR The width is expressed as a percentage of the available space to draw the sector Should be in the range 0<=sectorWidth<=1

Parameters:
newSectorWidth - the double that represents the sector width
Throws:
java.lang.IllegalArgumentException - if newSectorWidth is not in the correct range.
See Also:
getSectorWidth()

getSectorWidth

public double getSectorWidth()
Returns the sector width

Returns:
double
See Also:
setSectorWidth(double)

setMissingPolicy

public void setMissingPolicy(int newMissingPolicy)
Sets the graph behavior for displaying missing values. (Similar to the server side "missing" statement in prog gchart.)
Valid values are:
GraphConstants.AUTOMATIC is the same as the server side proc gchart default (which is to display all classification variable missing values except category).
GraphConstants.TRUE is the same as the server side gchart behavior with the "missing" statement (which is to display all all classification variable missing values (including category)). GraphConstants.FALSE means don't display any classification variable missing values.

Special note:
The following String values are interpreted as missingPolicy values:


The following Number values are interpreted as missing values:

Throws:
java.lang.IllegalArgumentException - if newMissing is invalid.
See Also:
getMissingPolicy()

getMissingPolicy

public int getMissingPolicy()
Returns the graph behavior for displaying missing values.

Returns:
how to display classification variable missing values.
See Also:
setMissingPolicy(int)

hashCode

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

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

applyWindroseSettings

public void applyWindroseSettings()
Sets the appropriate settings such to match a server side WindoseRose radar chart.


applyFlorenceSettings

public void applyFlorenceSettings()
Sets the appropriate settings such to match a server side florence/sector radar chart.


equals

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

The result is true if and only if the argument is not null and is a RadarChartModel object that has the same properties as this object.

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

setDrawSectorOnAxis

public void setDrawSectorOnAxis(boolean newDrawSectorOnAxis)
Set whether sector elements should be drawn on top of their axis as opposed to beside it. This setting only applies when the radar type is SECTOR or CHORD default is false.

Parameters:
newDrawSectorOnAxis - The desired value.
See Also:
isDrawSectorOnAxis()

isDrawSectorOnAxis

public boolean isDrawSectorOnAxis()
Return whether the sector elements are drawn on top of their axis.

See Also:
setDrawSectorOnAxis(boolean)



Copyright © 2009 SAS Institute Inc. All Rights Reserved.