javascript - echarts 图形占满整个容器

查看:190
本文介绍了javascript - echarts 图形占满整个容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

如图,蓝色背景是容器,但是echarts图上下左右还有很多空间.导致显示不够.怎么铺满一点?

tooltip: {
    formatter: "{a} <br/>{b} : {c}%"
},
grid: {
    top: 0,
    bottom: 0
},
toolbox: {
    show: false
},
pointer: {
    length: '10%',
    width: 4,
    color: 'auto'
},
series: [{
    name: '总数',
    type: 'gauge',
    max: 100,
    detail: {
        formatter: '{value}',
        offsetCenter: [0, '10%'],
        textStyle: {
            color: 'auto',
            fontSize: 12
        }
    },
    data: [{ value: 50, name: '总数' }]
}]

解决方案

仪表盘类型的图在series属性里面加上 radius: '100%',就可以占满了~

这篇关于javascript - echarts 图形占满整个容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