RacingBars
名稱:RacingBars(賽跑長條圖)
說明:內建計數器來顯示 value 中第 0 筆資料到最後一筆資料。
params$
型別:
DeepPartial<RacingBarsParams>欄位:
名稱 說明 型別 bar 長條圖的設定 ObjectbarLabel 資料 label的顯示設定ObjectvalueLabel 資料 value的顯示設定ObjectaxisLabel X軸標籤的顯示設定 ObjectrankingAmount 排名數量(顯示項目數量),預設為10,如設定為 'auto'會在空間足夠下將所有資料顯示出來'auto' | numberautorun 賽跑啟動狀態,預設是靜止不動的,設定為 true後才會開始跑booleanloop 設定賽跑為重覆執行不停止 booleanparams.bar名稱 說明 型別 barWidth 各別 Bar 寬度 numberbarPadding Bar 間距 numberbarRadius Bar 圓角寬度 booleanparams.barLabel名稱 說明 型別 position 擺放位置 'inside' | 'outside' | 'none'padding 間距 numbercolorType 標籤顏色類別 ColorTypeparams.valueLabel名稱 說明 型別 padding 間距 numbercolorType 標籤顏色類別 ColorTypeformat 標籤顯示文字的函式 string | ((text: d3.NumberValue) => string | d3.NumberValueparams.axisLabel名稱 說明 型別 offset 圖軸標籤擺放位置 [number, number]colorType 標籤顏色類別 ColorType
詳細型別
type ColorType = 'none' | 'label' | 'labelContrast' | 'primary' | 'secondary' | 'background'
- 預設值:
{
bar: {
barWidth: number
barPadding: number
barRadius: number | boolean
}
barLabel: {
position: 'inside' | 'outside' | 'none'
padding: number
rotate: number
colorType: ColorType
}
valueLabel: {
padding: number
colorType: ColorType
format: string | ((text: d3.NumberValue | null) => string | d3.NumberValue)
}
axisLabel: {
offset: [number, number]
colorType: ColorType
}
rankingAmount: 'auto' | number
autorun: boolean
loop: boolean
}