| java.lang.Object de.progra.charting.model.AbstractChartDataModel de.progra.charting.model.ObjectChartDataModel
ObjectChartDataModel | public class ObjectChartDataModel extends AbstractChartDataModel (Code) | | 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.
author: mueller version: 1.0 |
Constructor Summary | |
public | ObjectChartDataModel() Creates a new empty DefaultChartDataModel. | public | ObjectChartDataModel(Number[][] data, Object[] columns, String rows) Creates new ObjectChartDataModel with the default axis binding.
Parameters: data - the array of values. | public | ObjectChartDataModel(int[][] data, Object[] columns, String[] rows) Creates new ObjectChartDataModel.
Parameters: data - the array of values. | public | ObjectChartDataModel(double[][] data, Object[] columns, String[] rows) Creates new ObjectChartDataModel.
Parameters: data - the array of values. | public | ObjectChartDataModel(DataSet[] ds, Object[] columns) Creates a new ObjectChartDataModel using the
given array of DataSets, effectively enabling the creation
of DataModels with differently sized DataSets. |
valuesbyaxis | protected HashMap valuesbyaxis(Code) | | A HashMap containing the ordered data per axis.
|
ObjectChartDataModel | public ObjectChartDataModel()(Code) | | Creates a new empty DefaultChartDataModel.
Initializes all Objects and Arrays as empty ones.
|
ObjectChartDataModel | public ObjectChartDataModel(Number[][] data, Object[] columns, String rows)(Code) | | Creates new ObjectChartDataModel with the default axis binding.
Parameters: data - the array of values. The first index specifies thedatasets, the last one is the value index. Parameters: columns - the array of x-axis values. The length of thedatasets and the length of the column should be equal and the columns shouldbe ordered. Parameters: rows - the DataSet titles |
ObjectChartDataModel | public ObjectChartDataModel(int[][] data, Object[] columns, String[] rows)(Code) | | Creates new ObjectChartDataModel.
Parameters: data - the array of values. The first index specifies thedatasets, the last one is the value index. Parameters: columns - the array of x-axis values. The length of thedatasets and the length of the column should be equal andthe columns should be ordered. Parameters: rows - the DataSet titles |
ObjectChartDataModel | public ObjectChartDataModel(double[][] data, Object[] columns, String[] rows)(Code) | | Creates new ObjectChartDataModel.
Parameters: data - the array of values. The first index specifies thedatasets, the last one is the value index. Parameters: columns - the array of x-axis values. The length of thedatasets and the length of the column should be equal andthe columns should be ordered. Parameters: rows - the DataSet titles |
ObjectChartDataModel | public ObjectChartDataModel(DataSet[] ds, Object[] columns)(Code) | | Creates a new ObjectChartDataModel using the
given array of DataSets, effectively enabling the creation
of DataModels with differently sized DataSets. Internally, the DataSets
are transformed into equally sized DataSets, where the missing data fields
are filled with Double.NaN.
Parameters: ds - the array of DataSets to be used. Parameters: 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 onlycontain some column values |
getAxisBinding | public int getAxisBinding(int set)(Code) | | Returns the axis to which a DataSet is attached
Parameters: set - the DataSet index the axis constant |
getChartDataModelConstraints | public ChartDataModelConstraints getChartDataModelConstraints(int axis)(Code) | | Returns a ChartDataModelConstraints Object for a given axis.
This way, there are different constraints for the first and for
the second y-axis. If the model is empty, the maximum values are 1 and
the minimum values are 0, thus enabling proper rendering.
Parameters: axis - the axis constant the ChartDataModelConstraints for the defined y-axis |
getColumnValueAt | public Object getColumnValueAt(int col)(Code) | | Returns a specific column value.
the column value or null if the column doesn't exist. Parameters: col - the column index |
getColumnValueAt | public Object getColumnValueAt(int set, int col)(Code) | | Calls getColumnValueAt(int col).
the column value or null if the column doesn't exist. Parameters: col - the column index |
getDataSetLength | public int getDataSetLength(int set)(Code) | | Returns the length of a certain dataset.
Parameters: set - the DataSet index the DataSet length |
getDataSetName | public String getDataSetName(int set)(Code) | | Returns the title of the DataSet. This is the number of
the DataSet per default.
Parameters: set - the DataSet index the String title |
getDataSetNumber | public int getDataSetNumber()(Code) | | Returns the total amount of datasets.
the amount of DataSet |
getFirstColumnValue | protected double getFirstColumnValue()(Code) | | Is called by the ChartDataModelConstraints Object to compute the minimum column value.
Returns 0.0. |
getLastColumnValue | protected double getLastColumnValue()(Code) | | Is called by the ChartDataModelConstraints Object to compute the maximum column value.
Returns columns.length . |
getOrderedValues | protected TreeSet getOrderedValues(int axis)(Code) | | Returns an ordered set of all data values for the specified axis.
This is called by the ChartDataModelConstraints classes.
|
getValueAt | public Number getValueAt(int set, int index)(Code) | | Returns the Value in a specific dataset at a certain index.
Parameters: set - the DataSet index Parameters: index - the value index the Number value |
setChartDataModelConstraints | public void setChartDataModelConstraints(int axis, ChartDataModelConstraints constraints)(Code) | | Sets the ChartDataModelConstraints object for the given
axis binding.
Parameters: axis - the Axis constant Parameters: constraints - the ChartDataModelConstraints object a ChartDataModelConstraints object. |
|
|