|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.approximatrix.charting.model.AbstractChartDataModel
com.approximatrix.charting.model.ObjectChartDataModel
public class ObjectChartDataModel
The ObjectChartDataModel implements a ChartDataModel for Charts, which have e.g. String values on the x-axis. This is especially useful for Barcharts and also for Piecharts, although those don't exactly have an x-axis.
| Field Summary | |
|---|---|
protected java.lang.Object[] |
columns
The x-axis values. |
protected ChartDataModelConstraints |
constraints1
The constraints for the first and second y-axes. |
protected ChartDataModelConstraints |
constraints2
The constraints for the first and second y-axes. |
protected DataSet[] |
data
The data values. |
protected java.util.HashMap |
valuesbyaxis
A HashMap containing the ordered data per axis. |
| Fields inherited from class com.approximatrix.charting.model.AbstractChartDataModel |
|---|
autoscale, listener, manualscale, maxcolumn, maxvalue, mincolumn, minvalue |
| Constructor Summary | |
|---|---|
ObjectChartDataModel()
Creates a new empty DefaultChartDataModel. |
|
ObjectChartDataModel(DataSet[] ds,
java.lang.Object[] columns)
Creates a new ObjectChartDataModel using the given array of DataSets, effectively enabling the creation of DataModels with differently sized DataSets. |
|
ObjectChartDataModel(double[][] data,
java.lang.Object[] columns,
java.lang.String[] rows)
Creates new ObjectChartDataModel. |
|
ObjectChartDataModel(int[][] data,
java.lang.Object[] columns,
java.lang.String[] rows)
Creates new ObjectChartDataModel. |
|
ObjectChartDataModel(java.lang.Number[][] data,
java.lang.Object[] columns,
java.lang.String[] rows)
Creates new ObjectChartDataModel with the default axis binding. |
|
| Method Summary | |
|---|---|
int |
getAxisBinding(int set)
Returns the axis to which a DataSet is attached |
ChartDataModelConstraints |
getChartDataModelConstraints(int axis)
Returns a ChartDataModelConstraints Object for a given axis. |
java.lang.Object |
getColumnValueAt(int col)
Returns a specific column value. |
java.lang.Object |
getColumnValueAt(int set,
int col)
Calls getColumnValueAt(int col). |
int |
getDataSetLength(int set)
Returns the length of a certain dataset. |
java.lang.String |
getDataSetName(int set)
Returns the title of the DataSet. |
int |
getDataSetNumber()
Returns the total amount of datasets. |
protected double |
getFirstColumnValue()
Is called by the ChartDataModelConstraints Object to compute the minimum column value. |
protected double |
getLastColumnValue()
Is called by the ChartDataModelConstraints Object to compute the maximum column value. |
protected java.util.TreeSet |
getOrderedValues(int axis)
Returns an ordered set of all data values for the specified axis. |
java.lang.Number |
getValueAt(int set,
int index)
Returns the Value in a specific dataset at a certain index. |
void |
setChartDataModelConstraints(int axis,
ChartDataModelConstraints constraints)
Sets the ChartDataModelConstraints object for the given axis binding. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.Object[] columns
protected DataSet[] data
protected java.util.HashMap valuesbyaxis
protected ChartDataModelConstraints constraints1
protected ChartDataModelConstraints constraints2
| Constructor Detail |
|---|
public ObjectChartDataModel()
public ObjectChartDataModel(java.lang.Number[][] data,
java.lang.Object[] columns,
java.lang.String[] rows)
data - the array of values. The first index specifies the
datasets, the last one is the value index.columns - the array of x-axis values. The length of the
datasets and the length of the column should be equal and the columns should
be ordered.rows - the DataSet titles
public ObjectChartDataModel(int[][] data,
java.lang.Object[] columns,
java.lang.String[] rows)
data - the array of values. The first index specifies the
datasets, the last one is the value index.columns - the array of x-axis values. The length of the
datasets and the length of the column should be equal and
the columns should be ordered.rows - the DataSet titles
public ObjectChartDataModel(double[][] data,
java.lang.Object[] columns,
java.lang.String[] rows)
data - the array of values. The first index specifies the
datasets, the last one is the value index.columns - the array of x-axis values. The length of the
datasets and the length of the column should be equal and
the columns should be ordered.rows - the DataSet titles
public ObjectChartDataModel(DataSet[] ds,
java.lang.Object[] columns)
ds - the array of DataSets to be used.columns - the array of column values. This needs to be supplied,
because using Objects as x-axis values you need to have an ordered
superset of all column values especially if different DataSets only
contain some column values| Method Detail |
|---|
public int getDataSetLength(int set)
set - the DataSet index
public int getDataSetNumber()
public java.lang.String getDataSetName(int set)
getDataSetName in interface ChartDataModelgetDataSetName in class AbstractChartDataModelset - the DataSet index
public int getAxisBinding(int set)
getAxisBinding in interface ChartDataModelgetAxisBinding in class AbstractChartDataModelset - the DataSet index
public java.lang.Number getValueAt(int set,
int index)
set - the DataSet indexindex - the value index
public ChartDataModelConstraints getChartDataModelConstraints(int axis)
axis - the axis constant
public void setChartDataModelConstraints(int axis,
ChartDataModelConstraints constraints)
axis - the Axis constantconstraints - the ChartDataModelConstraints objectpublic java.lang.Object getColumnValueAt(int col)
col - the column index
null if the column doesn't exist.
public java.lang.Object getColumnValueAt(int set,
int col)
col - the column indexset - the data set index
null if the column doesn't exist.protected java.util.TreeSet getOrderedValues(int axis)
getOrderedValues in class AbstractChartDataModelprotected double getFirstColumnValue()
getFirstColumnValue in class AbstractChartDataModelprotected double getLastColumnValue()
getLastColumnValue in class AbstractChartDataModelcolumns.length.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||