1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- /**
- |--------------------------------------------------
- | 柱状图公共配置
- |--------------------------------------------------
- */
- 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 }
|