Class ListSeries

  • All Implemented Interfaces:
    Series, Serializable

    public class ListSeries
    extends AbstractSeries
    A series consisting of a list of numerical values. In this case, the numerical values will be interpreted as Y values, and X values will be automatically calculated, either starting at 0 and incrementing by 1, or from pointStart and pointInterval given in the plotOptions. If the axis has categories, these will be used. This option is not available for range series.
    See Also:
    Serialized Form
    • Constructor Detail

      • ListSeries

        public ListSeries()
      • ListSeries

        public ListSeries​(String name)
        Constructs a ListSeries with the given series name.
        Parameters:
        name -
      • ListSeries

        public ListSeries​(Number... values)
        Constructs a ListSeries with the given array of values.
        Parameters:
        values -
      • ListSeries

        public ListSeries​(Collection<Number> values)
        Constructs a ListSeries with the given collection of values.
        Parameters:
        values - the values to use
      • ListSeries

        public ListSeries​(String name,
                          Number... values)
        Constructs a ListSeries with the given series name and array of values.
        Parameters:
        name -
        values -
      • ListSeries

        public ListSeries​(String name,
                          Collection<Number> values)
        Constructs a ListSeries with the given series name and collection of values.
        Parameters:
        name - the name of the series
        values - the values to use
    • Method Detail

      • getData

        public Number[] getData()
        Returns:
        An array of the numeric values
      • setData

        public void setData​(Number... values)
        Sets the values in the list series to the ones provided.
        Parameters:
        values -
      • setData

        public void setData​(List<Number> data)
        Sets the given list of numeric values as the values in this list series.
        Parameters:
        data -
      • addData

        public void addData​(Number number)
        Adds a given number to the series and immediately updates the chart if it already has been drawn. If the chart has not yet been drawn all items are added to the chart when it is drawn the first time.
        Parameters:
        number - the number to be added to the series
      • addData

        public void addData​(Number number,
                            boolean updateChartImmediately,
                            boolean shift)
        Adds a given number to the series and optionally immediately updates the chart if it has been drawn. This method is useful if you want to add many items without a client/server round-trip for each item added. Do this by specifying false for the updateChartImmediately parameter.
        Parameters:
        number - the number to be added to the series
        updateChartImmediately - if true the chart will be dynamically updated, using animation if enabled.
        shift - If true, the first item from the series is removed. Handy if dynamically adjusting adding points and fixed amount of points should be kept visible.
      • updatePoint

        public void updatePoint​(int pointIndex,
                                Number newValue)
        Updates the value of the data point at pointIndex to newValue and immediately updates it on the chart using animation if enabled.
        Parameters:
        pointIndex - the index of the point to update
        newValue - the new value of the point