com.vaadin.flow.component.charts.model.
Class DataSeriesItem
All Implemented Interfaces:
Direct Known Subclasses:
BoxPlotItem
, DataSeriesItem3d
, DataSeriesItemBullet
, DataSeriesItemSankey
, DataSeriesItemTimeline
, DataSeriesItemXrange
, FlagItem
, OhlcItem
, WaterFallSum
The DataSeriesItem class represents a single entry in a DataSeries
.
See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty item, without values, colors, etc.
DataSeriesItem
(Number x, Number y) Constructs an item with X and Y values
DataSeriesItem
(Number x, Number y, Color color) Constructs an item with numerical values for the X and Y axes and assigns the specified color to the item.
DataSeriesItem
(Number x, Number low, Number high) Constructs a DataSeriesItem with the given X, min and max values for use in range visualizations.
DataSeriesItem
(String name, Number y) Constructs an item with a name and a Y value
DataSeriesItem
(String name, Number y, Color color) Constructs an item with a name and a value on the Y-axis and assigns the specified color to the item.
DataSeriesItem
(Instant instant, Number y) Constructs a DataSeriesItem with the given instant as X value and Y value.
DataSeriesItem
(Instant instant, Number low, Number high) Constructs a DataSeriesItem with the given instant as X value with min and max values for use in range visualizations.
DataSeriesItem
(Date date, Number y) Deprecated.
as of 4.0.DataSeriesItem
(Date date, Number low, Number high) Deprecated.
as of 4.0. -
Method Summary
Modifier and TypeMethodDescriptiongetDial()
Returns the current dial.
getHigh()
Returns the upper range for visualizations.
getLow()
Returns the lower range for visualizations.
boolean
Checks if the data can be rendered in an optimized manner.
boolean
Checks whether or not the item is selected.
protected void
Marks the item as customized, so that it can be rendered in a more optimal way.
void
Sets the individual color for the point.
void
Sets the
cursor
CSS attribute to be shown on mouse overvoid
setDataLabels
(DataLabels dataLabels) Set the label configuration for this item
void
setDescription
(String description) Requires Accessibility module
void
Sets the dial or arrow pointer of the gauge.
void
Sets the upper range for visualizations.
void
Sets the ID for the point.
void
setLegendIndex
(Number legendIndex) Sets the sequential index of the pie slice in the legend.
void
Sets the lower range for visualizations.
void
Sets the marker of this data series item
void
Sets the name of the data item as shown in the legend, tooltip, dataLabel etc.
void
setSelected
(Boolean selected) Sets whether the data item is selected or not.
void
setSliced
(boolean sliced) Sets whether to display a slice offset from the center.
Methods inherited from class com.vaadin.flow.component.charts.model.AbstractSeriesItem
getClassName, getColor, getColorIndex, getId, getLegendIndex, getMarker, getName, getSliced, getX, getY, setClassName, setColorIndex, setX, setX, setX, setY
-
Constructor Details
-
DataSeriesItem
public DataSeriesItem()Creates an empty item, without values, colors, etc.
-
DataSeriesItem
Constructs an item with a name and a Y value
Parameters:
name
- Name of the item.y
- Y-value of the item. -
DataSeriesItem
Constructs an item with a name and a value on the Y-axis and assigns the specified color to the item.
Parameters:
name
- Name of the item.y
- Y-value of the item.color
- Color of the item. -
DataSeriesItem
Constructs an item with X and Y values
Parameters:
x
- X-value of the item.y
- Y-value of the item. -
DataSeriesItem
Constructs an item with numerical values for the X and Y axes and assigns the specified color to the item.
Parameters:
x
- X-value of the item.y
- Y-value of the item.color
- Color of the item. -
DataSeriesItem
Constructs a DataSeriesItem with the given instant as X value and Y value.
Parameters:
instant
- Instant of the item, as its X-value.y
- Y-value of the item. -
DataSeriesItem
Deprecated.as of 4.0. UseDataSeriesItem(Instant, Number)
-
DataSeriesItem
Constructs a DataSeriesItem with the given instant as X value with min and max values for use in range visualizations.
Parameters:
instant
- Instant of the item, as its X-value.low
- Lower value for range visualization.high
- Upper value for range visualization. -
DataSeriesItem
Deprecated.as of 4.0. UseDataSeriesItem(Instant, Number,Number)
-
DataSeriesItem
Constructs a DataSeriesItem with the given X, min and max values for use in range visualizations.
Parameters:
x
- X-value of the item.low
- Lower value for range visualization.high
- Upper value for range visualization.
-
-
Method Details
-
setName
Sets the name of the data item as shown in the legend, tooltip, dataLabel etc. Defaults to "".
Overrides:
setName
in classAbstractSeriesItem
Parameters:
name
- Name of the item. -
setSliced
public void setSliced(boolean sliced) Sets whether to display a slice offset from the center. Defaults to false. Note: This applies to pie charts only.
Overrides:
setSliced
in classAbstractSeriesItem
Parameters:
sliced
- When true, this item should be displayed with a small offset from the centre of the pie chart; when false, this item will be rendered normally. -
isSelected
public boolean isSelected()Checks whether or not the item is selected.
Returns:
true if the item is selected, false otherwise.
See Also:
-
setSelected
Sets whether the data item is selected or not.
Parameters:
selected
- Whether or not the item should be selected. -
setId
Sets the ID for the point. This can be used after rendering to get a reference to the point object. Defaults to null.
Overrides:
setId
in classAbstractSeriesItem
Parameters:
id
- New id. -
setLegendIndex
Sets the sequential index of the pie slice in the legend. Defaults to undefined. Note This applies to pie charts only.
Overrides:
setLegendIndex
in classAbstractSeriesItem
Parameters:
legendIndex
- Index in the legend. -
setMarker
Sets the marker of this data series item
Overrides:
setMarker
in classAbstractSeriesItem
Parameters:
marker
- Marker of the item. -
setColor
Sets the individual color for the point. Defaults to null. This might not work for all chart types.
Overrides:
setColor
in classAbstractSeriesItem
Parameters:
color
- Color of the item. -
setDial
Sets the dial or arrow pointer of the gauge.
Note This is only applicable for gauge charts.
Parameters:
dial
- Dial to use. -
getDial
Returns the current dial. This is only applicable for gauge charts.
Returns:
The dial or arrow pointer of a gauge chart. Only applicable for gauge charts.
See Also:
-
isCustomized
public boolean isCustomized()Checks if the data can be rendered in an optimized manner.
Returns:
true if the data series item can be rendered in optimized manner, false otherwise.
-
makeCustomized
protected void makeCustomized()Marks the item as customized, so that it can be rendered in a more optimal way.
-
getLow
Returns the lower range for visualizations.
Returns:
The lower range.
-
setLow
Sets the lower range for visualizations.
Parameters:
low
- New lower range. -
getHigh
Returns the upper range for visualizations.
Returns:
The upper range.
-
setHigh
Sets the upper range for visualizations.
Parameters:
high
- New upper range. -
getDataLabels
Returns:
dataLabels
See Also:
-
setDataLabels
Set the label configuration for this item
Parameters:
dataLabels
- -
getCursor
Returns:
cursor
See Also:
-
setCursor
Sets the
cursor
CSS attribute to be shown on mouse overAccepts CSS
cursor
values like: alias, all-scroll, auto, cell, context-menu, col-resize, copy, crosshair, default, e-resize, ew-resize, grab, grabbing, help, move, n-resize, ne-resize, nesw-resize, ns-resize, nw-resize, nwse-resize, no-drop, none, not-allowed, pointer, progress, row-resize, s-resize, se-resize, sw-resize, text, vertical-text, w-resize, wait, zoom-in, zoom-outNote that not all browsers have support for all values.
Parameters:
cursor
- -
getDescription
See Also:
-
setDescription
Requires Accessibility module
A description of the series to add to the screen reader information about the series.
Defaults to: undefined
-