import { PublicConfigClass } from '../../../../../utils/PublicConfigClass';

import { echartOptionProfixHandle } from '../../../chart';
import { PieCommonConfig } from './basis';
import { cloneDeep } from 'lodash-es';
import dataJson from './data.json';

export const includes = ['legend'];

export const option = {
  type: 'ring',
  tooltip: {
    show: true,
    trigger: 'item'
  },
  legend: {
    show: true
  },
  dataset: { ...dataJson },
  series: [
    {
      type: 'pie',
      radius: ['40%', '65%'],
      center: ['50%', '60%'],
      roseType: false,
      avoidLabelOverlap: false,
      itemStyle: {
        show: true,
        borderRadius: 10,
        borderColor: '#fff',
        borderWidth: 2
      },
      label: {
        show: false,
        position: 'center'
      },
      emphasis: {
        label: {
          show: true,
          fontSize: '40',
          fontWeight: 'bold'
        }
      },
      labelLine: {
        show: false
      }
    }
  ]
};

export default class Config extends PublicConfigClass {
  key = PieCommonConfig.key;
  chartConfig = cloneDeep(PieCommonConfig);
  // 图表配置项
  option = echartOptionProfixHandle(option, includes);
}
