MultiGroupAxis
名稱:Multi Group Axis(多組資料中的 Group 圖軸)
說明:使用上等同於 Grid 資料類別中的
GroupAxis,標籤文字預設會對應對應dataFormatter$中gridList陣列中索引 [0] 的columnLabels(通常來說 MultiGrid 多組 Grid 資料會使用相同的 X 軸標籤)。使用方式:圖軸的格式會搭配
dataFormatter的gridList[].groupAxis欄位設定,詳細 API 請參考文件(不過大部份情況下如已使用Preset則不太需要自行設定dataFormatter,較常使用的是圖軸標籤的設定)圖軸標籤設定:使用
dataFormatter的gridList[].groupAxis.label設定標籤文字,範例如下:
chart.dataFormatter$.next({
gridList: [
{
groupAxis: {
label: '地區'
}
}
]
})
params$
型別:
Partial<GroupAxisParams>欄位:
名稱 說明 型別 labelOffset 圖軸標籤位移 [number, number]labelColorType 圖軸標籤顏色類別 ColorTypeaxisLineVisible 顯示圖軸線 booleanaxisLineColorType 圖軸線顏色類別 ColorTypeticks 刻度數量
*number: 合適數量
*null: 自動判斷all: 全部number | null | 'all'tickFormat 刻度文字格式
*string: 以d3-format格式 進行註記
*Function: 自訂 function 回傳顯示文字)string | ((text: d3.NumberValue) => string | d3.NumberValuetickLineVisible 顯示刻度線 booleantickPadding 刻度和文字的距離 numbertickFullLine 將刻度線顯示在整個場景上 booleantickFullLineDasharray 設定刻度線虛線格式(搭配 tickFullLine為true)stringtickColorType 刻度顏色類別 ColorTypetickTextRotate 刻度文字旋轉 numbertickTextColorType 刻度文字顏色類別 ColorTypegridIndexes 對應的 data$Grid 資料索引,可對應一組或多組 Grid 資料number[] | 'all'
詳細型別
type ColorType = 'none' | 'label' | 'labelContrast' | 'primary' | 'secondary' | 'background'
- 預設值:
{
labelOffset: [0, 0],
labelColorType: 'primary',
axisLineVisible: true,
axisLineColorType: 'primary',
ticks: 'all',
tickFormat: text => text,
tickLineVisible: true,
tickPadding: 20,
tickFullLine: false,
tickFullLineDasharray: 'none',
tickColorType: 'secondary',
tickTextRotate: 0,
tickTextColorType: 'primary',
gridIndexes: [0]
}