Class PointLegendItemClickEvent
- java.lang.Object
-
- java.util.EventObject
-
- com.vaadin.flow.component.ComponentEvent<Chart>
-
- com.vaadin.flow.component.charts.events.PointLegendItemClickEvent
-
- All Implemented Interfaces:
ClickEvent,HasItem,HasSeries,Serializable
@DomEvent("point-legend-item-click") public class PointLegendItemClickEvent extends ComponentEvent<Chart> implements ClickEvent, HasItem
The PointLegendItemClickEvent class stores information on click events on the charts's legend items that correspond to a chart point.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description PointLegendItemClickEvent(Chart source, boolean fromClient, int pageX, int pageY, boolean altKey, boolean ctrlKey, boolean metaKey, boolean shiftKey, int button, int seriesIndex, String category, int pointIndex, String pointId)Constructs a SeriesLegendItemClickEvent
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetCategory()StringgetItemId()The ID of the series item that is associated with the event.intgetItemIndex()Returns the index of the series item, that is associated with this event, inHasSeries.getSeries().MouseEventDetailsgetMouseDetails()Gets the mouse click detailsintgetSeriesItemIndex()Returns the index of the series-
Methods inherited from class com.vaadin.flow.component.ComponentEvent
getSource, isFromClient, unregisterListener
-
Methods inherited from class java.util.EventObject
toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.vaadin.flow.component.charts.events.ClickEvent
getAbsoluteX, getAbsoluteY, getButton, getxAxisValue, getyAxisValue, isAltKey, isCtrlKey, isMetaKey, isShiftKey
-
-
-
-
Constructor Detail
-
PointLegendItemClickEvent
public PointLegendItemClickEvent(Chart source, boolean fromClient, @EventData("event.detail.originalEvent.browserEvent.pageX") int pageX, @EventData("event.detail.originalEvent.browserEvent.pageY") int pageY, @EventData("event.detail.originalEvent.browserEvent.altKey") boolean altKey, @EventData("event.detail.originalEvent.browserEvent.ctrlKey") boolean ctrlKey, @EventData("event.detail.originalEvent.browserEvent.metaKey") boolean metaKey, @EventData("event.detail.originalEvent.browserEvent.shiftKey") boolean shiftKey, @EventData("event.detail.originalEvent.button") int button, @EventData("event.detail.point.series.index") int seriesIndex, @EventData("event.detail.point.category") String category, @EventData("event.detail.point.index") int pointIndex, @EventData("event.detail.point.id") String pointId)
Constructs a SeriesLegendItemClickEvent- Parameters:
source-fromClient-
-
-
Method Detail
-
getSeriesItemIndex
public int getSeriesItemIndex()
Description copied from interface:HasSeriesReturns the index of the series- Specified by:
getSeriesItemIndexin interfaceHasSeries- Returns:
-
getCategory
public String 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, inHasSeries.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 interfaceHasItem- Returns:
- the index of the item in the series
- See Also:
HasItem.getItem(),HasItem.getItemId()
-
getItemId
public String 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.- Specified by:
getItemIdin interfaceHasItem- Returns:
- the ID of the series item associated with the event, or null if the series item has no ID
- See Also:
HasItem.getItem(),HasItem.getItemIndex()
-
getMouseDetails
public MouseEventDetails getMouseDetails()
Description copied from interface:ClickEventGets the mouse click details- Specified by:
getMouseDetailsin interfaceClickEvent- Returns:
-
-