Class CrosshairLabel
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.impl.plugins.CrosshairLabel
-
public final class CrosshairLabel extends NativeObjectContainer
Crosshair.ID
plugin configuration element in order to have in the chart the label on the axes where the mouse is positioned.- Author:
- Andrea "Stock" Stocchero
-
-
Field Summary
Fields Modifier and Type Field Description static IsColor
DEFAULT_BACKGROUND_COLOR
Default background color for label, rgb(110, 112, 121).static String
DEFAULT_BACKGROUND_COLOR_AS_STRING
Default background color for label, as string, rgb(110, 112, 121).static IsColor
DEFAULT_BORDER_COLOR
Default border color for label,HtmlColor.TRANSPARENT
.static String
DEFAULT_BORDER_COLOR_AS_STRING
Default border color for label, as string,HtmlColor.TRANSPARENT
.static int
DEFAULT_BORDER_RADIUS
Default border radius for crosshair label, value is 6.static int
DEFAULT_BORDER_WIDTH
Default border width for crosshair label, value is 0.static IsColor
DEFAULT_COLOR
Default font color for label,HtmlColor.WHITE
.static String
DEFAULT_COLOR_AS_STRING
Default font color for label, as string,HtmlColor.WHITE
.static boolean
DEFAULT_DISPLAY
Default flag if crosshair label must be showed in the chart, value is true.static int
DEFAULT_PADDING
Default padding for crosshair label, value is 6.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IsColor
getBackgroundColor()
Returns the background color.String
getBackgroundColorAsString()
Returns the background color.IsColor
getBorderColor()
Returns the border color.String
getBorderColorAsString()
Returns the border color.int
getBorderRadius()
Returns the label border radius (in pixels).int
getBorderWidth()
Returns the border width.IsColor
getColor()
Returns the crosshair label font color.String
getColorAsString()
Returns the crosshair label font color.IsFont
getFont()
Returns the font object.CrosshairFormatterCallback
getFormatter()
Returns the callback which can be implemented to change the text of label.int
getPadding()
Returns the padding of crosshair label.boolean
isDisplay()
Returnstrue
if label will be applied in the chart, otherwisefalse
.void
setBackgroundColor(String color)
Sets the background color.void
setBackgroundColor(IsColor color)
Sets the background color.void
setBorderColor(String borderColor)
Sets the border color.void
setBorderColor(IsColor borderColor)
Sets the border color.void
setBorderRadius(int borderRadius)
Sets the label border radius (in pixels).void
setBorderWidth(int borderWidth)
Sets the border width.void
setColor(String color)
Sets the crosshair label font color.void
setColor(IsColor color)
Set the crosshair label font color.void
setDisplay(boolean display)
Setstrue
if label will be applied in the chart, otherwisefalse
.void
setFormatter(CrosshairFormatterCallback formatterCallback)
Sets the callback which can be implemented to change the text of label.void
setPadding(int padding)
Sets the padding of crosshair label.-
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
-
-
-
-
Field Detail
-
DEFAULT_COLOR
public static final IsColor DEFAULT_COLOR
Default font color for label,HtmlColor.WHITE
.
-
DEFAULT_COLOR_AS_STRING
public static final String DEFAULT_COLOR_AS_STRING
Default font color for label, as string,HtmlColor.WHITE
.
-
DEFAULT_BACKGROUND_COLOR
public static final IsColor DEFAULT_BACKGROUND_COLOR
Default background color for label, rgb(110, 112, 121).
-
DEFAULT_BACKGROUND_COLOR_AS_STRING
public static final String DEFAULT_BACKGROUND_COLOR_AS_STRING
Default background color for label, as string, rgb(110, 112, 121).
-
DEFAULT_BORDER_COLOR
public static final IsColor DEFAULT_BORDER_COLOR
Default border color for label,HtmlColor.TRANSPARENT
.
-
DEFAULT_BORDER_COLOR_AS_STRING
public static final String DEFAULT_BORDER_COLOR_AS_STRING
Default border color for label, as string,HtmlColor.TRANSPARENT
.
-
DEFAULT_BORDER_WIDTH
public static final int DEFAULT_BORDER_WIDTH
Default border width for crosshair label, value is 0.- See Also:
- Constant Field Values
-
DEFAULT_DISPLAY
public static final boolean DEFAULT_DISPLAY
Default flag if crosshair label must be showed in the chart, value is true.- See Also:
- Constant Field Values
-
DEFAULT_PADDING
public static final int DEFAULT_PADDING
Default padding for crosshair label, value is 6.- See Also:
- Constant Field Values
-
DEFAULT_BORDER_RADIUS
public static final int DEFAULT_BORDER_RADIUS
Default border radius for crosshair label, value is 6.- See Also:
- Constant Field Values
-
-
Method Detail
-
getFont
public IsFont getFont()
Returns the font object.- Returns:
- the font object.
-
setDisplay
public void setDisplay(boolean display)
Setstrue
if label will be applied in the chart, otherwisefalse
.- Parameters:
display
-true
if label will be applied in the chart, otherwisefalse
-
isDisplay
public boolean isDisplay()
Returnstrue
if label will be applied in the chart, otherwisefalse
.- Returns:
true
if label will be applied in the chart, otherwisefalse
-
getColorAsString
public String getColorAsString()
Returns the crosshair label font color.- Returns:
- the crosshair label font color.
-
getColor
public IsColor getColor()
Returns the crosshair label font color.- Returns:
- the crosshair label font color.
-
setColor
public void setColor(String color)
Sets the crosshair label font color.- Parameters:
color
- the crosshair label font color.
-
setColor
public void setColor(IsColor color)
Set the crosshair label font color.- Parameters:
color
- the crosshair label font color.
-
setPadding
public void setPadding(int padding)
Sets the padding of crosshair label.- Parameters:
padding
- padding of crosshair label
-
getPadding
public int getPadding()
Returns the padding of crosshair label.- Returns:
- the padding of crosshair label
-
setBackgroundColor
public void setBackgroundColor(String color)
Sets the background color.- Parameters:
color
- the background color.
-
setBackgroundColor
public void setBackgroundColor(IsColor color)
Sets the background color.- Parameters:
color
- the background color.
-
getBackgroundColorAsString
public String getBackgroundColorAsString()
Returns the background color.- Returns:
- the background color.
-
getBackgroundColor
public IsColor getBackgroundColor()
Returns the background color.- Returns:
- the background color.
-
setBorderRadius
public void setBorderRadius(int borderRadius)
Sets the label border radius (in pixels).- Parameters:
borderRadius
- the label border radius (in pixels).
-
getBorderRadius
public int getBorderRadius()
Returns the label border radius (in pixels).- Returns:
- the label border radius (in pixels).
-
setBorderColor
public void setBorderColor(IsColor borderColor)
Sets the border color.- Parameters:
borderColor
- the border color.
-
setBorderColor
public void setBorderColor(String borderColor)
Sets the border color.- Parameters:
borderColor
- the border color.
-
getBorderColorAsString
public String getBorderColorAsString()
Returns the border color.- Returns:
- the border color.
-
getBorderColor
public IsColor getBorderColor()
Returns the border color.- Returns:
- the border color.
-
setBorderWidth
public void setBorderWidth(int borderWidth)
Sets the border width.- Parameters:
borderWidth
- the border width.
-
getBorderWidth
public int getBorderWidth()
Returns the border width.- Returns:
- the border width.
-
getFormatter
public CrosshairFormatterCallback getFormatter()
Returns the callback which can be implemented to change the text of label.- Returns:
- the callback which can be implemented to change the text of label
-
setFormatter
public void setFormatter(CrosshairFormatterCallback formatterCallback)
Sets the callback which can be implemented to change the text of label.- Parameters:
formatterCallback
- the callback which can be implemented to change the text of label
-
-