com.vaadin.flow.component.charts.model.
Class ListSeries
All Implemented Interfaces:
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:
-
Constructor Summary
ConstructorsConstructorDescriptionListSeries
(Number... values) Constructs a ListSeries with the given array of values.
ListSeries
(String name) Constructs a ListSeries with the given series name.
ListSeries
(String name, Number... values) Constructs a ListSeries with the given series name and array of values.
ListSeries
(String name, Collection<Number> values) Constructs a ListSeries with the given series name and collection of values.
ListSeries
(Collection<Number> values) Constructs a ListSeries with the given collection of values.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a given number to the series and immediately updates the chart if it already has been drawn.
void
Adds a given number to the series and optionally immediately updates the chart if it has been drawn.
Number[]
getData()
void
Sets the values in the list series to the ones provided.
void
Sets the given list of numeric values as the values in this list series.
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.
Methods inherited from class com.vaadin.flow.component.charts.model.AbstractSeries
getColorAxis, getConfiguration, getId, getName, getPlotOptions, getStack, getxAxis, getyAxis, isVisible, setColorAxis, setConfiguration, setId, setName, setPlotOptions, setStack, setVisible, setVisible, setxAxis, setyAxis, setyAxis, updateSeries
-
Constructor Details
-
ListSeries
public ListSeries() -
ListSeries
Constructs a ListSeries with the given series name.
Parameters:
name
- -
ListSeries
Constructs a ListSeries with the given array of values.
Parameters:
values
- -
ListSeries
Constructs a ListSeries with the given collection of values.
Parameters:
values
- the values to use -
ListSeries
Constructs a ListSeries with the given series name and array of values.
Parameters:
name
-values
- -
ListSeries
Constructs a ListSeries with the given series name and collection of values.
Parameters:
name
- the name of the seriesvalues
- the values to use
-
-
Method Details
-
getData
Returns:
An array of the numeric values
-
setData
Sets the values in the list series to the ones provided.
Parameters:
values
- -
setData
Sets the given list of numeric values as the values in this list series.
Parameters:
data
- -
addData
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
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 seriesupdateChartImmediately
- 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
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 updatenewValue
- the new value of the point
-