echartsConfig.js 2.46 KB
var warehouseHealthOption = {
    color: ['#04efcd', '#fdb300', '#f43d33'],
    tooltip: {
        trigger: 'axis',
        formatter: function (params) {
            var result = params[0].name + '<br>';
            params.forEach(function (item) {
                if (item.value) {
                    result += item.marker + '  ' + item.value + '%</br>';
                } else {
                    result += item.marker + '   - </br>';
                }
            });
            return result;
        },
        axisPointer: {
            type: 'shadow',
        },
    },
    legend: {
        show: true,
        top: 0,
        textStyle: {
            color: '#fff'
        }
    },
    grid: {
        top: '13%',
        left: '0.5%',
        right: '3%',
        bottom: '2%',
        containLabel: true,
    },
    xAxis: {
        type: 'category',
        axisLabel: {
            rotate: 0,
            interval: -1,
            textStyle: {
                color: '#fff',
            },
        },
        axisLine: {
            lineStyle: {
                color: '#afa3a3',
                width: 1,
            },
        },
        data: [],
    },

    yAxis: {
        type: 'value',
        min: 0,
        max: 100,
        splitLine: true,
        axisTick: {
            show: true,
            alignWithLabel: true,
        },
        axisLabel: {
            show: true,
            interval: 'auto',
            formatter: '{value}' + '%',
            textStyle: {
                color: '#fff',
            },
        },
        axisLine: {
            lineStyle: {
                color: '#afa3a3',
                width: 1,
            },
        },
    },

    series: [
        {
            name: "综合效率",
            type: 'bar',
            barWidth: '22%',
            label: {
                show: true,
                position: 'top',    // 强制在顶部
                distance: 2,       // 距离柱子顶部2px
                formatter: '{c}',
                fontSize: 10,
                color: '#fff'
            },
            data: [],
        },
        {
            name: "利用率",
            type: 'bar',
            barWidth: '22%',
            label: {
                show: true,
                position: 'top',    // 强制在顶部
                distance: 2,       // 距离柱子顶部2px
                formatter: '{c}',
                fontSize: 10,
                color: '#fff'
            },
            data: [],
        }
    ],
}