Class DataSeriesItem
- java.lang.Object
-
- com.vaadin.flow.component.charts.model.AbstractConfigurationObject
-
- com.vaadin.flow.component.charts.model.AbstractSeriesItem
-
- com.vaadin.flow.component.charts.model.DataSeriesItem
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
BoxPlotItem
,DataSeriesItem3d
,DataSeriesItemBullet
,DataSeriesItemTimeline
,DataSeriesItemXrange
,FlagItem
,OhlcItem
,WaterFallSum
public class DataSeriesItem extends AbstractSeriesItem
The DataSeriesItem class represents a single entry in aDataSeries
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DataSeriesItem()
Creates an empty item, without values, colors, etc.DataSeriesItem(Number x, Number y)
Constructs an item with X and Y valuesDataSeriesItem(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 valueDataSeriesItem(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getCursor()
DataLabels
getDataLabels()
String
getDescription()
Dial
getDial()
Returns the current dial.Number
getHigh()
Returns the upper range for visualizations.Number
getLow()
Returns the lower range for visualizations.boolean
isCustomized()
Checks if the data can be rendered in an optimized manner.boolean
isSelected()
Checks whether or not the item is selected.protected void
makeCustomized()
Marks the item as customized, so that it can be rendered in a more optimal way.void
setColor(Color color)
Sets the individual color for the point.void
setCursor(String cursor)
Sets thecursor
CSS attribute to be shown on mouse overvoid
setDataLabels(DataLabels dataLabels)
Set the label configuration for this itemvoid
setDescription(String description)
Requires Accessibility modulevoid
setDial(Dial dial)
Sets the dial or arrow pointer of the gauge.void
setHigh(Number high)
Sets the upper range for visualizations.void
setId(String id)
Sets the ID for the point.void
setLegendIndex(Number legendIndex)
Sets the sequential index of the pie slice in the legend.void
setLow(Number low)
Sets the lower range for visualizations.void
setMarker(Marker marker)
Sets the marker of this data series itemvoid
setName(String name)
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 Detail
-
DataSeriesItem
public DataSeriesItem()
Creates an empty item, without values, colors, etc.
-
DataSeriesItem
public DataSeriesItem(String name, Number y)
Constructs an item with a name and a Y value- Parameters:
name
- Name of the item.y
- Y-value of the item.
-
DataSeriesItem
public 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.- Parameters:
name
- Name of the item.y
- Y-value of the item.color
- Color of the item.
-
DataSeriesItem
public DataSeriesItem(Number x, Number y)
Constructs an item with X and Y values- Parameters:
x
- X-value of the item.y
- Y-value of the item.
-
DataSeriesItem
public 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.- Parameters:
x
- X-value of the item.y
- Y-value of the item.color
- Color of the item.
-
DataSeriesItem
public DataSeriesItem(Instant instant, Number y)
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 public DataSeriesItem(Date date, Number y)
Deprecated.as of 4.0. UseDataSeriesItem(Instant, Number)
-
DataSeriesItem
public 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.- Parameters:
instant
- Instant of the item, as its X-value.low
- Lower value for range visualization.high
- Upper value for range visualization.
-
DataSeriesItem
@Deprecated public DataSeriesItem(Date date, Number low, Number high)
Deprecated.as of 4.0. UseDataSeriesItem(Instant, Number,Number)
-
-
Method Detail
-
setName
public void setName(String name)
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(Boolean)
-
setSelected
public void setSelected(Boolean selected)
Sets whether the data item is selected or not.- Parameters:
selected
- Whether or not the item should be selected.
-
setId
public void setId(String id)
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
public void setLegendIndex(Number legendIndex)
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
public void setMarker(Marker marker)
Sets the marker of this data series item- Overrides:
setMarker
in classAbstractSeriesItem
- Parameters:
marker
- Marker of the item.
-
setColor
public void setColor(Color color)
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
public void setDial(Dial dial)
Sets the dial or arrow pointer of the gauge.Note This is only applicable for gauge charts.
- Parameters:
dial
- Dial to use.
-
getDial
public Dial 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:
setDial(Dial)
-
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
public Number getLow()
Returns the lower range for visualizations.- Returns:
- The lower range.
-
setLow
public void setLow(Number low)
Sets the lower range for visualizations.- Parameters:
low
- New lower range.
-
getHigh
public Number getHigh()
Returns the upper range for visualizations.- Returns:
- The upper range.
-
setHigh
public void setHigh(Number high)
Sets the upper range for visualizations.- Parameters:
high
- New upper range.
-
getDataLabels
public DataLabels getDataLabels()
- Returns:
- dataLabels
- See Also:
setDataLabels(DataLabels)
-
setDataLabels
public void setDataLabels(DataLabels dataLabels)
Set the label configuration for this item- Parameters:
dataLabels
-
-
getCursor
public String getCursor()
- Returns:
- cursor
- See Also:
setCursor(String)
-
setCursor
public void setCursor(String cursor)
Sets thecursor
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
public String getDescription()
- See Also:
setDescription(String)
-
setDescription
public void setDescription(String description)
Requires Accessibility module
A description of the series to add to the screen reader information about the series.
Defaults to: undefined
-
-