com.vaadin.flow.component.charts.events.
Class PointSelectEvent
All Implemented Interfaces:
The PointSelectEvent class stores data for select events on the points of the chart.
See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionPointSelectEvent(Chart source, boolean fromClient, int seriesIndex, String category, int pointIndex, String pointId) -
Method Summary
Modifier and TypeMethodDescriptionThe ID of the series item that is associated with the event.
intReturns the index of the series item, that is associated with this event, in
HasSeries.getSeries().intReturns the index of the series
Methods inherited from class com.vaadin.flow.component.ComponentEvent
getSource, isFromClient, unregisterListenerMethods inherited from class java.util.EventObject
toString
-
Constructor Details
-
PointSelectEvent
public PointSelectEvent(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.index") int pointIndex, @EventData("event.detail.originalEvent.target.id") String pointId)
-
-
Method Details
-
getSeriesItemIndex
public int getSeriesItemIndex()Description copied from interface:
HasSeriesReturns the index of the series
Specified by:
getSeriesItemIndexin interfaceHasSeriesReturns:
-
getCategory
Specified by:
getCategoryin interfaceHasItem -
getItemIndex
public int getItemIndex()Description copied from interface:
HasItemReturns 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:
getItemIndexin interfaceHasItemReturns:
the index of the item in the series
See Also:
-
getItemId
Description copied from interface:
HasItemThe 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
AbstractSeriesItemandNodesupport setting an ID. For other types of series items this property will always return null. ForAbstractSeriesItemthe 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.
-