Package org.pepstock.charba.client.geo
Class ColorAxis
- java.lang.Object
-
- org.pepstock.charba.client.configuration.Axis
-
- org.pepstock.charba.client.configuration.CartesianAxis<CartesianLinearTick>
-
- org.pepstock.charba.client.configuration.CartesianLinearAxis
-
- org.pepstock.charba.client.geo.ColorAxis
-
- All Implemented Interfaces:
IsLinearAxis
,IsNumericAxis
public final class ColorAxis extends CartesianLinearAxis
The coloring of the nodes will be done with a special color scale.
Provides the elements, as colored legend, which can provide the how the values are distributed on map.- Author:
- Andrea "Stock" Stocchero
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_MISSING_COLOR
Default missing color options,HtmlColor.TRANSPARENT
.static int
DEFAULT_QUANTIZE
Default quantize options, 0.static ScaleId
ID
Projection axis id.static AxisType
TYPE
Projection axis type.
-
Method Summary
All Methods Instance Methods Concrete Methods Default Methods Modifier and Type Method Description IsChart
getChart()
Returns the chart instancedefault IsColor
getColorForValue(double value)
Returns the color for a specific data value.default String
getColorForValueAsString(double value)
Returns the color for a specific data value.protected T
getConfiguration()
Returns the configuration element.default Interpolate
getInterpolate()
Returns the color interpolation of the scale.default InterpolateCallback
getInterpolateCallback()
Returns the color interpolation callback of the scale.default Legend
getLegend()
Returns the legend configuration.org.pepstock.charba.client.geo.ColorAxisMapper
getMapper()
default IsColor
getMissingColor()
Returns the missing color.default String
getMissingColorAsString()
Returns the missing color.default ColorCallback<ScaleContext>
getMissingColorCallback()
Returns the missing color callback.default int
getQuantize()
Returns the amount of pieces to allow to split the color scale in N quantized equal bins.default QuantizeCallback
getQuantizeCallback()
Returns the callback to get the amount of pieces to allow to split the color scale in N quantized equal bins.ChartEnvelop<NativeObject>
loadNativeObject(ChartEnvelop<NativeObject> envelop)
Returns the native object instance inside an envelop.
It can be called only fromorg.pepstock.charba.client
package.void
merge(NativeObjectContainer source, String property)
Merge a native object in the this one with a specific property name.
This is used by plugins implementation (native java script ones) when they are not using the standard way to add plugin configuration in the options of chart.protected void
setConfiguration(T configuration)
default void
setInterpolate(InterpolateCallback interpolateCallback)
Sets the color interpolation callback of the scale.default void
setInterpolate(Interpolate interpolate)
Sets the color interpolation of the scale.default void
setMissingColor(String missingColor)
Sets the missing color.default void
setMissingColor(ColorCallback<ScaleContext> missingColorCallback)
Sets the missing color callback.default void
setMissingColor(IsColor missingColor)
Sets the missing color.default void
setQuantize(int quantize)
Sets the amount of pieces to allow to split the color scale in N quantized equal bins.default void
setQuantize(QuantizeCallback quantizeCallback)
Sets the callback to get the amount of pieces to allow to split the color scale in N quantized equal bins.String
toJSON()
Returns the JSON representation of the object.-
Methods inherited from class org.pepstock.charba.client.configuration.CartesianLinearAxis
getAxisElement, getGrace, getGraceAsPercentage, getTicks, setGrace, setGraceAsPercentage
-
Methods inherited from class org.pepstock.charba.client.configuration.CartesianAxis
getBounds, getGrid, getPosition, getStack, getStackWeight, getTitle, isOffset, isSingleStacked, isStacked, setBounds, setOffset, setPosition, setSingleStacked, setStack, setStacked, setStackWeight
-
Methods inherited from class org.pepstock.charba.client.configuration.Axis
getAxis, getAxisBuildTicksCallback, getAxisCalculateLabelRotationCallback, getAxisDataLimitsCallback, getAxisDimensionsCallback, getAxisFitCallback, getAxisTickToLabelConversionCallback, getAxisUpdateCallback, getBackgroundColor, getBackgroundColorAsString, getCharbaId, getDisplay, getId, getType, getWeight, isAlignToPixels, isReverse, setAlignToPixels, setAxisBuildTicksCallback, setAxisCalculateLabelRotationCallback, setAxisDataLimitsCallback, setAxisDimensionsCallback, setAxisFitCallback, setAxisTickToLabelConversionCallback, setAxisUpdateCallback, setBackgroundColor, setBackgroundColor, setDisplay, setDisplay, setReverse, setWeight
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pepstock.charba.client.configuration.IsLinearAxis
isBeginAtZero, setBeginAtZero
-
Methods inherited from interface org.pepstock.charba.client.configuration.IsNumericAxis
getMax, getMin, getSuggestedMax, getSuggestedMin, setMax, setMin, setSuggestedMax, setSuggestedMin
-
-
-
-
Field Detail
-
DEFAULT_MISSING_COLOR
public static final String DEFAULT_MISSING_COLOR
Default missing color options,HtmlColor.TRANSPARENT
.
-
DEFAULT_QUANTIZE
public static final int DEFAULT_QUANTIZE
Default quantize options, 0.- See Also:
- Constant Field Values
-
ID
public static final ScaleId ID
Projection axis id.
-
TYPE
public static final AxisType TYPE
Projection axis type.
-
-
Constructor Detail
-
ColorAxis
public ColorAxis(IsChart chart)
Builds the object storing the chart instance and axis type.- Parameters:
chart
- chart instance
-
-
Method Detail
-
getMapper
public org.pepstock.charba.client.geo.ColorAxisMapper getMapper()
-
setMissingColor
public default void setMissingColor(IsColor missingColor)
Sets the missing color.- Parameters:
missingColor
- the missing color.
-
setMissingColor
public default void setMissingColor(String missingColor)
Sets the missing color.- Parameters:
missingColor
- the missing color.
-
getMissingColorAsString
public default String getMissingColorAsString()
Returns the missing color.- Returns:
- the missing color.
-
getMissingColor
public default IsColor getMissingColor()
Returns the missing color.- Returns:
- the missing color.
-
setQuantize
public default void setQuantize(int quantize)
Sets the amount of pieces to allow to split the color scale in N quantized equal bins.- Parameters:
quantize
- the amount of pieces to allow to split the color scale in N quantized equal bins
-
getQuantize
public default int getQuantize()
Returns the amount of pieces to allow to split the color scale in N quantized equal bins.- Returns:
- the amount of pieces to allow to split the color scale in N quantized equal bins
-
setInterpolate
public default void setInterpolate(Interpolate interpolate)
Sets the color interpolation of the scale.- Parameters:
interpolate
- the color interpolation of the scale
-
getInterpolate
public default Interpolate getInterpolate()
Returns the color interpolation of the scale.- Returns:
- the color interpolation of the scale
-
setInterpolate
public default void setInterpolate(InterpolateCallback interpolateCallback)
Sets the color interpolation callback of the scale.- Parameters:
interpolateCallback
- the color interpolation callback of the scale
-
getInterpolateCallback
public default InterpolateCallback getInterpolateCallback()
Returns the color interpolation callback of the scale.- Returns:
- the color interpolation callback of the scale
-
setQuantize
public default void setQuantize(QuantizeCallback quantizeCallback)
Sets the callback to get the amount of pieces to allow to split the color scale in N quantized equal bins.- Parameters:
quantizeCallback
- the callback to get the amount of pieces to allow to split the color scale in N quantized equal bins
-
getQuantizeCallback
public default QuantizeCallback getQuantizeCallback()
Returns the callback to get the amount of pieces to allow to split the color scale in N quantized equal bins.- Returns:
- the callback to get the amount of pieces to allow to split the color scale in N quantized equal bins
-
setMissingColor
public default void setMissingColor(ColorCallback<ScaleContext> missingColorCallback)
Sets the missing color callback.- Parameters:
missingColorCallback
- the missing color callback
-
getMissingColorCallback
public default ColorCallback<ScaleContext> getMissingColorCallback()
Returns the missing color callback.- Returns:
- the missing color callback
-
getColorForValueAsString
public default String getColorForValueAsString(double value)
Returns the color for a specific data value.- Parameters:
value
- to use for searching- Returns:
- a color a string or
Undefined.STRING
if not recognized the value by the chart.
-
getColorForValue
public default IsColor getColorForValue(double value)
Returns the color for a specific data value.- Parameters:
value
- to use for searching- Returns:
- a color or
null
if not recognized the value by the chart.
-
getLegend
public default Legend getLegend()
Returns the legend configuration.- Returns:
- the legend configuration
-
setConfiguration
protected final void setConfiguration(T configuration)
- Parameters:
configuration
- the configuration to set
-
getConfiguration
protected final T getConfiguration()
Returns the configuration element.- Returns:
- the configuration element.
-
merge
public final void merge(NativeObjectContainer source, String property)
Merge a native object in the this one with a specific property name.
This is used by plugins implementation (native java script ones) when they are not using the standard way to add plugin configuration in the options of chart.- Parameters:
source
- native object container to addproperty
- property name
-
toJSON
public final String toJSON()
Returns the JSON representation of the object.- Returns:
- the JSON representation of the object.
-
loadNativeObject
public final ChartEnvelop<NativeObject> loadNativeObject(ChartEnvelop<NativeObject> envelop)
Returns the native object instance inside an envelop.
It can be called only fromorg.pepstock.charba.client
package.- Parameters:
envelop
- envelop instance which will contain the native object- Returns:
- the envelop, passed as argument, loaded with the native object
-
getChart
public final IsChart getChart()
Returns the chart instance- Returns:
- the chart
-
-