@DomEvent(value="point-click") public class PointClickEvent extends com.vaadin.flow.component.ComponentEvent<Chart> implements ClickEvent, HasItem
source| Constructor and Description |
|---|
PointClickEvent(Chart source,
boolean fromClient,
int pageX,
int pageY,
boolean altKey,
boolean ctrlKey,
boolean metaKey,
boolean shiftKey,
int button,
double x,
double y,
int seriesIndex,
String category,
int pointIndex,
String pointId)
Constructs a PointClickEvent
|
| 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(). |
MouseEventDetails |
getMouseDetails()
Gets the mouse click details
|
int |
getSeriesItemIndex()
Returns the index of the series
|
getSource, isFromClient, unregisterListenertoStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAbsoluteX, getAbsoluteY, getButton, getxAxisValue, getyAxisValue, isAltKey, isCtrlKey, isMetaKey, isShiftKeypublic PointClickEvent(Chart source, boolean fromClient, @EventData(value="event.detail.originalEvent.pageX") int pageX, @EventData(value="event.detail.originalEvent.pageY") int pageY, @EventData(value="event.detail.originalEvent.altKey") boolean altKey, @EventData(value="event.detail.originalEvent.ctrlKey") boolean ctrlKey, @EventData(value="event.detail.originalEvent.metaKey") boolean metaKey, @EventData(value="event.detail.originalEvent.shiftKey") boolean shiftKey, @EventData(value="event.detail.originalEvent.button") int button, @EventData(value="event.detail.originalEvent.point.x") double x, @EventData(value="event.detail.originalEvent.point.y") double y, @EventData(value="event.detail.originalEvent.point.series.index") int seriesIndex, @EventData(value="event.detail.originalEvent.point.category") String category, @EventData(value="event.detail.originalEvent.point.index") int pointIndex, @EventData(value="event.detail.originalEvent.point.id") String pointId)
source - fromClient - pageX - pageY - altKey - ctrlKey - metaKey - shiftKey - button - seriesIndex - category - pointIndex - pointId - public MouseEventDetails getMouseDetails()
ClickEventgetMouseDetails in interface ClickEventpublic int getSeriesItemIndex()
HasSeriesgetSeriesItemIndex in interface HasSeriespublic 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()Copyright © 2023. All rights reserved.