Package org.zkoss.chart.model
Class DefaultXYModel
- java.lang.Object
-
- org.zkoss.chart.model.AbstractChartsModel
-
- org.zkoss.chart.model.DefaultXYModel
-
- All Implemented Interfaces:
Serializable,ChartsModel,XYModel
- Direct Known Subclasses:
DefaultLowHighModel,DefaultXYZModel
public class DefaultXYModel extends AbstractChartsModel implements XYModel
A XY data model implementation ofXYModel. A XY model is an N series of (X, Y) data objects .- Author:
- jumperchen
- See Also:
XYModel,Charts, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classDefaultXYModel.XYPair
-
Field Summary
Fields Modifier and Type Field Description protected List<Comparable<?>>_seriesListprotected Map<Comparable<?>,List<DefaultXYModel.XYPair>>_seriesMap-
Fields inherited from class org.zkoss.chart.model.AbstractChartsModel
_listeners
-
-
Constructor Summary
Constructors Constructor Description DefaultXYModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddValue(Comparable<?> series, Number x, Number y)Append an (x,y) into a series.voidaddValue(Comparable<?> series, Number x, Number y, int index)Add an (x,y) into a series at specified index.voidclear()clear this model.Objectclone()intgetDataCount(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;NumbergetX(Comparable<?> series, int index)Get X value of a specified series and data index.NumbergetY(Comparable<?> series, int index)Get Y value of a specified series and data index.booleanisAutoSort()check whether to autosort on x value for each series; default is true.voidremoveSeries(Comparable<?> series)/** Remove data of a specified series.voidremoveValue(Comparable<?> series, int index)Remove (x,Y) value of a specified series and data index.voidsetAutoSort(boolean auto)Set model to autosort on x value for each series.voidsetValue(Comparable<?> series, Number x, Number y, int index)Replace the value of the new (x,y) into a series at specified index.-
Methods inherited from class org.zkoss.chart.model.AbstractChartsModel
addChartsDataListener, fireEvent, removeChartsDataListener
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.zkoss.chart.model.ChartsModel
addChartsDataListener, removeChartsDataListener
-
-
-
-
Field Detail
-
_seriesMap
protected Map<Comparable<?>,List<DefaultXYModel.XYPair>> _seriesMap
-
_seriesList
protected List<Comparable<?>> _seriesList
-
-
Method Detail
-
getSeries
public Comparable<?> getSeries(int index)
Description copied from interface:XYModelGet a series of the specified index;
-
getSeries
public Collection<Comparable<?>> getSeries()
Description copied from interface:XYModelGet all series as a collection.
-
getDataCount
public int getDataCount(Comparable<?> series)
Description copied from interface:XYModelGet data count of a specified series.- Specified by:
getDataCountin interfaceXYModel- Parameters:
series- the specified series.
-
getX
public Number getX(Comparable<?> series, int index)
Description copied from interface:XYModelGet X value of a specified series and data index.
-
getY
public Number getY(Comparable<?> series, int index)
Description copied from interface:XYModelGet Y value of a specified series and data index.
-
setValue
public void setValue(Comparable<?> series, Number x, Number y, int index)
Description copied from interface:XYModelReplace the value of the new (x,y) into a series at specified index.
-
addValue
public void addValue(Comparable<?> series, Number x, Number y)
Description copied from interface:XYModelAppend an (x,y) into a series.
-
addValue
public void addValue(Comparable<?> series, Number x, Number y, int index)
Description copied from interface:XYModelAdd an (x,y) into a series at specified index.
-
setAutoSort
public void setAutoSort(boolean auto)
Description copied from interface:XYModelSet model to autosort on x value for each series.- Specified by:
setAutoSortin interfaceXYModel
-
isAutoSort
public boolean isAutoSort()
Description copied from interface:XYModelcheck whether to autosort on x value for each series; default is true.- Specified by:
isAutoSortin interfaceXYModel
-
removeSeries
public void removeSeries(Comparable<?> series)
Description copied from interface:XYModel/** Remove data of a specified series.- Specified by:
removeSeriesin interfaceXYModel- Parameters:
series- the series
-
removeValue
public void removeValue(Comparable<?> series, int index)
Description copied from interface:XYModelRemove (x,Y) value of a specified series and data index.- Specified by:
removeValuein interfaceXYModel- Parameters:
series- the series.index- the data index.
-
clear
public void clear()
Description copied from interface:XYModelclear this model.
-
clone
public Object clone()
- Overrides:
clonein classAbstractChartsModel
-
-