public class SimpleXYModel extends AbstractChartModel implements XYModel
XYModel
.
A XY model is an N series of (X, Y) data objects .XYModel
,
Chart
,
Serialized FormModifier and Type | Class and Description |
---|---|
protected static class |
SimpleXYModel.XYPair |
Modifier and Type | Field and Description |
---|---|
protected List<Comparable<?>> |
_seriesList |
protected Map<Comparable<?>,List<SimpleXYModel.XYPair>> |
_seriesMap |
_listeners
Constructor and Description |
---|
SimpleXYModel() |
Modifier and Type | Method and Description |
---|---|
void |
addValue(Comparable<?> series,
Number x,
Number y)
Append an (x,y) into a series.
|
void |
addValue(Comparable<?> series,
Number x,
Number y,
int index)
Add an (x,y) into a series at specified index.
|
void |
clear()
clear this model.
|
Object |
clone() |
int |
getDataCount(Comparable<?> series)
Get data count of a specified series.
|
Collection<Comparable<?>> |
getSeries()
Get all series as a collection.
|
Comparable<?> |
getSeries(int index)
Get a series of the specified index;
|
Number |
getX(Comparable<?> series,
int index)
Get X value of a specified series and data index.
|
Number |
getY(Comparable<?> series,
int index)
Get Y value of a specified series and data index.
|
boolean |
isAutoSort()
check whether to autosort on x value for each series; default is true.
|
void |
removeSeries(Comparable<?> series)
Remove data of a specified series.
|
void |
removeValue(Comparable<?> series,
int index)
Remove (x,y) value of a specified series and data index.
|
void |
setAutoSort(boolean auto)
Set model to autosort on x value for each series.
|
void |
setValue(Comparable<?> series,
Number x,
Number y,
int index)
Replace the value of the new (x,y) into a series at specified index.
|
addChartDataListener, fireEvent, fireEvent, removeChartDataListener
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addChartDataListener, removeChartDataListener
protected Map<Comparable<?>,List<SimpleXYModel.XYPair>> _seriesMap
protected List<Comparable<?>> _seriesList
public Comparable<?> getSeries(int index)
XYModel
public Collection<Comparable<?>> getSeries()
XYModel
public int getDataCount(Comparable<?> series)
XYModel
getDataCount
in interface XYModel
series
- the specified series.public Number getX(Comparable<?> series, int index)
XYModel
public Number getY(Comparable<?> series, int index)
XYModel
public void setValue(Comparable<?> series, Number x, Number y, int index)
XYModel
public void addValue(Comparable<?> series, Number x, Number y)
XYModel
public void addValue(Comparable<?> series, Number x, Number y, int index)
XYModel
public void setAutoSort(boolean auto)
XYModel
setAutoSort
in interface XYModel
public boolean isAutoSort()
XYModel
isAutoSort
in interface XYModel
public void removeSeries(Comparable<?> series)
XYModel
removeSeries
in interface XYModel
series
- the seriespublic void removeValue(Comparable<?> series, int index)
XYModel
removeValue
in interface XYModel
series
- the series.index
- the data index.public void clear()
XYModel
public Object clone()
clone
in class AbstractChartModel
Copyright © 2019. All rights reserved.