# 類別: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 > |
# 定義於
# 屬性
# aspectRatio
• Readonly
aspectRatio: number
# 定義於
# attached
• Readonly
attached: boolean
# 定義於
# boxes
• Readonly
boxes: LayoutItem
[]
# 定義於
# canvas
• Readonly
canvas: HTMLCanvasElement
# 定義於
# chartArea
• Readonly
chartArea: ChartArea
# 定義於
# config
• Readonly
config: ChartConfiguration
<TType
, TData
, TLabel
> | ChartConfigurationCustomTypesPerDataset
<TType
, TData
, TLabel
>
# 定義於
# ctx
• Readonly
ctx: CanvasRenderingContext2D
# 定義於
# currentDevicePixelRatio
• Readonly
currentDevicePixelRatio: number
# 定義於
# data
• data: ChartData
<TType
, TData
, TLabel
>
# 定義於
# height
• Readonly
height: number
# 定義於
# id
• Readonly
id: string
# 定義於
# legend
• Optional
Readonly
legend: LegendElement
<TType
>
# 定義於
# options
• options: DeepPartial
<CoreChartOptions
<TType
> & ElementChartOptions
<TType
> & PluginChartOptions
<TType
> & DatasetChartOptions
<TType
> & ScaleChartOptions
<TType
> & ChartTypeRegistry
[TType
]["chartOptions"
]>
# 定義於
# platform
• Readonly
platform: BasePlatform
# 定義於
# scales
• Readonly
scales: Object
# 索引簽名
▪ [key: string
]: Scale
# 定義於
# tooltip
• Optional
Readonly
tooltip: TooltipModel
<TType
>
# 定義於
# width
• Readonly
width: number
# 定義於
# defaults
▪ Static
Readonly
defaults: Defaults
# 定義於
# instances
▪ Static
Readonly
instances: Object
# 索引簽名
▪ [key: string
]: Chart
# 定義於
# overrides
▪ Static
Readonly
overrides: Overrides
# 定義於
# registry
▪ Static
Readonly
registry: Registry
# 定義於
# version
▪ Static
Readonly
version: string
# 定義於
# 方法
# bindEvents
▸ bindEvents(): void
# 返回值
void
# 定義於
# buildOrUpdateControllers
▸ buildOrUpdateControllers(): void
# 返回值
void
# 定義於
# buildOrUpdateScales
▸ buildOrUpdateScales(): void
# 返回值
void
# 定義於
# clear
▸ clear(): Chart
<TType
, TData
, TLabel
>
# 返回值
Chart
<TType
, TData
, TLabel
>
# 定義於
# destroy
▸ destroy(): void
# 返回值
void
# 定義於
# draw
▸ draw(): void
# 返回值
void
# 定義於
# ensureScalesHaveIDs
▸ ensureScalesHaveIDs(): void
# 返回值
void
# 定義於
# getActiveElements
▸ getActiveElements(): 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 |
# 返回值
# 定義於
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
# 定義於
# setActiveElements
▸ setActiveElements(active
): void
# 參數
名稱 | 型別 |
---|---|
active | ActiveDataPoint [] |
# 返回值
void
# 定義於
# setDatasetVisibility
▸ setDatasetVisibility(datasetIndex
, visible
): void
# 參數
名稱 | 型別 |
---|---|
datasetIndex | number |
visible | boolean |
# 返回值
void
# 定義於
# show
▸ show(datasetIndex
, dataIndex?
): void
# 參數
名稱 | 型別 |
---|---|
datasetIndex | number |
dataIndex? | number |
# 返回值
void
# 定義於
# stop
▸ stop(): Chart
<TType
, TData
, TLabel
>
# 返回值
Chart
<TType
, TData
, TLabel
>
# 定義於
# toBase64Image
▸ toBase64Image(type?
, quality?
): string
# 參數
名稱 | 型別 |
---|---|
type? | string |
quality? | unknown |
# 返回值
string
# 定義於
# toggleDataVisibility
▸ toggleDataVisibility(index
): void
# 參數
名稱 | 型別 |
---|---|
index | number |
# 返回值
void
# 定義於
# unbindEvents
▸ unbindEvents(): void
# 返回值
void
# 定義於
# update
▸ update(mode?
): void
# 參數
名稱 | 型別 |
---|---|
mode? | "none" | "hide" | "show" | "default" | "active" | "resize" | "reset" | (ctx : { datasetIndex : number }) => "none" | "hide" | "show" | "default" | "active" | "resize" | "reset" |
# 返回值
void
# 定義於
# updateHoverStyle
▸ updateHoverStyle(items
, mode
, enabled
): void
# 參數
名稱 | 型別 |
---|---|
items | InteractionItem [] |
mode | "dataset" |
enabled | boolean |
# 返回值
void
# 定義於
# 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
>
# 定義於
# register
▸ Static
register(...items
): void
# 參數
名稱 | 型別 |
---|---|
...items | ChartComponentLike [] |
# 返回值
void
# 定義於
# unregister
▸ Static
unregister(...items
): void
# 參數
名稱 | 型別 |
---|---|
...items | ChartComponentLike [] |
# 返回值
void