import * as echarts from "echarts";

const getMultiLineChart = (dataX, dataY1, dataY2, dataY3, dataY4, dataY5, dataY6) => {
  return {
    tooltip: {
      trigger: "axis",
      axisPointer: {
        type: "cross",
        label: {
          backgroundColor: "#6a7985"
        }
      }
    },
    grid: {
      top: "50px",
      right: "50px",
      bottom: "0px",
      left: "40px",
      containLabel: true
    },
    legend: {
      data: ["人工智能", "集成电路", "量子科技", "生物科技", "通信网络", "能源"],
      show: true,
      top: "0px",
      left: "center",
      textStyle: {
        color: "rgba(95, 101, 108, 1)",
        fontFamily: "Microsoft YaHei",
        fontSize: "16px"
      }, // 设置图例标记为圆形
      icon: "circle",
      itemWidth: 10, // 圆的直径
      itemHeight: 10, // 圆的直径
      itemGap: 20 // 图例项之间的间距
    },
    color: [
      "rgba(10, 87, 166, 1)", // 人工智能（深蓝色）
      "rgba(64, 196, 181, 1)", // 集成电路（青绿色）
      "rgba(114, 46, 209, 1)", // 量子科技（紫色）
      "rgba(245, 141, 46, 1)", // 生物科技（橙色）
      "rgba(111, 180, 255, 1)", // 通信网络（浅蓝色）
      "rgba(196, 92, 68, 1)" // 能源（红褐色）
    ],
    xAxis: [
      {
        type: "category",
        boundaryGap: false,
        data: dataX,
        axisLabel: {
          fontSize: 14 // 设置X轴字体大小
        }
      }
    ],
    yAxis: [
      {
        type: "value",
        splitLine: {
          show: true,
          lineStyle: {
            type: "dashed",
            color: "#E7F3FF"
          }
        },
        axisLabel: {
          fontSize: 14 // 设置X轴字体大小
        },

      }
    ],
    series: [
      {
        name: "人工智能",
        type: "line",
        lineStyle: {
          width: 1.5 // 单位：px，数值越大线条越粗
        },
        areaStyle: {
          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
            {
              offset: 0,
              color: "rgba(10, 87, 166, 0.2)" // 起始颜色
            },
            {
              offset: 1,
              color: "rgba(10, 87, 166, 0)" // 结束颜色
            }
          ])
        },
        emphasis: {
          focus: "series"
        },
        data: dataY1
      },
      {
        name: "集成电路",
        type: "line",
        lineStyle: {
          width: 1.5 // 单位：px，数值越大线条越粗
        },
        areaStyle: {
          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
            {
              offset: 0,
              color: "rgba(64, 196, 181, 0.2)" // 起始颜色
            },
            {
              offset: 1,
              color: "rgba(64, 196, 181, 0)" // 结束颜色
            }
          ])
        },
        emphasis: {
          focus: "series"
        },
        data: dataY2
      },
      {
        name: "量子科技",
        type: "line",
        lineStyle: {
          width: 1.5 // 单位：px，数值越大线条越粗
        },
        areaStyle: {
          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
            {
              offset: 0,
              color: "rgba(114, 46, 209, 1)" // 起始颜色
            },
            {
              offset: 1,
              color: "rgba(114, 46, 209, 0)" // 结束颜色
            }
          ])
        },
        emphasis: {
          focus: "series"
        },
        data: dataY3
      },
      {
        name: "生物科技",
        type: "line",
        lineStyle: {
          width: 1.5 // 单位：px，数值越大线条越粗
        },
        areaStyle: {
          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
            {
              offset: 0,
              color: "rgba(245, 141, 46, 0.2)" // 起始颜色
            },
            {
              offset: 1,
              color: "rgba(245, 141, 46, 0)" // 结束颜色
            }
          ])
        },
        emphasis: {
          focus: "series"
        },
        data: dataY4
      },
      {
        name: "通信网络",
        type: "line",
        lineStyle: {
          width: 1.5 // 单位：px，数值越大线条越粗
        },
        areaStyle: {
          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
            {
              offset: 0,
              color: "rgba(111, 180, 255, 0.2)" // 起始颜色
            },
            {
              offset: 1,
              color: "rgba(111, 180, 255, 0)" // 结束颜色
            }
          ])
        },
        emphasis: {
          focus: "series"
        },
        data: dataY5
      },
      {
        name: "能源",
        type: "line",
        lineStyle: {
          width: 1.5 // 单位：px，数值越大线条越粗
        },
        areaStyle: {
          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
            {
              offset: 0,
              color: "rgba(196, 92, 68, 0.2)" // 起始颜色
            },
            {
              offset: 1,
              color: "rgba(196, 92, 68, 0)" // 结束颜色
            }
          ])
        },
        emphasis: {
          focus: "series"
        },
        data: dataY6
      }
    ]
  };
};

export default getMultiLineChart;
