Class CrosshairOptionsBuilder
- java.lang.Object
-
- org.pepstock.charba.client.commons.AbstractBaseBuilder
-
- org.pepstock.charba.client.impl.plugins.CrosshairOptionsBuilder
-
- All Implemented Interfaces:
IsBuilder
public final class CrosshairOptionsBuilder extends AbstractBaseBuilder
Comfortable object to createCrosshair.ID
plugin options by a builder.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CrosshairOptions
build()
Returns a configured plugin options.static CrosshairOptionsBuilder
create()
Returns new builder instance.static CrosshairOptionsBuilder
create(IsChart chart)
Returns new builder instance using the chart global options.CrosshairOptionsBuilder
setEnabled(boolean enabled)
Setstrue
if plugin is enabled.CrosshairOptionsBuilder
setLabelsBackgroundColor(String color)
Sets, for both labels, the background color.CrosshairOptionsBuilder
setLabelsBackgroundColor(IsColor color)
Sets, for both labels, the background color.CrosshairOptionsBuilder
setLabelsBorderColor(String borderColor)
Sets the border color.CrosshairOptionsBuilder
setLabelsBorderColor(IsColor borderColor)
Sets the border color.CrosshairOptionsBuilder
setLabelsBorderRadius(int borderRadius)
Sets, for both labels, the label border radius (in pixels).CrosshairOptionsBuilder
setLabelsBorderWidth(int borderWidth)
Sets the border width.CrosshairOptionsBuilder
setLabelsColor(String color)
Sets, for both labels, the crosshair label font color.CrosshairOptionsBuilder
setLabelsColor(IsColor color)
Set the crosshair label font color.CrosshairOptionsBuilder
setLabelsDisplay(boolean display)
Sets, for both labels,true
if label will be applied in the chart, otherwisefalse
.CrosshairOptionsBuilder
setLabelsPadding(int padding)
Sets, for both labels, the padding of crosshair label.CrosshairOptionsBuilder
setLineColor(String color)
Sets the color of the line.CrosshairOptionsBuilder
setLineColor(IsColor color)
Sets the color of the line.CrosshairOptionsBuilder
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.CrosshairOptionsBuilder
setLineDashOffset(double lineDashOffset)
Sets the line dash pattern offset.CrosshairOptionsBuilder
setLineWidth(int lineWidth)
Sets the width of the line.CrosshairOptionsBuilder
setMode(InteractionAxis mode)
Sets the interaction axis mode.CrosshairOptionsBuilder
setModifierKey(ModifierKey modifierKey)
Sets the modifier key to activate the crosshair.CrosshairOptionsBuilder
setXLabelBackgroundColor(String color)
Sets, for X label, the background color.CrosshairOptionsBuilder
setXLabelBackgroundColor(IsColor color)
Sets, for X label, the background color.CrosshairOptionsBuilder
setXLabelBorderColor(String borderColor)
Sets the border color.CrosshairOptionsBuilder
setXLabelBorderColor(IsColor borderColor)
Sets the border color.CrosshairOptionsBuilder
setXLabelBorderRadius(int borderRadius)
Sets, for X label, the label border radius (in pixels).CrosshairOptionsBuilder
setXLabelBorderWidth(int borderWidth)
Sets the border width.CrosshairOptionsBuilder
setXLabelColor(String color)
Sets, for X label, the crosshair label font color.CrosshairOptionsBuilder
setXLabelColor(IsColor color)
Set the crosshair label font color.CrosshairOptionsBuilder
setXLabelDisplay(boolean display)
Sets, for X label,true
if label will be applied in the chart, otherwisefalse
.CrosshairOptionsBuilder
setXLabelFormatter(CrosshairFormatterCallback formatterCallback)
Sets, for X label, the callback which can be implemented to change the text of label.CrosshairOptionsBuilder
setXLabelPadding(int padding)
Sets, for X label, the padding of crosshair label.CrosshairOptionsBuilder
setXScaleID(String scaleId)
Sets the ID of the X scale to bind onto.CrosshairOptionsBuilder
setXScaleID(ScaleId scaleId)
Sets the ID of the X scale to bind onto.CrosshairOptionsBuilder
setYLabelBackgroundColor(String color)
Sets, for Y label, the background color.CrosshairOptionsBuilder
setYLabelBackgroundColor(IsColor color)
Sets, for Y label, the background color.CrosshairOptionsBuilder
setYLabelBorderColor(String borderColor)
Sets the border color.CrosshairOptionsBuilder
setYLabelBorderColor(IsColor borderColor)
Sets the border color.CrosshairOptionsBuilder
setYLabelBorderRadius(int borderRadius)
Sets, for Y label, the label border radius (in pixels).CrosshairOptionsBuilder
setYLabelBorderWidth(int borderWidth)
Sets the border width.CrosshairOptionsBuilder
setYLabelColor(String color)
Sets, for Y label, the crosshair label font color.CrosshairOptionsBuilder
setYLabelColor(IsColor color)
Set the crosshair label font color.CrosshairOptionsBuilder
setYLabelDisplay(boolean display)
Sets, for Y label,true
if label will be applied in the chart, otherwisefalse
.CrosshairOptionsBuilder
setYLabelFormatter(CrosshairFormatterCallback formatterCallback)
Sets, for Y label, the callback which can be implemented to change the text of label.CrosshairOptionsBuilder
setYLabelPadding(int padding)
Sets, for Y label, the padding of crosshair label.CrosshairOptionsBuilder
setYScaleID(String scaleId)
Sets the ID of the Y scale to bind onto.CrosshairOptionsBuilder
setYScaleID(ScaleId scaleId)
Sets the ID of the Y scale to bind onto.-
Methods inherited from class org.pepstock.charba.client.commons.AbstractBaseBuilder
isBuilt, setBuilt
-
-
-
-
Method Detail
-
create
public static CrosshairOptionsBuilder create()
Returns new builder instance.- Returns:
- new builder instance
-
create
public static CrosshairOptionsBuilder create(IsChart chart)
Returns new builder instance using the chart global options.- Parameters:
chart
- chart instance related to the plugin options- Returns:
- new builder instance
-
build
public CrosshairOptions build()
Returns a configured plugin options.- Returns:
- a configured plugin options.
-
setEnabled
public CrosshairOptionsBuilder setEnabled(boolean enabled)
Setstrue
if plugin is enabled.- Parameters:
enabled
-true
if plugin is enabled.- Returns:
- new builder instance
-
setMode
public CrosshairOptionsBuilder setMode(InteractionAxis mode)
Sets the interaction axis mode.- Parameters:
mode
- the interaction axis mode- Returns:
- new builder instance
-
setLineColor
public CrosshairOptionsBuilder setLineColor(IsColor color)
Sets the color of the line.- Parameters:
color
- the color of the line.- Returns:
- new builder instance
-
setLineColor
public CrosshairOptionsBuilder setLineColor(String color)
Sets the color of the line.- Parameters:
color
- the color of the line.- Returns:
- new builder instance
-
setLineWidth
public CrosshairOptionsBuilder setLineWidth(int lineWidth)
Sets the width of the line.- Parameters:
lineWidth
- the width of the line- Returns:
- new builder instance
-
setLineDash
public CrosshairOptionsBuilder 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- Returns:
- new builder instance
-
setLineDashOffset
public CrosshairOptionsBuilder setLineDashOffset(double lineDashOffset)
Sets the line dash pattern offset.- Parameters:
lineDashOffset
- Offset for line dashes.- Returns:
- new builder instance
-
setXScaleID
public CrosshairOptionsBuilder setXScaleID(String scaleId)
Sets the ID of the X scale to bind onto.- Parameters:
scaleId
- the ID of the X scale to bind onto- Returns:
- new builder instance
-
setXScaleID
public CrosshairOptionsBuilder setXScaleID(ScaleId scaleId)
Sets the ID of the X scale to bind onto.- Parameters:
scaleId
- the ID of the X scale to bind onto- Returns:
- new builder instance
-
setYScaleID
public CrosshairOptionsBuilder setYScaleID(String scaleId)
Sets the ID of the Y scale to bind onto.- Parameters:
scaleId
- the ID of the Y scale to bind onto- Returns:
- new builder instance
-
setYScaleID
public CrosshairOptionsBuilder setYScaleID(ScaleId scaleId)
Sets the ID of the Y scale to bind onto.- Parameters:
scaleId
- the ID of the Y scale to bind onto- Returns:
- new builder instance
-
setModifierKey
public CrosshairOptionsBuilder setModifierKey(ModifierKey modifierKey)
Sets the modifier key to activate the crosshair.- Parameters:
modifierKey
- the modifier key to activate the crosshair- Returns:
- new builder instance
-
setXLabelDisplay
public CrosshairOptionsBuilder setXLabelDisplay(boolean display)
Sets, for X label,true
if label will be applied in the chart, otherwisefalse
.- Parameters:
display
-true
if label will be applied in the chart, otherwisefalse
- Returns:
- new builder instance
-
setXLabelColor
public CrosshairOptionsBuilder setXLabelColor(String color)
Sets, for X label, the crosshair label font color.- Parameters:
color
- the crosshair label font color.- Returns:
- new builder instance
-
setXLabelColor
public CrosshairOptionsBuilder setXLabelColor(IsColor color)
Set the crosshair label font color.- Parameters:
color
- the crosshair label font color.- Returns:
- new builder instance
-
setXLabelPadding
public CrosshairOptionsBuilder setXLabelPadding(int padding)
Sets, for X label, the padding of crosshair label.- Parameters:
padding
- padding of crosshair label- Returns:
- new builder instance
-
setXLabelBackgroundColor
public CrosshairOptionsBuilder setXLabelBackgroundColor(String color)
Sets, for X label, the background color.- Parameters:
color
- the background color.- Returns:
- new builder instance
-
setXLabelBackgroundColor
public CrosshairOptionsBuilder setXLabelBackgroundColor(IsColor color)
Sets, for X label, the background color.- Parameters:
color
- the background color.- Returns:
- new builder instance
-
setXLabelBorderRadius
public CrosshairOptionsBuilder setXLabelBorderRadius(int borderRadius)
Sets, for X label, the label border radius (in pixels).- Parameters:
borderRadius
- the label border radius (in pixels).- Returns:
- new builder instance
-
setXLabelFormatter
public CrosshairOptionsBuilder setXLabelFormatter(CrosshairFormatterCallback formatterCallback)
Sets, for X label, 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- Returns:
- new builder instance
-
setXLabelBorderColor
public CrosshairOptionsBuilder setXLabelBorderColor(IsColor borderColor)
Sets the border color.- Parameters:
borderColor
- the border color.- Returns:
- new builder instance
-
setXLabelBorderColor
public CrosshairOptionsBuilder setXLabelBorderColor(String borderColor)
Sets the border color.- Parameters:
borderColor
- the border color.- Returns:
- new builder instance
-
setXLabelBorderWidth
public CrosshairOptionsBuilder setXLabelBorderWidth(int borderWidth)
Sets the border width.- Parameters:
borderWidth
- the border width.- Returns:
- new builder instance
-
setYLabelDisplay
public CrosshairOptionsBuilder setYLabelDisplay(boolean display)
Sets, for Y label,true
if label will be applied in the chart, otherwisefalse
.- Parameters:
display
-true
if label will be applied in the chart, otherwisefalse
- Returns:
- new builder instance
-
setYLabelColor
public CrosshairOptionsBuilder setYLabelColor(String color)
Sets, for Y label, the crosshair label font color.- Parameters:
color
- the crosshair label font color.- Returns:
- new builder instance
-
setYLabelColor
public CrosshairOptionsBuilder setYLabelColor(IsColor color)
Set the crosshair label font color.- Parameters:
color
- the crosshair label font color.- Returns:
- new builder instance
-
setYLabelPadding
public CrosshairOptionsBuilder setYLabelPadding(int padding)
Sets, for Y label, the padding of crosshair label.- Parameters:
padding
- padding of crosshair label- Returns:
- new builder instance
-
setYLabelBackgroundColor
public CrosshairOptionsBuilder setYLabelBackgroundColor(String color)
Sets, for Y label, the background color.- Parameters:
color
- the background color.- Returns:
- new builder instance
-
setYLabelBackgroundColor
public CrosshairOptionsBuilder setYLabelBackgroundColor(IsColor color)
Sets, for Y label, the background color.- Parameters:
color
- the background color.- Returns:
- new builder instance
-
setYLabelBorderRadius
public CrosshairOptionsBuilder setYLabelBorderRadius(int borderRadius)
Sets, for Y label, the label border radius (in pixels).- Parameters:
borderRadius
- the label border radius (in pixels).- Returns:
- new builder instance
-
setYLabelFormatter
public CrosshairOptionsBuilder setYLabelFormatter(CrosshairFormatterCallback formatterCallback)
Sets, for Y label, 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- Returns:
- new builder instance
-
setYLabelBorderColor
public CrosshairOptionsBuilder setYLabelBorderColor(IsColor borderColor)
Sets the border color.- Parameters:
borderColor
- the border color.- Returns:
- new builder instance
-
setYLabelBorderColor
public CrosshairOptionsBuilder setYLabelBorderColor(String borderColor)
Sets the border color.- Parameters:
borderColor
- the border color.- Returns:
- new builder instance
-
setYLabelBorderWidth
public CrosshairOptionsBuilder setYLabelBorderWidth(int borderWidth)
Sets the border width.- Parameters:
borderWidth
- the border width.- Returns:
- new builder instance
-
setLabelsDisplay
public CrosshairOptionsBuilder setLabelsDisplay(boolean display)
Sets, for both labels,true
if label will be applied in the chart, otherwisefalse
.- Parameters:
display
-true
if label will be applied in the chart, otherwisefalse
- Returns:
- new builder instance
-
setLabelsColor
public CrosshairOptionsBuilder setLabelsColor(String color)
Sets, for both labels, the crosshair label font color.- Parameters:
color
- the crosshair label font color.- Returns:
- new builder instance
-
setLabelsColor
public CrosshairOptionsBuilder setLabelsColor(IsColor color)
Set the crosshair label font color.- Parameters:
color
- the crosshair label font color.- Returns:
- new builder instance
-
setLabelsPadding
public CrosshairOptionsBuilder setLabelsPadding(int padding)
Sets, for both labels, the padding of crosshair label.- Parameters:
padding
- padding of crosshair label- Returns:
- new builder instance
-
setLabelsBackgroundColor
public CrosshairOptionsBuilder setLabelsBackgroundColor(String color)
Sets, for both labels, the background color.- Parameters:
color
- the background color.- Returns:
- new builder instance
-
setLabelsBackgroundColor
public CrosshairOptionsBuilder setLabelsBackgroundColor(IsColor color)
Sets, for both labels, the background color.- Parameters:
color
- the background color.- Returns:
- new builder instance
-
setLabelsBorderRadius
public CrosshairOptionsBuilder setLabelsBorderRadius(int borderRadius)
Sets, for both labels, the label border radius (in pixels).- Parameters:
borderRadius
- the label border radius (in pixels).- Returns:
- new builder instance
-
setLabelsBorderColor
public CrosshairOptionsBuilder setLabelsBorderColor(IsColor borderColor)
Sets the border color.- Parameters:
borderColor
- the border color.- Returns:
- new builder instance
-
setLabelsBorderColor
public CrosshairOptionsBuilder setLabelsBorderColor(String borderColor)
Sets the border color.- Parameters:
borderColor
- the border color.- Returns:
- new builder instance
-
setLabelsBorderWidth
public CrosshairOptionsBuilder setLabelsBorderWidth(int borderWidth)
Sets the border width.- Parameters:
borderWidth
- the border width.- Returns:
- new builder instance
-
-