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 SummaryFields 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 SummaryAll 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.NativeObjectContainercheckAndGetColor, 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, 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, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
 
- 
 
- 
- 
- 
Field Detail- 
DEFAULT_COLORpublic static final IsColor DEFAULT_COLOR Default font color for label,HtmlColor.WHITE.
 - 
DEFAULT_COLOR_AS_STRINGpublic static final String DEFAULT_COLOR_AS_STRING Default font color for label, as string,HtmlColor.WHITE.
 - 
DEFAULT_BACKGROUND_COLORpublic static final IsColor DEFAULT_BACKGROUND_COLOR Default background color for label, rgb(110, 112, 121).
 - 
DEFAULT_BACKGROUND_COLOR_AS_STRINGpublic static final String DEFAULT_BACKGROUND_COLOR_AS_STRING Default background color for label, as string, rgb(110, 112, 121).
 - 
DEFAULT_BORDER_COLORpublic static final IsColor DEFAULT_BORDER_COLOR Default border color for label,HtmlColor.TRANSPARENT.
 - 
DEFAULT_BORDER_COLOR_AS_STRINGpublic static final String DEFAULT_BORDER_COLOR_AS_STRING Default border color for label, as string,HtmlColor.TRANSPARENT.
 - 
DEFAULT_BORDER_WIDTHpublic static final int DEFAULT_BORDER_WIDTH Default border width for crosshair label, value is 0.- See Also:
- Constant Field Values
 
 - 
DEFAULT_DISPLAYpublic 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_PADDINGpublic static final int DEFAULT_PADDING Default padding for crosshair label, value is 6.- See Also:
- Constant Field Values
 
 - 
DEFAULT_BORDER_RADIUSpublic static final int DEFAULT_BORDER_RADIUS Default border radius for crosshair label, value is 6.- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getFontpublic IsFont getFont() Returns the font object.- Returns:
- the font object.
 
 - 
setDisplaypublic void setDisplay(boolean display) Setstrueif label will be applied in the chart, otherwisefalse.- Parameters:
- display-- trueif label will be applied in the chart, otherwise- false
 
 - 
isDisplaypublic boolean isDisplay() Returnstrueif label will be applied in the chart, otherwisefalse.- Returns:
- trueif label will be applied in the chart, otherwise- false
 
 - 
getColorAsStringpublic String getColorAsString() Returns the crosshair label font color.- Returns:
- the crosshair label font color.
 
 - 
getColorpublic IsColor getColor() Returns the crosshair label font color.- Returns:
- the crosshair label font color.
 
 - 
setColorpublic void setColor(String color) Sets the crosshair label font color.- Parameters:
- color- the crosshair label font color.
 
 - 
setColorpublic void setColor(IsColor color) Set the crosshair label font color.- Parameters:
- color- the crosshair label font color.
 
 - 
setPaddingpublic void setPadding(int padding) Sets the padding of crosshair label.- Parameters:
- padding- padding of crosshair label
 
 - 
getPaddingpublic int getPadding() Returns the padding of crosshair label.- Returns:
- the padding of crosshair label
 
 - 
setBackgroundColorpublic void setBackgroundColor(String color) Sets the background color.- Parameters:
- color- the background color.
 
 - 
setBackgroundColorpublic void setBackgroundColor(IsColor color) Sets the background color.- Parameters:
- color- the background color.
 
 - 
getBackgroundColorAsStringpublic String getBackgroundColorAsString() Returns the background color.- Returns:
- the background color.
 
 - 
getBackgroundColorpublic IsColor getBackgroundColor() Returns the background color.- Returns:
- the background color.
 
 - 
setBorderRadiuspublic void setBorderRadius(int borderRadius) Sets the label border radius (in pixels).- Parameters:
- borderRadius- the label border radius (in pixels).
 
 - 
getBorderRadiuspublic int getBorderRadius() Returns the label border radius (in pixels).- Returns:
- the label border radius (in pixels).
 
 - 
setBorderColorpublic void setBorderColor(IsColor borderColor) Sets the border color.- Parameters:
- borderColor- the border color.
 
 - 
setBorderColorpublic void setBorderColor(String borderColor) Sets the border color.- Parameters:
- borderColor- the border color.
 
 - 
getBorderColorAsStringpublic String getBorderColorAsString() Returns the border color.- Returns:
- the border color.
 
 - 
getBorderColorpublic IsColor getBorderColor() Returns the border color.- Returns:
- the border color.
 
 - 
setBorderWidthpublic void setBorderWidth(int borderWidth) Sets the border width.- Parameters:
- borderWidth- the border width.
 
 - 
getBorderWidthpublic int getBorderWidth() Returns the border width.- Returns:
- the border width.
 
 - 
getFormatterpublic 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
 
 - 
setFormatterpublic 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
 
 
- 
 
-