var colors = ['#5793f3', '#d14a61', '#675bba'];

export default {
  color: colors,
  title: {
    text: '月最小停车时长',
    textStyle: {
      color: '#fff'
    }
  },
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'cross'
    },
    formatter (pamams) {
      let doc = `
            <div>${pamams[0].name}</div>
        `
      pamams.forEach(item => {
        let str = `<div>
                    <span style="background: ${item.color};width: 10px;height: 10px;border-radius: 50%;display: inline-block;"></span> ${item.seriesName}: ${item.data}h
                  </div>`
        doc += str
      })
      return doc
    }
  },
  grid: {
    left: '1%',
    right: '8%',
    bottom: '6%',
    containLabel: true
  },
  toolbox: {
    // feature: {
    //   dataView: {show: true, readOnly: false},
    //   restore: {show: true},
    //   saveAsImage: {show: true}
    // }
  },
  legend: {
    textStyle: {
      color: '#fff'
    }
  },
  xAxis: [
    {
      type: 'category',
      axisTick: {
        alignWithLabel: true,
        textStyle: {
          color: '#2DA2FD'
        }
      },
      axisLabel: {
        color: '#fff'
      },
      data: ['1月','2月','3月','4月','5月']
    }
  ],
  yAxis: [
    {
      type: 'value',
      name: '停车时长(h)h',
      axisLine: {
        lineStyle: {
          color: '#5a6379'
        }
      },
      axisLabel: {
        formatter: '{value}',
        color: '#fff'
      },
      nameTextStyle: {
        color: '#fff',
        padding: [0, 0, 0, 50]
      },
      splitLine: {
        lineStyle: {
          color: '#5a6379'
        }
      }
    }
  ],
  series: [
    {
      // markPoint: {
      //   data: [
      //     {type: 'max', name: '最大值'},
      //     {type: 'min', name: '最小值'}
      //   ]
      // },
      name:'月最小停车时长',
      type:'bar',
      data:[15.32, 12.76, 15.65, 13.23, 15.88]
    },
    {
      name:'最小停车时长',
      type:'bar',
      data:[12.39, 12.39, 12.39, 12.39, 12.39]
    }
  ]
};