# 類別:Chart<TType, TData, TLabel>

# 型別參數

名稱 型別
TType 繼承自 ChartType = ChartType
TData DefaultDataPoint<TType>
TLabel unknown

# 建構子

# 建構子

new Chart<TType, TData, TLabel>(item, config)

# 型別參數

名稱 型別
TType 繼承自 keyof ChartTypeRegistry = keyof ChartTypeRegistry
TData DistributiveArray<ChartTypeRegistry[TType]["defaultDataPoint"]>
TLabel unknown

# 參數

名稱 型別
item ChartItem
config ChartConfiguration<TType, TData, TLabel> | ChartConfigurationCustomTypesPerDataset<TType, TData, TLabel>

# 定義於

types/index.d.ts:509 (開啟新視窗)

# 屬性

# aspectRatio

Readonly aspectRatio: number

# 定義於

types/index.d.ts:496 (開啟新視窗)


# attached

Readonly attached: boolean

# 定義於

types/index.d.ts:501 (開啟新視窗)


# boxes

Readonly boxes: LayoutItem[]

# 定義於

types/index.d.ts:497 (開啟新視窗)


# canvas

Readonly canvas: HTMLCanvasElement

# 定義於

types/index.d.ts:491 (開啟新視窗)


# chartArea

Readonly chartArea: ChartArea

# 定義於

types/index.d.ts:499 (開啟新視窗)


# config

Readonly config: ChartConfiguration<TType, TData, TLabel> | ChartConfigurationCustomTypesPerDataset<TType, TData, TLabel>

# 定義於

types/index.d.ts:493 (開啟新視窗)


# ctx

Readonly ctx: CanvasRenderingContext2D

# 定義於

types/index.d.ts:492 (開啟新視窗)


# currentDevicePixelRatio

Readonly currentDevicePixelRatio: number

# 定義於

types/index.d.ts:498 (開啟新視窗)


# data

data: ChartData<TType, TData, TLabel>

# 定義於

types/index.d.ts:506 (開啟新視窗)


# height

Readonly height: number

# 定義於

types/index.d.ts:495 (開啟新視窗)


# id

Readonly id: string

# 定義於

types/index.d.ts:490 (開啟新視窗)


# legend

Optional Readonly legend: LegendElement<TType>

# 定義於

types/index.d.ts:503 (開啟新視窗)


# options

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

# 定義於

types/index.d.ts:507 (在新視窗開啟)


# platform

Readonly platform: BasePlatform

# 定義於

types/index.d.ts:489 (在新視窗開啟)


# scales

Readonly scales: Object

# 索引簽名

▪ [key: string]: Scale

# 定義於

types/index.d.ts:500 (在新視窗開啟)


# tooltip

Optional Readonly tooltip: TooltipModel<TType>

# 定義於

types/index.d.ts:504 (在新視窗開啟)


# width

Readonly width: number

# 定義於

types/index.d.ts:494 (在新視窗開啟)


# defaults

Static Readonly defaults: Defaults

# 定義於

types/index.d.ts:551 (在新視窗開啟)


# instances

Static Readonly instances: Object

# 索引簽名

▪ [key: string]: Chart

# 定義於

types/index.d.ts:554 (在新視窗開啟)


# overrides

Static Readonly overrides: Overrides

# 定義於

types/index.d.ts:552 (在新視窗開啟)


# registry

Static Readonly registry: Registry

# 定義於

types/index.d.ts:555 (在新視窗開啟)


# version

Static Readonly version: string

# 定義於

types/index.d.ts:553 (在新視窗開啟)

# 方法

# bindEvents

bindEvents(): void

# 返回值

void

# 定義於

types/index.d.ts:541 (在新視窗開啟)


# buildOrUpdateControllers

buildOrUpdateControllers(): void

# 返回值

void

# 定義於

types/index.d.ts:517 (在新視窗開啟)


# buildOrUpdateScales

buildOrUpdateScales(): void

# 返回值

void

# 定義於

types/index.d.ts:516 (在新視窗開啟)


# clear

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

# 返回值

Chart<TType, TData, TLabel>

# 定義於

types/index.d.ts:511 (在新視窗開啟)


# destroy

destroy(): void

# 返回值

void

# 定義於

types/index.d.ts:539 (在新視窗開啟)


# draw

draw(): void

# 返回值

void

# 定義於

types/index.d.ts:521 (在新視窗開啟)


# ensureScalesHaveIDs

ensureScalesHaveIDs(): void

# 返回值

void

# 定義於

types/index.d.ts:515 (在新視窗開啟)


# getActiveElements

getActiveElements(): ActiveElement[]

# 返回值

ActiveElement[]

# 定義於

types/index.d.ts:536 (opens new window)


# getContext

getContext(): Object

# 返回值

Object

名稱 型別
chart Chart<keyof ChartTypeRegistry, (number | [number, number] | Point | BubbleDataPoint)[], unknown>
type string

# 定義於

types/index.d.ts:549 (opens new window)


# getDataVisibility

getDataVisibility(index): boolean

# 參數

