Class: Chart<TType, TData, TLabel>

    Type parameters

    NameType
    TTypeextends keyof keyof ChartTypeRegistry
    TDataDistributiveArray<[TType][“defaultDataPoint”]>
    TLabelunknown

    Parameters

    NameType
    item
    configChartConfiguration<TType, TData, TLabel>

    Defined in

    index.esm.d.ts:498 (opens new window)

    aspectRatio

    Readonly aspectRatio: number

    Defined in


    attached

    Readonly attached: boolean

    Defined in

    index.esm.d.ts:491 (opens new window)


    boxes

    Readonly boxes: LayoutItem[]

    Defined in

    index.esm.d.ts:487Chart - 图4 (opens new window)


    canvas

    Readonly canvas: HTMLCanvasElement

    Defined in


    chartArea

    Readonly chartArea:

    Defined in


    config

    Readonly config: <TType, TData, TLabel>

    Defined in


    ctx

    Readonly ctx: CanvasRenderingContext2D

    Defined in

    index.esm.d.ts:482Chart - 图8 (opens new window)


    currentDevicePixelRatio

    Readonly currentDevicePixelRatio: number

    Defined in


    data

    data: <TType, TData, TLabel>

    Defined in


    height

    Readonly height: number

    Defined in

    index.esm.d.ts:485 (opens new window)


    id

    Readonly id: string

    Defined in


    options

    options: DeepPartial<<TType> & ElementChartOptions<TType> & <TType> & DatasetChartOptions<TType> & <TType> & ChartTypeRegistry[TType]["chartOptions"]>

    Defined in

    index.esm.d.ts:496 (opens new window)


    platform

    Readonly platform: BasePlatform

    Defined in

    index.esm.d.ts:479Chart - 图14 (opens new window)


    scales

    Readonly scales: Object

    Index signature

    ▪ [key: string]:

    Defined in


    tooltip

    Optional Readonly tooltip: <TType>

    Defined in


    width

    Readonly width: number

    Defined in

    index.esm.d.ts:484 (opens new window)


    Static Readonly defaults:

    Defined in


    instances

    Static Readonly instances: Object

    Index signature

    ▪ [key: string]: Chart

    Defined in

    index.esm.d.ts:538 (opens new window)


    overrides

    Static Readonly overrides: Overrides

    Defined in

    index.esm.d.ts:536Chart - 图20 (opens new window)


    registry

    Static Readonly registry: Registry

    Defined in

    index.esm.d.ts:539 (opens new window)


    version

    Static Readonly version: string

    Defined in

    bindEvents

    Returns

    void

    Defined in


    buildOrUpdateControllers

    buildOrUpdateControllers(): void

    Returns

    void

    Defined in


    buildOrUpdateScales

    buildOrUpdateScales(): void

    Returns

    void

    Defined in


    clear

    clear(): <TType, TData, >

    Returns

    <TType, TData, TLabel>

    Defined in


    destroy

    destroy(): void

    Returns

    void

    Defined in


    draw

    draw(): void

    Returns

    void

    Defined in


    ensureScalesHaveIDs

    ensureScalesHaveIDs(): void

    Returns

    void

    Defined in


    getActiveElements

    getActiveElements(): []

    Returns

    []

    Defined in


    getDataVisibility

    getDataVisibility(index): boolean

    Parameters

    NameType
    indexnumber

    Returns

    boolean

    Defined in

    index.esm.d.ts:520 (opens new window)


    getDatasetMeta

    getDatasetMeta(datasetIndex): ChartMeta<<AnyObject, AnyObject>, Element<AnyObject, AnyObject>, keyof >

    Parameters

    NameType
    datasetIndexnumber

    Returns

    ChartMeta<<AnyObject, AnyObject>, Element<AnyObject, AnyObject>, keyof >

    Defined in


    getElementsAtEventForMode

    getElementsAtEventForMode(e, mode, options, useFinalPosition): []

    Parameters

    NameType
    eEvent
    modestring
    options
    useFinalPositionboolean

    Returns

    []

    Defined in


    getSortedVisibleDatasetMetas

    getSortedVisibleDatasetMetas(): <Element<AnyObject, AnyObject>, <AnyObject, AnyObject>, keyof ChartTypeRegistry>[]

    Returns

    ChartMeta<<AnyObject, AnyObject>, Element<AnyObject, AnyObject>, keyof >[]

    Defined in


    getVisibleDatasetCount(): number

    Returns

    number

    Defined in

    index.esm.d.ts:516 (opens new window)


    hide

    hide(datasetIndex, dataIndex?): void

    Parameters

    Returns

    void

    Defined in


    isDatasetVisible

    isDatasetVisible(datasetIndex): boolean

    Parameters

    NameType
    datasetIndexnumber

    Returns

    boolean

    Defined in

    index.esm.d.ts:517 (opens new window)


    notifyPlugins

    notifyPlugins(hook, args?): boolean | void

    Parameters

    NameType
    hookstring
    args?AnyObject

    Returns

    Defined in


    render

    render(): void

    Returns

    void

    Defined in


    reset

    reset(): void

    Returns

    void

    Defined in


    resize

    resize(width?, height?): void

    Parameters

    NameType
    width?number
    height?number

    Returns

    void

    Defined in

    index.esm.d.ts:503 (opens new window)


    setActiveElements

    setActiveElements(active):

    Parameters

    NameType
    active[]

    Returns

    void

    Defined in

    index.esm.d.ts:525Chart - 图42 (opens new window)


    setDatasetVisibility

    setDatasetVisibility(datasetIndex, visible): void

    Parameters

    NameType
    datasetIndexnumber
    visibleboolean

    Returns

    void

    Defined in


    show

    show(datasetIndex, dataIndex?): void

    Parameters

    Returns

    void

    Defined in

    index.esm.d.ts:522Chart - 图44 (opens new window)


    stop

    stop(): Chart<TType, TData, TLabel>

    Returns

    Chart<TType, TData, TLabel>

    Defined in

    index.esm.d.ts:501 (opens new window)


    toBase64Image

    toBase64Image(type?, quality?): string

    Parameters

    NameType
    type?string
    quality?unknown

    Returns

    string

    Defined in


    toggleDataVisibility

    toggleDataVisibility(index): void

    Parameters

    NameType
    indexnumber

    Returns

    void

    Defined in

    index.esm.d.ts:519 (opens new window)


    unbindEvents

    unbindEvents(): void

    Returns

    void

    Defined in

    index.esm.d.ts:530Chart - 图48 (opens new window)


    update

    update(mode?): void

    Parameters

    NameType
    mode?“resize” | “reset” | “none” | “hide” | “show” | “normal” | “active”

    Returns

    void

    Defined in


    updateHoverStyle

    updateHoverStyle(items, mode, enabled): void

    Parameters

    NameType
    itemsElement<AnyObject, AnyObject>
    mode“dataset”
    enabledboolean

    Returns

    void

    Defined in


    getChart

    Static getChart(key): <keyof ChartTypeRegistry, (number | | BubbleDataPoint)[], unknown>

    Parameters

    NameType
    keystring | HTMLCanvasElement | CanvasRenderingContext2D

    Returns

    <keyof ChartTypeRegistry, (number | | BubbleDataPoint)[], unknown>

    Defined in

    index.esm.d.ts:540 (opens new window)


    Static register(…items): void

    Parameters

    Returns

    void

    Defined in

    index.esm.d.ts:541Chart - 图52 (opens new window)


    unregister

    Static unregister(…items): void

    Parameters

    NameType
    …items[]

    Returns

    void

    Defined in