Class Ticks
- java.lang.Object
- 
- org.pepstock.charba.client.commons.NativeObjectContainer
- 
- org.pepstock.charba.client.commons.AbstractNode
- 
- org.pepstock.charba.client.options.AbstractModel<AbstractScale,IsDefaultTicks>
- 
- org.pepstock.charba.client.options.Ticks
 
 
 
 
- 
- All Implemented Interfaces:
- IsDefaultFontContainer,- IsDefaultTicks,- HasFont
 
 public final class Ticks extends AbstractModel<AbstractScale,IsDefaultTicks> implements IsDefaultTicks, HasFont All configuration for ticks of a chart.
 It defines options for the tick marks that are generated by the axis.- Author:
- Andrea "Stock" Stocchero
 
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description ElementAligngetAlign()Returns the tick alignment along the axis.intgetAutoSkipPadding()Returns the padding between the ticks on the horizontal axis when autoSkip is enabled.
 Note: Only applicable to horizontal scales.IsColorgetBackdropColor()Returns the color of label backdrops.StringgetBackdropColorAsString()Returns the color of label backdrops.PaddinggetBackdropPadding()Returns the padding of label backdrop.intgetCount()Returns the number of ticks to generate.
 If specified, this overrides the automatic generation.CrossAligngetCrossAlign()Returns the tick alignment perpendicular to the axis.FontContainergetFontContainer()Returns a font container instance to use in the default methods of this interface.intgetLabelOffset()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.MajorgetMajor()Returns the major element.intgetMaxRotation()Returns the maximum rotation for tick labels when rotating to condense labels.
 Note: Rotation doesn't occur until necessary.intgetMaxTicksLimit()Returns the maximum number of ticks and grid to show.intgetMinRotation()Returns the minimum rotation for tick labels.
 Note: Only applicable to horizontal scales.TicksNumberFormatgetNumberFormat()Returns the number formatting options.intgetPadding()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.intgetPrecision()If defined and stepSize is not specified, the step size will be rounded to this many decimal places.intgetSampleSize()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.TickSourcegetSource()Returns the property controls the ticks generation.doublegetStepSize()Returns the user defined fixed step size for the scale.IsColorgetTextStrokeColor()Returns the text stroke color.StringgetTextStrokeColorAsString()Returns the text stroke color as string.intgetTextStrokeWidth()Returns the text stroke width.intgetZ()Returns z-index of tick layer.booleanisAutoSkip()Iftrue, automatically calculates how many labels that can be shown and hides labels accordingly.
 Turn it off to show all labels no matter whatbooleanisDisplay()Iftrue, show tick marks.booleanisIncludeBounds()Iftrue, the defined minimum and maximum values should be presented as ticks even if they are not "nice".booleanisMirror()Returns the flips tick labels around axis, displaying the labels inside the chart instead of outside.
 Note: Only applicable to vertical scales.booleanisShowLabelBackdrop()Iftrue, draw a background behind the tick labels.voidsetAlign(ElementAlign align)Sets the tick alignment along the axis.voidsetAutoSkip(boolean autoSkip)Iftrue, automatically calculates how many labels that can be shown and hides labels accordingly.
 Turn it off to show all labels no matter whatvoidsetAutoSkipPadding(int autoSkipPadding)Sets the padding between the ticks on the horizontal axis when autoSkip is enabled.
 Note: Only applicable to horizontal scales.voidsetBackdropColor(String backdropColor)Sets the color of label backdrops.voidsetBackdropColor(IsColor backdropColor)Sets the color of label backdrops.voidsetCount(int count)Sets the number of ticks to generate.
 If specified, this overrides the automatic generation.voidsetCrossAlign(CrossAlign crossAlign)Sets the tick alignment perpendicular to the axis.voidsetDisplay(boolean display)Iftrue, show tick marks.voidsetIncludeBounds(boolean includeBounds)Iftrue, the defined min and maximum values should be presented as ticks even if they are not "nice"voidsetLabelOffset(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.voidsetMaxRotation(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.voidsetMaxTicksLimit(int maxTicksLimit)Sets the maximum number of ticks and grid to show.voidsetMinRotation(int minRotation)Sets the minimum rotation for tick labels.
 Note: Only applicable to horizontal scales.voidsetMirror(boolean mirror)Sets the flips tick labels around axis, displaying the labels inside the chart instead of outside.
 Note: Only applicable to vertical scales.voidsetPadding(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.voidsetPrecision(int precision)If defined and stepSize is not specified, the step size will be rounded to this many decimal places.voidsetSampleSize(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.voidsetShowLabelBackdrop(boolean showLabelBackdrop)Iftrue, draw a background behind the tick labels.voidsetSource(TickSource source)Sets the property controls the ticks generation.voidsetStepSize(double stepSize)Sets the user defined fixed step size for the scale.voidsetTextStrokeColor(String color)Sets the text stroke color.voidsetTextStrokeColor(IsColor color)Sets the text stroke color.voidsetTextStrokeWidth(int textStrokeWidth)Sets the text stroke width.voidsetZ(int z)Sets z-index of tick layer.- 
Methods inherited from class org.pepstock.charba.client.options.AbstractModelgetDefaultValues, getParent, loadPadding, setCallbackToModel, setCallbackToModel, setEventToModel
 - 
Methods inherited from class org.pepstock.charba.client.commons.AbstractNodecheckAndAddToParent, 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
 - 
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainercheckDefaultValuesArgument, 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
 
- 
 
- 
- 
- 
Method Detail- 
getFontContainerpublic FontContainer getFontContainer() Description copied from interface:HasFontReturns a font container instance to use in the default methods of this interface.- Specified by:
- getFontContainerin interface- HasFont
- Returns:
- a font container instance
 
 - 
getMajorpublic Major getMajor() Returns the major element.- Specified by:
- getMajorin interface- IsDefaultTicks
- Returns:
- the major
 
 - 
getNumberFormatpublic TicksNumberFormat getNumberFormat() Returns the number formatting options.- Specified by:
- getNumberFormatin interface- IsDefaultTicks
- Returns:
- the number formatting options
 
 - 
getBackdropPaddingpublic Padding getBackdropPadding() Returns the padding of label backdrop.- Specified by:
- getBackdropPaddingin interface- IsDefaultTicks
- Returns:
- the padding of label backdrop
 
 - 
setDisplaypublic void setDisplay(boolean display) Iftrue, show tick marks.- Parameters:
- display- if- true, show tick marks.
 
 - 
isDisplaypublic boolean isDisplay() Iftrue, show tick marks.- Specified by:
- isDisplayin interface- IsDefaultTicks
- Returns:
- if true, show tick marks.
 
 - 
setAutoSkippublic void setAutoSkip(boolean autoSkip) Iftrue, automatically calculates how many labels that can be shown and hides labels accordingly.
 Turn it off to show all labels no matter what- Parameters:
- 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
 
 - 
isAutoSkippublic boolean isAutoSkip() Iftrue, automatically calculates how many labels that can be shown and hides labels accordingly.
 Turn it off to show all labels no matter what- Specified by:
- isAutoSkipin interface- IsDefaultTicks
- Returns:
- 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.
 
 - 
setAutoSkipPaddingpublic void setAutoSkipPadding(int autoSkipPadding) Sets the padding between the ticks on the horizontal axis when autoSkip is enabled.
 Note: Only applicable to horizontal scales.- Parameters:
- autoSkipPadding- padding between the ticks on the horizontal axis when autoSkip is enabled.
 Note: Only applicable to horizontal scales.
 
 - 
getAutoSkipPaddingpublic int getAutoSkipPadding() Returns the padding between the ticks on the horizontal axis when autoSkip is enabled.
 Note: Only applicable to horizontal scales.- Specified by:
- getAutoSkipPaddingin interface- IsDefaultTicks
- Returns:
- padding between the ticks on the horizontal axis when autoSkip is enabled.
 Note: Only applicable to horizontal scales.
 
 - 
setIncludeBoundspublic void setIncludeBounds(boolean includeBounds) Iftrue, the defined min and maximum values should be presented as ticks even if they are not "nice"- Parameters:
- includeBounds- if- true, the defined min and maximum values should be presented as ticks even if they are not "nice"
 
 - 
isIncludeBoundspublic boolean isIncludeBounds() Iftrue, the defined minimum and maximum values should be presented as ticks even if they are not "nice".- Specified by:
- isIncludeBoundsin interface- IsDefaultTicks
- Returns:
- if true, the defined min and maximum values should be presented as ticks even if they are not "nice"
 
 - 
setLabelOffsetpublic 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.- Parameters:
- 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)
 
 - 
getLabelOffsetpublic 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.- Specified by:
- getLabelOffsetin interface- IsDefaultTicks
- 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).
 
 - 
setCountpublic void setCount(int count) Sets the number of ticks to generate.
 If specified, this overrides the automatic generation.- Parameters:
- count- the number of ticks to generate.
 If specified, this overrides the automatic generation
 
 - 
getCountpublic int getCount() Returns the number of ticks to generate.
 If specified, this overrides the automatic generation.- Specified by:
- getCountin interface- IsDefaultTicks
- Returns:
- the number of ticks to generate.
 If specified, this overrides the automatic generation
 
 - 
setMaxRotationpublic 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.- Parameters:
- maxRotation- maximum rotation for tick labels when rotating to condense labels.
 Note: Rotation doesn't occur until necessary.
 Note: Only applicable to horizontal scales.
 
 - 
getMaxRotationpublic int getMaxRotation() Returns the maximum rotation for tick labels when rotating to condense labels.
 Note: Rotation doesn't occur until necessary. Note: Only applicable to horizontal scales.- Specified by:
- getMaxRotationin interface- IsDefaultTicks
- Returns:
- maximum rotation for tick labels when rotating to condense labels.
 Note: Rotation doesn't occur until necessary. Note: Only applicable to horizontal scales.
 
 - 
setMinRotationpublic void setMinRotation(int minRotation) Sets the minimum rotation for tick labels.
 Note: Only applicable to horizontal scales.- Parameters:
- minRotation- minimum rotation for tick labels.
 Note: Only applicable to horizontal scales.
 
 - 
getMinRotationpublic int getMinRotation() Returns the minimum rotation for tick labels.
 Note: Only applicable to horizontal scales.- Specified by:
- getMinRotationin interface- IsDefaultTicks
- Returns:
- minimum rotation for tick labels.
 Note: Only applicable to horizontal scales.
 
 - 
setMirrorpublic 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.- Parameters:
- mirror- flips tick labels around axis, displaying the labels inside the chart instead of outside.
 Note: Only applicable to vertical scales.
 
 - 
isMirrorpublic boolean isMirror() Returns the flips tick labels around axis, displaying the labels inside the chart instead of outside.
 Note: Only applicable to vertical scales.- Specified by:
- isMirrorin interface- IsDefaultTicks
- Returns:
- flips tick labels around axis, displaying the labels inside the chart instead of outside.
 Note: Only applicable to vertical scales.
 
 - 
setPaddingpublic 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.- Parameters:
- 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.
 
 - 
getPaddingpublic 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.- Specified by:
- getPaddingin interface- IsDefaultTicks
- Returns:
- 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.
 
 - 
setMaxTicksLimitpublic void setMaxTicksLimit(int maxTicksLimit) Sets the maximum number of ticks and grid to show.- Parameters:
- maxTicksLimit- maximum number of ticks and grid to show.
 
 - 
getMaxTicksLimitpublic int getMaxTicksLimit() Returns the maximum number of ticks and grid to show.- Specified by:
- getMaxTicksLimitin interface- IsDefaultTicks
- Returns:
- maximum number of ticks and grid to show.
 
 - 
setStepSizepublic void setStepSize(double stepSize) Sets the user defined fixed step size for the scale.- Parameters:
- stepSize- user defined fixed step size for the scale.
 
 - 
getStepSizepublic double getStepSize() Returns the user defined fixed step size for the scale.- Specified by:
- getStepSizein interface- IsDefaultTicks
- Returns:
- user defined fixed step size for the scale.
 
 - 
setBackdropColorpublic void setBackdropColor(IsColor backdropColor) Sets the color of label backdrops.- Parameters:
- backdropColor- color of label backdrops.
 
 - 
setBackdropColorpublic void setBackdropColor(String backdropColor) Sets the color of label backdrops.- Parameters:
- backdropColor- color of label backdrops.
 
 - 
getBackdropColorAsStringpublic String getBackdropColorAsString() Returns the color of label backdrops.- Specified by:
- getBackdropColorAsStringin interface- IsDefaultTicks
- Returns:
- color of label backdrops.
 
 - 
getBackdropColorpublic IsColor getBackdropColor() Returns the color of label backdrops.- Returns:
- color of label backdrops.
 
 - 
setShowLabelBackdroppublic void setShowLabelBackdrop(boolean showLabelBackdrop) Iftrue, draw a background behind the tick labels.- Parameters:
- showLabelBackdrop- if- true, draw a background behind the tick labels.
 
 - 
isShowLabelBackdroppublic boolean isShowLabelBackdrop() Iftrue, draw a background behind the tick labels.- Specified by:
- isShowLabelBackdropin interface- IsDefaultTicks
- Returns:
- if true, draw a background behind the tick labels.
 
 - 
setSourcepublic void setSource(TickSource source) Sets the property controls the ticks generation.- Parameters:
- source- property controls the ticks generation.
 
 - 
getSourcepublic TickSource getSource() Returns the property controls the ticks generation.- Specified by:
- getSourcein interface- IsDefaultTicks
- Returns:
- property controls the ticks generation.
 
 - 
setPrecisionpublic void setPrecision(int precision) If defined and stepSize is not specified, the step size will be rounded to this many decimal places.- Parameters:
- precision- if defined and stepSize is not specified, the step size will be rounded to this many decimal places.
 
 - 
getPrecisionpublic int getPrecision() If defined and stepSize is not specified, the step size will be rounded to this many decimal places.- Specified by:
- getPrecisionin interface- IsDefaultTicks
- Returns:
- if defined and stepSize is not specified, the step size will be rounded to this many decimal places.
 
 - 
setZpublic void setZ(int z) Sets z-index of tick layer. Useful when ticks are drawn on chart area.
 Values less than or equals to 0 are drawn under datasets, greater than 0 on top.- Parameters:
- z- z-index of tick layer. Useful when ticks are drawn on chart area.
 Values less than or equals to 0 are drawn under datasets, greater than 0 on top.
 
 - 
getZpublic int getZ() Returns z-index of tick layer. Useful when ticks are drawn on chart area.
 Values less than or equals to 0 are drawn under datasets, greater than 0 on top.- Specified by:
- getZin interface- IsDefaultTicks
- Returns:
- z-index of tick layer. Useful when ticks are drawn on chart area.
 Values less than or equals to 0 are drawn under datasets, greater than 0 on top.
 
 - 
setSampleSizepublic 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.- Parameters:
- sampleSize- the number of ticks to examine when deciding how many labels will fit.
 
 - 
getSampleSizepublic 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.- Specified by:
- getSampleSizein interface- IsDefaultTicks
- Returns:
- the number of ticks to examine when deciding how many labels will fit.
 
 - 
setAlignpublic void setAlign(ElementAlign align) Sets the tick alignment along the axis.- Parameters:
- align- the tick alignment along the axis
 
 - 
getAlignpublic ElementAlign getAlign() Returns the tick alignment along the axis.- Specified by:
- getAlignin interface- IsDefaultTicks
- Returns:
- the tick alignment along the axis
 
 - 
setCrossAlignpublic void setCrossAlign(CrossAlign crossAlign) Sets the tick alignment perpendicular to the axis.- Parameters:
- crossAlign- the tick alignment perpendicular to the axis
 
 - 
getCrossAlignpublic CrossAlign getCrossAlign() Returns the tick alignment perpendicular to the axis.- Specified by:
- getCrossAlignin interface- IsDefaultTicks
- Returns:
- the tick alignment perpendicular to the axis
 
 - 
setTextStrokeColorpublic final void setTextStrokeColor(IsColor color) Sets the text stroke color.- Parameters:
- color- the text stroke color
 
 - 
setTextStrokeColorpublic final void setTextStrokeColor(String color) Sets the text stroke color.- Parameters:
- color- the text stroke color.
 
 - 
getTextStrokeColorAsStringpublic final String getTextStrokeColorAsString() Returns the text stroke color as string.- Specified by:
- getTextStrokeColorAsStringin interface- IsDefaultTicks
- Returns:
- the text stroke color as string.
 
 - 
getTextStrokeColorpublic final IsColor getTextStrokeColor() Returns the text stroke color.- Returns:
- the text stroke color.
 
 - 
setTextStrokeWidthpublic final void setTextStrokeWidth(int textStrokeWidth) Sets the text stroke width.- Parameters:
- textStrokeWidth- the text stroke width.
 
 - 
getTextStrokeWidthpublic final int getTextStrokeWidth() Returns the text stroke width.- Specified by:
- getTextStrokeWidthin interface- IsDefaultTicks
- Returns:
- the text stroke width.
 
 
- 
 
-