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.IDplugin options by a builder.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CrosshairOptionsbuild()Returns a configured plugin options.static CrosshairOptionsBuildercreate()Returns new builder instance.static CrosshairOptionsBuildercreate(IsChart chart)Returns new builder instance using the chart global options.CrosshairOptionsBuildersetEnabled(boolean enabled)Setstrueif plugin is enabled.CrosshairOptionsBuildersetLabelsBackgroundColor(String color)Sets, for both labels, the background color.CrosshairOptionsBuildersetLabelsBackgroundColor(IsColor color)Sets, for both labels, the background color.CrosshairOptionsBuildersetLabelsBorderColor(String borderColor)Sets the border color.CrosshairOptionsBuildersetLabelsBorderColor(IsColor borderColor)Sets the border color.CrosshairOptionsBuildersetLabelsBorderRadius(int borderRadius)Sets, for both labels, the label border radius (in pixels).CrosshairOptionsBuildersetLabelsBorderWidth(int borderWidth)Sets the border width.CrosshairOptionsBuildersetLabelsColor(String color)Sets, for both labels, the crosshair label font color.CrosshairOptionsBuildersetLabelsColor(IsColor color)Set the crosshair label font color.CrosshairOptionsBuildersetLabelsDisplay(boolean display)Sets, for both labels,trueif label will be applied in the chart, otherwisefalse.CrosshairOptionsBuildersetLabelsPadding(int padding)Sets, for both labels, the padding of crosshair label.CrosshairOptionsBuildersetLineColor(String color)Sets the color of the line.CrosshairOptionsBuildersetLineColor(IsColor color)Sets the color of the line.CrosshairOptionsBuildersetLineDash(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.CrosshairOptionsBuildersetLineDashOffset(double lineDashOffset)Sets the line dash pattern offset.CrosshairOptionsBuildersetLineWidth(int lineWidth)Sets the width of the line.CrosshairOptionsBuildersetMode(InteractionAxis mode)Sets the interaction axis mode.CrosshairOptionsBuildersetModifierKey(ModifierKey modifierKey)Sets the modifier key to activate the crosshair.CrosshairOptionsBuildersetXLabelBackgroundColor(String color)Sets, for X label, the background color.CrosshairOptionsBuildersetXLabelBackgroundColor(IsColor color)Sets, for X label, the background color.CrosshairOptionsBuildersetXLabelBorderColor(String borderColor)Sets the border color.CrosshairOptionsBuildersetXLabelBorderColor(IsColor borderColor)Sets the border color.CrosshairOptionsBuildersetXLabelBorderRadius(int borderRadius)Sets, for X label, the label border radius (in pixels).CrosshairOptionsBuildersetXLabelBorderWidth(int borderWidth)Sets the border width.CrosshairOptionsBuildersetXLabelColor(String color)Sets, for X label, the crosshair label font color.CrosshairOptionsBuildersetXLabelColor(IsColor color)Set the crosshair label font color.CrosshairOptionsBuildersetXLabelDisplay(boolean display)Sets, for X label,trueif label will be applied in the chart, otherwisefalse.CrosshairOptionsBuildersetXLabelFormatter(CrosshairFormatterCallback formatterCallback)Sets, for X label, the callback which can be implemented to change the text of label.CrosshairOptionsBuildersetXLabelPadding(int padding)Sets, for X label, the padding of crosshair label.CrosshairOptionsBuildersetXScaleID(String scaleId)Sets the ID of the X scale to bind onto.CrosshairOptionsBuildersetXScaleID(ScaleId scaleId)Sets the ID of the X scale to bind onto.CrosshairOptionsBuildersetYLabelBackgroundColor(String color)Sets, for Y label, the background color.CrosshairOptionsBuildersetYLabelBackgroundColor(IsColor color)Sets, for Y label, the background color.CrosshairOptionsBuildersetYLabelBorderColor(String borderColor)Sets the border color.CrosshairOptionsBuildersetYLabelBorderColor(IsColor borderColor)Sets the border color.CrosshairOptionsBuildersetYLabelBorderRadius(int borderRadius)Sets, for Y label, the label border radius (in pixels).CrosshairOptionsBuildersetYLabelBorderWidth(int borderWidth)Sets the border width.CrosshairOptionsBuildersetYLabelColor(String color)Sets, for Y label, the crosshair label font color.CrosshairOptionsBuildersetYLabelColor(IsColor color)Set the crosshair label font color.CrosshairOptionsBuildersetYLabelDisplay(boolean display)Sets, for Y label,trueif label will be applied in the chart, otherwisefalse.CrosshairOptionsBuildersetYLabelFormatter(CrosshairFormatterCallback formatterCallback)Sets, for Y label, the callback which can be implemented to change the text of label.CrosshairOptionsBuildersetYLabelPadding(int padding)Sets, for Y label, the padding of crosshair label.CrosshairOptionsBuildersetYScaleID(String scaleId)Sets the ID of the Y scale to bind onto.CrosshairOptionsBuildersetYScaleID(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)
Setstrueif plugin is enabled.- Parameters:
enabled-trueif 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,trueif label will be applied in the chart, otherwisefalse.- Parameters:
display-trueif 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,trueif label will be applied in the chart, otherwisefalse.- Parameters:
display-trueif 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,trueif label will be applied in the chart, otherwisefalse.- Parameters:
display-trueif 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
-
-