/**
 * @author  daya
 * @createDate  2021/10/29 15:45
 * 备注: pie图表设置
 **/
// eslint-disable-next-line no-unused-vars
import * as echarts from 'echarts'
// 按需引入,charts很多东西的
// eslint-disable-next-line no-unused-vars,no-redeclare
import {defaultColor, defaultFontSize, formatToMillion, linearGradientStyle, labelStyle, horizontalDataZoom, verticalDataZoom} from '../../charts'
/**
 * 提示语(tooltip)
 * 图例(legend)
 * 颜色(color)
 * x轴 (xAxis)
 * y轴 (xAxis)
 * 主体样式 (series)
 * **/
// 引入图标各组件的预设情况
import chart from '../../chart-perset'
let tooltip = chart.tooltip
let legend = chart.legend
let color = chart.pieColor
let series = chart.pieSeries
let toolbox = chart.toolbox
// pie
/**
 * pie公共部分开始
 * **/
// 文字样式
// eslint-disable-next-line no-unused-vars
const fontStyle = {
  color: defaultColor,
  fontSize: defaultFontSize
}
// eslint-disable-next-line no-unused-vars
const axisStyle = {
  splitLine: false,
  axisLine: false,
  axisTick: false,
  axisLabel: {
    color: defaultColor,
    fontSize: defaultFontSize,
    formatter: formatToMillion
  }
}

/** pie公共部分结束 **/
/**
 * *图表预设样式
 * opt
 **/
// 因为使用驼峰式，所有拼接变量的时候将style1的第一个字母转换成大写
// TODO: optionStyle应该还是可以再抽成一个js的
// 样式1
export const optionStyle1 = {
  tooltip: {
    trigger: 'item'
  },
  legend: {
    ...legend.legendStyle3
  },
  series: [
    series.seriesStyle1
  ]
}

// 样式2
export const optionStyle2 = {
  ...optionStyle1,
  tooltip: {
    trigger: 'item'
  },
  legend: {
    ...legend.legendStyle4
  },
  series: [
    series.seriesStyle2
  ]
}

export const optionStyle3 = {
  ...optionStyle1,
  tooltip: {
    trigger: 'item'
  },
  legend: {
    ...legend.legendStyle4
  },
  series: [
    series.seriesStyle3
  ]
}

export const optionStyle4 = {
  // ...optionStyle1,
  tooltip: {
    trigger: 'item'
  },
  color: color.colorStyle,
  // visualMap: {
  //   show: false,
  //   min: 80,
  //   max: 600,
  //   inRange: {
  //     colorLightness: [0, 1]
  //   }
  // },
  series: [
    series.seriesStyle4
  ]
}

export const optionStyle5 = {
  ...optionStyle1,
  tooltip: {},
  series: [
    series.seriesStyle5
  ]
}
export const optionStyle6 = {
  ...optionStyle1,
  tooltip: {
    ...tooltip.tooltipStyle3
  },
  legend: {
    ...legend.legendStyle5
  },
  toolbox: {
    ...toolbox.toolboxStyle1
  },
  series: series.seriesStyle6
}

export const optionStyle7 = {
  ...optionStyle1,
  legend: {
    ...legend.legendStyle6
  },
  toolbox: {
    ...toolbox.toolboxStyle1
  },
  series: [
    series.seriesStyle7
  ]
}

export const optionStyle8 = {
  series: series.seriesStyle8
}

export const optionStyle9 = {
  tooltip: {
    ...tooltip.tooltipStyle3
  },
  legend: {
    ...legend.legendStyle7
  },
  series: [
    series.seriesStyle9
  ]
}
export const optionStyle10 = {
  tooltip: {
    ...tooltip.tooltipStyle3
  },
  legend: {
    ...legend.legendStyle8
  },
  series: [
    series.seriesStyle10
  ]
}

export const optionStyle11 = {
  tooltip: {
    ...tooltip.tooltipStyle3
  },
  legend: {
    ...legend.legendStyle9
  },
  series: series.seriesStyle11
}

export const optionStyle12 = {
  ...optionStyle1,
  tooltip: {
    ...tooltip.tooltipStyle3,
    trigger: 'item'
  },
  legend: {
    ...legend.legendStyle1
  },
  series: series.seriesStyle12,
  color: color.colorStyle22
}
export const optionStyle31 = {
  tooltip: {
    trigger: 'item'
  },
  legend: {
    ...legend.legendStyle32
  },
  series: [
    series.seriesStyle31
  ],
  color: color.colorStyle31

}
export const optionStyle32 = {
  tooltip: {
    trigger: 'item'
  },
  legend: {
    ...legend.legendStyle33
  },
  series: [
    series.seriesStyle31
  ],
  color: color.colorStyle31

}
export const optionStyle41 = {
  tooltip: {
    trigger: 'item'
  },
  legend: {
    ...legend.legendStyle41
  },
  series: [
    series.seriesStyle41
  ],
  color: color.colorStyle41

}
export const optionStyle42 = {
  tooltip: {
    trigger: 'item'
  },
  legend: {
    ...legend.legendStyle42
  },
  series: [
    series.seriesStyle42
  ],
  color: color.colorStyle41

}

export const opt = {
  optionStyle1,
  optionStyle2,
  optionStyle3,
  optionStyle4,
  optionStyle5,
  optionStyle6,
  optionStyle7,
  optionStyle8,
  optionStyle9,
  optionStyle10,
  optionStyle11,
  optionStyle12,
  optionStyle31,
  optionStyle41,
  optionStyle42
}

// commonConfig 导出的预设样式
export const commonConfig = {
  ...tooltip,
  ...legend,
  ...color,
  ...series
}

/**
 * 饼图颜色设置
 * pieColor
 **/
export const pieColor = {
  ...color
}
/**
 * *柱状图放入宽度设置(series)
 * pieSeries
 **/
export const pieSeries = {
  ...series
}

