进度条

描述:当前是关于Echarts图表中的 柱状图 示例。
 
            let xData = [30]
let yData = [100]
option = {
    backgroundColor: '#fff',
    grid: {
        top: 0,
        bottom: 0,
        left: '10%',
        right: '10%',
    },
    xAxis: {
        show: false,
        type: 'value',
        boundaryGap: [0, 0],
    },
    yAxis: [
        {
            type: 'category',
            data: [''],
            axisLine: { show: false },
            axisTick: [
                {
                    show: false,
                },
            ],
        },
    ],
    series: [
        {
            name: '金额',
            type: 'bar',
            zlevel: 1,
            itemStyle: {
                normal: {
                    barBorderRadius: 30,
                    color: new echarts.graphic.LinearGradient(1, 0, 0, 1, [
                        {
                            offset: 1,
                            color: '#F18854',
                        },
                        {
                            offset: 0,
                            color: '#E64F36',
                        },
                    ]),
                },
            },
            barWidth: 20,
            data: xData,

        },
        {
            name: '背景',
            type: 'bar',
            barWidth: 20,
            barGap: '-100%',
            data: yData,
            itemStyle: {
                normal: {
                    color: '#f84f2e20',
                    borderWidth: 1,
                    borderColor: '#f84f2e20',
                    barBorderRadius: 30,
                },
            },
            label: {
                show: true,
                verticalAlign: "middle",
                position: "right",
                fontSize: 14,
                color: "#000",
                formatter: function (data) {
                    return xData[0] + "%";
                }
            },
        },
    ],
};