import * as echarts from 'echarts'

const getMultiLineChart = (dataX, dataY1, dataY2, dataY3) => {
  return {
    tooltip: {
      trigger: 'axis',
      axisPointer: {
        type: 'cross',
        label: {
          backgroundColor: '#6a7985'
        }
      }
    },
    grid: {
      top: '15%',
      right: '5%',
      bottom: '5%',
      left: '5%',
      containLabel: true
    },
    legend: {
      show: true,
      top: 10,
      left:'center'
    },
    color: ['rgba(10, 87, 166, 0.7)', 'rgba(255, 172, 77, 0.7)','rgba(114, 46, 209, 0.7)'],
    xAxis: [
      {
        type: 'category',
        boundaryGap: false,
        data: dataX
      }
    ],
    yAxis: [
      {
        type: 'value'
      }
    ],
    series: [
      {
        name: '人工智能',
        type: 'line',

        areaStyle: {
          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
            offset: 0,
            color: 'rgba(10, 87, 166, 0.7)' // 起始颜色
          }, {
            offset: 1,
            color: 'rgba(10, 87, 166, 0)' // 结束颜色
          }])
        },
        emphasis: {
          focus: 'series'
        },
        data: dataY1
      },
      {
        name: '集成电路',
        type: 'line',
        areaStyle: {
          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
            offset: 0,
            color: 'rgba(255, 172, 77, 0.7)' // 起始颜色
          }, {
            offset: 1,
            color: 'rgba(255, 172, 77, 0)' // 结束颜色
          }])
        },
        emphasis: {
          focus: 'series'
        },
        data: dataY2
      },
      {
        name: '量子科技',
        type: 'line',
        areaStyle: {
          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
            offset: 0,
            color: 'rgba(114, 46, 209, 0.7)' // 起始颜色
          }, {
            offset: 1,
            color: 'rgba(114, 46, 209, 0)' // 结束颜色
          }])
        },
        emphasis: {
          focus: 'series'
        },
        data: dataY3
      }
    ]
  }
}

export default getMultiLineChart