Class CrosshairOptions
- java.lang.Object
- 
- org.pepstock.charba.client.commons.NativeObjectContainer
- 
- org.pepstock.charba.client.commons.AbstractNode
- 
- org.pepstock.charba.client.plugins.AbstractPluginOptions
- 
- org.pepstock.charba.client.impl.plugins.CrosshairOptions
 
 
 
 
- 
- All Implemented Interfaces:
- IsDefaultEventHandler,- HasEvents
 
 public final class CrosshairOptions extends AbstractPluginOptions Configuration options ofCrosshair.IDplugin.
 It manages the drawing the horizontal and vertical crosshair on the chart.- Author:
- Andrea "Stock" Stocchero
 
- 
- 
Field SummaryFields Modifier and Type Field Description static booleanDEFAULT_ENABLEDDefault enabled options, true.static IsColorDEFAULT_LINE_COLORDefault line color,HtmlColor.LIGHT_GRAY.static StringDEFAULT_LINE_COLOR_AS_STRINGDefault line color as string,HtmlColor.LIGHT_GRAY.static List<Integer>DEFAULT_LINE_DASHDefault line dash, [2, 2].static doubleDEFAULT_LINE_DASH_OFFSETDefault line dash offset, 0.0.static intDEFAULT_LINE_WIDTHDefault line width, 1.static InteractionAxisDEFAULT_MODEDefault interaction axis mode,InteractionAxis.XY.
 - 
Constructor SummaryConstructors Constructor Description CrosshairOptions()Builds the object with new java script object setting the default value of plugin.
 The global plugin options is used, if exists, as defaults values.CrosshairOptions(IsChart chart)Builds the object with a chart instance in order to get the right defaults.
 If the plugin options have not been set by chart type, it will use the global.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description CrosshairLabelsgetLabels()Returns the labels utility to set the same value to all labels.IsColorgetLineColor()Returns the color of the line.StringgetLineColorAsString()Returns the color of the line.List<Integer>getLineDash()Returns the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.doublegetLineDashOffset()Returns the line dash pattern offset.intgetLineWidth()Sets the width of the line.InteractionAxisgetMode()Returns the interaction axis mode.ModifierKeygetModifierKey()Returns the modifier key to activate the crosshair.CrosshairLabelgetXLabel()ScaleIdgetXScaleID()Returns the ID of the X scale to bind onto.CrosshairLabelgetYLabel()ScaleIdgetYScaleID()Returns the ID of the Y scale to bind onto.booleanisEnabled()Returnstrueif plugin is enabled.voidsetEnabled(boolean enabled)Setstrueif plugin is enabled.voidsetEvents(Set<IsEvent> events)Sets the browser events that the legend should listen to.voidsetEvents(IsEvent... events)Sets the browser events that the chart should listen to.voidsetLineColor(String color)Sets the color of the line.voidsetLineColor(IsColor color)Sets the color of the line.voidsetLineDash(int... lineDash)Sets the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.voidsetLineDashOffset(double lineDashOffset)Sets the line dash pattern offset.voidsetLineWidth(int lineWidth)Sets the width of the line.voidsetMode(InteractionAxis mode)Sets the interaction axis mode.voidsetModifierKey(ModifierKey modifierKey)Sets the modifier key to activate the crosshair.voidsetXScaleID(String scaleId)Sets the ID of the X scale to bind onto.voidsetXScaleID(ScaleId scaleId)Sets the ID of the X scale to bind onto.voidsetYScaleID(String scaleId)Sets the ID of the Y scale to bind onto.voidsetYScaleID(ScaleId scaleId)Sets the ID of the Y scale to bind onto.- 
Methods inherited from class org.pepstock.charba.client.plugins.AbstractPluginOptionsapplyingDefaults, applyingDefaults, getEventsOptionHandler, getId, getPluginId, loadGlobalsPluginOptions, store, store, store, store
 - 
Methods inherited from class org.pepstock.charba.client.commons.AbstractNodecheckAndAddToParent, getChildKey, getParentNode, getRootNode, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent
 - 
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainercheckDefaultValuesArgument, 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_ENABLEDpublic static final boolean DEFAULT_ENABLED Default enabled options, true.- See Also:
- Constant Field Values
 
 - 
DEFAULT_MODEpublic static final InteractionAxis DEFAULT_MODE Default interaction axis mode,InteractionAxis.XY.
 - 
DEFAULT_LINE_COLORpublic static final IsColor DEFAULT_LINE_COLOR Default line color,HtmlColor.LIGHT_GRAY.
 - 
DEFAULT_LINE_COLOR_AS_STRINGpublic static final String DEFAULT_LINE_COLOR_AS_STRING Default line color as string,HtmlColor.LIGHT_GRAY.
 - 
