|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.servlet.tbeans.graphics.BaseLineChart
public class BaseLineChart
The LineChart is a Swing component that uses a LineChartDataModel (data properties) and a LineChartModel (display properties) to produce a series of connected veticies representing data values.
Data
The number and arrangement of data elements (i.e. lines), axes and legend is determined by the LineChartDataModel (assigned via the setDataModel method) which provides a handle to data and associated mapping properties. To illustrate the LineChartTableDataModel is used to assign a Swing TableModel along with a collection of variable properties to define the data column mapping onto the graph. The LineChartOLAPDataModel is used to assign OLAP data via a com.sas.storage.olap.OLAPDataSetInterface.
Display Properties
The LineChartModel properties define the display appearance. The LineChartModel contains LineChart 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 LineChart guarantees a non-null LineChartModel via the getGraphModel method. Passing a null parameter to the LineChart's setGraphModel method triggers an IllegalArgumentException. The LineChartModel properties can be modified directly.
For example:
LineChart lineChart = new LineChart(); LineChartModel lineChartModel = lineChart.getGraphModel(); // Assign background color lineChartModel.setBackgroundFillStyle(new FillStyle(Color.lightGray)); // Assign data element outline color lineChartModel.getDataElementStyles().getOutlineLineStyle().setColor(Color.yellow);
However it may be simpler to modify the properties indirectly by applying a GraphStyle via the applyGraphStyle method. The LineChartModel allows for a high degree of control over the LineChart'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, response axis, category axis and data element values) applying a GraphStyle on the LineChart 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 predefined GraphStyles are provided and can be used as is or tweaked to provide the desired presentation. Applying a GraphStyle on a LineChart will modify some of the LineChartModel properties.
Graph
,
GraphStyle
,
NoteModel
,
LineChartModel
,
LineChartDataModel
,
LineChartTableDataModel
,
LineChartOLAPDataModel
,
Serialized FormConstructor Summary | |
---|---|
BaseLineChart()
Construct a LineChart using the default GraphStyle (GraphStyle.CONVENTION_STYLE). |
Method Summary | |
---|---|
void |
applyColorScheme(ColorScheme scheme)
Apply a color scheme to this graph's display attributes. |
void |
applyGraphStyle(GraphStyle graphStyle)
Apply the GraphStyle display properties onto the LineChart. |
LineChartModel |
getGraphModel()
Returns the LineChartModel that encapsulates most of the LineChart's display properties. |
ChartImageMapInfo |
getImageMapInfo()
The LineChartImageMapInfo class encapsulates the mapping of regions associated with line 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(LineChartDataModel newDataModel)
Sets the LineChartDataModel that provides data properties like where the data values are located and how they are to be displayed by the LineChart. |
void |
setGraphModel(LineChartModel newLineChartModel)
Sets a LineChartModel to define most of the LineChart'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 interface com.sas.actionprovider.HttpActionProviderViewInterface |
---|
getRequest, setRequest |
Constructor Detail |
---|
public BaseLineChart()
GraphStyle
Method Detail |
---|
public void setGraphModel(LineChartModel newLineChartModel) throws java.lang.IllegalArgumentException
Typically applyGraphStyle is used to modify the graphs display properties.
newLineChartModel
- the LineChartModel that encapsulates the LineChart's display properties
java.lang.IllegalArgumentException
- if newLineChartModel is null.getGraphModel()
,
LineChartModel.apply(com.sas.graphics.components.linechart.LineChartModel)
,
GraphStyle
public LineChartModel getGraphModel()
setGraphModel(com.sas.graphics.components.linechart.LineChartModel)
,
LineChartModel.apply(com.sas.graphics.components.linechart.LineChartModel)
public void setDataModel(LineChartDataModel newDataModel)
Any change in the LineChartDataModel properties will cause the LineChart 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 LineChart's paint behavior is needed.
Note: Data value changes will also trigger LineChart to update.
A valid LineChartDataModel is required to draw a graph.
newDataModel
- provides a handle to the data
along with any associated mapping propertiesLineChartTableDataModel
,
LineChartOLAPDataModel
public ChartImageMapInfo getImageMapInfo()
public void applyColorScheme(ColorScheme scheme)
applyColorScheme
in class com.sas.servlet.tbeans.graphics.BaseGraph
scheme
- class containing a set of colors for the charts.public void applyGraphStyle(GraphStyle graphStyle)
The GraphStyle enforces certain constraints that are not enforced on the Graph's display models (LineChartModel and NoteModels). For example only one value text color may be specified on the GraphStyle, whereas the LineChartModel 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 LineChartModel and the title and footnote NoteModels. The LineChart 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 LineChart. Similarly modifying any of LineChart's display properties after this method has been called will have no affect on the GraphStyle properties. To affect any change in the LineChart display appearance the modified GraphStyle or a different GraphStyle would need to be applied again.
A blind PropertyChangeEvent is fired by the LineChart after the apply is made.
No action is taken if a null GraphStyle is passed in.
applyGraphStyle
in class com.sas.servlet.tbeans.graphics.BaseGraph
graphStyle
- the GraphStyle whose properties are conveyed to the LineChartNoteModel
,
LineChartModel
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |