XYAux
Name: X And Y Axes Auxiliary Line (X and Y Axes Auxiliary Line)
Description: X, Y axis auxiliary lines used for MultiValue data type
params$
Type:
DeepPartial<XYAuxParams>
Fields:
Name Description Type xAxis X axis settings Object
yAxis Y axis settings Object
params.xAxis
,params.yAxis
Fields:
Name Description Type showLine Show auxiliary line boolean
showLabel Show auxiliary label boolean
lineDashArray Line attribute dash-array string
lineColorType Line color type ColorType
labelColorType Label color type ColorType
labelTextColorType Label text color type ColorType
labelTextFormat Label text function string | ((text: any) => string)
labelPadding Label padding number
Detailed Types
type ColorType = 'none' | 'label' | 'labelContrast' | 'primary' | 'secondary' | 'background'
- Default value:
{
xAxis: {
showLine: true,
showLabel: true,
lineDashArray: '3, 3',
lineColorType: 'primary',
labelColorType: 'primary',
labelTextColorType: 'background',
labelTextFormat: num => {
if (num === null || Number.isNaN(num) == true) {
return num || 0
}
const absNum = Math.abs(num)
if (absNum > 0 && absNum < 1) {
const strNum = num.toString()
const match = strNum.match(/0\.(0*)([1-9])/)
if (match) {
const precision = match[1].length + 1
return num.toFixed(precision)
}
return num.toString()
}
const parts = num.toString().split('.')
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
return parts[0]
},
labelPadding: 20,
},
yAxis: {
showLine: true,
showLabel: true,
lineDashArray: '3, 3',
lineColorType: 'primary',
labelColorType: 'primary',
labelTextColorType: 'background',
labelTextFormat: num => {
if (num === null || Number.isNaN(num) == true) {
return num || 0
}
const absNum = Math.abs(num)
if (absNum > 0 && absNum < 1) {
const strNum = num.toString()
const match = strNum.match(/0\.(0*)([1-9])/)
if (match) {
const precision = match[1].length + 1
return num.toFixed(precision)
}
return num.toString()
}
const parts = num.toString().split('.')
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
return parts[0]
},
labelPadding: 20,
}
}