Class ScaleContext
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.callbacks.ChartContext
-
- org.pepstock.charba.client.callbacks.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 Summary
Constructors Constructor Description ScaleContext(Axis axis, NativeObject nativeObject)
Creates the object with an envelop of the native object instance to be wrapped.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
checkIfPropertyIsValid(Key property)
Checks if the key passed as argument is a key already used for other context properties.Axis
getAxis()
Returns the axis instance where the callback must be invoked.int
getIndex()
Returns the index of the tick.String
getLabel()
Returns the label that is shown on the perimeter of the scale.ScaleItem
getScale()
Returns the scale instance which contains the element to configure.ScaleTickItem
getTick()
Returns the tick item instance which contains data to be consumed configuring the element.-
Methods inherited from class org.pepstock.charba.client.callbacks.ChartContext
getAttribute, getAttribute, getAttribute, getAttribute, getAttributes, getChart, getType, hasAttributes, isConsistent, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes
-
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainer
checkDefaultValuesArgument, empty, getArrayValue, getElement, getIncrementalId, getNativeChart, getNativeEvent, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, isType, keys, loadNativeObject, remove, remove, setArrayValue, setArrayValue, setArrayValue, setElement, setEmptyValue, setNewIncrementalId, setNewIncrementalId, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
-
-
-
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 invokednativeObject
- 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 forRadialPointLabels
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 classChartContext
- Parameters:
property
- property to use to store a custom attribute- Returns:
true
if the property can be used to store an attribute.
-
-