public final class Ticks extends AbstractTick<Scale,IsDefaultTicks> implements IsDefaultTicks
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkAndAddToParent()
Called recursively when a property has been set in the item.
This is mandatory because it could happen that the parent item is not present, therefore it must be added. |
int |
getAutoSkipPadding()
Returns the padding between the ticks on the horizontal axis when autoSkip is enabled.
|
IsColor |
getBackdropColor()
Returns the color of label backdrops.
|
String |
getBackdropColorAsString()
Returns the color of label backdrops.
|
int |
getBackdropPaddingX()
Returns the horizontal padding of label backdrop.
|
int |
getBackdropPaddingY()
Returns the vertical padding of label backdrop.
|
protected Key |
getChildKey()
Returns the property name to use to add this element to its parent.
|
protected D |
getDefaultValues()
Returns the default provider instance.
|
Fonter |
getFonter()
Returns a fonter instance to use into 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. |
List<String> |
getLabels()
Returns the array of labels to display.
|
double |
getLineHeight()
Returns the height of an individual line of text.
|
String |
getLineHeightAsString()
Returns the height of an individual line of text.
|
TickMajor |
getMajor()
Returns the major element.
|
double |
getMax()
Returns the user defined maximum number for the scale, overrides maximum value from data.
|
Date |
getMaxAsDate()
If defined, this will override the data maximum.
|
String |
getMaxAsString()
Returns the user defined maximum number for the scale, overrides maximum value from data.
|
int |
getMaxRotation()
Returns the maximum rotation for tick labels when rotating to condense labels.
|
int |
getMaxTicksLimit()
Returns the maximum number of ticks and gridlines to show.
|
double |
getMin()
Returns the user defined minimum number for the scale, overrides minimum value from data.
|
Date |
getMinAsDate()
If defined, this will override the data minimum.
|
String |
getMinAsString()
Returns the user defined minimum number for the scale, overrides minimum value from data.
|
TickMinor |
getMinor()
Returns the minor tick element.
|
int |
getMinRotation()
Returns the minimum rotation for tick labels.
|
int |
getPadding()
Returns the padding between the tick label and the axis.
|
protected P |
getParent()
Returns the parent element.
|
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.
|
double |
getSuggestedMax()
Returns the adjustment used when calculating the maximum data value.
|
double |
getSuggestedMin()
Returns the adjustment used when calculating the minimum data value.
|
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 |
isBeginAtZero()
If
true, scale will include 0 if it is not already included. |
boolean |
isDisplay()
If
true, show tick marks. |
boolean |
isMirror()
Returns the flips tick labels around axis, displaying the labels inside the chart instead of outside.
|
boolean |
isReverse()
Returns the reverses order of tick labels.
|
boolean |
isShowLabelBackdrop()
If
true, draw a background behind the tick labels. |
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(IsColor backdropColor)
Sets the color of label backdrops.
|
void |
setBackdropColor(String backdropColor)
Sets the color of label backdrops.
|
void |
setBackdropPaddingX(int backdropPaddingX)
Sets the horizontal padding of label backdrop.
|
void |
setBackdropPaddingY(int backdropPaddingY)
Sets the vertical padding of label backdrop.
|
void |
setBeginAtZero(boolean beginAtZero)
If
true, scale will include 0 if it is not already included. |
protected void |
setCallbackToModel(org.pepstock.charba.client.options.AbstractModel<?,?> model,
Key key,
CallbackProxy.Proxy proxy)
Adds a proxy function (for callbacks) to a model at the specific key.
|
void |
setDisplay(boolean display)
If
true, show tick marks. |
protected void |
setEventToModel(org.pepstock.charba.client.options.AbstractModel<?,?> model,
Key key,
CallbackProxy.Proxy proxy)
Adds a proxy function (for events) to a model at the specific key.
|
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 |
setLabels(List<String> labels)
Sets an array of labels to display.
|
void |
setLabels(String... labels)
Sets an array of labels to display.
|
void |
setLineHeight(double lineHeight)
Sets the height of an individual line of text.
|
void |
setLineHeight(String lineHeight)
Sets the height of an individual line of text.
|
void |
setMax(Date max)
If defined, this will override the data maximum.
|
void |
setMax(double max)
Sets the user defined maximum number for the scale, overrides maximum value from data.
|
void |
setMax(String max)
Sets the user defined maximum number for the scale, overrides maximum value from data.
|
void |
setMaxRotation(int maxRotation)
Sets the maximum rotation for tick labels when rotating to condense labels.
|
void |
setMaxTicksLimit(int maxTicksLimit)
Sets the maximum number of ticks and gridlines to show.
|
void |
setMin(Date min)
If defined, this will override the data minimum.
|
void |
setMin(double min)
Sets the user defined minimum number for the scale, overrides minimum value from data.
|
void |
setMin(String min)
Sets the user defined minimum number for the scale, overrides minimum value from data.
|
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 |
setPrecision(int precision)
If defined and stepSize is not specified, the step size will be rounded to this many decimal places.
|
void |
setReverse(boolean reverse)
Sets the reverses order of tick labels.
|
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 |
setSuggestedMax(double suggestedMax)
Sets the adjustment used when calculating the maximum data value.
|
void |
setSuggestedMin(double suggestedMin)
Sets the adjustment used when calculating the minimum data value.
|
void |
setZ(int z)
Sets z-index of tick layer.
|
checkValue, empty, getArrayValue, getNativeChart, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, keys, remove, remove, removeIfExists, setArrayValue, setArrayValue, setArrayValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, typeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLineHeightgetFontColorAsString, getFontFamily, getFontSize, getFontStylegetFontColor, getFontColorAsString, getFontFamily, getFontSize, getFontStyle, setFontColor, setFontColor, setFontFamily, setFontSize, setFontStylepublic TickMinor getMinor()
getMinor in interface IsDefaultTickspublic TickMajor getMajor()
getMajor in interface IsDefaultTickspublic void setBeginAtZero(boolean beginAtZero)
true, scale will include 0 if it is not already included.beginAtZero - if true, scale will include 0 if it is not already included.public boolean isBeginAtZero()
true, scale will include 0 if it is not already included.isBeginAtZero in interface IsDefaultTickstrue, scale will include 0 if it is not already included.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 IsDefaultTickstrue, show tick marks.public void setReverse(boolean reverse)
reverse - reverses order of tick labels.public boolean isReverse()
isReverse in interface IsDefaultTickstrue reverses order of tick labels.public void setAutoSkip(boolean autoSkip)
true, automatically calculates how many labels that can be shown and hides labels accordingly. Turn it off to show all labels no matter whatautoSkip - 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()
true, automatically calculates how many labels that can be shown and hides labels accordingly. Turn it off to show all labels no matter whatisAutoSkip in interface IsDefaultTickstrue, automatically calculates how many labels that can be shown and hides labels accordingly. Turn it off to show all labels no matter what.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()
getAutoSkipPadding in interface IsDefaultTickspublic 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 IsDefaultTickspublic 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()
getMaxRotation in interface IsDefaultTickspublic void setMinRotation(int minRotation)
minRotation - minimum rotation for tick labels. Note: Only applicable to horizontal scales.public int getMinRotation()
getMinRotation in interface IsDefaultTickspublic 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()
isMirror in interface IsDefaultTickspublic 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()
getPadding in interface IsDefaultTickspublic void setMin(double min)
min - the user defined minimum number for the scale, overrides minimum value from data.public double getMin()
getMin in interface IsDefaultTickspublic void setMin(Date min)
min - If defined, this will override the data minimum.public Date getMinAsDate()
public void setMax(double max)
max - user defined maximum number for the scale, overrides maximum value from data.public double getMax()
getMax in interface IsDefaultTickspublic void setMax(Date max)
max - if defined, this will override the data maximum.public Date getMaxAsDate()
public void setMin(String min)
min - the user defined minimum number for the scale, overrides minimum value from data.public String getMinAsString()
public void setMax(String max)
max - user defined maximum number for the scale, overrides maximum value from data.public String getMaxAsString()
public void setMaxTicksLimit(int maxTicksLimit)
maxTicksLimit - maximum number of ticks and gridlines to show.public int getMaxTicksLimit()
getMaxTicksLimit in interface IsDefaultTickspublic void setStepSize(double stepSize)
stepSize - user defined fixed step size for the scale.public double getStepSize()
getStepSize in interface IsDefaultTickspublic void setSuggestedMax(double suggestedMax)
suggestedMax - adjustment used when calculating the maximum data value.public double getSuggestedMax()
getSuggestedMax in interface IsDefaultTickspublic void setSuggestedMin(double suggestedMin)
suggestedMin - adjustment used when calculating the minimum data value.public double getSuggestedMin()
getSuggestedMin in interface IsDefaultTickspublic 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 IsDefaultTickspublic IsColor getBackdropColor()
public void setBackdropPaddingX(int backdropPaddingX)
backdropPaddingX - horizontal padding of label backdrop.public int getBackdropPaddingX()
getBackdropPaddingX in interface IsDefaultTickspublic void setBackdropPaddingY(int backdropPaddingY)
backdropPaddingY - vertical padding of label backdrop.public int getBackdropPaddingY()
getBackdropPaddingY in interface IsDefaultTickspublic 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 IsDefaultTickstrue, draw a background behind the tick labels.public void setLabels(String... labels)
labels - An array of labels to display.public void setLabels(List<String> labels)
labels - A list of labels to display.public List<String> getLabels()
public void setSource(TickSource source)
source - property controls the ticks generation.public TickSource getSource()
getSource in interface IsDefaultTickspublic 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 IsDefaultTickspublic void setZ(int z)
z - z-index of tick layer. Useful when ticks are drawn on chart area.public int getZ()
getZ in interface IsDefaultTickspublic void setSampleSize(int sampleSize)
sampleSize - the number of ticks to examine when deciding how many labels will fit.public int getSampleSize()
getSampleSize in interface IsDefaultTickspublic final Fonter getFonter()
HasFontpublic final void setLineHeight(double lineHeight)
lineHeight - height of an individual line of text.public final void setLineHeight(String lineHeight)
lineHeight - height of an individual line of text.public final double getLineHeight()
public final String getLineHeightAsString()
protected final Key getChildKey()
null if is a root element.protected final P getParent()
null if is a root element.protected final D getDefaultValues()
protected final void setEventToModel(org.pepstock.charba.client.options.AbstractModel<?,?> model,
Key key,
CallbackProxy.Proxy proxy)
model - element where adding the function proxykey - property name to use to add the function proxyproxy - the function proxy instance to addprotected final void setCallbackToModel(org.pepstock.charba.client.options.AbstractModel<?,?> model,
Key key,
CallbackProxy.Proxy proxy)
model - element where adding the function proxykey - property name to use to add the function proxyproxy - the function proxy instance to addprotected final void checkAndAddToParent()