Interface: CoreChartOptions<TType>

    animation: false | AnimationSpec<TType> & { onComplete?: (event: ) => void ; onProgress?: (event: AnimationEvent) => void }

    Inherited from: AnimationOptions.animation

    Defined in:


    animations

    animations: <TType>

    Inherited from: AnimationOptions.animations

    Defined in: index.esm.d.ts:1543CoreChartOptions - 图2 (opens new window)


    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

    Defined in: index.esm.d.ts:1399 (opens new window)


    backgroundColor

    backgroundColor: Color

    base background color

    see Defaults.backgroundColor

    Defined in:


    borderColor

    borderColor:

    base border color

    see Defaults.borderColor

    Defined in: index.esm.d.ts:1378 (opens new window)


    color

    color: Color

    base color

    see Defaults.color

    Defined in:


    datasets

    datasets: object

    Type declaration:

    NameType
    bar
    bubble
    doughnut
    line
    pie
    polarArea
    scatter

    Defined in: index.esm.d.ts:1354 (opens new window)


    Override the window’s default devicePixelRatio.

    default window.devicePixelRatio

    Defined in:


    events

    events: (mousemove | mouseout | click | touchstart | touchmove)[]

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

    default [‘mousemove’, ‘mouseout’, ‘click’, ‘touchstart’, ‘touchmove’]

    Defined in:


    font

    font:

    base font

    see Defaults.font

    Defined in: index.esm.d.ts:1383CoreChartOptions - 图10 (opens new window)


    hover

    hover: CoreInteractionOptions

    Defined in:


    indexAxis

    indexAxis: x | y

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

    default ‘x’

    Defined in:


    interaction

    interaction:

    Defined in: index.esm.d.ts:1418 (opens new window)


    layout

    layout: object

    Type declaration:

    Defined in:


    locale: string

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

    default user’s browser setting

    Defined in: index.esm.d.ts:1405 (opens new window)


    maintainAspectRatio

    maintainAspectRatio: boolean

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

    Defined in: index.esm.d.ts:1393CoreChartOptions - 图16 (opens new window)


    normalized

    normalized: boolean

    Chart.js is fastest if you provide data with indices that are unique, sorted, and consistent across datasets and provide the normalized: true option to let Chart.js know that you have done so.

    Inherited from: ParsingOptions.

    Defined in: index.esm.d.ts:52 (opens new window)


    parsing

    parsing: false | { [key: string]: string; }

    How to parse the dataset. The parsing can be disabled by specifying parsing: false at chart options or dataset. If parsing is disabled, data must be sorted and in the formats the associated chart type and scales use internally.

    Inherited from: ParsingOptions.

    Defined in: index.esm.d.ts:43CoreChartOptions - 图18 (opens new window)


    responsive

    responsive: boolean

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

    default true

    Defined in: index.esm.d.ts:1388 (opens new window)


    transitions

    transitions: TransitionsSpec<TType>

    Inherited from: AnimationOptions.transitions

    Defined in:

    onClick

    onClick(event: , elements: ActiveElement[], chart: <bar | line | scatter | bubble | pie | doughnut | polarArea | radar, (number | ScatterDataPoint | )[], unknown>): void

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

    Parameters:

    NameType
    event
    ActiveElement[]
    chart<bar | line | scatter | bubble | pie | doughnut | polarArea | radar, (number | ScatterDataPoint | )[], unknown>

    Returns: void

    Defined in: index.esm.d.ts:1436 (opens new window)


    onHover(event: , elements: ActiveElement[], chart: <bar | line | scatter | bubble | pie | doughnut | polarArea | radar, (number | ScatterDataPoint | )[], unknown>): void

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

    Parameters:

    Returns: void

    Defined in:


    onResize

    onResize(chart: <bar | line | scatter | bubble | pie | doughnut | polarArea | radar, (number | ScatterDataPoint | )[], unknown>, size: { height: number ; width: number }): void

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

    Parameters:

    NameType
    chart<bar | line | scatter | bubble | pie | doughnut | polarArea | radar, (number | ScatterDataPoint | )[], unknown>
    sizeobject
    size.heightnumber
    number

    Returns: void