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.IDplugin 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 IsColorDEFAULT_BACKGROUND_COLORDefault background color for label, rgb(110, 112, 121).static StringDEFAULT_BACKGROUND_COLOR_AS_STRINGDefault background color for label, as string, rgb(110, 112, 121).static IsColorDEFAULT_BORDER_COLORDefault border color for label,HtmlColor.TRANSPARENT.static StringDEFAULT_BORDER_COLOR_AS_STRINGDefault border color for label, as string,HtmlColor.TRANSPARENT.static intDEFAULT_BORDER_RADIUSDefault border radius for crosshair label, value is 6.static intDEFAULT_BORDER_WIDTHDefault border width for crosshair label, value is 0.static IsColorDEFAULT_COLORDefault font color for label,HtmlColor.WHITE.static StringDEFAULT_COLOR_AS_STRINGDefault font color for label, as string,HtmlColor.WHITE.static booleanDEFAULT_DISPLAYDefault flag if crosshair label must be showed in the chart, value is true.static intDEFAULT_PADDINGDefault padding for crosshair label, value is 6.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IsColorgetBackgroundColor()Returns the background color.StringgetBackgroundColorAsString()Returns the background color.IsColorgetBorderColor()Returns the border color.StringgetBorderColorAsString()Returns the border color.intgetBorderRadius()Returns the label border radius (in pixels).intgetBorderWidth()Returns the border width.IsColorgetColor()Returns the crosshair label font color.StringgetColorAsString()Returns the crosshair label font color.IsFontgetFont()Returns the font object.CrosshairFormatterCallbackgetFormatter()Returns the callback which can be implemented to change the text of label.intgetPadding()Returns the padding of crosshair label.booleanisDisplay()Returnstrueif label will be applied in the chart, otherwisefalse.voidsetBackgroundColor(String color)Sets the background color.voidsetBackgroundColor(IsColor color)Sets the background color.voidsetBorderColor(String borderColor)Sets the border color.voidsetBorderColor(IsColor borderColor)Sets the border color.voidsetBorderRadius(int borderRadius)Sets the label border radius (in pixels).voidsetBorderWidth(int borderWidth)Sets the border width.voidsetColor(String color)Sets the crosshair label font color.voidsetColor(IsColor color)Set the crosshair label font color.voidsetDisplay(boolean display)Setstrueif label will be applied in the chart, otherwisefalse.voidsetFormatter(CrosshairFormatterCallback formatterCallback)Sets the callback which can be implemented to change the text of label.voidsetPadding(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)
Setstrueif label will be applied in the chart, otherwisefalse.- Parameters:
display-trueif label will be applied in the chart, otherwisefalse
-
isDisplay
public boolean isDisplay()
Returnstrueif label will be applied in the chart, otherwisefalse.- Returns:
trueif 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
-
-