/** |-------------------------------------------------- | 柱状图公共配置 |-------------------------------------------------- */ let _BarOptions = { tooltip: { trigger: 'axis', axisPointer: { type: 'shadow', }, }, legend: { data: [], }, grid: { left: '2%', right: '2%', top: 0, bottom: 0, containLabel: true, }, xAxis: { show: true, type: 'value', boundaryGap: [0, 0], axisTick: { show: false, }, axisLine: { lineStyle: { color: 'transparent', }, }, axisLabel: { show: false, color: '#fff', }, splitLine: { lineStyle: { type: 'dotted', }, }, }, yAxis: { type: 'category', axisLine: { lineStyle: { color: '#fff', }, }, axisLabel: { show: true, color: '#fff', }, axisTick: { show: false, }, data: [], }, series: [ { name: '', type: 'bar', barMaxWidth: 10, itemStyle: { normal: { color: '#a856f8', }, }, data: [], }, ], } let handlerBarColor = colors => { return function(params) { let colorList = colors.reverse() return colorList[params.dataIndex] } } let BarOptions = JSON.parse(JSON.stringify(_BarOptions)) export { BarOptions, handlerBarColor }