Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ChartOptions

Hierarchy

  • ChartOptions

Index

Properties

Optional animation

animation?: AnimationSpec

Optional animations

animations?: { radius?: AnimationsSpec; x?: AnimationsSpec; y?: AnimationsSpec }

Type declaration

Optional aspectRatio

aspectRatio?: number

Canvas aspect ratio (i.e. width / height, a value of 1 representing a square canvas). Note that this option is ignored if the height is explicitly defined either as attribute or via the style.

default

2

Optional backgroundColor

backgroundColor?: Scriptable<CHARTJS.Color>

base background color

see

Defaults.backgroundColor

Optional borderColor

borderColor?: Scriptable<CHARTJS.Color>

base border color

see

Defaults.borderColor

Optional color

base color

see

Defaults.color

Optional devicePixelRatio

devicePixelRatio?: number

Override the window's default devicePixelRatio.

default

window.devicePixelRatio

Optional elements

elements?: { arc?: ElementOptions; bar?: ElementOptions; line?: ElementOptions; point?: ElementOptions }

Type declaration

Optional events

events?: ("mousemove" | "mouseout" | "click" | "touchstart" | "touchmove" | "touchend" | "pointerenter" | "pointerdown" | "pointermove" | "pointerup" | "pointerleave" | "pointerout")[]

The events option defines the browser events that the chart should listen to for tooltips and hovering.

default

['mousemove', 'mouseout', 'click', 'touchstart', 'touchmove']

Optional font

font?: Partial<FontSpec>

base font

see

Defaults.font

Optional hover

Optional indexAxis

indexAxis?: "x" | "y"

The base axis of the chart. 'x' for vertical charts and 'y' for horizontal charts.

default

'x'

Optional interaction

Optional layout

layout?: Partial<{ autoPadding?: boolean; padding?: Scriptable<number | Partial<ChartArea>> }>

Optional locale

locale?: string

Locale used for number formatting (using Intl.NumberFormat).

default

user's browser setting

Optional maintainAspectRatio

maintainAspectRatio?: boolean

Maintain the original canvas aspect ratio (width / height) when resizing.

default

true

Optional onClick

onClick?: ScriptableFunction<void>

Called if the event is of type 'mouseup' or 'click'. Passed the event, an array of active elements, and the chart.

Optional onHover

onHover?: ScriptableFunction<void>

Called when any of the events fire. Passed the event, an array of active elements (bars, points, etc), and the chart.

Optional onResize

onResize?: ScriptableFunction<void>

Called when a resize occurs. Gets passed two arguments?: the chart instance and the new size.

Optional plugins

plugins?: { legend?: LegendOptions; title?: any; tooltip?: { callbacks?: any; external?: any } }

Type declaration

  • Optional legend?: LegendOptions
  • Optional title?: any
  • Optional tooltip?: { callbacks?: any; external?: any }
    • Optional callbacks?: any
    • Optional external?: any

Optional resizeDelay

resizeDelay?: number

Delay the resize update by give amount of milliseconds. This can ease the resize process by debouncing update of the elements.

default

0

Optional responsive

responsive?: boolean

Resizes the chart canvas when its container does (important note...).

default

true

Optional scales

scales?: { x?: ScaleOptions; y?: ScaleOptions }

Type declaration

Generated using TypeDoc