public class ChartModel extends 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(String... series)
Constructs a chart model with initialized series set.
|
Modifier and Type | Method and Description |
---|---|
void |
addAnnotation(String key,
Object value)
Inserts a new annotation.
|
ChartModel.DataPoint |
addDataPoint(Object label)
Adds a data point to the chart model.
|
int |
dataPointCount()
Returns the number of data points in this chart model.
|
Collection<ChartModel.Annot> |
getAnnotations()
Returns the annotations in this chart.
|
ChartModel.DataPoint[] |
getDataPoints()
Returns all of data points in order.
|
Object[] |
getLabels()
Returns all of labels in order.
|
ChartModel.DataPoint |
getLastDataPoint()
Returns the last element inside all of data points.
|
String[] |
getSeries()
Returns all of series.
|
int |
seriesCount()
Returns the number of series in this chart model.
|
public ChartModel(String... series)
series
- a set of seriespublic int seriesCount()
public ChartModel.DataPoint addDataPoint(Object label)
label
- label instancepublic String[] getSeries()
public ChartModel.DataPoint[] getDataPoints()
public Object[] getLabels()
public int dataPointCount()
public ChartModel.DataPoint getLastDataPoint()
public void addAnnotation(String key, Object value)
key
- key of annotationvalue
- value of annotationpublic Collection<ChartModel.Annot> getAnnotations()