com.sas.servlet.tbeans.graphics
Class BaseRadarChart

com.sas.servlet.tbeans.graphics.BaseRadarChart
All Implemented Interfaces:
ActionProviderViewInterface, HttpActionProviderInterface, HttpActionProviderViewInterface, com.sas.beans.PropertyChangeSource, com.sas.lang.ObjectDataInterface, com.sas.servlet.tbeans.features.FeatureListInterface, RenderableInterface, TransformationInterface, com.sas.util.WriteToPrintWriterInterface, java.io.Serializable
Direct Known Subclasses:
RadarChart

public class BaseRadarChart

The RadarChart is a Swing component that uses a RadarChartDataModel (data properties) and a RadarChartModel (display properties) to produce a graphical circular shaped representation of the data, consisting of radial axes onto which data points may be plotted.

Data

The number and arrangement of data elements, axes and legend is determined by the RadarChartDataModel (assigned via the setDataModel method) which provides data properties. To illustrate the RadarChartTableDataModel is used to assign a javax.swing.table.TableModel along with a collection of variable properties to define the data column mapping onto the graph. The RadarChartOLAPDataModel is used to assign OLAP data via a com.sas.storage.olap.OLAPDataSetInterface.

Display Properties

The RadarChartModel properties define the display appearance. The RadarChartModel contains RadarChart specific properties, common graph properties and a collection of contained models (which provide display properties for sub-portions of the graph such as the legend). The RadarChart guarantees a non-null RadarChartModel via the getGraphModel method. Passing a null parameter to the RadarChart's setGraphModel method triggers an IllegalArgumentException. The RadarChartModel properties can be modified directly.

For example:

 RadarChart radarChart = new RadarChart();
 RadarChartModel radarChartModel = radarChart.getGraphModel();
 
 // Assign background color
 radarChartModel.setBackgroundFillStyle(new FillStyle(Color.lightGray));

 // Assign data element outline color
 radarChartModel.getDataElementStyles().getOutlineLineStyle().setColor(Color.yellow);
 

However it may be simpler to modify the properties indirectly by applying a GraphStyle via the applyGraphStyle method. The RadarChartModel allows for a high degree of control over the RadarChart's appearance. Because of the large number of display properties and the repetitive nature of some of the properties (for example: there are text style properties for the values text in the legend, axis and data element values) applying a GraphStyle on the RadarChart may be the simplest way to obtain the desired results. A GraphStyle is a collection of graph properties that can be applied to any graph. Several canned GraphStyles are provided and can be used as is or tweaked to provide the desired presentation. Applying a GraphStyle on a RadarChart will modify some of the RadarChartModel properties.

See Also:
Serialized Form

Constructor Summary
BaseRadarChart()
          Construct a RadarChart using the default GraphStyle (GraphStyle.CONVENTION_STYLE).
 
Method Summary
 void applyGraphStyle(GraphStyle graphStyle)
          Apply the GraphStyle display properties onto the RadarChart.
 RadarChartModel getGraphModel()
          Returns the RadarChartModel that encapsulates most of the RadarChart's display properties.
 ChartImageMapInfo getImageMapInfo()
          
The RadarChartImageMapInfo class encapsulates the mapping of regions associated with radar elements, labels (for both axes and legends) and values (for both axes and legends) as projected onto the display area along with their associated data.
 void setDataModel(RadarChartDataModel newDataModel)
          Sets the RadarChartDataModel which provides data properties along with any associated mapping properties to define the number and arrangement of data elements, legend and axes.
 void setGraphModel(RadarChartModel newRadarChartModel)
          Sets a RadarChartModel to define most of the RadarChart's display properties.
 
Methods inherited from class com.sas.servlet.tbeans.BaseActionTransformation
dispose, getActionProvider, getActionSupportType, getUniqueId, isActionVisible, listActionTypes, listAreaTypes, setActionProvider, setActionSupportType, setActionVisible, setUniqueId, write
 
Methods inherited from class com.sas.servlet.tbeans.BaseTransformation
addPropertyChangeListener, addPropertyChangeListener, cleanUpResources, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getCustomAttributes, getDescription, getId, getInputTransform, getLocale, getName, getObjectData, getObjectDataProperty, getOutputTransform, getRequest, getResponse, getTagEpilog, getTagProlog, hasListeners, isCleanUpResourcesOn, isVisible, removePropertyChangeListener, removePropertyChangeListener, setCleanUpResourcesOn, setCustomAttributes, setDescription, setId, setInputTransform, setLocale, setLocaleDependentProperties, setName, setObjectData, setObjectDataProperty, setOutputTransform, setRequest, setResponse, setTagEpilog, setTagProlog, setVisible, toString, write, write, write
 
