# 类: Chart<TType, TData, TLabel>
# 类型参数
| 名称 | 类型 |
|---|---|
TType | 扩展 ChartType = ChartType |
TData | DefaultDataPoint<TType> |
TLabel | 未知 |
# 构造函数
# 构造函数
• new Chart<TType, TData, TLabel>(item, config)
# 类型参数
| 名称 | 类型 |
|---|---|
TType | 扩展 ChartTypeRegistry = keyof ChartTypeRegistry |
TData | DistributiveArray<ChartTypeRegistry[TType]["defaultDataPoint"]> |
TLabel | 未知 |
# 参数
| 名称 | 类型 |
|---|---|
item | 图表项 |
config | ChartConfiguration<TType, TData, TLabel> | ChartConfigurationCustomTypesPerDataset<TType, TData, TLabel> |
# 定义于
types/index.d.ts:509 (在新窗口中打开)
# 属性
# aspectRatio
• Readonly aspectRatio: number
# 定义于
types/index.d.ts:496 (在新窗口中打开)
# 附件
• Readonly 附件: boolean
# 定义在
types/index.d.ts:501 (在新窗口中打开)
# 盒子
• Readonly 盒子: LayoutItem[]
# 定义在
types/index.d.ts:497 (在新窗口中打开)
# 画布
• Readonly 画布: HTMLCanvasElement
# 定义在
types/index.d.ts:491 (在新窗口中打开)
# 饼状图区域
• Readonly 饼状图区域: ChartArea
# 定义在
types/index.d.ts:499 (在新窗口中打开)
# 配置
• Readonly 配置: 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 (在新窗口中打开)
# 平台
• Readonly 平台: BasePlatform
# 定义于
types/index.d.ts:489 (在新窗口中打开)
# 比例尺
• Readonly 比例尺: Object
# 索引签名
▪ [键: string]: Scale
# 定义于
types/index.d.ts:500 (在新窗口中打开)
# 工具提示
• Optional Readonly 工具提示: TooltipModel<TType>
# 定义于
types/index.d.ts:504 (在新窗口中打开)
# 宽度
• Readonly 宽度: number
# 定义于
types/index.d.ts:494 (在新窗口中打开)
# 默认值
▪ Static Readonly 默认值: Defaults
# 定义于
types/index.d.ts:551 (在新窗口中打开)
# 实例
▪ Static Readonly 实例: Object
# 索引签名
▪ [键: string]: Chart
# 定义于
# 重写
▪ 静态 只读 重写: 重写
# 定义于
# 注册表
▪ 静态 只读 注册表: 注册表
# 定义于
# 版本
▪ 静态 只读 版本: 字符串
# 定义于
# 方法
# bindEvents
▸ bindEvents(): void
# 返回
void
# 定义于
# buildOrUpdateControllers
▸ buildOrUpdateControllers(): void
# 返回
void
# 定义于
# buildOrUpdateScales
▸ buildOrUpdateScales(): void
# 返回
void
# 定义于
types/index.d.ts:516 (在新窗口中打开)
# 清除
▸ clear(): Chart<TType, TData, TLabel>
# 返回
Chart<TType, TData, TLabel>
# 定义在
types/index.d.ts:511 (在新窗口中打开)
# 销毁
▸ destroy(): void
# 返回
void
# 定义在
types/index.d.ts:539 (在新窗口中打开)
# 绘制
▸ draw(): void
# 返回
void
# 定义在
types/index.d.ts:521 (在新窗口中打开)
# 确保尺度有ID
▸ ensureScalesHaveIDs(): void
# 返回
void
# 定义在
types/index.d.ts:515 (在新窗口中打开)
# 获取活动元素
▸ getActiveElements(): ActiveElement[]
# 返回
# 定义在
types/index.d.ts:536 (在新窗口中打开)
# 获取上下文
▸ getContext(): Object
# 返回
Object
| 名称 | 类型 |
|---|---|
图表 | Chart<keyof ChartTypeRegistry, (number | [number, number] | Point | BubbleDataPoint)[], unknown> |
类型 | 字符串 |
# 定义于
types/index.d.ts:549 (在新窗口中打开)
# getDataVisibility
▸ getDataVisibility(index): boolean
# 参数
| 名称 | 类型 |
|---|---|
index | 数字 |
# 返回值
布尔值
# 定义于
types/index.d.ts:532 (在新窗口中打开)
# getDatasetMeta
▸ getDatasetMeta(datasetIndex): ChartMeta<keyof ChartTypeRegistry, default<AnyObject, AnyObject>, default<AnyObject, AnyObject>>
# 参数
| 名称 | 类型 |
|---|---|
datasetIndex | 数字 |
# 返回值
ChartMeta<keyof ChartTypeRegistry, default<AnyObject, AnyObject>, default<AnyObject, AnyObject>>
# 定义于
types/index.d.ts:527 (在新窗口中打开)
# getElementsAtEventForMode
▸ getElementsAtEventForMode(e, mode, options, useFinalPosition): InteractionItem[]
# 参数
| 名称 | 类型 |
|---|---|
e | 事件 |
mode | 字符串 |
options | 交互选项 |
useFinalPosition | 布尔值 |
# 返回值
交互项[]
# 定义于
types/index.d.ts:524 (在新窗口中打开)
# 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 (在新窗口中打开)
# getVisibleDatasetCount
▸ getVisibleDatasetCount(): number
# 返回值
数字
# 定义于
types/index.d.ts:528 (在新窗口中打开)
# hide
▸ hide(datasetIndex, dataIndex?): void
# 参数
| 名称 | 类型 |
|---|---|
datasetIndex | 数字 |
dataIndex? | 数字 |
# 返回值
void
# 定义于
types/index.d.ts:533 (在新窗口中打开)
# isDatasetVisible
▸ isDatasetVisible(datasetIndex): boolean
# 参数
| 名称 | 类型 |
|---|---|
datasetIndex | 数字 |
# 返回值
布尔值
# 定义于
types/index.d.ts:529 (在新窗口中打开)
# isPluginEnabled
▸ isPluginEnabled(pluginId): boolean
# 参数
| 名称 | 类型 |
|---|---|
pluginId | 字符串 |
# 返回值
布尔值
# 定义于
types/index.d.ts:547 (在新窗口中打开)
# isPointInArea
▸ isPointInArea(point): boolean
# 参数
| 名称 | 类型 |
|---|---|
point | Point |
# 返回值
布尔值
# 定义于
types/index.d.ts:523 (在新窗口中打开)
# notifyPlugins
▸ notifyPlugins(hook, args?): boolean | void
# 参数
| 名称 | 类型 |
|---|---|
hook | 字符串 |
args? | 任意对象 |
# 返回值
boolean | void
# 定义于
# render
▸ render(): void
# 返回值
void
# 定义于
# reset
▸ reset(): void
# 返回值
void
# 定义于
# resize
▸ resize(width?, height?): void
# 参数
| 名称 | 类型 |
|---|---|
width? | 数字 |
height? | 数字 |
# 返回值
void
# 定义于
# setActiveElements
▸ setActiveElements(active): void
# 参数
| 名称 | 类型 |
|---|---|
active | ActiveDataPoint[] |
# 返回值
void
# 定义于
# setDatasetVisibility
▸ setDatasetVisibility(datasetIndex, visible): void
# 参数
| 名称 | 类型 |
|---|---|
datasetIndex | 数字 |
visible | 布尔值 |
# 返回值
void
# 定义于
# show
▸ show(datasetIndex, dataIndex?): void
# 参数
| 名称 | 类型 |
|---|---|
datasetIndex | 数字 |
dataIndex? | 数字 |
# 返回值
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? | 字符串 |
quality? | 未知 |
# 返回值
字符串
# 定义于
types/index.d.ts:540 (在新窗口中打开)
# toggleDataVisibility
▸ toggleDataVisibility(index): void
# 参数
| 名称 | 类型 |
|---|---|
index | 数字 |
# 返回值
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 | 交互项[] |
mode | "dataset" |
enabled | 布尔值 |
# 返回值
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