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

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

export const includes = ['legend', 'xAxis', 'yAxis', 'grid'];

export const option = {
  tooltip: {
    show: true,
    trigger: 'axis',
    axisPointer: {
      type: 'line'
    }
  },
  xAxis: {
    show: true,
    type: 'category'
  },
  yAxis: {
    show: true,
    type: 'value'
  },
  dataset: { ...dataJson },
  series: [
    {
      type: 'line',
      symbolSize: 5, //设定实心点的大小
      lineStyle: {
        type: 'solid',
        width: 3,
        color: {
          type: 'linear',
          colorStops: [
            {
              offset: 0,
              color: chartColorsSearch['dark'][0] // 0% 处的颜色
            },
            {
              offset: 1,
              color: chartColorsSearch['dark'][1] // 100% 处的颜色
            }
          ],
          globalCoord: false // 缺省为 false
        },
        shadowColor: chartColorsSearch['dark'][2],
        shadowBlur: 10,
        shadowOffsetY: 20
      }
    }
  ]
};

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