Interface IsFill

  • All Superinterfaces:
    Key
    All Known Implementing Classes:
    AbsoluteDatasetIndexFill, Fill, RelativeDatasetIndexFill

    public interface IsFill
    extends Key
    Represents how to fill the area under the line. This is an interfaces implemented on different way, as CHART.JS has implemented.
    Both line and radar charts support a fill option on the dataset object which can be used to create area between two datasets or a dataset.
    These are the different kinds of fill you can set:
    • Predefined values, mapped by Fill.
    • Absolute dataset index, as integer (1,2,3,...)
    • Relative dataset index, as string ("-1", "-2", "+1", "+2",...)
    • Predefined boolean, if true the fill is applied, othewise false.
    Author:
    Andrea "Stock" Stocchero
    • Method Detail

      • isValid

        static boolean isValid​(IsFill fill)
        Returns true if fill passed as argument is not null and its value is not null and its mode is not null as well.
        Parameters:
        fill - fill to be checked
        Returns:
        true if fill passed as argument is not null and its value is not null and its mode is not null as well.
      • transform

        static Object transform​(Object object)
        Returns a object which can be a boolean, integer, string or IsFill when the callback has been activated.
        Parameters:
        object - object to be normalized.
        Returns:
        a object property value
      • toObject

        static Object toObject​(IsFill fill)
        Transforms a IsFill instance in the a CHART.JS FILL property accepted value.
        Parameters:
        fill - fill instance to transform
        Returns:
        a CHART.JS FILL property accepted value
      • getMode

        FillingMode getMode()
        Returns the type of filling.
        Returns:
        the type of filling.
      • getValueAsInt

        int getValueAsInt()
        Returns the value as integer (valid ONLY for absolute dataset index), otherwise Undefined.INTEGER.
        Returns:
        the value as integer (valid ONLY for absolute dataset index), otherwise Undefined.INTEGER.
      • getValue

        String getValue()
        Returns the value as string (valid ONLY for relative dataset index and predefined), otherwise Undefined.STRING.
        Returns:
        the value as string (valid ONLY for relative dataset index and predefined), otherwise Undefined.STRING.