public final class Ticks extends AbstractModel<AbstractScale,IsDefaultTicks> implements IsDefaultTicks, HasFont
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.
Note: Only applicable to horizontal scales. |
IsColor |
getBackdropColor()
Returns the color of label backdrops.
|
String |
getBackdropColorAsString()
Returns the color of label backdrops.
|
Padding |
getBackdropPadding()
Returns the padding of label backdrop.
|
int |
getCount()
Returns the number of ticks to generate.
If specified, this overrides the automatic generation. |
CrossAlign |
getCrossAlign()
Returns the tick alignment perpendicular to the axis.
|
FontContainer |
getFontContainer()
Returns a font container instance to use in the default methods of this interface.
|
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 the major element.
|
int |
getMaxRotation()
Returns the maximum rotation for tick labels when rotating to condense labels.
Note: Rotation doesn't occur until necessary. |
int |
getMaxTicksLimit()
Returns the maximum number of ticks and grid to show.
|
int |
getMinRotation()
Returns the minimum rotation for tick labels.
Note: Only applicable to horizontal scales. |
TicksNumberFormat |
getNumberFormat()
Returns the number formatting options.
|
int |
getPadding()
Returns the 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. |
int |
getPrecision()
If defined and stepSize is not specified, the step size will be rounded to this many decimal places.
|
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. |
TickSource |
getSource()
Returns the property controls the ticks generation.
|
double |
getStepSize()
Returns the user defined fixed step size for the scale.
|
IsColor |
getTextStrokeColor()
Returns the text stroke color.
|
String |
getTextStrokeColorAsString()
Returns the text stroke color as string.
|
int |
getTextStrokeWidth()
Returns the text stroke width.
|
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.Turn it off to show all labels no matter what |
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.
Note: Only applicable to vertical scales. |
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.Turn it off to show all labels no matter what |
void |
setAutoSkipPadding(int autoSkipPadding)
Sets the padding between the ticks on the horizontal axis when autoSkip is enabled.
Note: Only applicable to horizontal scales. |
void |
setBackdropColor(IsColor backdropColor)
Sets the color of label backdrops.
|
void |
setBackdropColor(String backdropColor)
Sets the color of label backdrops.
|
void |
setCount(int count)
Sets the number of ticks to generate.
If specified, this overrides the automatic generation. |
void |
setCrossAlign(CrossAlign crossAlign)
Sets the tick alignment perpendicular to the axis.
|
void |
setDisplay(boolean display)
If
true , show tick marks. |
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.
Note: Rotation doesn't occur until necessary. Note: Only applicable to horizontal scales. |
void |
setMaxTicksLimit(int maxTicksLimit)
Sets the maximum number of ticks and grid to show.
|
void |
setMinRotation(int minRotation)
Sets the minimum rotation for tick labels.
Note: Only applicable to horizontal scales. |
void |
setMirror(boolean mirror)
Sets the flips tick labels around axis, displaying the labels inside the chart instead of outside.
Note: Only applicable to vertical scales. |
void |
setPadding(int padding)
Sets the 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. |
void |
setPrecision(int precision)
If defined and stepSize is not specified, the step size will be rounded to this many decimal places.
|
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 |
setSource(TickSource source)
Sets the property controls the ticks generation.
|
void |
setStepSize(double stepSize)
Sets the user defined fixed step size for the scale.
|
void |
setTextStrokeColor(IsColor color)
Sets the text stroke color.
|
void |
setTextStrokeColor(String color)
Sets the text stroke color.
|
void |
setTextStrokeWidth(int textStrokeWidth)
Sets the text stroke width.
|
void |
setZ(int z)
Sets z-index of tick layer.
|
getDefaultValues, getParent, loadPadding, setCallbackToModel, setCallbackToModel, setEventToModel
checkAndAddToParent, 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, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent
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, 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, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
public FontContainer getFontContainer()
HasFont
getFontContainer
in interface HasFont
public Major getMajor()
getMajor
in interface IsDefaultTicks
public TicksNumberFormat getNumberFormat()
getNumberFormat
in interface IsDefaultTicks
public Padding getBackdropPadding()
getBackdropPadding
in interface IsDefaultTicks
public void setDisplay(boolean display)
true
, show tick marks.display
- if true
, show tick marks.public boolean isDisplay()
true
, show tick marks.isDisplay
in interface IsDefaultTicks
true
, show tick marks.public void setAutoSkip(boolean autoSkip)
true
, automatically calculates how many labels that can be shown and hides labels accordingly.autoSkip
- if true
, automatically calculates how many labels that can be shown and hides labels accordingly.public boolean isAutoSkip()
true
, automatically calculates how many labels that can be shown and hides labels accordingly.isAutoSkip
in interface IsDefaultTicks
true
, automatically calculates how many labels that can be shown and hides labels accordingly.public void setAutoSkipPadding(int autoSkipPadding)
autoSkipPadding
- padding between the ticks on the horizontal axis when autoSkip is enabled.public int getAutoSkipPadding()
getAutoSkipPadding
in interface IsDefaultTicks
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".isIncludeBounds
in interface IsDefaultTicks
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()
getLabelOffset
in interface IsDefaultTicks
public void setCount(int count)
count
- the number of ticks to generate.public int getCount()
getCount
in interface IsDefaultTicks
public void setMaxRotation(int maxRotation)
maxRotation
- maximum rotation for tick labels when rotating to condense labels.public int getMaxRotation()
getMaxRotation
in interface IsDefaultTicks
public void setMinRotation(int minRotation)
minRotation
- minimum rotation for tick labels.public int getMinRotation()
getMinRotation
in interface IsDefaultTicks
public void setMirror(boolean mirror)
mirror
- flips tick labels around axis, displaying the labels inside the chart instead of outside.public boolean isMirror()
isMirror
in interface IsDefaultTicks
public void setPadding(int padding)
padding
- padding between the tick label and the axis.public int getPadding()
getPadding
in interface IsDefaultTicks
public void setMaxTicksLimit(int maxTicksLimit)
maxTicksLimit
- maximum number of ticks and grid to show.public int getMaxTicksLimit()
getMaxTicksLimit
in interface IsDefaultTicks
public void setStepSize(double stepSize)
stepSize
- user defined fixed step size for the scale.public double getStepSize()
getStepSize
in interface IsDefaultTicks
public void setBackdropColor(IsColor backdropColor)
backdropColor
- color of label backdrops.public void setBackdropColor(String backdropColor)
backdropColor
- color of label backdrops.public String getBackdropColorAsString()
getBackdropColorAsString
in interface IsDefaultTicks
public IsColor getBackdropColor()
public void setShowLabelBackdrop(boolean showLabelBackdrop)
true
, draw a background behind the tick labels.showLabelBackdrop
- if true
, draw a background behind the tick labels.public boolean isShowLabelBackdrop()
true
, draw a background behind the tick labels.isShowLabelBackdrop
in interface IsDefaultTicks
true
, draw a background behind the tick labels.public void setSource(TickSource source)
source
- property controls the ticks generation.public TickSource getSource()
getSource
in interface IsDefaultTicks
public void setPrecision(int precision)
precision
- if defined and stepSize is not specified, the step size will be rounded to this many decimal places.public int getPrecision()
getPrecision
in interface IsDefaultTicks
public void setZ(int z)
z
- z-index of tick layer. Useful when ticks are drawn on chart area.public int getZ()
getZ
in interface IsDefaultTicks
public void setSampleSize(int sampleSize)
sampleSize
- the number of ticks to examine when deciding how many labels will fit.public int getSampleSize()
getSampleSize
in interface IsDefaultTicks
public void setAlign(ElementAlign align)
align
- the tick alignment along the axispublic ElementAlign getAlign()
getAlign
in interface IsDefaultTicks
public void setCrossAlign(CrossAlign crossAlign)
crossAlign
- the tick alignment perpendicular to the axispublic CrossAlign getCrossAlign()
getCrossAlign
in interface IsDefaultTicks
public final void setTextStrokeColor(IsColor color)
color
- the text stroke colorpublic final void setTextStrokeColor(String color)
color
- the text stroke color.public final String getTextStrokeColorAsString()
getTextStrokeColorAsString
in interface IsDefaultTicks
public final IsColor getTextStrokeColor()
public final void setTextStrokeWidth(int textStrokeWidth)
textStrokeWidth
- the text stroke width.public final int getTextStrokeWidth()
getTextStrokeWidth
in interface IsDefaultTicks