Class DrilldownEvent
- java.lang.Object
-
- java.util.EventObject
-
- com.vaadin.flow.component.ComponentEvent<Chart>
-
- com.vaadin.flow.component.charts.events.DrilldownEvent
-
- All Implemented Interfaces:
HasItem
,HasSeries
,Serializable
@DomEvent("chart-drilldown") public class DrilldownEvent extends ComponentEvent<Chart> implements HasItem
The DrilldownEvent class stores information on click events in drilldown points- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getCategory()
String
getDrilldown()
Gets the name of the drilldownString
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, inHasSeries.getSeries()
.int
getSeriesItemIndex()
Returns the index of the seriesDouble
getxValue()
Double
getyValue()
-
Methods inherited from class com.vaadin.flow.component.ComponentEvent
getSource, isFromClient, unregisterListener
-
Methods inherited from class java.util.EventObject
toString
-
-
-
-
Constructor Detail
-
DrilldownEvent
public DrilldownEvent(Chart source, boolean fromClient, @EventData("event.detail.originalEvent.point.drilldown") String drilldown, @EventData("event.detail.originalEvent.point.category") String category, @EventData("event.detail.originalEvent.point.x") Double x, @EventData("event.detail.originalEvent.point.y") Double y, @EventData("event.detail.originalEvent.point.index") int pointIndex, @EventData("event.detail.originalEvent.point.id") String pointId, @EventData("event.detail.originalEvent.point.series.index") int seriesIndex)
Construct a ChartDrilldownEvent- Parameters:
source
-
-
-
Method Detail
-
getDrilldown
public String getDrilldown()
Gets the name of the drilldown- Returns:
-
getxValue
public Double getxValue()
-
getyValue
public Double getyValue()
-
getCategory
public String getCategory()
- Specified by:
getCategory
in interfaceHasItem
-
getSeriesItemIndex
public int getSeriesItemIndex()
Description copied from interface:HasSeries
Returns the index of the series- Specified by:
getSeriesItemIndex
in interfaceHasSeries
- Returns:
-
getItemIndex
public int getItemIndex()
Description copied from interface:HasItem
Returns 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:
getItemIndex
in interfaceHasItem
- Returns:
- the index of the item in the series
- See Also:
HasItem.getItem()
,HasItem.getItemId()
-
getItemId
public String getItemId()
Description copied from interface:HasItem
The 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
AbstractSeriesItem
andNode
support setting an ID. For other types of series items this property will always return null. ForAbstractSeriesItem
the 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:
getItemId
in 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()
-
-