# 介面:BarControllerDatasetOptions

# 繼承關係

# 屬性

# animation

animation: false | AnimationSpec<"bar"> & { onComplete?: (this: Chart<keyof ChartTypeRegistry, (number | [number, number] | Point | BubbleDataPoint)[], unknown>, event: AnimationEvent) => void ; onProgress?: (this: Chart<keyof ChartTypeRegistry, (number | [number, number] | Point | BubbleDataPoint)[], unknown>, event: AnimationEvent) => void }

# 繼承自

AnimationOptions.animation

# 定義於

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


# animations

animations: AnimationsSpec<"bar">

# 繼承自

AnimationOptions.animations

# 定義於

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


# backgroundColor

backgroundColor: ScriptableAndArray<Color, ScriptableContext<"bar">>

# 繼承自

ScriptableAndArrayOptions.backgroundColor

# 定義於

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


# barPercentage

barPercentage: number

每個長條圖在類別寬度內所佔可用寬度的百分比(0-1)。 1.0 將佔據整個類別寬度,並將長條圖緊靠在一起。

預設值

0.9

# 定義於

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


# barThickness

barThickness: number | "flex"

以像素為單位手動設定每個長條圖的寬度。如果設定為 'flex',它會計算「最佳」範例寬度,以便將長條圖並排放置。如果未設定(預設值),則長條圖會根據最小間隔的大小均等。

# 定義於

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


# base

base: ScriptableAndArray<number, ScriptableContext<"bar">>

長條圖在數值軸上以資料單位表示的基準值。

# 繼承自

ScriptableAndArrayOptions.base

# 定義於

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


# borderColor

borderColor: ScriptableAndArray<Color, ScriptableContext<"bar">>

# 繼承自

ScriptableAndArrayOptions.borderColor

# 定義於

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


# borderRadius

borderRadius: ScriptableAndArray<number | BorderRadius, ScriptableContext<"bar">>

邊框圓角

預設值

0

# 繼承自

ScriptableAndArrayOptions.borderRadius

# 定義於

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


# borderSkipped

borderSkipped: ScriptableAndArray<boolean | "end" | "start" | "left" | "top" | "bottom" | "right" | "middle", ScriptableContext<"bar">>

跳過的(排除的)邊框:'start'、'end'、'left'、'right'、'bottom'、'top'、'middle'、false (無) 或 true (全部)。

預設值

'start'

# 繼承自

ScriptableAndArrayOptions.borderSkipped

# 定義於

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


# borderWidth

borderWidth: ScriptableAndArray<number | { bottom?: number ; left?: number ; right?: number ; top?: number }, ScriptableContext<"bar">>

邊框寬度,數字表示所有邊都相同,物件表示分別指定每個邊的寬度

預設值

0

# 繼承自

ScriptableAndArrayOptions.borderWidth

# 定義於

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


# categoryPercentage

categoryPercentage: number

每個類別在樣本寬度內應佔用的可用寬度百分比(0-1)。

預設值

0.8

# 定義於

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


# clip

clip: number | false | ChartArea

如何相對於 chartArea 進行裁剪。正值允許溢出,負值則在 chartArea 內裁剪該像素數量。0 = 在 chartArea 裁剪。裁剪也可以針對每側進行配置:clip: {left: 5, top: false, right: -2, bottom: 0}

# 繼承自

ControllerDatasetOptions.clip

# 定義於

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


# grouped

grouped: boolean

是否應在索引軸上將長條圖分組

預設值

true

# 定義於

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


# hidden

hidden: boolean

配置資料集的顯示狀態。將其設定為 true,即可從圖表中隱藏資料集。

預設值

false

# 繼承自

ControllerDatasetOptions.hidden

# 定義於

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


# hoverBackgroundColor

hoverBackgroundColor: ScriptableAndArray<Color, ScriptableContext<"bar">>

# 繼承自

ScriptableAndArrayOptions.hoverBackgroundColor

# 定義於

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


# hoverBorderColor

hoverBorderColor: ScriptableAndArray<Color, ScriptableContext<"bar">>

# 繼承自

ScriptableAndArrayOptions.hoverBorderColor

# 定義於

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


# hoverBorderWidth

hoverBorderWidth: ScriptableAndArray<number, ScriptableContext<"bar">>

# 繼承自

ScriptableAndArrayOptions.hoverBorderWidth

# 定義於

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


# indexAxis

indexAxis: "x" | "y"

圖表的基本軸。垂直圖表為 'x',水平圖表為 'y'。

預設值

'x'

# 繼承自

ControllerDatasetOptions.indexAxis

# 定義於

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


# inflateAmount

inflateAmount: ScriptableAndArray<number | "auto", ScriptableContext<"bar">>

放大矩形的量。這可以用來隱藏長條之間的偽影。單位為像素。「auto」在 barPercentage * categoryPercentage 為 1 時轉換為 0.33 像素,否則為 0。

預設值

'auto'

# 繼承自

ScriptableAndArrayOptions.inflateAmount

# 定義於

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


# label

label: string

資料集的標籤,會顯示在圖例和工具提示中。

# 繼承自

ControllerDatasetOptions.label

# 定義於

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


# maxBarThickness

maxBarThickness: number

設定此值以確保長條的尺寸不會超過此厚度。

# 定義於

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


# minBarLength

minBarLength: number

設定此項以確保長條圖的最小像素長度。

# 定義於

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


# normalized (正規化)

normalized: boolean

如果您提供的數據索引是唯一、已排序,且在數據集中保持一致,並提供 normalized: true 選項以告知 Chart.js 您已完成此操作,Chart.js 的執行速度會最快。

# 繼承自

ControllerDatasetOptions.normalized

# 定義於

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


# order (順序)

order: number

數據集的繪圖順序。也會影響堆疊、工具提示和圖例的順序。

# 繼承自

ControllerDatasetOptions.order

# 定義於

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


# parsing (解析)

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

如何解析數據集。可以透過在圖表選項或數據集指定 parsing: false 來停用解析。如果停用解析,數據必須經過排序,並且採用相關圖表類型和刻度在內部使用的格式。

# 繼承自

ControllerDatasetOptions.parsing

# 定義於

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


# pointStyle (點樣式)

pointStyle: PointStyle

圖例的點樣式

預設值

'circle;

# 定義於

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


# stack (堆疊)

stack: string

此數據集所屬群組的 ID(當堆疊時,每個群組將是一個單獨的堆疊)。

# 繼承自

ControllerDatasetOptions.stack

# 定義於

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


# transitions (轉場效果)

transitions: TransitionsSpec<"bar">

# 繼承自

AnimationOptions.transitions

# 定義於

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


# xAxisID (X軸ID)

xAxisID: string

要在此數據集上繪製的 X 軸 ID。

# 定義於

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


# yAxisID (Y軸ID)

yAxisID: string

要在此數據集上繪製的 Y 軸 ID。

# 定義於

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