barOptions.js 2.74 KB
/*
 * @Author: 前端 qianduan01@didihu.com.cn
 * @Date: 2022-10-25 10:46:24
 * @LastEditors: 前端 qianduan01@didihu.com.cn
 * @LastEditTime: 2022-10-25 15:14:13
 * @FilePath: \dj-data-view\src\components\barOptions.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
function getBarOptions(obj) {
  var options = {
    xAxis: {
      type: 'category',
      axisLabel: {
        color: '#606266',
        fontSize: '0.8em',
        rotate: 30
      },
      splitLine: {
        show: false
      },
      axisTick: {
        show: false
      },
      axisLine: {
        show: false
      },
      data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
    },
    grid: {
      left: '3%',
      right: '6%',
      top: '6%',
      bottom: '0%',
      containLabel: true
    },
    yAxis: {
      nameGap: 30,
      type: 'value',
      splitLine: {
        show: false
      },
      axisLabel: {
        show: false
      },
      splitLine: {
        lineStyle: {
          color: '#2F314F'
        }
      },
      splitNumber: 4
    },
    series: [
      {
        type: 'bar',
        symbol: 'circle',
        backgroundStyle: {
          color: '#6578FF'
        },
        barWidth: '30%',
        data: [120, 200, 150, 80, 70, 110, 130]
      }
    ]
  }
  return options
}
function getBarReverseOptions(obj) {
  var options = {
    tooltip: {
      trigger: 'axis',
      showContent: false,
      axisPointer: {
        type: 'shadow',
        shadowStyle: {
          color: 'rgba(210, 210, 210, 0.2)'
        }
      },
      borderWidth: 0,
      backgroundColor: 'rgba(68,68,68,0.80)',
      confine: true,
      textStyle: {
        color: '#ffffff',
        fontSize: 8
      }
    },
    yAxis: {
      type: 'category',
      axisLabel: {
        color: '#ccc',
        fontSize: '0.8em'
      },
      splitLine: {
        show: false
      },
      axisTick: {
        show: false
      },
      axisLine: {
        show: false
      },
      data: ['一般发展', '一般价值', '一般挽留', '重要挽留', '重要价值', '重要发展', '重要保持', '一般保持']
    },
    grid: {
      left: '15%',
      right: '0%',
      top: '0%',
      bottom: '0%',
      containLabel: true
    },
    xAxis: {
      nameGap: 30,
      type: 'value',
      splitLine: {
        show: false
      },
      axisLabel: {
        show: false
      },
      splitNumber: 4
    },
    series: [
      {
        type: 'bar',
        symbol: 'circle',
        backgroundStyle: {
          color: '#6578FF'
        },
        data: [30, 120, 200, 150, 80, 70, 110, 130]
      }
    ]
  }
  return options
}
export { getBarReverseOptions, getBarOptions }