Class DatasetReference


  • public final class DatasetReference
    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, providing the right indexes to get the data set.
    Author:
    Andrea "Stock" Stocchero
    • Constructor Detail

      • DatasetReference

        public DatasetReference​(AbstractDatasetContext context,
                                DatasetElement item)
        Creates the item reference using a a scriptale context and a data set item.
        Parameters:
        context - scriptable context instance
        item - data set item to add to the object
    • Method Detail

      • getElement

        public final DatasetElement getElement()
        Returns the data set item element.
        Returns:
        the data set element
      • getDatasetIndex

        public final int getDatasetIndex()
        Returns the data set item index.
        Returns:
        the data set item index.
      • getIndex

        public final int getIndex()
        Returns the data set item data index.
        Returns:
        the data set item data index.