设备运行统计

描述:当前是关于Echarts图表中的 柱状图 示例。
 
            option = {
    title: {
        text: '设备运行统计',
        textStyle: {
            color: '#222',
        }
    },
    tooltip: {
        trigger: 'axis',
        axisPointer: { // 坐标轴指示器,坐标轴触发有效
            type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
        },
        //formatter: '{a}<br />{c}'
    },
    backgroundColor: '#fff',
    color: ["#F92727", "#F99227", "#50D4AB"],
    legend: {
        show: true,
        top: '2%',
        icon: "rect",
        itemWidth: 15, // 图例标记的图形宽度。
        itemHeight: 15, //  图例标记的图形高度。
        textStyle: {
            color: '#222',
            fontSize: 14,
            padding: [0, 8, 0, 8]
        }
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis: [{
        type: 'category',
        axisLine: {
            //坐标轴轴线相关设置。数学上的x轴
            show: true,
            lineStyle: {
                color: 'rgb(41,188,245)',
            },
        },
        axisLabel: {
            //坐标轴刻度标签的相关设置
            textStyle: {
                color: '#222',
                fontSize: 12,
            },
        },
        axisTick: {
            show: false,
        },
        data: ['呼兰1', '呼兰2', '呼兰3', '呼兰4', '呼兰5']
    }],
    yAxis: [{
        // minInterval: 1,
        type: 'value',
        splitLine: {
            show: true,
            lineStyle: {
                color: '#f2f2f2',
                type: 'soiled'
            },
        },
        axisLabel: {
            show: true,
            textStyle: {
                color: '#222',
                fontSize: 14
            }
        },
        axisTick: {
            show: true,
        },
    },

    ],
    series: [
        {
            name: '故障',
            type: 'bar',
            stack: 'machine',
            barWidth: 40,
            label: {
                show: true
            },
            data: [540, 520, 560, 400, 480, 500, 600]
        },
        {
            name: '停止',
            type: 'bar',
            label: {
                show: true
            },
            stack: 'machine',
            data: [60, 80, 80, 300, 200, 120, 160]
        },
        {
            name: '运行',
            type: 'bar',

            label: {
                show: true
            },
            stack: 'machine',
            data: [840, 840, 800, 740, 760, 820, 680]
        },

    ]
};