export default {
  legend: {
    type: 'scroll',
    orient: 'vertical',
    top: 8,
    bottom: 8,
    right: 8,
    textStyle: {
      color: '#ffffff'
    },
    formatter: function (name) {
      if (name.length > 7) return `${name.substring(0, 5)}...`
      return name
    }
  },
  tooltip: {
    trigger: 'item'
  },
  series: [
    {
      name: '外圈背景',
      type: 'pie',
      center: ['35%', '50%'],
      radius: ['25.44%', '59.62%'],
      silent: true,
      label: {
        show: false
      },
      labelLine: {
        show: false
      },
      itemStyle: {
        color: '#ffffff'
      },
      data: [{ value: 1 }]
    },
    {
      name: '内圈背景',
      type: 'pie',
      center: ['35%', '50%'],
      radius: ['17.36%', '21.77%'],
      silent: true,
      label: {
        show: false
      },
      labelLine: {
        show: false
      },
      itemStyle: {
        color: '#ffffff'
      },
      data: [{ value: 1 }]
    },
    {
      name: '工序能耗本月排行榜',
      type: 'pie',
      center: ['35%', '50%'],
      radius: ['25.45%', '56.82%'],
      startAngle: 160,
      label: {
        fontSize: 14,
        color: '#ffffff',
        formatter: ['{d}%'].join('\n')
      },
      tooltip: {
        formatter: function ({ data, percent }) {
          const { name, Total } = data
          return `<div style='text-align: left;'>${name}<br />用量：${Total}<br />占比：${percent}%</div>`
        }
      }
    }
  ]
}
