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

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

export const includes = ['legend'];

export const option = {
  tooltip: {
    show: true
  },
  legend: {
    data: dataJson.seriesData.map(i => i.name)
  },
  dataset: { ...dataJson },
  radar: {
    shape: 'polygon',
    radius: ['0%', '60%'],
    center: ['50%', '55%'],
    splitArea: { show: true },
    splitLine: { show: true },
    axisName: { show: true, color: '#eee', fontSize: 12 },
    axisLine: { show: true },
    axisTick: { show: true },
    indicator: dataJson.radarIndicator
  },
  series: [
    {
      name: 'radar',
      type: 'radar',
      areaStyle: {
        opacity: 0.1
      },
      data: dataJson.seriesData
    }
  ]
};

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