| java.lang.Object de.progra.charting.model.AbstractChartDataModel de.progra.charting.model.DefaultChartDataModel
All known Subclasses: de.progra.charting.model.EditableChartDataModel,
DefaultChartDataModel | public class DefaultChartDataModel extends AbstractChartDataModel (Code) | | Implements a default ChartModel. It uses a DataSet[] and the columns
are numeric. It's purely read-only.
author: mueller version: 1.0 |
Constructor Summary | |
public | DefaultChartDataModel() Creates a new empty DefaultChartDataModel. | public | DefaultChartDataModel(Number[][] data, double[] columns, String[] rows) Creates new DefaultChartDataModel with the default axis binding.
Parameters: data - the array of values. | public | DefaultChartDataModel(int[][] data, double[] columns, String[] rows) Creates new DefaultChartDataModel.
Parameters: data - the array of values. | public | DefaultChartDataModel(double[][] data, double[] columns, String[] rows) Creates new DefaultChartDataModel.
Parameters: data - the array of values. | public | DefaultChartDataModel(DataSet[] ds) Creates a new DefaultChartDataModel using the
given array of DataSets, effectively enabling the creation
of DataModels with differently sized DataSets. |
columnSet | protected TreeSet columnSet(Code) | | The sorted x-axis values used for calculating the constraints.
|
valuesbyaxis | protected HashMap valuesbyaxis(Code) | | A HashMap containing the ordered data used for calculating the constraints.
|
DefaultChartDataModel | public DefaultChartDataModel()(Code) | | Creates a new empty DefaultChartDataModel.
|
DefaultChartDataModel | public DefaultChartDataModel(Number[][] data, double[] columns, String[] rows)(Code) | | Creates new DefaultChartDataModel 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 array of DataSet titles. It has to have the samelength as the number of DataSets. |
DefaultChartDataModel | public DefaultChartDataModel(int[][] data, double[] columns, String[] rows)(Code) | | Creates new DefaultChartDataModel.
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 array of DataSet titles. It has to have the samelength as the number of DataSets. |
DefaultChartDataModel | public DefaultChartDataModel(double[][] data, double[] columns, String[] rows)(Code) | | Creates new DefaultChartDataModel.
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 array of DataSet titles. It has to have the samelength as the number of DataSets. |
DefaultChartDataModel | public DefaultChartDataModel(DataSet[] ds)(Code) | | Creates a new DefaultChartDataModel using the
given array of DataSets, effectively enabling the creation
of DataModels with differently sized DataSets.
Parameters: ds - the array of DataSets to be used. |
getAxisBinding | public int getAxisBinding(int set)(Code) | | Returns the axis binding for a DataSet
Parameters: set - the DataSet index an axis binding 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. a ChartDataModelConstraints object with the constraintsfor the specified y-axis. |
getColumnClass | public Class getColumnClass()(Code) | | Returns the class of the column values.
Double.class |
getColumnValueAt | public Object getColumnValueAt(int col)(Code) | | Use getColumnValue(int set, int col) instead, because DefaultChartDataModel
can contain DataSets with different lengths and column values.
null |
getColumnValueAt | public Object getColumnValueAt(int set, int col)(Code) | | Returns a specific column value.
the column value or null if the column doesn't exist. Parameters: col - the column index Parameters: set - the DataSet of which the column value is desired |
getDataSetLength | public int getDataSetLength(int set)(Code) | | Returns the length of a certain dataset.
Parameters: set - the DataSet the length of the DataSet |
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 DataSets |
getFirstColumnValue | protected double getFirstColumnValue()(Code) | | Returns the first ordered column value for use by the ChartDataModelConstraints.
|
getLastColumnValue | protected double getLastColumnValue()(Code) | | Returns the last ordered column value for use by the ChartDataModelConstraints.
|
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 at the specified position |
isColumnNumeric | public boolean isColumnNumeric()(Code) | | Returns true if the columns are numeric.
true |
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. |
trimSet | protected void trimSet(TreeSet s)(Code) | | Removes infinite and NaN values from a TreeSet. Called with the TreeSet
containing all values. If asymptotic functions are plotted, infinite values
are the max / min values, resulting in bogus point-to-pixel rations. Therefore,
these values are omitted from these calculations.
|
|
|