
import * as echarts from 'echarts'

const getLineChart = (dataX, dataY) => {
  return {
    grid: {
      left: '2%',
      top: '8%',
      right: '2%',
      bottom: '3%',
      containLabel: true
    },
    xAxis: {
      type: 'category',
      boundaryGap: false,
      splitLine: {
        show: false
      },
      axisLine: {
        show: false
      },
      data: dataX
    },
    yAxis: {
      type: 'value',
      splitLine: {
        show: true, lineStyle: {
          type: "dashed",
          color: "#E7F3FF"
        }
      },
      axisLine: {
        show: false
      },

    },
    color: ['rgb(255, 172, 77)'],
    series: [
      {
        data: dataY,
        type: 'line',
        emphasis: {
          focus: 'series'
        },
        areaStyle: {
          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
            offset: 0,
            color: 'rgba(255, 172, 77, 0.5)' // 起始颜色：深色
          }, {
            offset: 1,
            color: 'rgba(255, 172, 77,0)' // 结束颜色：浅色且透明度降低
          }])
        },
      }
    ]
  }
}

export default getLineChart;