import * as echarts from "echarts";

export default function getData(params = [1, 2, 3, 4, 5, 6, 7, ]) {
    return {
        color: [
            "rgba(62,175,64,.8)",
            "rgba(239,107,61,.8)",
        ],
        title: {
            show: false,
            text: "渐变堆叠面积图",
        },
        tooltip: {
            trigger: "axis",
            textStyle: {
                color: "#FFF",
            },
            confine: true,
            backgroundColor: "rgba(11, 12, 72, 0.8)",
            borderColor: "rgba(11, 12, 72, 0.4)",
            position: "bottom",
        },
        legend: {
            show: true,
            top: 0,
            right: 10,
            itemGap: 20,
            textStyle: {
                color: "#FFF",
            },
        },
        // toolbox: {},
        grid: {
            top: 30,
            left: 10,
            right: 15,
            bottom: 10,
            containLabel: true,
        },
        xAxis: {
            type: "category",
            boundaryGap: false,
            data: [
                "1",
                "2",
                "3",
                "4",
                "5",
                "6",
                "7",
            ],
            axisLabel: {
                color: "#FFFFFF",
                // rotate: 50,
            },
            axisTick: {
                show: false,
            },
        },
        yAxis: {
            type: "value",
            axisLabel: {
                color: "#FFFFFF",
            },
            splitLine: {
                lineStyle: {
                    color: "#ccc",
                },
            },
        },
        series: [{
                name: "告警数",
                type: "line",
                smooth: true,
                showSymbol: true,
                areaStyle: {
                    opacity: 0.8,
                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                            offset: 0,
                            color: "rgba(62,175,64)",
                        },
                        {
                            offset: 1,
                            color: "rgba(62,175,64,.1)",
                        },
                    ]),
                },
                data: [12, 13, 15, 17, 19, 10, 123] || params,
            },
            {
                name: "离线数",
                type: "line",
                smooth: true,
                showSymbol: true,
                areaStyle: {
                    opacity: 0.8,
                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                            offset: 0,
                            color: "rgba(62, 175, 64,1)",
                        },
                        {
                            offset: 1,
                            color: "rgba(62, 175, 64,.1)",
                        },
                    ]),
                },
                data: [21, 31, 51, 71, 91, 110, 213],
            },
        ],
    }
}