All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.ibm.beans.charting.ChartModel

java.lang.Object
   |
   +----COM.ibm.desktop.Model
           |
           +----COM.ibm.beans.charting.ChartModel

public class ChartModel
extends Model
ChartModel defines the data required by the Charting Beans for charting, viz., the data values to be charted, the labels, axes labels and title to be used for the chart. It allows access and modification of all of these chart properties. It also maintains the type (view) of the chart currently being displayed.


Variable Index

 o fChartColors
The colors to be used for drawing each bar/wedge of the chart.
 o fChartData
The data to be charted, which is essentially a Vector of Numbers.
 o fChartLabels
The labels to be displayed for each bar/point/wedge in the charts
 o fChartTitle
The title of the chart.
 o fChartType
The type of chart to be displayed, which could be one of: 1.
 o fXAxisLabel
The label to be drawn below the X axis in the Bar and Line Charts.
 o fYAxisLabel
The label to be drawn above the Y axis in the Bar and Line Charts.

Constructor Index

 o ChartModel()
Default constructor of the Chart's Model.

Method Index

 o getChartColors()
Returns a vector of all the colors to be used for plotting the data.
 o getChartData()
Returns all the data that is to be charted, in a Vector.
 o getChartLabels()
Returns the vector of labels for the data.
 o getChartTitle()
Returns the chart's title.
 o getChartType()
Returns the currently selected chart type.
 o getColor(int)
Returns the color to be used for charting the data at the specified index.
 o getData(int)
Returns the data value at this index.
 o getDataSize()
Returns the size of the data (vector) to be plotted.
 o getFileExtension()
Return the file extension string (3 or 4 letter string without the .)
 o getLabel(int)
Returns the label to be used for charting the data at this index.
 o getXAxisLabel()
Returns the X axis label to be used for the chart.
 o getYAxisLabel()
Returns the Y axis label to be used for the chart.
 o setChartColors(Vector)
Sets all the colors to be used for charting the data, from the vector specified.
 o setChartData(Vector)
Sets all the data that is to be charted from the vector specified
 o setChartLabels(Vector)
Sets the vector of labels for the data.
 o setChartTitle(String)
Sets the chart's title to the one specified.
 o setChartType(ChartType)
Sets the chart type to the specified one.
 o setColor(int, Color)
Sets the color to be used for charting the data at this index.
 o setData(int, Number)
Sets the data at this index.
 o setLabel(int, String)
Sets the label to be used for data at this index.
 o setXAxisLabel(String)
Sets the chart's X-axis label to the one specified.
 o setYAxisLabel(String)
Sets the chart's Y-axis label to the one specified.

Variables

 o fChartType
 protected ChartType fChartType
The type of chart to be displayed, which could be one of: 1. BarChart 2. LineChart 3. PieChart

 o fChartData
 protected Vector fChartData
The data to be charted, which is essentially a Vector of Numbers.

 o fChartLabels
 protected Vector fChartLabels
The labels to be displayed for each bar/point/wedge in the charts

 o fChartTitle
 protected String fChartTitle
The title of the chart.

 o fChartColors
 protected Vector fChartColors
The colors to be used for drawing each bar/wedge of the chart.

 o fXAxisLabel
 protected String fXAxisLabel
The label to be drawn below the X axis in the Bar and Line Charts.

 o fYAxisLabel
 protected String fYAxisLabel
The label to be drawn above the Y axis in the Bar and Line Charts.

Constructors

 o ChartModel
 public ChartModel()
Default constructor of the Chart's Model.

Methods

 o getFileExtension
 public String getFileExtension()
Return the file extension string (3 or 4 letter string without the .)

Overrides:
getFileExtension in class Model
 o getChartType
 public ChartType getChartType()
Returns the currently selected chart type.

 o setChartType
 public void setChartType(ChartType type)
Sets the chart type to the specified one.

Parameters:
type - the chart type
 o getData
 public Number getData(int index) throws ArrayIndexOutOfBoundsException
Returns the data value at this index.

Parameters:
index - the specified index
 o setData
 public void setData(int index,
                     Number value)
Sets the data at this index.

Parameters:
index - the specified index
value - the data value to be set
 o getChartData
 public Vector getChartData()
Returns all the data that is to be charted, in a Vector.

 o setChartData
 public void setChartData(Vector dataValues)
Sets all the data that is to be charted from the vector specified

Parameters:
dataValues - the vector of data values (Number objects) to be charted.
 o getColor
 public Color getColor(int index)
Returns the color to be used for charting the data at the specified index.

Parameters:
index - the specified index
 o setColor
 public void setColor(int index,
                      Color color)
Sets the color to be used for charting the data at this index.

Parameters:
index - the specified index
color - the specified color
 o getChartColors
 public Vector getChartColors()
Returns a vector of all the colors to be used for plotting the data.

 o setChartColors
 public void setChartColors(Vector colors)
Sets all the colors to be used for charting the data, from the vector specified.

Parameters:
colors - the vector of colors to be used
 o getLabel
 public String getLabel(int index)
Returns the label to be used for charting the data at this index.

Parameters:
index - the specified index
 o setLabel
 public void setLabel(int index,
                      String label)
Sets the label to be used for data at this index.

Parameters:
index - the specified index
label - the label string
 o getChartLabels
 public Vector getChartLabels()
Returns the vector of labels for the data.

 o setChartLabels
 public void setChartLabels(Vector labels)
Sets the vector of labels for the data.

Parameters:
labels - the vector of labels to be used
 o getChartTitle
 public String getChartTitle()
Returns the chart's title.

 o setChartTitle
 public void setChartTitle(String title)
Sets the chart's title to the one specified.

Parameters:
title - the title for the chart
 o getXAxisLabel
 public String getXAxisLabel()
Returns the X axis label to be used for the chart.

 o setXAxisLabel
 public void setXAxisLabel(String label)
Sets the chart's X-axis label to the one specified.

Parameters:
label - the X-axis label for the chart
 o getYAxisLabel
 public String getYAxisLabel()
Returns the Y axis label to be used for the chart.

 o setYAxisLabel
 public void setYAxisLabel(String label)
Sets the chart's Y-axis label to the one specified.

Parameters:
label - the Y-axis label for the chart
 o getDataSize
 public int getDataSize()
Returns the size of the data (vector) to be plotted.


All Packages  Class Hierarchy  This Package  Previous  Next  Index