Package org.zkoss.zul

Class SimpleXYModel

All Implemented Interfaces:
Serializable, ChartModel, XYModel
Direct Known Subclasses:
SimpleXYZModel

public class SimpleXYModel extends AbstractChartModel implements XYModel
A XY data model implementation of XYModel. A XY model is an N series of (X, Y) data objects .
Author:
henrichen
See Also:
  • Field Details

  • Constructor Details

    • SimpleXYModel

      public SimpleXYModel()
  • Method Details

    • getSeries

      public Comparable<?> getSeries(int index)
      Description copied from interface: XYModel
      Get a series of the specified index;
      Specified by:
      getSeries in interface XYModel
    • getSeries

      public Collection<Comparable<?>> getSeries()
      Description copied from interface: XYModel
      Get all series as a collection.
      Specified by:
      getSeries in interface XYModel
    • getDataCount

      public int getDataCount(Comparable<?> series)
      Description copied from interface: XYModel
      Get data count of a specified series.
      Specified by:
      getDataCount in interface XYModel
      Parameters:
      series - the specified series.
    • getX

      public Number getX(Comparable<?> series, int index)
      Description copied from interface: XYModel
      Get X value of a specified series and data index.
      Specified by:
      getX in interface XYModel
      Parameters:
      series - the series.
      index - the data index.
    • getY

      public Number getY(Comparable<?> series, int index)
      Description copied from interface: XYModel
      Get Y value of a specified series and data index.
      Specified by:
      getY in interface XYModel
      Parameters:
      series - the series.
      index - the data index.
    • setValue

      public void setValue(Comparable<?> series, Number x, Number y, int index)
      Description copied from interface: XYModel
      Replace the value of the new (x,y) into a series at specified index.
      Specified by:
      setValue in interface XYModel
      Parameters:
      series - the series
      x - the x value
      y - the y value
      index - the data index
    • addValue

      public void addValue(Comparable<?> series, Number x, Number y)
      Description copied from interface: XYModel
      Append an (x,y) into a series.
      Specified by:
      addValue in interface XYModel
      Parameters:
      series - the series.
      x - the x value.
      y - the y value.
    • addValue

      public void addValue(Comparable<?> series, Number x, Number y, int index)
      Description copied from interface: XYModel
      Add an (x,y) into a series at specified index.
      Specified by:
      addValue in interface XYModel
      Parameters:
      series - the series.
      x - the x value.
      y - the y value.
      index - the data index.
    • setAutoSort

      public void setAutoSort(boolean auto)
      Description copied from interface: XYModel
      Set model to autosort on x value for each series.
      Specified by:
      setAutoSort in interface XYModel
    • isAutoSort

      public boolean isAutoSort()
      Description copied from interface: XYModel
      check whether to autosort on x value for each series; default is true.
      Specified by:
      isAutoSort in interface XYModel
    • removeSeries

      public void removeSeries(Comparable<?> series)
      Description copied from interface: XYModel
      Remove data of a specified series.
      Specified by:
      removeSeries in interface XYModel
      Parameters:
      series - the series
    • removeValue

      public void removeValue(Comparable<?> series, int index)
      Description copied from interface: XYModel
      Remove (x,y) value of a specified series and data index.
      Specified by:
      removeValue in interface XYModel
      Parameters:
      series - the series.
      index - the data index.
    • clear

      public void clear()
      Description copied from interface: XYModel
      clear this model.
      Specified by:
      clear in interface XYModel
    • clone

      public Object clone()
      Overrides:
      clone in class AbstractChartModel