• 常见代码


    硬盘空间占比:

    option = {
        title : {
            text: '/sda',
            subtext: '物理硬盘',
            x:'center'
        },
        tooltip : {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        legend: {
            orient: 'vertical',
            left: 'left',
            data: ['sda1', 'sda2']
        },
        series : [
            {
                name: '/sda',
                type: 'pie',
                radius : '45%',
                center: ['25%', '35%'],
                data:[
                    {value:30, name:'已用'},
                    {value:80, name:'未用'},
                ],
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };

    系统平均负载(1,5, 15):

    option = {
        title: {
            text: '系统平均负载'
        },
        tooltip: {
            trigger: 'axis'
        },
        legend: {
            data:['load_1m','load_5m','load15m'],
            left:'center'
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        toolbox: {
            feature: {
                saveAsImage: {}
            }
        },
        xAxis: {
            type: 'category',
            boundaryGap: false,
            data: ['13:35:00', '13:40:00', '13:45:00', '13:50:00', '13:55:00', '14:00:00', '14:05:00']
        },
        yAxis: {
            type: 'value'
        },
        series: [
            {
                name:'load_1m',
                type:'line',
                stack: '总量',
                data: [1.2, 1.5, 0.8, 1.5, 2.0, 0.5, 1.56]
            },
            {
                name:'load_5m',
                type:'line',
                stack: '总量',
                data: [1.2, 1.5, 0.8, 1.5, 2.0, 0.5, 1.56]
            },
            {
                name:'load_15m',
                type:'line',
                stack: '总量',
                data: [0.3, 0.375, 0.2, 0.375, 0.5, 0.125, 0.39]
            }
        ]
    };

     CPU:

    option = {
        title: {
            text: 'CPU使用率',
            left: 'bottom'
        },
        tooltip: {
            trigger: 'axis'
        },
        legend: {
            data:['cpu_total']
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        toolbox: {
            feature: {
                saveAsImage: {}
            }
        },
        xAxis: {
            type: 'category',
            boundaryGap: false,
            data: ['13:35:00', '13:40:00', '13:45:00', '13:50:00', '13:55:00', '14:00:00', '14:05:00']
        },
        yAxis: {
            type: 'value'
        },
        series: [
            {
                name:'load_1m',
                type:'line',
                stack: '总量',
                data: [1.2, 1.5, 0.8, 1.5, 2.0, 0.5, 1.56]
            },
            {
                name:'load_5m',
                type:'line',
                stack: '总量',
                data: [1.2, 1.5, 0.8, 1.5, 2.0, 0.5, 1.56]
            },
            {
                name:'load_15m',
                type:'line',
                stack: '总量',
                data: [0.3, 0.375, 0.2, 0.375, 0.5, 0.125, 0.39]
            }
        ]
    };
  • 相关阅读:
    Xamarin.Forms移动开发系列1:介绍和安装
    网络协议 1
    07 MySQL之索引原理
    06 Navicat安装及简单使用
    05 Mysql之多表查询
    04 Mysql之单表查询
    03 Mysql数据库之(行记录)详细操作
    02 Mysql之库表简易操作
    01 Mysql数据库初识
    07 Python之协程
  • 原文地址:https://www.cnblogs.com/xuegqcto/p/10298508.html
Copyright © 2020-2023  润新知