com.vaadin.flow.component.charts.events.
Class PointRemoveEvent
- java.lang.Object
-
- java.util.EventObject
-
- com.vaadin.flow.component.ComponentEvent<Chart>
-
- com.vaadin.flow.component.charts.events.PointRemoveEvent
-
All Implemented Interfaces:
@DomEvent("point-remove") public class PointRemoveEvent extends ComponentEvent<Chart> implements HasItem
The PointRemoveEvent class stores data for remove events on the points of the chart
See Also:
-
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description PointRemoveEvent​(Chart source, boolean fromClient, int seriesIndex, String category, double x, double y, int pointIndex, String pointId)
-
Method Summary
All Methods Modifier and Type Method Description String
getCategory()
String
getItemId()
The ID of the series item that is associated with the event.
int
getItemIndex()
Returns the index of the series item, that is associated with this event, in
HasSeries.getSeries()
.int
getSeriesItemIndex()
Returns the index of the series
double
getxValue()
double
getyValue()
-
Methods inherited from class com.vaadin.flow.component.ComponentEvent
getSource, isFromClient, unregisterListener
-
Methods inherited from class java.util.EventObject
toString
-
-
-
-
Constructor Detail
-
PointRemoveEvent
public PointRemoveEvent​(Chart source, boolean fromClient, @EventData("event.detail.originalEvent.target.series.index") int seriesIndex, @EventData("event.detail.originalEvent.target.category") String category, @EventData("event.detail.originalEvent.target.x") double x, @EventData("event.detail.originalEvent.target.y") double y, @EventData("event.detail.originalEvent.target.index") int pointIndex, @EventData("event.detail.originalEvent.target.id") String pointId)
-
-
Method Detail
-
getSeriesItemIndex
public int getSeriesItemIndex()
Description copied from interface:
HasSeries
Returns the index of the series
Specified by:
getSeriesItemIndex
in interfaceHasSeries
Returns:
-
getCategory
public String getCategory()
Specified by:
getCategory
in interfaceHasItem
-
getItemIndex
public int getItemIndex()
Description copied from interface:
HasItem
Returns the index of the series item, that is associated with this event, in
HasSeries.getSeries()
. Can be used to identify the item within the series.Example for
ListSeries
:int itemIndex = event.getItemIndex(); ListSeries series = (ListSeries) event.getSeries(); Number datum = series.getData()[itemIndex];
Specified by:
getItemIndex
in interfaceHasItem
Returns:
the index of the item in the series
See Also:
-
getxValue
public double getxValue()
-
getyValue
public double getyValue()
-
getItemId
public String getItemId()
Description copied from interface:
HasItem
The ID of the series item that is associated with the event. Can be used to identify the item within the series.
Example for
NodeSeries
:String id = this.getItemId(); NodeSeries series = (NodeSeries) this.getSeries(); Optional<Node> nodeForId = series.getNodes().stream() .filter(node -> node.getId().equals(id)) .findFirst();
Only
AbstractSeriesItem
andNode
support setting an ID. For other types of series items this property will always return null. ForAbstractSeriesItem
the ID is optional. Unless the developer has explicitly set an ID for the item associated with the event, this property will be null. SeeHasItem.getItem()
orHasItem.getItemIndex()
for alternatives.
-
-