# 介面:CartesianScaleOptions

# 階層

# 屬性

# alignToPixels

alignToPixels: boolean

將像素值對齊到裝置像素

# 繼承自

CoreScaleOptions.alignToPixels

# 定義於

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


# axis

axis: "x" | "y" | "r"

此軸的類型。可能的值為:'x'、'y'、'r'。如果未設定,則從 ID 的第一個字元推斷,該字元應為 'x'、'y' 或 'r'。

# 定義於

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


# backgroundColor

backgroundColor: Color

刻度區域的背景顏色。

# 繼承自

CoreScaleOptions.backgroundColor

# 定義於

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


# border

border: BorderOptions

# 定義於

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


# bounds

bounds: "data" | "ticks"

刻度邊界策略(受 min/max 時間選項繞過)

  • data:確保資料完全可見,移除外部刻度
  • ticks:確保刻度完全可見,截斷外部資料

2.7.0

預設

'ticks'

# 定義於

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


# clip

clip: boolean

相對於刻度的大小而不是圖表區域裁剪資料集繪圖。

預設

true

# 繼承自

CoreScaleOptions.clip

# 定義於

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


# display

display: boolean | "auto"

控制軸的全域可見性(為 true 時可見,為 false 時隱藏)。當 display: 'auto' 時,軸僅在至少一個相關聯的資料集可見時才可見。

預設

true

# 繼承自

CoreScaleOptions.display

# 定義於

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


# grid

grid: Partial<GridLineOptions>

# 定義於

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


# max

max: number

使用者定義的刻度最大值,會覆寫來自資料的最大值。

# 覆寫

CoreScaleOptions.max

# 定義於

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


# min

min: number

使用者定義的刻度最小值,會覆寫來自資料的最小值。

# 覆寫

CoreScaleOptions.min

# 定義於

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


# offset

offset: boolean

如果為 true,則會在兩邊邊緣加入額外空間,並縮放座標軸以符合圖表區域。預設情況下,長條圖會設定為 true。

預設

false

# 定義於

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


# position

position: "center" | "left" | "top" | "bottom" | "right" | { [scale: string]: number; }

座標軸的位置。

# 定義於

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


# reverse

reverse: boolean

反轉刻度。

預設

false

# 繼承自

CoreScaleOptions.reverse

# 定義於

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


# stack

Optional stack: string

堆疊群組。具有相同 position 和相同 stack 的座標軸會堆疊在一起。

# 定義於

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


# stackWeight

Optional stackWeight: number

刻度在堆疊群組中的權重。用於決定群組內為刻度分配的空間量。

預設

1

# 定義於

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


# stacked

Optional stacked: boolean | "single"

如果為 true,資料會由資料集的資料組成

預設

false

# 定義於

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


# suggestedMax

suggestedMax: unknown

計算最小資料值時使用的調整值。

# 繼承自

CoreScaleOptions.suggestedMax

# 定義於

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


# suggestedMin

suggestedMin: unknown

計算最大資料值時使用的調整值。

# 繼承自

CoreScaleOptions.suggestedMin

# 定義於

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


# ticks

ticks: CartesianTickOptions

# 定義於

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


# title

title: Object

刻度標題的選項。

# 類型宣告

名稱 類型 描述
align Align 座標軸標題的對齊方式。
color Color 座標軸標籤的顏色。
display boolean 如果為 true,則會顯示座標軸標題。
font ScriptableAndScriptableOptions<Partial<FontSpec>, ScriptableCartesianScaleContext> 關於座標軸標題字型的資訊。
padding number | { bottom: number ; top: number ; y: number } 要套用在刻度標籤周圍的邊距。
text string | string[] 標題的文字,例如「# of People」或「Response Choices」。

# 定義於

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


# weight

weight: number

用於排序座標軸的權重。權重越高,離圖表區域越遠。

預設

true

# 繼承自

CoreScaleOptions.weight

# 定義於

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

# 方法

# afterBuildTicks

afterBuildTicks(axis): void

