Class ActiveDatasetElement


  • public final class ActiveDatasetElement
    extends NativeObjectContainer
    Calling some methods on your chart instance passing an argument of an event, will return the elements at the event position.
    The elements are mapped by this object.
    This is the CHART.JS item with all needed info about a selected data set.
    This object has been created and passed to event handler or callbacks to apply own logic.
    Author:
    Andrea "Stock" Stocchero
    • Field Detail

      • FACTORY

        public static final org.pepstock.charba.client.items.ActiveDatasetElement.ActiveDatasetElementFactory FACTORY
        Factory instance to create active data set elements.
    • Constructor Detail

      • ActiveDatasetElement

        public ActiveDatasetElement​(int datasetIndex,
                                    int dataIndex)
        Creates a data set element, setting data set and data element indexes.
        Parameters:
        datasetIndex - the index of the data set.
        dataIndex - the index of the data element
      • ActiveDatasetElement

        public ActiveDatasetElement()
        Creates an empty data set element.
    • Method Detail

      • setDatasetIndex

        public void setDatasetIndex​(int datasetIndex)
        Sets the index of the data set.
        Parameters:
        datasetIndex - the index of the data set.
      • getDatasetIndex

        public int getDatasetIndex()
        Returns the index of the data set.
        Returns:
        the index of the data set.
      • setIndex

        public void setIndex​(int dataIndex)
        Sets the index of the data element.
        Parameters:
        dataIndex - the index of the data element
      • getIndex

        public int getIndex()
        Returns the index of the data element.
        Returns:
        the index of the data element