Class DatasetItem


  • public final class DatasetItem
    extends NativeObjectContainer
    Calling some methods on your chart instance passing an argument of an event, will return the elements at the event position.
    Created and passed by CHART.JS and provide dataset information.
    Author:
    Andrea "Stock" Stocchero
    • Constructor Detail

      • DatasetItem

        public DatasetItem​(ChartEnvelop<NativeObject> envelop)
        Creates the item using an envelop with the native java script object which contains all properties.
        Parameters:
        envelop - envelop with the native java script object which contains all properties.
    • Method Detail

      • getController

        public DatasetItemController getController()
        Returns the dataset controller.
        Returns:
        the dataset controller
      • getType

        public Type getType()
        Returns the type of dataset.
        Returns:
        the type of dataset. If not set or invalid, the default is ChartType.BAR.
      • isVisible

        public boolean isVisible()
        Returns if the dataset is visible.
        Returns:
        true if the dataset is visible, otherwise is Undefined.BOOLEAN.
      • isHidden

        public boolean isHidden()
        Returns if the dataset is hidden.
        Returns:
        true if the dataset is hidden, otherwise is Undefined.BOOLEAN.
      • getIndex

        public int getIndex()
        Returns the dataset index.
        Returns:
        the dataset index.
      • getIndexAxis

        public IndexAxis getIndexAxis()
        Returns the dataset index axis.
        Returns:
        the dataset index axis or null if not found.
      • getOrder

        public int getOrder()
        Returns the dataset order.
        Returns:
        the dataset order.
      • getLabel

        public String getLabel()
        Returns the dataset label.
        Returns:
        the dataset label.
      • getYAxisID

        public ScaleId getYAxisID()
        Returns the Y axis ID.
        Returns:
        the Y axis ID.
      • getYScale

        public ScaleItem getYScale()
        Returns the Y scale item or null if not exists.
        Returns:
        the Y scale item or null if not exists
      • getXAxisID

        public ScaleId getXAxisID()
        Returns the X axis ID.
        Returns:
        the X axis ID.
      • getXScale

        public ScaleItem getXScale()
        Returns the X scale item or null if not exists.
        Returns:
        the X scale item or null if not exists
      • getRAxisID

        public ScaleId getRAxisID()
        Returns the R axis ID.
        Returns:
        the R axis ID.
      • getRScale

        public ScaleItem getRScale()
        Returns the R scale item or null if not exists.
        Returns:
        the R scale item or null if not exists
      • getValueAxisID

        public ScaleId getValueAxisID()
        Returns the value axis ID.
        Returns:
        the value axis ID.
      • getValueScale

        public ScaleItem getValueScale()
        Returns the value scale item or null if not exists.
        If IndexAxis = IndexAxis.Y then iScale === yScale and vScale === xScale.
        For radar, iScale === vScale === rScale.
        Returns:
        the value scale item or null if not exists
      • getIndexAxisID

        public ScaleId getIndexAxisID()
        Returns the index axis ID.
        Returns:
        the index axis ID.
      • getIndexScale

        public ScaleItem getIndexScale()
        Returns the index scale item or null if not exists.
        If IndexAxis = IndexAxis.Y then iScale === yScale and vScale === xScale.
        For radar, iScale === vScale === rScale.
        Returns:
        the index scale item or null if not exists
      • getTotal

        public double getTotal()
        Returns the dataset total value of data.
        Returns:
        the dataset total value of data.
      • getElements

        public List<DatasetElement> getElements()
        Returns a list of dataset elements.
        Returns:
        a list of dataset elements.