在建立刻度後執行的回呼。對於篩選刻度很有用。

# 參數

名稱 類型
axis Scale<CoreScaleOptions>

# 回傳

void

# 繼承自

CoreScaleOptions.afterBuildTicks

# 定義於

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


# afterCalculateLabelRotation

afterCalculateLabelRotation(axis): void

在判斷刻度旋轉後執行的回呼。

# 參數

名稱 類型
axis Scale<CoreScaleOptions>

# 返回值

void

# 繼承自

CoreScaleOptions.afterCalculateLabelRotation

# 定義於

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


# afterDataLimits

afterDataLimits(axis): void

在數據範圍確定後執行的回呼函數。

# 參數

名稱 類型
axis Scale<CoreScaleOptions>

# 返回值

void

# 繼承自

CoreScaleOptions.afterDataLimits

# 定義於

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


# afterFit

afterFit(axis): void

在刻度符合畫布大小後執行的回呼函數。

# 參數

名稱 類型
axis Scale<CoreScaleOptions>

# 返回值

void

# 繼承自

CoreScaleOptions.afterFit

# 定義於

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


# afterSetDimensions

afterSetDimensions(axis): void

在尺寸設定後執行的回呼函數。

# 參數

名稱 類型
axis Scale<CoreScaleOptions>

# 返回值

void

# 繼承自

CoreScaleOptions.afterSetDimensions

# 定義於

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


# afterTickToLabelConversion

afterTickToLabelConversion(axis): void

在刻度轉換為字串後執行的回呼函數。

# 參數

名稱 類型
axis Scale<CoreScaleOptions>

# 返回值

void

# 繼承自

CoreScaleOptions.afterTickToLabelConversion

# 定義於

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


# afterUpdate

afterUpdate(axis): void

在更新流程結束時執行的回呼函數。

# 參數

名稱 類型
axis Scale<CoreScaleOptions>

# 返回值

void

# 繼承自

CoreScaleOptions.afterUpdate

# 定義於

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


# beforeBuildTicks

beforeBuildTicks(axis): void

在建立刻度前執行的回呼函數。

# 參數

名稱 類型
axis Scale<CoreScaleOptions>

# 返回值

void

# 繼承自

CoreScaleOptions.beforeBuildTicks

# 定義於

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


# beforeCalculateLabelRotation

beforeCalculateLabelRotation(axis): void

在確定刻度旋轉前執行的回呼函數。

# 參數

名稱 類型
axis Scale<CoreScaleOptions>

# 返回值

void

# 繼承自

CoreScaleOptions.beforeCalculateLabelRotation

# 定義於

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


# beforeDataLimits

beforeDataLimits(axis): void

在確定數據範圍前執行的回呼函數。

# 參數

名稱 類型
axis Scale<CoreScaleOptions>

# 返回值

void

# 繼承自

CoreScaleOptions.beforeDataLimits

# 定義於

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


# beforeFit

beforeFit(axis): void

在刻度符合畫布大小前執行的回呼函數。

# 參數

名稱 類型
axis Scale<CoreScaleOptions>

# 返回值

void

# 繼承自

CoreScaleOptions.beforeFit

# 定義於

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


# beforeSetDimensions

beforeSetDimensions(axis): void

在尺寸設定前執行的回呼函數。

# 參數

名稱 類型
axis Scale<CoreScaleOptions>

# 返回值

void

# 繼承自

CoreScaleOptions.beforeSetDimensions

# 定義於

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


# beforeTickToLabelConversion

beforeTickToLabelConversion(axis): void

在刻度轉換為字串前執行的回呼函數。

# 參數

名稱 類型
axis Scale<CoreScaleOptions>

# 返回值

void

# 繼承自

CoreScaleOptions.beforeTickToLabelConversion

# 定義於

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


# beforeUpdate

beforeUpdate(axis): void

在更新流程開始前執行的回呼函數。

# 參數

名稱 類型
axis Scale<CoreScaleOptions>

# 返回值

void

# 繼承自

CoreScaleOptions.beforeUpdate

# 定義於

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