Class InteractionItem


  • public final class InteractionItem
    extends NativeObjectContainer
    Object used by CHART.JS to manages the user interaction on chart instances, for events, hovering and tooltips.
    Author:
    Andrea "Stock" Stocchero
    • Constructor Detail

      • InteractionItem

        public InteractionItem​(IsChart chart,
                               ChartElement element,
                               int datasetIndex,
                               int index)
        Creates an item with chart and a specific dataset element, setting dataset and data indexes.
        Parameters:
        chart - chart instance
        element - element of the dataset
        datasetIndex - dataset index in the chart
        index - data index in the dataset data
    • Method Detail

      • getChart

        public final IsChart getChart()
        Returns the CHARBA chart instance.
        Returns:
        the CHARBA chart instance
      • getIndex

        public final int getIndex()
        Returns the index of the data inside the dataset.
        Returns:
        the index of the data inside the dataset.
      • getDatasetIndex

        public final int getDatasetIndex()
        Returns the dataset index of the chart
        Returns:
        the dataset index of the chart.
      • getElement

        public final ChartElement getElement()
        Returns the chart element (point, arc, bar, etc.) for this tooltip item.
        Returns:
        the chart element (point, arc, bar, etc.) for this tooltip item.
      • nativeObject

        public NativeObject nativeObject()
        Returns the native object instance.
        Returns:
        the native object instance.
      • createFactory

        public static NativeObjectContainerFactory<InteractionItem> createFactory​(IsChart chart)
        Returns an interaction items factory for a specific chart.
        Parameters:
        chart - chart instance
        Returns:
        an interaction items factory for a specific chart