Overview

WebCharts3D software uses classes derived from  com.gp.api.model.MxChartModel class to represent chart's model. To create a model you can either derive a new class from MxChartModel and implement required methods (see below) or use API functions described in API section of this chapter to create an instance of  MxStandardChartModel from XML, files or databases, or to dynamically build model.

NOTE Some of the API calls expect and return instances of  com.gp.api.model.MxWidgetModel. This class is a superclass of MxChartModel and should be casted to MxChartModel.


All models represent a two-dimensional table with labels where rows are treated as series and columns as elements of these series (unless isTransposed attribute is specified). In some cases, the chart expects a particular number of rows and in some it can handle any number of rows - see  Requirements section for the details.


To create your own chart model, derive a class from MxChartModel and implement the following methods:

public abstract int getColCount()
Returns number of the columns in the model

public abstract int getRowCount()
Returns number of the rows in the model

public abstract double valueAt(int rowIndex, int colIndex)
Returns value at a particular row and column. This value of Double.NaN to represents a gap in the data.

public abstract String getColLabelAt(int colIndex)
Returns column's label

public abstract String getRowLabelAt(int rowIndex)
Returns row's label

public abstract int getColSelection()
Returns currently selected column. This method can return -1 or 0 for the models that do not support selection.

public abstract void setColSelection(int colSelection)
Sets currently selected column

public abstract int getRowSelection()
Returns currently selected row. This method can return -1 or 0 for the models that do not support selection.

public abstract void setRowSelection(int rowSelection)
Sets currently selected row