echarts关于仪表盘的配置

option = {
    tooltip: {
        formatter: '{a} <br/>{b} : {c}%'
    },
    toolbox: {
        feature: {
            restore: {},
            saveAsImage: {}
        }
    },
    series: [
        {
            name: '业务指标',
            startAngle: 220,
            endAngle: -40,
            type: 'gauge',
            detail: {
                formatter: '{value}%',
                color: '#ff6700'
            },
            axisLabel:{
                distance:-55
            },
            splitNumber: 4,
            axisLine: {
                show: true
            },
            splitLine: {
                show: false
            },
             axisTick: {
                show: false
            },
            pointer: {
                show: false
            },
            axisLine: {
                    lineStyle: {  
                    color: [[0.35, '#ff6700'], [1, '#23c023']]
                }  
            },
            data: [{value: 35, name: '今日饮水量'}],
            title: {                // 仪表盘标题。
                show: true,             // 是否显示标题,默认 true。
                offsetCenter: [0,"80%"],//相对于仪表盘中心的偏移位置,数组第一项是水平方向的偏移,第二项是垂直方向的偏移。可以是绝对的数值,也可以是相对于仪表盘半径的百分比。
                color: "#ff6700",          // 文字的颜色,默认 #333。
                fontSize: 20,           // 文字的字体大小,默认 15。
            },
        }
    ],
    
    
};

配置结果

posted @ 2020-10-14 20:23  深海里的星星i  阅读(1003)  评论(0)    收藏  举报