Class DefaultChartTicks
- java.lang.Object
-
- org.pepstock.charba.client.defaults.chart.DefaultChartTicks
-
- All Implemented Interfaces:
IsDefaultFontContainer,IsDefaultTicks
public final class DefaultChartTicks extends Object implements IsDefaultTicks
Defaults for ticks option element, based on chart type.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TickAligngetAlign()Returns the tick alignment along the axis.intgetAutoSkipPadding()Returns the padding between the ticks on the horizontal axis when autoSkip is enabled.StringgetBackdropColorAsString()Returns the color of label backdrops.IsDefaultPaddinggetBackdropPadding()Returns the padding of label backdrop.StringgetColorAsString()Returns the font color as string.intgetCount()Returns the number of ticks to generate.
If specified, this overrides the automatic generation.CrossAligngetCrossAlign()Returns the tick alignment perpendicular to the axis.IsDefaultFontgetFont()Returns the font element.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.IsDefaultMajorgetMajor()Returns the major tick defaults.intgetMaxRotation()Returns the maximum rotation for tick labels when rotating to condense labels.intgetMaxTicksLimit()Returns the maximum number of ticks and grid to show.intgetMinRotation()Returns the minimum rotation for tick labels.IsDefaultNumberFormatOptionsgetNumberFormat()Returns the number formatting options.intgetPadding()Returns the padding between the tick label and the axis.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.StringgetTextStrokeColorAsString()Returns the text stroke color as string.intgetTextStrokeWidth()Returns the text stroke width.intgetZ()Returns z-index of tick layer.booleanisAutoSkip()If true, automatically calculates how many labels that can be shown and hides labels accordingly.booleanisDisplay()If true, show tick marksbooleanisIncludeBounds()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.booleanisShowLabelBackdrop()If true, draw a background behind the tick labels.
-
-
-
Method Detail
-
getFont
public IsDefaultFont getFont()
Description copied from interface:IsDefaultFontContainerReturns the font element.- Specified by:
getFontin interfaceIsDefaultFontContainer- Returns:
- the font
-
getBackdropPadding
public IsDefaultPadding getBackdropPadding()
Description copied from interface:IsDefaultTicksReturns the padding of label backdrop.- Specified by:
getBackdropPaddingin interfaceIsDefaultTicks- Returns:
- padding of label backdrop.
-
getMajor
public IsDefaultMajor getMajor()
Description copied from interface:IsDefaultTicksReturns the major tick defaults.- Specified by:
getMajorin interfaceIsDefaultTicks- Returns:
- the major tick defaults.
-
getNumberFormat
public IsDefaultNumberFormatOptions getNumberFormat()
Description copied from interface:IsDefaultTicksReturns the number formatting options.- Specified by:
getNumberFormatin interfaceIsDefaultTicks- Returns:
- the number formatting options
-
getColorAsString
public String getColorAsString()
Description copied from interface:IsDefaultFontContainerReturns the font color as string.- Specified by:
getColorAsStringin interfaceIsDefaultFontContainer- Returns:
- font color as string
-
isDisplay
public boolean isDisplay()
Description copied from interface:IsDefaultTicksIf true, show tick marks- Specified by:
isDisplayin interfaceIsDefaultTicks- Returns:
- if true, show tick marks.
-
isAutoSkip
public boolean isAutoSkip()
Description copied from interface:IsDefaultTicksIf true, 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 interfaceIsDefaultTicks- 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.
-
getAutoSkipPadding
public int getAutoSkipPadding()
Description copied from interface:IsDefaultTicksReturns the padding between the ticks on the horizontal axis when autoSkip is enabled. Note: Only applicable to horizontal scales.- Specified by:
getAutoSkipPaddingin interfaceIsDefaultTicks- Returns:
- padding between the ticks on the horizontal axis when autoSkip is enabled. Note: Only applicable to horizontal scales.
-
isIncludeBounds
public boolean isIncludeBounds()
Description copied from interface:IsDefaultTicksIftrue, the defined minimum and maximum values should be presented as ticks even if they are not "nice".- Specified by:
isIncludeBoundsin interfaceIsDefaultTicks- Returns:
- if
true, the defined min and maximum values should be presented as ticks even if they are not "nice"
-
getLabelOffset
public int getLabelOffset()
Description copied from interface:IsDefaultTicksReturns 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 interfaceIsDefaultTicks- 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).
-
getCount
public int getCount()
Description copied from interface:IsDefaultTicksReturns the number of ticks to generate.
If specified, this overrides the automatic generation.- Specified by:
getCountin interfaceIsDefaultTicks- Returns:
- the number of ticks to generate.
If specified, this overrides the automatic generation
-
getMaxRotation
public int getMaxRotation()
Description copied from interface:IsDefaultTicksReturns 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 interfaceIsDefaultTicks- Returns:
- maximum rotation for tick labels when rotating to condense labels. Note: Rotation doesn't occur until necessary. Note: Only applicable to horizontal scales.
-
getMinRotation
public int getMinRotation()
Description copied from interface:IsDefaultTicksReturns the minimum rotation for tick labels. Note: Only applicable to horizontal scales.- Specified by:
getMinRotationin interfaceIsDefaultTicks- Returns:
- minimum rotation for tick labels. Note: Only applicable to horizontal scales.
-
isMirror
public boolean isMirror()
Description copied from interface:IsDefaultTicksReturns the flips tick labels around axis, displaying the labels inside the chart instead of outside. Note: Only applicable to vertical scales.- Specified by:
isMirrorin interfaceIsDefaultTicks- Returns:
- flips tick labels around axis, displaying the labels inside the chart instead of outside. Note: Only applicable to vertical scales.
-
getPadding
public int getPadding()
Description copied from interface:IsDefaultTicksReturns 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 interfaceIsDefaultTicks- 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.
-
getMaxTicksLimit
public int getMaxTicksLimit()
Description copied from interface:IsDefaultTicksReturns the maximum number of ticks and grid to show.- Specified by:
getMaxTicksLimitin interfaceIsDefaultTicks- Returns:
- maximum number of ticks and grid to show.
-
getStepSize
public double getStepSize()
Description copied from interface:IsDefaultTicksReturns the user defined fixed step size for the scale.- Specified by:
getStepSizein interfaceIsDefaultTicks- Returns:
- user defined fixed step size for the scale.
-
getBackdropColorAsString
public String getBackdropColorAsString()
Description copied from interface:IsDefaultTicksReturns the color of label backdrops.- Specified by:
getBackdropColorAsStringin interfaceIsDefaultTicks- Returns:
- color of label backdrops.
-
isShowLabelBackdrop
public boolean isShowLabelBackdrop()
Description copied from interface:IsDefaultTicksIf true, draw a background behind the tick labels.- Specified by:
isShowLabelBackdropin interfaceIsDefaultTicks- Returns:
- if true, draw a background behind the tick labels.
-
getSource
public TickSource getSource()
Description copied from interface:IsDefaultTicksReturns the property controls the ticks generation.- Specified by:
getSourcein interfaceIsDefaultTicks- Returns:
- property controls the ticks generation.
-
getPrecision
public int getPrecision()
Description copied from interface:IsDefaultTicksIf defined and stepSize is not specified, the step size will be rounded to this many decimal places.- Specified by:
getPrecisionin interfaceIsDefaultTicks- Returns:
- if defined and stepSize is not specified, the step size will be rounded to this many decimal places.
-
getZ
public int getZ()
Description copied from interface:IsDefaultTicksReturns 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 interfaceIsDefaultTicks- 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.
-
getSampleSize
public int getSampleSize()
Description copied from interface:IsDefaultTicksReturns 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 interfaceIsDefaultTicks- Returns:
- the number of ticks to examine when deciding how many labels will fit.
-
getAlign
public TickAlign getAlign()
Description copied from interface:IsDefaultTicksReturns the tick alignment along the axis.- Specified by:
getAlignin interfaceIsDefaultTicks- Returns:
- the tick alignment along the axis
-
getCrossAlign
public CrossAlign getCrossAlign()
Description copied from interface:IsDefaultTicksReturns the tick alignment perpendicular to the axis.- Specified by:
getCrossAlignin interfaceIsDefaultTicks- Returns:
- the tick alignment perpendicular to the axis
-
getTextStrokeColorAsString
public String getTextStrokeColorAsString()
Description copied from interface:IsDefaultTicksReturns the text stroke color as string.- Specified by:
getTextStrokeColorAsStringin interfaceIsDefaultTicks- Returns:
- the text stroke color as string.
-
getTextStrokeWidth
public int getTextStrokeWidth()
Description copied from interface:IsDefaultTicksReturns the text stroke width.- Specified by:
getTextStrokeWidthin interfaceIsDefaultTicks- Returns:
- the text stroke width.
-
-