import * as echarts from "echarts";

const getbarChart1 = (data) => {
    return {
        legend: {
            show: true,
            top: "5%",
            right: "10%",
            //   right: "top",
            textStyle: {
                color: "#D9F7FF", //字体颜色
                fontSize: "23.9982px",
            },
        },
        tooltip: {
            trigger: "axis",
            textStyle: {
                // color: '#17d3ff',
                color: "#fff",
                fontSize: 24,
            },
            backgroundColor: new echarts.graphic.LinearGradient(
                0,
                0,
                0,
                1, [{
                        offset: 0,
                        color: "#5bd4d5",
                    },
                    {
                        offset: 1,
                        color: "#5b9dd5",
                    },
                ],
                false
            ),
        },
        grid: {
          left: '3%',
          right: '4%',
          bottom: '3%',
          containLabel: true
        },
        xAxis: {
            type: "category",
            axisLine: {
                lineStyle: {
                    color: "#ccc",
                },
            },
            axisLabel: {
                color: "#777",
                fontSize: "14px",
            },
            data: data.datax
        },
        yAxis: {
            type: "value",
            nameTextStyle: { fontSize: "14px" },
            show: false,
            axisLine: {
                lineStyle: {
                    color: "#ccc",
                },
                show: false,
            },
            splitLine: {
                lineStyle: {
                    color: "#888",
                },
                show: false,

            },
        },
        series: [
          {
                type: "bar",
                barWidth: "36px",
                itemStyle: {
                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                        { offset: 0, color: "#5bd4d5" },
                        { offset: 1, color: "#5b9dd5" },
                    ]),
                },
                label: {
                    show: true,
                    position: 'top'
                },
                data: data.datay
            }
           
        ],
    };
}

export default getbarChart1;