36 lines
863 B
TypeScript
36 lines
863 B
TypeScript
import { XAXisComponentOption } from 'echarts'
|
|
|
|
declare const AXIS_TYPES: {
|
|
readonly value: 1
|
|
readonly category: 1
|
|
readonly time: 1
|
|
readonly log: 1
|
|
}
|
|
declare type OptionAxisType = keyof typeof AXIS_TYPES
|
|
|
|
export const generateXAxis = function (
|
|
type?: OptionAxisType,
|
|
gridIndex?: number,
|
|
// boundaryGap?: [string | number, string | number],
|
|
): XAXisComponentOption {
|
|
return {
|
|
type: type || 'value',
|
|
show: true,
|
|
gridIndex: gridIndex || 0,
|
|
// scale: true,
|
|
// boundaryGap: true,
|
|
axisLine: { onZero: false, lineStyle: { color: '#aaa' } },
|
|
axisTick: { show: false },
|
|
axisLabel: {
|
|
show: true,
|
|
showMinLabel: false,
|
|
showMaxLabel: false,
|
|
color: '#34495e',
|
|
},
|
|
splitLine: { show: true, lineStyle: { color: '#aaa' } },
|
|
min: 'dataMin',
|
|
max: 'dataMax',
|
|
// interval: undefined,
|
|
}
|
|
}
|