public class ChartModel
extends java.lang.Object
Note that this is not a full MVC type model; the expected usage pattern is to create an empty chart, add data points (by consulting the business model), and produce the list of data points which contain a label and a set of data values for all serials.
Modifier and Type | Class and Description |
---|---|
class |
ChartModel.Annot
Model of an annotation.
|
class |
ChartModel.DataPoint
A class of data point.
|
Constructor and Description |
---|
ChartModel(java.lang.String... series)
Constructs a chart model with initialized series set.
|
Modifier and Type | Method and Description |
---|---|
void |
addAnnotation(java.lang.String key,
java.lang.Object value)
Inserts a new annotation.
|
ChartModel.DataPoint |
addDataPoint(java.lang.Object label)
Adds a data point to the chart model.
|
int |
dataPointCount()
Returns the number of data points in this chart model.
|
java.util.Collection<ChartModel.Annot> |
getAnnotations()
Returns the annotations in this chart.
|
ChartModel.DataPoint[] |
getDataPoints()
Returns all of data points in order.
|
java.lang.Object[] |
getLabels()
Returns all of labels in order.
|
ChartModel.DataPoint |
getLastDataPoint()
Returns the last element inside all of data points.
|
java.lang.String[] |
getSeries()
Returns all of series.
|
int |
seriesCount()
Returns the number of series in this chart model.
|
public ChartModel(java.lang.String... series)
series
- a set of seriespublic int seriesCount()
public ChartModel.DataPoint addDataPoint(java.lang.Object label)
label
- label instancepublic java.lang.String[] getSeries()
public ChartModel.DataPoint[] getDataPoints()
public java.lang.Object[] getLabels()
public int dataPointCount()
public ChartModel.DataPoint getLastDataPoint()
public void addAnnotation(java.lang.String key, java.lang.Object value)
key
- key of annotationvalue
- value of annotationpublic java.util.Collection<ChartModel.Annot> getAnnotations()