名稱 型別
index number

# 返回值

boolean

# 定義於

types/index.d.ts:532 (opens new window)


# getDatasetMeta

getDatasetMeta(datasetIndex): ChartMeta<keyof ChartTypeRegistry, default<AnyObject, AnyObject>, default<AnyObject, AnyObject>>

# 參數

名稱 型別
datasetIndex number

# 返回值

ChartMeta<keyof ChartTypeRegistry, default<AnyObject, AnyObject>, default<AnyObject, AnyObject>>

# 定義於

types/index.d.ts:527 (opens new window)


# getElementsAtEventForMode

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

# 參數

名稱 型別
e Event
mode string
options InteractionOptions
useFinalPosition boolean

# 返回值

InteractionItem[]

# 定義於

types/index.d.ts:524 (opens new window)


# getSortedVisibleDatasetMetas

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

# 返回值

ChartMeta<keyof ChartTypeRegistry, default<AnyObject, AnyObject>, default<AnyObject, AnyObject>>[]

# 定義於

types/index.d.ts:526 (opens new window)


# getVisibleDatasetCount

getVisibleDatasetCount(): number

# 返回值

number

number

types/index.d.ts:528 (opens new window)


# hide

hide(datasetIndex, dataIndex?): void

# 參數

名稱 型別
datasetIndex number
dataIndex? number

# 返回值

void

void

types/index.d.ts:533 (opens new window)


# isDatasetVisible

isDatasetVisible(datasetIndex): boolean

# 參數

名稱 型別
datasetIndex number

# 返回值

boolean

boolean

types/index.d.ts:529 (opens new window)


# isPluginEnabled

isPluginEnabled(pluginId): boolean

# 參數

名稱 型別
pluginId string

# 返回值

boolean

boolean

types/index.d.ts:547 (opens new window)


# isPointInArea

isPointInArea(point): boolean

# 參數

名稱 型別
point Point

# 返回值

boolean

boolean

types/index.d.ts:523 (opens new window)


# notifyPlugins

notifyPlugins(hook, args?): boolean | void

# 參數

名稱 型別
hook string
args? AnyObject

# 返回值

boolean | void

# 定義於

types/index.d.ts:545 (opens new window)


# render

render(): void

# 返回值

void

void

types/index.d.ts:520 (opens new window)


# reset

reset(): void

# 返回值

void

void

types/index.d.ts:518 (opens new window)


# resize

resize(width?, height?): void

# 參數

名稱 型別
width? number
height? number

# 返回值

void

# 定義於

types/index.d.ts:514 (開啟新視窗)


# setActiveElements

setActiveElements(active): void

# 參數

名稱 型別
active ActiveDataPoint[]

# 返回值

void

# 定義於

types/index.d.ts:537 (開啟新視窗)


# setDatasetVisibility

setDatasetVisibility(datasetIndex, visible): void

# 參數

名稱 型別
datasetIndex number
visible boolean

# 返回值

void

# 定義於

types/index.d.ts:530 (開啟新視窗)


# show

show(datasetIndex, dataIndex?): void

# 參數

名稱 型別
datasetIndex number
dataIndex? number

# 返回值

void

# 定義於

types/index.d.ts:534 (開啟新視窗)


# stop

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

# 返回值

Chart<TType, TData, TLabel>

# 定義於

types/index.d.ts:512 (開啟新視窗)


# toBase64Image

toBase64Image(type?, quality?): string

# 參數

名稱 型別
type? string
quality? unknown

# 返回值

string

# 定義於

types/index.d.ts:540 (開啟新視窗)


# toggleDataVisibility

toggleDataVisibility(index): void

# 參數

名稱 型別
index number

# 返回值

void

# 定義於

types/index.d.ts:531 (開啟新視窗)


# unbindEvents

unbindEvents(): void

# 返回值

void

# 定義於

types/index.d.ts:542 (開啟新視窗)


# update

update(mode?): void

# 參數

名稱 型別
mode? "none" | "hide" | "show" | "default" | "active" | "resize" | "reset" | (ctx: { datasetIndex: number }) => "none" | "hide" | "show" | "default" | "active" | "resize" | "reset"

# 返回值

void

# 定義於

types/index.d.ts:519 (開啟新視窗)


# updateHoverStyle

updateHoverStyle(items, mode, enabled): void

# 參數

名稱 型別
items InteractionItem[]
mode "dataset"
enabled boolean

# 返回值

void

# 定義於

types/index.d.ts:543 (開啟新視窗)


# getChart

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

# 參數

名稱 型別
key string | HTMLCanvasElement | CanvasRenderingContext2D

# 返回值

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

# 定義於

types/index.d.ts:556 (開啟新視窗)


# register

Static register(...items): void

# 參數

名稱 型別
...items ChartComponentLike[]

# 返回值

void

# 定義於

types/index.d.ts:557 (開啟新視窗)


# unregister

Static unregister(...items): void

# 參數

名稱 型別
...items ChartComponentLike[]

# 返回值

void

# 定義於

types/index.d.ts:558 (開啟新視窗)