# 介面:LineControllerDatasetOptions

# 繼承關係

# 屬性

# animation

animation: false | AnimationSpec<"line"> & { 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<"line">

# 繼承自

AnimationOptions.animations

# 定義於

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


# backgroundColor

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

# 繼承自

ScriptableAndArrayOptions.backgroundColor

# 定義於

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


# borderCapStyle

borderCapStyle: Scriptable<CanvasLineCap, ScriptableContext<"line">>

線條端點樣式。請參閱 MDN。

預設值

'butt'

# 繼承自

ScriptableOptions.borderCapStyle

# 定義於

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


# borderColor

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

# 繼承自

ScriptableAndArrayOptions.borderColor

# 定義於

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


# borderDash

borderDash: Scriptable<number[], ScriptableContext<"line">>

線條虛線。請參閱 MDN。

預設值

[]

# 繼承自

ScriptableOptions.borderDash

# 定義於

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


# borderDashOffset

borderDashOffset: Scriptable<number, ScriptableContext<"line">>

線條虛線偏移量。請參閱 MDN。

預設值

0.0

# 繼承自

ScriptableOptions.borderDashOffset

# 定義於

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


# borderJoinStyle

borderJoinStyle: Scriptable<CanvasLineJoin, ScriptableContext<"line">>

線條接合樣式。請參閱 MDN。

預設值

'miter'

# 繼承自

ScriptableOptions.borderJoinStyle

# 定義於

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


# borderWidth

borderWidth: ScriptableAndArray<number, ScriptableContext<"line">>

# 繼承自

ScriptableAndArrayOptions.borderWidth

# 定義於

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


# capBezierPoints

capBezierPoints: Scriptable<boolean, ScriptableContext<"line">>

設為 true 可將貝茲曲線控制點保持在圖表內,設為 false 則不限制。

預設值

true

# 繼承自

ScriptableOptions.capBezierPoints

# 定義於

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


# 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 (開啟新視窗)


# cubicInterpolationMode

cubicInterpolationMode: Scriptable<"default" | "monotone", ScriptableContext<"line">>

要套用的內插模式。

預設值

'default'

# 繼承自

ScriptableOptions.cubicInterpolationMode

# 定義於

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


# fill

fill: Scriptable<FillTarget | ComplexFillTarget, ScriptableContext<"line">>

折線圖和雷達圖都支援資料集物件上的 fill 選項,可用於在兩個資料集之間或資料集與邊界(即刻度原點、起點或終點)之間建立區域。

# 繼承自

ScriptableOptions.fill

# 定義於

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


# hidden

hidden: boolean

設定資料集的可見性狀態。將其設為 true,以從圖表中隱藏資料集。

預設值

false

# 繼承自

ControllerDatasetOptions.hidden

# 定義於

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


# hoverBackgroundColor

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

# 繼承自

ScriptableAndArrayOptions.hoverBackgroundColor

# 定義於

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


# hoverBorderCapStyle

hoverBorderCapStyle: Scriptable<CanvasLineCap, ScriptableContext<"line">>

# 繼承自

ScriptableOptions.hoverBorderCapStyle

# 定義於

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


# hoverBorderColor

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

# 繼承自

ScriptableAndArrayOptions.hoverBorderColor

# 定義於

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


# hoverBorderDash

hoverBorderDash: Scriptable<number[], ScriptableContext<"line">>

# 繼承自

ScriptableOptions.hoverBorderDash

# 定義於

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


# hoverBorderDashOffset

hoverBorderDashOffset: Scriptable<number, ScriptableContext<"line">>

# 繼承自

ScriptableOptions.hoverBorderDashOffset

# 定義於

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


# hoverBorderJoinStyle

hoverBorderJoinStyle: Scriptable<CanvasLineJoin, ScriptableContext<"line">>

# 繼承自

ScriptableOptions.hoverBorderJoinStyle

# 定義於

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


# hoverBorderWidth

hoverBorderWidth: ScriptableAndArray<number, # 繼承自

ScriptableAndArrayOptions.hoverBorderWidth

# 定義於

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


# indexAxis

indexAxis: "x" | "y"

圖表的基本軸。「x」表示垂直圖表,「y」表示水平圖表。

預設值

'x'

# 繼承自

ControllerDatasetOptions.indexAxis

# 定義於

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


# label

label: string

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

# 繼承自

ControllerDatasetOptions.label

# 定義於

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


# normalized

normalized: boolean

如果您提供的資料索引是唯一的、已排序的,並且在所有資料集中都是一致的,並且提供 normalized: true 選項,讓 Chart.js 知道您已這樣做,則 Chart.js 的速度最快。

# 繼承自

ControllerDatasetOptions.normalized

# 定義於

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


# order

order: number

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

# 繼承自

ControllerDatasetOptions.order

# 定義於

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


# parsing

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

如何解析資料集。可以通過在圖表選項或資料集中指定 parsing: false 來禁用解析。如果禁用解析,資料必須經過排序,並且格式必須與相關的圖表類型和刻度在內部使用的格式一致。

# 繼承自

ControllerDatasetOptions.parsing

# 定義於

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


# pointBackgroundColor

pointBackgroundColor: ScriptableAndArray<Color, ScriptableContext<"line">>

點的填充顏色。

# 繼承自

ScriptableAndArrayOptions.pointBackgroundColor

# 定義於

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


# pointBorderColor

pointBorderColor: ScriptableAndArray<Color, ScriptableContext<"line">>

點的邊框顏色。

# 繼承自

ScriptableAndArrayOptions.pointBorderColor

# 定義於

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


# pointBorderWidth

pointBorderWidth: ScriptableAndArray<number, ScriptableContext<"line">>

點邊框的寬度,以像素為單位。

# 繼承自

ScriptableAndArrayOptions.pointBorderWidth

# 定義於

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


# pointHitRadius

pointHitRadius: ScriptableAndArray<number, ScriptableContext<"line">>

未顯示的點對滑鼠事件做出反應的像素大小。

# 繼承自

ScriptableAndArrayOptions.pointHitRadius

# 定義於

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


# pointHoverBackgroundColor

pointHoverBackgroundColor: ScriptableAndArray<Color, ScriptableContext<"line">>

滑鼠懸停時點的背景顏色。

# 繼承自

ScriptableAndArrayOptions.pointHoverBackgroundColor

# 定義於

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


# pointHoverBorderColor

pointHoverBorderColor: ScriptableAndArray<Color, ScriptableContext<"line">>

滑鼠懸停時點的邊框顏色。

# 繼承自

ScriptableAndArrayOptions.pointHoverBorderColor

# 定義於

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


# pointHoverBorderWidth

pointHoverBorderWidth: ScriptableAndArray<number, ScriptableContext<"line">>

滑鼠懸停時點的邊框寬度。

# 繼承自

ScriptableAndArrayOptions.pointHoverBorderWidth

# 定義於

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


# pointHoverRadius

pointHoverRadius: ScriptableAndArray<number, ScriptableContext<"line">>

滑鼠懸停時,點的半徑。

# 繼承自

ScriptableAndArrayOptions.pointHoverRadius

# 定義於

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


# pointRadius

pointRadius: ScriptableAndArray<number, ScriptableContext<"line">>

點形狀的半徑。如果設定為 0,則不會渲染點。

# 繼承自

ScriptableAndArrayOptions.pointRadius

# 定義於

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


# pointRotation

pointRotation: ScriptableAndArray<number, ScriptableContext<"line">>

點的旋轉角度,以度為單位。

# 繼承自

ScriptableAndArrayOptions.pointRotation

# 定義於

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


# pointStyle

pointStyle: ScriptableAndArray<PointStyle, ScriptableContext<"line">>

點的樣式。

# 繼承自

ScriptableAndArrayOptions.pointStyle

# 定義於

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


# segment

segment: Scriptable<{ backgroundColor: Scriptable<Color, ScriptableLineSegmentContext> ; borderCapStyle: Scriptable<CanvasLineCap, ScriptableLineSegmentContext> ; borderColor: Scriptable<Color, ScriptableLineSegmentContext> ; borderDash: Scriptable<number[], ScriptableLineSegmentContext> ; borderDashOffset: Scriptable<number, ScriptableLineSegmentContext> ; borderJoinStyle: Scriptable<CanvasLineJoin, ScriptableLineSegmentContext> ; borderWidth: Scriptable<number, ScriptableLineSegmentContext> }, ScriptableContext<"line">>

# 繼承自

ScriptableOptions.segment

# 定義於

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


# showLine

showLine: boolean

# 定義於

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


# spanGaps

spanGaps: number | boolean

如果為 true,則會在沒有或為 null 數據的點之間繪製線條。如果為 false,則具有 NaN 數據的點將會在線條中創建斷點。也可以是指定要跨越的最大間隙長度的數字。該值的單位取決於使用的比例。

預設值

false

# 覆寫

ScriptableOptions.spanGaps

# 定義於

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


# stack

stack: string

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

# 繼承自

ControllerDatasetOptions.stack

# 定義於

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


# stepped

stepped: Scriptable<boolean | "middle" | "after" | "before", ScriptableContext<"line">>

如果為 true,則將線條顯示為階梯線(將忽略張力)。

預設值

false

# 繼承自

ScriptableOptions.stepped

# 定義於

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


# tension

tension: Scriptable<number, ScriptableContext<"line">>

貝茲曲線張力(0 表示沒有貝茲曲線)。

預設值

0

# 繼承自

ScriptableOptions.tension

# 定義於

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


# transitions

transitions: TransitionsSpec<"line">

# 繼承自

AnimationOptions.transitions

# 定義於

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


# xAxisID

xAxisID: string

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

# 定義於

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


# yAxisID

yAxisID: string

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

# 定義於

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