DEFAULT_LINE_WIDTHpublic static final int DEFAULT_LINE_WIDTH Default line width, 1.- See Also:
- Constant Field Values
 
 - 
DEFAULT_LINE_DASH_OFFSETpublic static final double DEFAULT_LINE_DASH_OFFSET Default line dash offset, 0.0.- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
CrosshairOptionspublic CrosshairOptions() Builds the object with new java script object setting the default value of plugin.
 The global plugin options is used, if exists, as defaults values.
 - 
CrosshairOptionspublic CrosshairOptions(IsChart chart) Builds the object with a chart instance in order to get the right defaults.
 If the plugin options have not been set by chart type, it will use the global.- Parameters:
- chart- chart instance related to the plugin options
 
 
- 
 - 
Method Detail- 
setEventspublic void setEvents(IsEvent... events) Description copied from interface:HasEventsSets the browser events that the chart should listen to.
 - 
setEventspublic void setEvents(Set<IsEvent> events) Description copied from interface:HasEventsSets the browser events that the legend should listen to.
 - 
getLabelspublic CrosshairLabels getLabels() Returns the labels utility to set the same value to all labels.- Returns:
- the labels utility to set the same value to all labels
 
 - 
getXLabelpublic CrosshairLabel getXLabel() 
 - 
getYLabelpublic CrosshairLabel getYLabel() 
 - 
setEnabledpublic void setEnabled(boolean enabled) Setstrueif plugin is enabled.- Parameters:
- enabled-- trueif plugin is enabled.
 
 - 
isEnabledpublic boolean isEnabled() Returnstrueif plugin is enabled.- Returns:
- trueif plugin is enabled.
 
 - 
setModepublic void setMode(InteractionAxis mode) Sets the interaction axis mode.- Parameters:
- mode- the interaction axis mode
 
 - 
getModepublic InteractionAxis getMode() Returns the interaction axis mode.- Returns:
- the interaction axis mode
 
 - 
setLineColorpublic void setLineColor(IsColor color) Sets the color of the line.- Parameters:
- color- the color of the line.
 
 - 
setLineColorpublic void setLineColor(String color) Sets the color of the line.- Parameters:
- color- the color of the line.
 
 - 
getLineColorAsStringpublic String getLineColorAsString() Returns the color of the line.- Returns:
- the color of the line.
 
 - 
getLineColorpublic IsColor getLineColor() Returns the color of the line.- Returns:
- the color of the line.
 
 - 
setLineWidthpublic void setLineWidth(int lineWidth) Sets the width of the line.- Parameters:
- lineWidth- the width of the line
 
 - 
getLineWidthpublic int getLineWidth() Sets the width of the line.- Returns:
- the width of the line
 
 - 
setLineDashpublic void setLineDash(int... lineDash) Sets the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.- Parameters:
- lineDash- the line dash pattern used when stroking lines
 
 - 
getLineDashpublic List<Integer> getLineDash() Returns the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.- Returns:
- the line dash pattern used when stroking lines
 
 - 
setLineDashOffsetpublic void setLineDashOffset(double lineDashOffset) Sets the line dash pattern offset.- Parameters:
- lineDashOffset- Offset for line dashes.
 
 - 
getLineDashOffsetpublic double getLineDashOffset() Returns the line dash pattern offset.- Returns:
- Offset for line dashes.
 
 - 
setXScaleIDpublic final void setXScaleID(String scaleId) Sets the ID of the X scale to bind onto.- Parameters:
- scaleId- the ID of the X scale to bind onto
 
 - 
setXScaleIDpublic final void setXScaleID(ScaleId scaleId) Sets the ID of the X scale to bind onto.- Parameters:
- scaleId- the ID of the X scale to bind onto
 
 - 
getXScaleIDpublic final ScaleId getXScaleID() Returns the ID of the X scale to bind onto.- Returns:
- the ID of the X scale to bind onto
 
 - 
setYScaleIDpublic final void setYScaleID(String scaleId) Sets the ID of the Y scale to bind onto.- Parameters:
- scaleId- the ID of the Y scale to bind onto
 
 - 
setYScaleIDpublic final void setYScaleID(ScaleId scaleId) Sets the ID of the Y scale to bind onto.- Parameters:
- scaleId- the ID of the Y scale to bind onto
 
 - 
getYScaleIDpublic final ScaleId getYScaleID() Returns the ID of the Y scale to bind onto.- Returns:
- the ID of the Y scale to bind onto
 
 - 
setModifierKeypublic void setModifierKey(ModifierKey modifierKey) Sets the modifier key to activate the crosshair.- Parameters:
- modifierKey- the modifier key to activate the crosshair
 
 - 
getModifierKeypublic ModifierKey getModifierKey() Returns the modifier key to activate the crosshair.- Returns:
- the modifier key to activate the crosshair
 
 
- 
 
-