Class ScaleContext


  • public final class ScaleContext
    extends ChartContext
    The SCALE option context is used to give contextual information when resolving options.
    The context object contains the following properties:
    • index: index of the associated data
    • scale: scale instance which contains the element to configure
    • tick: tick item instance which contains data to be consumed configuring the element (only for ticks)
    • label: label item to manage by callback (only for point label context)
    Author:
    Andrea "Stock" Stocchero
    • Constructor Detail

      • ScaleContext

        public ScaleContext​(Axis axis,
                            NativeObject nativeObject)
        Creates the object with an envelop of the native object instance to be wrapped.
        Parameters:
        axis - axis instance where the callback must be invoked
        nativeObject - native object instance to be wrapped.
    • Method Detail

      • getAxis

        public final Axis getAxis()
        Returns the axis instance where the callback must be invoked.
        Returns:
        the axis instance where the callback must be invoked
      • getIndex

        public int getIndex()
        Returns the index of the tick.
        Returns:
        the index of the tick.
      • getScale

        public ScaleItem getScale()
        Returns the scale instance which contains the element to configure.
        Returns:
        the scale instance which contains the element to configure
      • getTick

        public ScaleTickItem getTick()
        Returns the tick item instance which contains data to be consumed configuring the element.
        Returns:
        the tick item instance which contains data to be consumed configuring the element
      • getLabel

        public String getLabel()
        Returns the label that is shown on the perimeter of the scale. Only for RadialPointLabels callback.
        Returns:
        the label that is shown on the perimeter of the scale. Only for RadialPointLabels callback.
      • 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 ChartContext
        Parameters:
        property - property to use to store a custom attribute
        Returns:
        true if the property can be used to store an attribute.