@DomEvent(value="point-click") public class PointClickEvent extends 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, unregisterListener
toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAbsoluteX, getAbsoluteY, getButton, getxAxisValue, getyAxisValue, isAltKey, isCtrlKey, isMetaKey, isShiftKey
public 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()
ClickEvent
getMouseDetails
in interface ClickEvent
public int getSeriesItemIndex()
HasSeries
getSeriesItemIndex
in interface HasSeries
public String getCategory()
getCategory
in interface HasItem
public int getItemIndex()
HasItem
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];
getItemIndex
in interface HasItem
HasItem.getItem()
,
HasItem.getItemId()
public String getItemId()
HasItem
Example for TreeSeries
:
String id = this.getItemId(); TreeSeries series = (TreeSeries) this.getSeries(); Optional<TreeSeriesItem> treeItem = series.getData().stream() .filter(item -> item.getId().equals(id)) .findFirst();
Only AbstractSeriesItem
supports 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 HasItem
HasItem.getItem()
,
HasItem.getItemIndex()
Copyright © 2023. All rights reserved.