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,
                                ChartElement element)
        Creates the item reference using a a scriptale context and a data element
        Parameters:
        context - scriptable context instance
        element - chart element to add to the object
      • DatasetReference

        public DatasetReference​(IsChart chart,
                                ChartEnvelop<NativeObject> envelop)
        Creates the item using a chart instance and a native java script object which contains all properties.
        Parameters:
        chart - chart instance needed to create the dataset reference
        envelop - envelop from chart with native java script object which contains all properties
    • Method Detail

      • getElement

        public final ChartElement 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.