@DomEvent(value="point-mouse-over") public class PointMouseOverEvent extends com.vaadin.flow.component.ComponentEvent<Chart> implements HasItem
source| Constructor and Description |
|---|
PointMouseOverEvent(Chart source,
boolean fromClient,
int seriesIndex,
int pointIndex,
String pointId,
String category) |
| Modifier and Type | Method and 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
|
getSource, isFromClient, unregisterListenertoStringpublic PointMouseOverEvent(Chart source, boolean fromClient, @EventData(value="event.detail.originalEvent.target.series.index") int seriesIndex, @EventData(value="event.detail.originalEvent.target.index") int pointIndex, @EventData(value="event.detail.originalEvent.target.id") String pointId, @EventData(value="event.detail.originalEvent.target.category") String category)
public String getCategory()
getCategory in interface HasItempublic int getItemIndex()
HasItemHasSeries.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];
getItemIndex in interface HasItemHasItem.getItem(),
HasItem.getItemId()public String getItemId()
HasItem
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 and Node support setting an ID.
For other types of series items this property will always return null.
For AbstractSeriesItem the ID is optional. Unless the developer
has explicitly set an ID for the item associated with the event, this
property will be null. See HasItem.getItem() or HasItem.getItemIndex()
for alternatives.
getItemId in interface HasItemHasItem.getItem(),
HasItem.getItemIndex()public int getSeriesItemIndex()
HasSeriesgetSeriesItemIndex in interface HasSeriesCopyright © 2024. All rights reserved.