Base-class of all axes (previously called labels).

Hierarchy (View Summary)

Constructors

Properties

allowLastLabelAboveMax: boolean
axisLineColor: string

the color of the border surrounding the chart.

axisLineDashPathEffect: DashPathEffect

the path effect of the axis line that makes dashed lines possible

axisLineWidth: number

the width of the border surrounding the chart in dp.

axisRange: number

the total range of values this axis covers

axisSuggestedMaximum: number

Set a suggested maximum value for this axis. If set, this will be used as maximum is no value is greater than it.

axisSuggestedMinimum: number

Set a suggested minimum value for this axis. If set, this will be used as minimum is no value is greater than it.

centerAxisLabels: boolean

Centers the axis labels instead of drawing them at their original position. This is useful especially for grouped BarChart.

chart: WeakRef<Chart<any, any, any>>

chart it belongs to

clipLimitLinesToContent: boolean

When enabled the limitlines will be clipped to contentRect, otherwise they can bleed outside the content rect.

customRenderer: CustomRenderer

custom line renderer

drawAxisLine: boolean

flag that indicates if the line alongside the axis is drawn or not

drawGridLines: boolean

flag indicating if the grid lines for this axis should be drawn

drawGridLinesBehindData: boolean

When enabled the grid lines are draw on top of the actual data, otherwise behind. Default: true

drawLabels: boolean

flag that indicates of the labels of this axis should be drawn or not

drawLabelsBehindData: boolean

When enabled the labels are drawn behind the actual data, otherwise on top. Default: false

drawLimitLines: boolean

flag indicating if the limit lines are drawn

drawLimitLinesBehindData: boolean

When enabled the LimitLines are drawn behind the actual data, otherwise on top. Default: false

drawMarkTicks: boolean

flag indicating the mark ticks should be drawn

enabled: boolean

flag that indicates if this axis / legend is enabled or not

ensureLastLabel: boolean
ensureVisible: boolean

Defines if the renderer should ensure we always see the component fully

forcedInterval: number
forceLabelsEnabled: boolean

if true, the set number of y-labels will be forced

granularity: number

the minimum interval between axis values When set, axis labels are controlled by the granularity property. When not set, axis values could possibly be repeated. This could happen if two adjacent axis values are rounded to same value. If using granularity this could be aed by having fewer axis values visible.

gridColor: string

the color of the grid lines for this axis (the horizontal lines coming from each label).

gridDashPathEffect: DashPathEffect

the path effect of the grid lines that makes dashed lines possible

gridLineWidth: number

the width of the grid lines that are drawn away from each axis label.

ignoreOffsets: boolean

the total range of values this axis covers

labelCount: number

the number of label entries the axis should have, default 6

labelTextAlign: Align

the labels text alignment of the axis labels.

mAxisMaximum: number

don't touch this direclty, use setter

mAxisMinimum: number

don't touch this directly, use setter

mAxisValueFormatter: IAxisValueFormatter

custom formatter that is used instead of the auto-formatter if set

mCenteredEntries: number[]

axis label entries only used for centered labels

mCustomAxisMax: boolean

flag indicating that the axis-max value has been customized

mCustomAxisMin: boolean

flag indicating that the axis-min value has been customized

mDecimals: number

the number of decimal digits to use

mEntries: number[]

the actual array of entries

mEntryCount: number

the number of entries the legend contains

mLabels: string[]
mLimitLines: LimitLine[]

array of limit lines that can be set for the axis

mTextSize: number

the text size of the labels

spaceMax: number

Extra spacing for axisMaximum to be added to automatically calculated axisMaximum

spaceMin: number

Extra spacing for axisMinimum to be added to automatically calculated axisMinimum

textColor: string

the text color to use for the labels

typeface: Font

the typeface used for the labels

xOffset: number

the offset in pixels this component has on the x-axis

yOffset: number

the offset in pixels this component has on the Y-axis

Accessors

  • get axisMaximum(): number
  • Returns number

  • set axisMaximum(max: number): void
  • Set a custom maximum value for this axis. If set, this value will not be calculated automatically depending on the provided data. Use resetAxisMaxValue() to undo this.

    Parameters

    • max: number

    Returns void

  • get axisMinimum(): number
  • Returns number

  • set axisMinimum(min: number): void
  • Set a custom minimum value for this axis. If set, this value will not be calculated automatically depending on the provided data. Use resetAxisMinValue() to undo this. Do not forget to call setStartAtZero(false) if you use this method. Otherwise, the axis-minimum value will still be forced to 0.

    Parameters

    • min: number

    Returns void

  • get font(): Font
  • returns the Typeface used for the labels, returns null if none is set

    Returns Font

    Font

  • set font(tf: Font): void
  • sets a specific Typeface for the labels

    Parameters

    • tf: Font

    Returns void

  • get limitLines(): LimitLine[]
  • Returns the LimitLines of this axis.

    Returns LimitLine[]

  • get longestLabel(): string
  • Returns the longest formatted label (in terms of characters), this axis contains.

    Returns string

  • get textSize(): number
  • returns the text size that is currently set for the labels, in pixels

    Returns number

  • set textSize(size: number): void
  • sets the size of the label text in density pixels min = 6f, max = 24f, default 10

    Parameters

    • size: number

      the text size, in DP

    Returns void

  • get valueFormatter(): IAxisValueFormatter
  • Returns the formatter used for formatting the axis labels.

    Returns IAxisValueFormatter

  • set valueFormatter(f: IAxisValueFormatter): void
  • Sets the formatter to be used for formatting the axis labels. If no formatter is set, the chart will automatically determine a reasonable formatting (concerning decimals) for all the values that are drawn inside the chart. Use chart.defaultValueFormatter to use the formatter calculated by the chart.

    Parameters

    Returns void

Methods

  • Adds a new LimitLine to this axis.

    Parameters

    Returns void

  • Calculates the minimum / maximum and range values of the axis with the given minimum and maximum values from the chart data.

    Parameters

    • dataMin: any

      the min value according to chart data

    • dataMax: any

      the max value according to chart data

    Returns void

  • Returns void

  • Enables the axis line to be drawn in dashed mode, e.g. like this "- - - - - -". THIS ONLY WORKS IF HARDWARE-ACCELERATION IS TURNED OFF. Keep in mind that hardware acceleration boosts performance.

    Parameters

    • lineLength: any

      the length of the line pieces

    • spaceLength: any

      the length of space in between the pieces

    • phase: any

      offset, in degrees (normally, use 0)

    Returns void

  • Enables the grid line to be drawn in dashed mode, e.g. like this "- - - - - -". THIS ONLY WORKS IF HARDWARE-ACCELERATION IS TURNED OFF. Keep in mind that hardware acceleration boosts performance.

    Parameters

    • lineLength: any

      the length of the line pieces

    • spaceLength: any

      the length of space in between the pieces

    • phase: any

      offset, in degrees (normally, use 0)

    Returns void

  • Parameters

    • index: any

    Returns string

  • Returns true if the axis max value has been customized (and is not calculated automatically)

    Returns boolean

  • Returns true if the axis min value has been customized (and is not calculated automatically)

    Returns boolean

  • Removes all LimitLines from the axis.

    Returns void

  • Removes the specified LimitLine from the axis.

    Parameters

    Returns void

  • By calling this method, any custom maximum value that has been previously set is reseted, and the calculation is done automatically.

    Returns void

  • By calling this method, any custom minimum value that has been previously set is reseted, and the calculation is done automatically.

    Returns void