Class Ticks<T extends Ticks<T>>

java.lang.Object
software.xdev.chartjs.model.options.ticks.Ticks<T>
Direct Known Subclasses:
CategoryTicks, LinearTicks, LogarithmicTicks, RadialLinearTicks, TimeTicks

public class Ticks<T extends Ticks<T>> extends Object
The grid line configuration is nested under the scale configuration in the ticks key. It defines options for the tick marks that are generated by the axis.
  • Field Details

  • Constructor Details

    • Ticks

      public Ticks()
  • Method Details

    • getAutoSkip

      public Boolean getAutoSkip()
      See Also:
    • setAutoSkip

      public T 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

      Default true

    • getAutoSkipPadding

      public BigDecimal getAutoSkipPadding()
      See Also:
    • setAutoSkipPadding

      public T setAutoSkipPadding(BigDecimal autoSkipPadding)

      Padding between the ticks on the horizontal axis when autoSkip is enabled.

      Note: Only applicable to horizontal scales.

    • getCallback

      public JavaScriptFunction getCallback()
      See Also:
    • setCallback

      public T setCallback(JavaScriptFunction callback)

      Returns the string representation of the tick value as it should be displayed on the chart. See callback section below.

      Default function(value) { return helpers.isArray(value) ? value : '' + value; }

    • getDisplay

      public Boolean getDisplay()
      See Also:
    • setDisplay

      public T setDisplay(Boolean display)

      If true, show the ticks.

      Default true

    • getFontColor

      public Color getFontColor()
      See Also:
    • setFontColor

      public T setFontColor(Color fontColor)

      Font color for the tick labels.

      Default "#666"

    • getFontFamily

      public String getFontFamily()
      See Also:
    • setFontFamily

      public T setFontFamily(String fontFamily)

      Font family for the tick labels, follows CSS font-family options.

      Default "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"

    • getFontSize

      public BigDecimal getFontSize()
      See Also:
    • setFontSize

      public T setFontSize(BigDecimal fontSize)

      Font size for the tick labels.

      Default 12

    • getFontStyle

      public FontStyle getFontStyle()
      See Also:
    • setFontStyle

      public T setFontStyle(FontStyle fontStyle)

      Font style for the tick labels, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).

      Default "normal"

    • getLabelOffset

      public BigDecimal getLabelOffset()
      See Also:
    • setLabelOffset

      public T setLabelOffset(BigDecimal labelOffset)

      Distance in pixels to offset the label from the centre 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

      Default 0

    • getMaxRotation

      public BigDecimal getMaxRotation()
      See Also:
    • setMaxRotation

      public T setMaxRotation(BigDecimal maxRotation)

      Maximum rotation for tick labels when rotating to condense labels. Note: Rotation doesn't occur until necessary. Note: Only applicable to horizontal scales.

      Default 90

    • getMinRotation

      public BigDecimal getMinRotation()
      See Also:
    • setMinRotation

      public T setMinRotation(BigDecimal minRotation)

      Minimum rotation for tick labels. Note: Only applicable to horizontal scales.

      Default 0

    • getMirror

      public Boolean getMirror()
      See Also:
    • setMirror

      public T setMirror(Boolean mirror)

      Flips tick labels around axis, displaying the labels inside the chart instead of outside. Note: Only applicable to vertical scales.

      Default false

    • getPadding

      public BigDecimal getPadding()
      See Also:
    • setPadding

      public T setPadding(BigDecimal padding)

      Padding between the tick label and the axis. Note: Only applicable to horizontal scales.

      Default 10

    • getReverse

      public Boolean getReverse()
      See Also:
    • setReverse

      public T setReverse(Boolean reverse)

      Reverses order of tick labels.

      Default false