public class CartesianLinearTick extends Object implements IsLinearTick
Modifier and Type | Method and Description |
---|---|
ElementAlign |
getAlign()
Returns the tick alignment along the axis.
|
int |
getAutoSkipPadding()
Returns the padding between the ticks on the horizontal axis when autoSkip is enabled.
|
Axis |
getAxis()
Returns the axis instance.
|
IsColor |
getBackdropColor()
Returns the color of label backdrops.
|
String |
getBackdropColorAsString()
Returns the color of label backdrops.
|
ColorCallback<ScaleContext> |
getBackdropColorCallback()
Returns the backdrop color callback instance.
|
Padding |
getBackdropPadding()
Returns the padding of label backdrop.
|
TickCallback |
getCallback()
Returns the user callback instance.
|
IsColor |
getColor()
Returns the font color.
|
String |
getColorAsString()
Returns the font color as string.
|
ColorCallback<ScaleContext> |
getColorCallback()
Returns the color callback, if set, otherwise
null . |
CrossAlign |
getCrossAlign()
Returns the tick alignment perpendicular to the axis.
|
Font |
getFont()
Returns the font element.
|
FontCallback<ScaleContext> |
getFontCallback()
Returns the font callback, if set, otherwise
null . |
int |
getLabelOffset()
Returns the distance in pixels to offset the label from the center point of the tick (in the y direction for the x axis, and the x direction for the y axis).
Note: this can cause labels at the edges to be cropped by the edge of the canvas. |
Major |
getMajor()
Returns major tick element.
|
int |
getMaxRotation()
Returns the maximum rotation for tick labels when rotating to condense labels.
|
int |
getMinRotation()
Returns the minimum rotation for tick labels.
|
IsNumberFormat |
getNumberFormat()
Returns the number format instance.
|
int |
getPadding()
Returns the padding between the tick label and the axis.
|
int |
getSampleSize()
Returns the number of ticks to examine when deciding how many labels will fit.
Setting a smaller value will be faster, but may be less accurate when there is large variability in label length. |
ShowLabelBackdropCallback |
getShowLabelBackdropCallback()
Returns the show label backdrop callback instance.
|
IsColor |
getTextStrokeColor()
Returns the text stroke color.
|
String |
getTextStrokeColorAsString()
Returns the text stroke color as string.
|
ColorCallback<ScaleContext> |
getTextStrokeColorCallback()
Returns the text stroke color callback, if set, otherwise
null . |
int |
getTextStrokeWidth()
Returns the text stroke width.
|
WidthCallback<ScaleContext> |
getTextStrokeWidthCallback()
Returns the text stroke width callback, if set, otherwise
null . |
org.pepstock.charba.client.configuration.LinearTickOptionsHandler |
getTickOptionsHandler()
Returns the linear tick options handler instance, for callbacks.
|
int |
getZ()
Returns z-index of tick layer.
|
boolean |
isAutoSkip()
If true, automatically calculates how many labels that can be shown and hides labels accordingly.
|
boolean |
isDisplay()
If true, show tick marks
|
boolean |
isIncludeBounds()
If
true , the defined minimum and maximum values should be presented as ticks even if they are not "nice". |
boolean |
isMirror()
Returns the flips tick labels around axis, displaying the labels inside the chart instead of outside.
|
boolean |
isShowLabelBackdrop()
If true, draw a background behind the tick labels.
|
void |
setAlign(ElementAlign align)
Sets the tick alignment along the axis.
|
void |
setAutoSkip(boolean autoSkip)
If true, automatically calculates how many labels that can be shown and hides labels accordingly.
|
void |
setAutoSkipPadding(int autoSkipPadding)
Sets the padding between the ticks on the horizontal axis when autoSkip is enabled.
|
void |
setBackdropColor(ColorCallback<ScaleContext> backdropColorCallback)
Sets the backdrop color callback instance.
|
void |
setBackdropColor(IsColor backdropColor)
Sets the color of label backdrops.
|
void |
setBackdropColor(NativeCallback backdropColorCallback)
Sets the backdrop color callback instance.
|
void |
setBackdropColor(String backdropColor)
Sets the color of label backdrops.
|
void |
setCallback(TickCallback callback)
Sets the user callback instance.
|
void |
setColor(ColorCallback<ScaleContext> colorCallback)
Sets the color callback.
|
void |
setColor(IsColor color)
Sets the font color.
|
void |
setColor(NativeCallback colorCallback)
Sets the color callback.
|
void |
setColor(String color)
Sets the font color.
|
void |
setCrossAlign(CrossAlign crossAlign)
Sets the tick alignment perpendicular to the axis.
|
void |
setDisplay(boolean display)
If true, show tick marks.
|
void |
setFont(FontCallback<ScaleContext> fontCallback)
Sets the font callback.
|
void |
setFont(NativeCallback fontCallback)
Sets the font callback.
|
void |
setIncludeBounds(boolean includeBounds)
If
true , the defined min and maximum values should be presented as ticks even if they are not "nice" |
void |
setLabelOffset(int labelOffset)
Sets the distance in pixels to offset the label from the center point of the tick (in the y direction for the x axis, and the x direction for the y axis).
Note: this can cause labels at the edges to be cropped by the edge of the canvas. |
void |
setMaxRotation(int maxRotation)
Sets the maximum rotation for tick labels when rotating to condense labels.
|
void |
setMinRotation(int minRotation)
Sets the minimum rotation for tick labels.
|
void |
setMirror(boolean mirror)
Sets the flips tick labels around axis, displaying the labels inside the chart instead of outside.
|
void |
setPadding(int padding)
Sets the padding between the tick label and the axis.
|
void |
setSampleSize(int sampleSize)
Sets the number of ticks to examine when deciding how many labels will fit.
Setting a smaller value will be faster, but may be less accurate when there is large variability in label length. |
void |
setShowLabelBackdrop(boolean showLabelBackdrop)
If true, draw a background behind the tick labels.
|
void |
setShowLabelBackdrop(NativeCallback showLabelBackdropCallback)
Sets the show label backdrop callback instance.
|
void |
setShowLabelBackdrop(ShowLabelBackdropCallback showLabelBackdropCallback)
Sets the show label backdrop callback instance.
|
void |
setTextStrokeColor(ColorCallback<ScaleContext> textStrokeColorCallback)
Sets the text stroke color callback.
|
void |
setTextStrokeColor(IsColor color)
Sets the text stroke color.
|
void |
setTextStrokeColor(NativeCallback textStrokeColorCallback)
Sets the text stroke color callback.
|
void |
setTextStrokeColor(String color)
Sets the text stroke color.
|
void |
setTextStrokeWidth(int textStrokeWidth)
Sets the text stroke width.
|
void |
setTextStrokeWidth(NativeCallback textStrokeWidthCallback)
Sets the text stroke width callback.
|
void |
setTextStrokeWidth(WidthCallback<ScaleContext> textStrokeWidthCallback)
Sets the text stroke width callback.
|
void |
setZ(int z)
Sets z-index of tick layer.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAxis, getCount, getCountCallback, getMaxTicksLimit, getMaxTicksLimitCallback, getPrecision, getPrecisionCallback, getStepSize, getStepSizeCallback, setCount, setCount, setCount, setMaxTicksLimit, setMaxTicksLimit, setMaxTicksLimit, setPrecision, setPrecision, setPrecision, setStepSize, setStepSize, setStepSize
getNumberFormat, getNumberFormatCallback, setNumberFormat, setNumberFormat
public final org.pepstock.charba.client.configuration.LinearTickOptionsHandler getTickOptionsHandler()
IsLinearTick
getTickOptionsHandler
in interface IsLinearTick
getTickOptionsHandler
in interface IsNumericTick
public TickCallback getCallback()
public void setCallback(TickCallback callback)
callback
- the callback to setpublic final IsNumberFormat getNumberFormat()
IsNumericTick
getNumberFormat
in interface IsNumericTick
public void setAutoSkip(boolean autoSkip)
autoSkip
- If true, automatically calculates how many labels that can be shown and hides labels accordingly. Turn it off to show all labels no matter whatpublic boolean isAutoSkip()
public void setAutoSkipPadding(int autoSkipPadding)
autoSkipPadding
- padding between the ticks on the horizontal axis when autoSkip is enabled. Note: Only applicable to horizontal scales.public int getAutoSkipPadding()
public void setIncludeBounds(boolean includeBounds)
true
, the defined min and maximum values should be presented as ticks even if they are not "nice"includeBounds
- if true
, the defined min and maximum values should be presented as ticks even if they are not "nice"public boolean isIncludeBounds()
true
, the defined minimum and maximum values should be presented as ticks even if they are not "nice".true
, the defined min and maximum values should be presented as ticks even if they are not "nice"public void setLabelOffset(int labelOffset)
labelOffset
- the distance in pixels to offset the label from the center point of the tick (in the y direction for the x axis, and the x direction for the y axis)public int getLabelOffset()
public void setMaxRotation(int maxRotation)
maxRotation
- maximum rotation for tick labels when rotating to condense labels. Note: Rotation doesn't occur until necessary. Note: Only applicable to horizontal
scales.public int getMaxRotation()
public void setMinRotation(int minRotation)
minRotation
- minimum rotation for tick labels. Note: Only applicable to horizontal scales.public int getMinRotation()
public void setMirror(boolean mirror)
mirror
- flips tick labels around axis, displaying the labels inside the chart instead of outside. Note: Only applicable to vertical scales.public boolean isMirror()
public void setSampleSize(int sampleSize)
sampleSize
- the number of ticks to examine when deciding how many labels will fit.public int getSampleSize()
public void setAlign(ElementAlign align)
align
- the tick alignment along the axispublic ElementAlign getAlign()
public void setCrossAlign(CrossAlign crossAlign)
crossAlign
- the tick alignment perpendicular to the axispublic CrossAlign getCrossAlign()
public Major getMajor()
public Font getFont()
public Padding getBackdropPadding()
public void setColor(IsColor color)
color
- font color.public void setColor(String color)
color
- font color.public String getColorAsString()
public IsColor getColor()
public void setDisplay(boolean display)
display
- if true, show tick markspublic boolean isDisplay()
public void setZ(int z)
z
- z-index of tick layer. Useful when ticks are drawn on chart area.public int getZ()
public void setTextStrokeColor(IsColor color)
color
- the text stroke colorpublic void setTextStrokeColor(String color)
color
- the text stroke color.public String getTextStrokeColorAsString()
public IsColor getTextStrokeColor()
public void setTextStrokeWidth(int textStrokeWidth)
textStrokeWidth
- the text stroke width.public int getTextStrokeWidth()
public void setPadding(int padding)
padding
- padding between the tick label and the axis. When set on a vertical axis, this applies in the horizontal (X) direction. When set on a horizontal axis, this
applies in the vertical (Y) direction.public int getPadding()
public void setBackdropColor(IsColor backdropColor)
backdropColor
- color of label backdrops.public void setBackdropColor(String backdropColor)
backdropColor
- color of label backdrops.public String getBackdropColorAsString()
public IsColor getBackdropColor()
public void setShowLabelBackdrop(boolean showLabelBackdrop)
showLabelBackdrop
- if true, draw a background behind the tick labels.public boolean isShowLabelBackdrop()
public FontCallback<ScaleContext> getFontCallback()
null
.getFontCallback
in interface IsScriptableFontProvider<ScaleContext>
null
.public ColorCallback<ScaleContext> getColorCallback()
null
.null
.public ColorCallback<ScaleContext> getTextStrokeColorCallback()
null
.null
.public WidthCallback<ScaleContext> getTextStrokeWidthCallback()
null
.null
.public ColorCallback<ScaleContext> getBackdropColorCallback()
public ShowLabelBackdropCallback getShowLabelBackdropCallback()
public void setColor(ColorCallback<ScaleContext> colorCallback)
colorCallback
- the color callback to setpublic void setColor(NativeCallback colorCallback)
colorCallback
- the color callback to setpublic void setTextStrokeColor(ColorCallback<ScaleContext> textStrokeColorCallback)
textStrokeColorCallback
- the text stroke color callback to setpublic void setTextStrokeColor(NativeCallback textStrokeColorCallback)
textStrokeColorCallback
- the text stroke color callback to setpublic void setTextStrokeWidth(WidthCallback<ScaleContext> textStrokeWidthCallback)
textStrokeWidthCallback
- the text stroke width callback to setpublic void setTextStrokeWidth(NativeCallback textStrokeWidthCallback)
textStrokeWidthCallback
- the text stroke width callback to setpublic void setFont(FontCallback<ScaleContext> fontCallback)
setFont
in interface IsScriptableFontProvider<ScaleContext>
fontCallback
- the font callback to setpublic void setFont(NativeCallback fontCallback)
setFont
in interface IsScriptableFontProvider<ScaleContext>
fontCallback
- the font callback to setpublic void setBackdropColor(ColorCallback<ScaleContext> backdropColorCallback)
backdropColorCallback
- the backdrop color callback instancepublic void setBackdropColor(NativeCallback backdropColorCallback)
backdropColorCallback
- the backdrop color callback instancepublic void setShowLabelBackdrop(ShowLabelBackdropCallback showLabelBackdropCallback)
showLabelBackdropCallback
- the show label backdrop callback instancepublic void setShowLabelBackdrop(NativeCallback showLabelBackdropCallback)
showLabelBackdropCallback
- the show label backdrop callback instancepublic final Axis getAxis()