Methods inherited from interface com.sas.actionprovider.HttpActionProviderViewInterface
getRequest, setRequest
 

Constructor Detail

BaseRadarChart

public BaseRadarChart()
Construct a RadarChart using the default GraphStyle (GraphStyle.CONVENTION_STYLE).

See Also:
GraphStyle
Method Detail

setGraphModel

public void setGraphModel(RadarChartModel newRadarChartModel)
                   throws java.lang.IllegalArgumentException
Sets a RadarChartModel to define most of the RadarChart's display properties. Modifying any RadarChartModel property triggers the RadarChart to update. The update is asynchronous and delayed so modifying multiple properties in quick succession will result in only a single update. Use the FullPaintInterface if greater control over the RadarChart's paint behavior is necessary.

Typically applyGraphStyle is used to modify the graphs display properties.

Parameters:
newRadarChartModel - the RadarChartModel that encapsulates the RadarChart's display properties
Throws:
java.lang.IllegalArgumentException - if newRadarChartModel is null.
See Also:
getGraphModel(), RadarChartModel.apply(com.sas.graphics.components.radarchart.RadarChartModel), GraphStyle

getGraphModel

public RadarChartModel getGraphModel()
Returns the RadarChartModel that encapsulates most of the RadarChart's display properties.

Returns:
the RadarChartModel that encapsulates most of the RadarChart's display properties
See Also:
setGraphModel(com.sas.graphics.components.radarchart.RadarChartModel), RadarChartModel.apply(com.sas.graphics.components.radarchart.RadarChartModel)

setDataModel

public void setDataModel(RadarChartDataModel newDataModel)
Sets the RadarChartDataModel which provides data properties along with any associated mapping properties to define the number and arrangement of data elements, legend and axes.

Any change in the RadarChartDataModel properties will cause the RadarChart to update. The update is asynchronous and delayed so modifying multiple properties in quick succession will result in only a single update. The FullPaintInterface can be used if greater control over the RadarChart's paint behavior is needed.

Note: Data value changes will also trigger RadarChart to update.

A valid RadarChartDataModel is required to draw a graph.

Parameters:
newDataModel - provides data properties
See Also:
RadarChartTableDataModel, RadarChartOLAPDataModel

getImageMapInfo

public ChartImageMapInfo getImageMapInfo()

The RadarChartImageMapInfo class encapsulates the mapping of regions associated with radar elements, labels (for both axes and legends) and values (for both axes and legends) as projected onto the display area along with their associated data. This is particularly useful with creating html imagemap information if the graph is used to create an image for an html document.

Returns:
the mapping of regions associated with graph elements

applyGraphStyle

public void applyGraphStyle(GraphStyle graphStyle)
Apply the GraphStyle display properties onto the RadarChart. The use of this method is a convenient way to quickly and easily affect the RadarChart's appearance. The RadarChartModel (accessible via the getGraphModel method) properties and the NoteModels (accessible via the getTitle and getFootnote methods) properties are modified by this method.

The GraphStyle enforces certain constraints that are not enforced on the Graph's display models (RadarChartModel and NoteModels). For example only one value text color may be specified on the GraphStyle, whereas the RadarChartModel supports setting different value text colors between axes, legends and data element text. Most presentations only require a single color for all types of value text, which is easily achieved by applying a GraphStyle.

Applying a GraphStyle will modify the display properties of the RadarChartModel and the title and footnote NoteModels. The RadarChart does not retain a link to the GraphStyle after this method has been called. Modifying any of the GraphStyle properties after this method has been called will have no affect on the RadarChart. Similarly modifying any of RadarChart's display properties after this method has been called will have no affect on the GraphStyle properties. To affect any change in the RadarChart display appearance the modified GraphStyle or a different GraphStyle would need to be applied again.

A blind PropertyChangeEvent is fired by the RadarChart after the apply is made.

No action is taken if a null GraphStyle is passed in.

Overrides:
applyGraphStyle in class com.sas.servlet.tbeans.graphics.BaseGraph
Parameters:
graphStyle - the GraphStyle whose properties are conveyed to the RadarChart
See Also:
NoteModel, RadarChartModel



Copyright © 2009 SAS Institute Inc. All Rights Reserved.