Class LegendClickEvent

  • All Implemented Interfaces:
    HasNativeEvent, IsLegendEvent

    public final class LegendClickEvent
    extends AbstractEvent
    Event which is fired when the user clicks on the legend of the chart.
    Author:
    Andrea "Stock" Stocchero
    • Field Detail

      • TYPE

        public static final EventType TYPE
        Event type
    • Constructor Detail

      • LegendClickEvent

        public LegendClickEvent​(ChartEventContext eventContext,
                                LegendItem item)
        Creates the event with legend item related to the click
        Parameters:
        eventContext - event context generated by CHART.js
        item - legend item related to the click
    • Method Detail

      • dispatch

        protected void dispatch​(EventHandler handler)
        Description copied from class: Event
        Implemented by subclasses to dispatch event on the handler.
        Specified by:
        dispatch in class Event
        Parameters:
        handler - handler instance
      • getItem

        public final LegendItem getItem()
        Returns the legend item related to the click
        Specified by:
        getItem in interface IsLegendEvent
        Returns:
        the legend item related to the click
      • getContext

        public abstract ChartEventContext getContext()
        Returns the java script function context of CHART.JS events.
        Returns:
        the java script function context of CHART.JS events.
      • getKey

        public abstract Key getKey()
        Returns the options key where default function is stored.
        Returns:
        the options key where default function is stored
      • getChart

        public abstract IsChart getChart()
        Returns the chart instance, stored in the event as source.
        Returns:
        the chart instance
      • getContext

        public final ChartEventContext getContext()
        Returns the java script function context of CHART.JS events.
        Returns:
        the java script function context of CHART.JS events.
      • getKey

        public final Key getKey()
        Returns the options key where default function is stored.
        Returns:
        the options key where default function is stored
      • getChart

        public IsChart getChart()
        Returns the chart instance, stored in the event as source.
        Overrides:
        getChart in class AbstractEvent
        Returns:
        the chart instance