com.vaadin.flow.component.charts.model.

Class DataSeriesItem

All Implemented Interfaces:

Serializable

Direct Known Subclasses:

BoxPlotItem, DataSeriesItem3d, DataSeriesItemBullet, DataSeriesItemSankey, DataSeriesItemTimeline, DataSeriesItemXrange, FlagItem, OhlcItem, WaterFallSum

public class DataSeriesItem extends AbstractSeriesItem

The DataSeriesItem class represents a single entry in a DataSeries.

See Also:

  • Constructor Details

    • 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.
    • 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.
    • DataSeriesItem

      public DataSeriesItem(Number x, Number low, Number high)

      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

      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 class AbstractSeriesItem

      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 class AbstractSeriesItem

      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

      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 class AbstractSeriesItem

      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 class AbstractSeriesItem

      Parameters:

      legendIndex - Index in the legend.

    • setMarker

      public void setMarker(Marker marker)

      Sets the marker of this data series item

      Overrides:

      setMarker in class AbstractSeriesItem

      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 class AbstractSeriesItem

      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:

    • 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

      public void setDataLabels(DataLabels dataLabels)

      Set the label configuration for this item

      Parameters:

      dataLabels -

    • getCursor

      public String getCursor()

      Returns:

      cursor

      See Also:

    • setCursor

      public void setCursor(String cursor)

      Sets the cursor CSS attribute to be shown on mouse over

      Accepts 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-out

      Note that not all browsers have support for all values.

      Parameters:

      cursor -

    • getDescription

      public String getDescription()

      See Also:

    • 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