@DomEvent(value="point-update") public class PointUpdateEvent extends ComponentEvent<Chart> implements HasItem
source
Constructor and Description |
---|
PointUpdateEvent(Chart source,
boolean fromClient,
int seriesIndex,
String category,
int pointIndex,
String pointId,
Double oldXValue,
Double oldYValue,
Double newXValue,
Double newYValue) |
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() . |
Double |
getOldXValue() |
Double |
getOldYValue() |
int |
getSeriesItemIndex()
Returns the index of the series
|
Double |
getxValue() |
Double |
getyValue() |
getSource, isFromClient, unregisterListener
toString
public PointUpdateEvent(Chart source, boolean fromClient, @EventData(value="event.detail.originalEvent.target.series.index") int seriesIndex, @EventData(value="event.detail.originalEvent.target.category") String category, @EventData(value="event.detail.originalEvent.target.index") int pointIndex, @EventData(value="event.detail.originalEvent.target.id") String pointId, @EventData(value="event.detail.originalEvent.target.x") Double oldXValue, @EventData(value="event.detail.originalEvent.target.y") Double oldYValue, @EventData(value="event.detail.originalEvent.options.x") Double newXValue, @EventData(value="event.detail.originalEvent.options.y") Double newYValue)
public Double getOldXValue()
public Double getOldYValue()
public Double getxValue()
public Double getyValue()
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 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 HasItem
HasItem.getItem()
,
HasItem.getItemIndex()
Copyright © 2024. All rights reserved.