StackedValueAxis
名稱:Stacked Value Axis(Value 圖軸)
說明:搭配堆疊資料的圖形(目前有
StackedBar
) 的 Value 圖軸(預設為 Y 軸)
params$
型別:
Partial<StackedValueAxisParams>
欄位:
名稱 說明 型別 labelOffset 擺放位置 [number, number]
labelColorType 和外框的間距 ColorType
axisLineVisible 底色顏色類別 boolean
axisLineColorType 邊框顏色類別 ColorType
ticks 圖例的間隔距離 number | null
tickFormat 列表圖示寬度 string | ((text: d3.NumberValue) => string | d3.NumberValue
tickLineVisible 列表圖示高度 boolean
tickPadding 列表圖示圓角寬度 number
tickFullLine 文字顏色類別 boolean
tickFullLineDasharray 文字顏色類別 string
tickColorType 文字顏色類別 ColorType
tickTextRotate 文字顏色類別 number
tickTextColorType 文字顏色類別 ColorType
詳細型別
type ColorType = 'none' | 'label' | 'labelContrast' | 'primary' | 'secondary' | 'background'
- 預設值:
{
labelOffset: [0, 0],
labelColorType: 'primary',
axisLineVisible: false,
axisLineColorType: 'primary',
ticks: null,
tickFormat: num => {
if (num === null || Number.isNaN(num) == true) {
return num || 0
}
var parts = num.toString().split('.')
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
return parts.join('.')
},
tickLineVisible: true,
tickPadding: 20,
tickFullLine: true,
tickFullLineDasharray: 'none',
tickColorType: 'secondary',
tickTextRotate: 0,
tickTextColorType: 'primary'
}