Class LabelsContext


  • public final class LabelsContext
    extends AbstractDatasetContext
    This object is wrapping the native java script object provided by LabelsPlugin.ID plugin when the callback function is called.
    Author:
    Andrea "Stock" Stocchero
    • Method Detail

      • getLabelOptions

        public Label getLabelOptions()
        Returns the label options of plugin.
        Returns:
        the label options of the plugin
      • getLabel

        public String getLabel()
        Returns the label for the data set.
        Returns:
        the label for the data set.
      • getPercentage

        public double getPercentage()
        Returns the percentage for the data set.
        Returns:
        the percentage for the data set.
      • getDataItem

        public DataItem getDataItem()
        Returns the value for the data set by a DataItem.
        Returns:
        the value for the data set by a DataItem.
      • isConsistent

        protected boolean isConsistent()
        Description copied from class: ChartContext
        Returns true if the context is consistent.
        Custom context (the plugin ones) should extend it and check if the context is consistent before invoking the callback.
        Overrides:
        isConsistent in class ChartContext
        Returns:
        true if the context is consistent
      • checkIfPropertyIsValid

        protected boolean checkIfPropertyIsValid​(Key property)
        Description copied from class: ChartContext
        Checks if the key passed as argument is a key already used for other context properties.
        Overrides:
        checkIfPropertyIsValid in class AbstractDatasetContext
        Parameters:
        property - property to use to store a custom attribute
        Returns:
        true if the property can be used to store an attribute.