Class representing the y-axis labels settings and its entries. Only use the setter methods to modify it. Do not access public variables directly. Be aware that not all features the YLabels class provides are suitable for the RadarChart. Customizations that affect the value range of the axis need to be applied before setting data for the chart.

Hierarchy (View Summary)

Constructors

Properties

allowLastLabelAboveMax: boolean
axisDependency: AxisDependency

the side this axis object represents

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

drawBottomYLabelEntry: boolean

indicates if the bottom y-label entry 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

drawTopYLabelEntry: boolean

indicates if the top y-label entry is drawn or not

drawZeroLine: boolean

flag that indicates if the zero-line should be drawn regardless of other grid lines

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

inverted: boolean

flag that indicates if the axis is inverted or not

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

maxWidth: number

the maximum width that the axis can take (in dp). use Inifinity for disabling the maximum default: Number.POSITIVE_INFINITY (no maximum specified)

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

minWidth: number

the minimum width that the axis should take (in dp).

default: 0.0

mLabels: string[]
mLimitLines: LimitLine[]

array of limit lines that can be set for the axis

mTextSize: number

the text size of the labels

the position of the y-labels relative to the chart

spaceBottom: number

axis space from the smallest value to the bottom in percent of the total axis range

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

spaceTop: number

axis space from the largest value to the top in percent of the total axis range

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

zeroLineColor: string

Color of the zero line

zeroLineWidth: number

Width of the zero line in pixels

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 needsOffset(): boolean
  • Returns true if this axis needs horizontal offset, false if no offset is needed.

    Returns boolean

  • 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

  • This is for HorizontalBarChart vertical spacing.

    Parameters

    • p: Paint

    Returns number

  • This is for normal (not horizontal) charts horizontal spacing.

    Parameters

    • p: Paint

    Returns number

  • 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

  • Returns true if autoscale restriction for axis max value is enabled

    Returns boolean

  • Returns true if autoscale restriction for axis min value is enabled

    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

  • This method is deprecated. Use setAxisMinimum(...) / setAxisMaximum(...) instead.

    Parameters

    • startAtZero: any

    Returns void

  • Sets autoscale restriction for axis max value as enabled/disabled

    Parameters

    • isEnabled: any

    Returns void

  • Sets autoscale restriction for axis min value as enabled/disabled

    Parameters

    • isEnabled: any

    Returns void