RacingValueAxis
Name: Racing Value Axis
Description: Mainly used with
RacingBars
to correspond to thexAxis
setting indataFormatter
.
params$
Type:
Partial<RacingValueAxisParams>
Fields:
Name Description Type labelOffset Axis label offset [number, number]
labelColorType Axis label color type ColorType
axisLineVisible Show axis line boolean
axisLineColorType Axis line color type ColorType
ticks Number of ticks
*number
: appropriate number
*null
: auto-detectnumber | null
tickFormat Tick text format
*string
: annotated withd3-format
format
*Function
: custom function returning display textstring | ((text: d3.NumberValue) => string | d3.NumberValue)
tickLineVisible Show tick line boolean
tickPadding Distance between tick and text number
tickFullLine Show tick line across the entire scene boolean
tickFullLineDasharray Set tick line dash format (used with tickFullLine
astrue
)string
tickColorType Tick color type ColorType
tickTextColorType Tick text color type ColorType
Detailed Types
type ColorType = 'none' | 'label' | 'labelContrast' | 'primary' | 'secondary' | 'background'
- Default values:
{
labelOffset: [0, 0],
labelColorType: 'primary',
axisLineVisible: false,
axisLineColorType: 'secondary',
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',
tickTextColorType: 'primary'
}