Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ScaleOptions

Hierarchy

  • ScaleOptions

Index

Properties

Optional afterBuildTicks

afterBuildTicks?: ScriptableFunction<void>

Callback that runs after ticks are created. Useful for filtering ticks.

Optional afterCalculateLabelRotation

afterCalculateLabelRotation?: ScriptableFunction<void>

Callback that runs after tick rotation is determined.

Optional afterDataLimits

afterDataLimits?: ScriptableFunction<void>

Callback that runs after data limits are determined.

Optional afterFit

afterFit?: ScriptableFunction<void>

Callback that runs after the scale fits to the canvas.

Optional afterSetDimensions

afterSetDimensions?: ScriptableFunction<void>

Callback that runs after dimensions are set.

Optional afterTickToLabelConversion

afterTickToLabelConversion?: ScriptableFunction<void>

Callback that runs after ticks are converted into strings.

Optional afterUpdate

afterUpdate?: ScriptableFunction<void>

Callback that runs at the end of the update process.

Optional alignToPixels

alignToPixels?: boolean

Align pixel values to device pixels

Optional angleLines

angleLines?: { borderDash?: Scriptable<number[]>; borderDashOffset?: Scriptable<number>; color?: Scriptable<CHARTJS.Color>; display?: boolean; lineWidth?: Scriptable<number> }

Type declaration

  • Optional borderDash?: Scriptable<number[]>

    Length and spacing of dashes on angled lines. See MDN.

    default

    []

  • Optional borderDashOffset?: Scriptable<number>

    Offset for line dashes. See MDN.

    default

    0

  • Optional color?: Scriptable<CHARTJS.Color>

    Color of angled lines.

    default

    'rgba(0, 0, 0, 0.1)'

  • Optional display?: boolean

    if true, angle lines are shown.

    default

    true

  • Optional lineWidth?: Scriptable<number>

    Width of angled lines.

    default

    1

Optional animate

animate?: boolean

Optional axis

axis?: "x" | "y"

Which type of axis this is. Possible values are?: 'x', 'y'. If not set, this is inferred from the first character of the ID which should be 'x' or 'y'.

Optional beforeBuildTicks

beforeBuildTicks?: ScriptableFunction<void>

Callback that runs before ticks are created.

Optional beforeCalculateLabelRotation

beforeCalculateLabelRotation?: ScriptableFunction<void>

Callback that runs before tick rotation is determined.

Optional beforeDataLimits

beforeDataLimits?: ScriptableFunction<void>

Callback that runs before data limits are determined.

Optional beforeFit

beforeFit?: ScriptableFunction<void>

Callback that runs before the scale fits to the canvas.

Optional beforeSetDimensions

beforeSetDimensions?: ScriptableFunction<void>

Callback that runs before dimensions are set.

Optional beforeTickToLabelConversion

beforeTickToLabelConversion?: ScriptableFunction<void>

Callback that runs before ticks are converted into strings.

Optional beforeUpdate

beforeUpdate?: ScriptableFunction<void>

Callback called before the update process starts.

Optional beginAtZero

beginAtZero?: boolean

if true, scale will include 0 if it is not already included.

default

false

Optional bounds

bounds?: "ticks" | "data"

Scale boundary strategy (bypassed by min/max time options)

  • data: make sure data are fully visible, ticks outside are removed
  • ticks: make sure ticks are fully visible, data outside are truncated
since

2.7.0

default

'ticks'

Optional display

display?: boolean | "auto"

Controls the axis global visibility (visible when true, hidden when false). When display?: 'auto', the axis is visible only if at least one associated dataset is visible.

default

true

Optional grid

Optional max

max?: number

User defined maximum value for the scale, overrides maximum value from data.

Optional min

min?: number

User defined minimum value for the scale, overrides minimum value from data.

Optional offset

offset?: boolean

If true, extra space is added to the both edges and the axis is scaled to fit into the chart area. This is set to true for a bar chart by default.

default

false

Optional pointLabels

pointLabels?: { backdropColor?: Scriptable<CHARTJS.Color>; backdropPadding?: Scriptable<number>; centerPointLabels?: boolean; color?: Scriptable<CHARTJS.Color>; display?: boolean; font?: Scriptable<FontSpec>; callback?: any }

Type declaration

  • Optional backdropColor?: Scriptable<CHARTJS.Color>

    Background color of the point label.

    default

    undefined

  • Optional backdropPadding?: Scriptable<number>

    Padding of label backdrop.

    default

    2

  • Optional centerPointLabels?: boolean

    if true, point labels are centered.

    default

    false

  • Optional color?: Scriptable<CHARTJS.Color>

    Color of label

    see

    Defaults.color

  • Optional display?: boolean

    if true, point labels are shown.

    default

    true

  • Optional font?: Scriptable<FontSpec>
  • callback?:function
    • callback(label?: string, index?: number): string | number | string[] | number[]
    • Callback function to transform data labels to point labels. The default implementation simply returns the current string.

      Parameters

      • Optional label: string
      • Optional index: number

      Returns string | number | string[] | number[]

Optional position

position?: "left" | "center" | "right" | "top" | "bottom" | {}

Position of the axis.

Optional reverse

reverse?: boolean

Reverse the scale.

default

false

Optional stack

stack?: string

Stack group. Axes at the same position with same stack are stacked.

Optional stackWeight

stackWeight?: number

Weight of the scale in stack group. Used to determine the amount of allocated space for the scale within the group.

default

1

Optional stacked

stacked?: boolean | "single"

If true, data will be comprised between datasets of data

default

false

Optional suggestedMax

suggestedMax?: number

Adjustment used when calculating the maximum data value.

Optional suggestedMin

suggestedMin?: number

Adjustment used when calculating the minimum data value.

Optional ticks

ticks?: TickOptions

Optional title

title?: { align?: "center" | "start" | "end"; color?: CHARTJS.Color; display?: boolean; font?: FontSpec; padding: number | { bottom?: number; top?: number; y?: number }; text?: string | string[] }

Options for the scale title.

Type declaration

  • Optional align?: "center" | "start" | "end"

    Alignment of the axis title.

  • Optional color?: CHARTJS.Color

    Color of the axis label.

  • Optional display?: boolean

    If true, displays the axis title.

  • Optional font?: FontSpec

    Information about the axis title font.

  • padding: number | { bottom?: number; top?: number; y?: number }

    Padding to apply around scale labels.

  • Optional text?: string | string[]

    The text for the title, e.g. "# of People" or "Response Choices".

Optional weight

weight?: number

The weight used to sort the axis. Higher weights are further away from the chart area.

default

true

Generated using TypeDoc