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

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

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

export const seriesItem = {
  type: 'line',
  label: {
    show: true,
    position: 'top',
    color: '#fff',
    fontSize: 12
  },
  smooth: true,
  symbolSize: 5, //设定实心点的大小
  itemStyle: {
    color: null,
    borderRadius: 0
  },
  lineStyle: {
    type: 'solid',
    width: 3,
    color: null
  }
};
export const option = {
  animationDuration: 2000,
  tooltip: {
    show: true,
    trigger: 'axis',
    axisPointer: {
      type: 'line'
    }
  },
  xAxis: {
    show: true,
    type: 'category',
    nameLocation: 'middle'
  },
  yAxis: {
    show: true,
    type: 'value'
  },
  dataset: { ...dataJson },
  series: [seriesItem, seriesItem]
};

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