Files
frontend-elite-data-analysis/src/data/echart/xAxis.ts
T
2022-12-06 14:10:18 +08:00

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,
}
}