// echart 柱状图配置
export const TraficFlowBar = () => ({
  title: {
    left: 'left',
    textStyle: {
      color: '#FFFFFF',
      fontSize: 14
    }
  },
  tooltip: {
    trigger: 'item',
    renderMode: 'html',
    appendToBody: false,
    // axisPointer: {
    //   type: 'cross'
    // }
  },
  grid: {
    top: 60,
    bottom: 20,
    left: 86,
    right: 86
  },
  legend: {
    show: true,
    top: 6,
    right: 22,
    itemWidth: 8,
    itemHeight: 8,
    textStyle: {
      color: '#ffffff'
    }
  },
  xAxis: {
    type: 'category',
    data: [],
    axisTick: {
      show: false
    },
    axisLabel: {
      color: '#ffffff'
    },
    axisLine: {
      show: true,
      lineStyle: {
        color: 'rgba(255, 255, 255, 0.2)'
      }
    }
  },
  yAxis: [{
    type: 'value',
    name: '平均车流量',
    nameTextStyle: {
      color: '#ffffff',
      padding: [0, 0, 0, -60]
    },
    minInterval: 100,
    splitLine: {
      show: false,
    },
    axisLabel: {
      color: '#ffffff'
    },
    axisLine: {
      show: true,
      lineStyle: {
        color: 'rgba(255, 255, 255, 0.2)'
      }
    }
  }, {
    type: 'value',
    name: '平均车速',
    nameTextStyle: {
      color: '#ffffff',
      padding: [0, -45, 0, 0]
    },
    minInterval: 30,
    splitLine: {
      show: false,
    },
    axisLabel: {
      color: '#ffffff'
    },
    axisLine: {
      show: true,
      lineStyle: {
        color: 'rgba(255, 255, 255, 0.2)'
      }
    }
  }],
  series: [
    {
      name: '车流量(辆)',
      data: [],
      type: 'line',
      yAxisIndex: 0,
      itemStyle: {
        color: '#54D0D3'
      },
      lineStyle: {
        color: '#54D0D3'
      },
      symbol: 'diamond'
    }, {
      name: '车速(km/h)',
      data: [],
      type: 'bar',
      barWidth: 21,
      yAxisIndex: 1,
      itemStyle: {
        color: {
          type: 'linear',
          x: 0,
          y: 0,
          x2: 0,
          y2: 1,
          colorStops: [{
            offset: 0, color: 'rgba(255, 221, 0, 1)'
          }, {
            offset: 1, color: 'rgba(211, 84, 84, 0.4)'
          }]
        }
      }
    }
  ]
})