Package org.zkoss.zul
Class SimpleXYModel
java.lang.Object
org.zkoss.zul.AbstractChartModel
org.zkoss.zul.SimpleXYModel
- All Implemented Interfaces:
Serializable,ChartModel,XYModel
- Direct Known Subclasses:
SimpleXYZModel
A XY data model implementation of
XYModel.
A XY model is an N series of (X, Y) data objects .- Author:
- henrichen
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<Comparable<?>>protected Map<Comparable<?>,List<SimpleXYModel.XYPair>> Fields inherited from class org.zkoss.zul.AbstractChartModel
_listeners -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddValue(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.clone()intgetDataCount(Comparable<?> series) Get data count of a specified series.Collection<Comparable<?>>Get all series as a collection.Comparable<?>getSeries(int index) Get a series of the specified index;getX(Comparable<?> series, int index) Get X value of a specified series and data index.getY(Comparable<?> series, int index) Get Y value of a specified series and data index.booleancheck 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.zul.AbstractChartModel
addChartDataListener, fireEvent, removeChartDataListenerMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.zkoss.zul.ChartModel
addChartDataListener, removeChartDataListener
-
Field Details
-
_seriesMap
-
_seriesList
-
-
Constructor Details
-
SimpleXYModel
public SimpleXYModel()
-
-
Method Details
-
getSeries
Description copied from interface:XYModelGet a series of the specified index; -
getSeries
Description copied from interface:XYModelGet all series as a collection. -
getDataCount
Description copied from interface:XYModelGet data count of a specified series.- Specified by:
getDataCountin interfaceXYModel- Parameters:
series- the specified series.
-
getX
Description copied from interface:XYModelGet X value of a specified series and data index. -
getY
Description copied from interface:XYModelGet Y value of a specified series and data index. -
setValue
Description copied from interface:XYModelReplace the value of the new (x,y) into a series at specified index. -
addValue
Description copied from interface:XYModelAppend an (x,y) into a series. -
addValue
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
Description copied from interface:XYModelRemove data of a specified series.- Specified by:
removeSeriesin interfaceXYModel- Parameters:
series- the series
-
removeValue
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
- Overrides:
clonein classAbstractChartModel
-