echarts水球图怎么保留两位小数,求解

var option = {
        backgroundColor:'transparent',
        title: [{
            text: name[0],
            left: '22%',
            top: '78%',
            textAlign: 'center',
            textStyle: {
                color: '#FFFFFF',
                fontSize: 15,
                fontWeight: 500,
                textAlign: 'center',
            }
        },{
            text: name[1],
            left: '49%',
            top: '78%',
            textAlign: 'center',
            textStyle: {
                color: '#FFFFFF',
                fontSize: 15,
                fontWeight: 500,
                textAlign: 'center',
            }
        },{
            text: name[2],
            left: '76%',
            top: '78%',
            textAlign: 'center',
            textStyle: {
                color: '#FFFFFF',
                fontSize: 15,
                fontWeight: 500,
                textAlign: 'center',
            }
        }],
        series: [{
            type: 'liquidFill',
            data: data[0],
            radius: '48%',
            // 水球颜色
            color: ['#269cc7', '#32cef5'],
            center: ['23%', '43%'],
            outline: {
                borderDistance: 8,
                itemStyle: {
                    borderWidth: 1,
                    borderColor: '#a8d9e9',
                }
            },
            // 内图 背景色 边
            backgroundStyle: {
                color: {
                    type: 'bar',
                    colorStops: [{
                        offset: 0,
                        color: '#3461b7' // 0% 处的颜色
                    },{
                        offset: 0.3,
                        color: '#1e3575' // 30% 处的颜色
                    }, {
                        offset: 1,
                        color: '#0E2342' // 100% 处的颜色
                    }],
                }
            },
            itemStyle: {
                normal: {
                    opacity: 1,
                    label: {
                        show:false,
                        color: '#fff',
                        insideColor: '#fff',
                        fontSize: 15,
                        fontWeight: 500,
                    },
                }
            },
        },{
            type: 'liquidFill',
            data: data[1],
            radius: '48%',
            // 水球颜色
            color: ['#708d50', '#91bb62'],
            center: ['50%', '43%'],
            outline: {
                borderDistance: 8,
                itemStyle: {
                    borderWidth: 1,
                    borderColor: '#E2D4FD',
                }
            },
            backgroundStyle: {
                color: {
                    type: 'bar',
                    colorStops: [{
                        offset: 0,
                        color: '#3461b7' // 0% 处的颜色
                    },{
                        offset: 0.3,
                        color: '#1e3575' // 30% 处的颜色
                    }, {
                        offset: 1,
                        color: '#0E2342' // 100% 处的颜色
                    }],
                }
            },
            itemStyle: {
                normal: {
                    opacity: 1,
                    label: {
                        show:false,
                        color: '#fff',
                        insideColor: '#fff',
                        fontSize: 15,
                        fontWeight: 500,
                    }
                }
            },
        },{
            type: 'liquidFill',
            data: data[2],
            radius: '48%',
            color: ['#2b7e7d', '#39aa96'],
            center: ['77%', '43%'],
            outline: {
                borderDistance: 8,
                itemStyle: {
                    borderWidth: 1,
                    borderColor: '#A5C2FF',
                }
            },
            backgroundStyle: {
                color: {
                    type: 'bar',
                    colorStops: [{
                        offset: 0,
                        color: '#3461b7' // 0% 处的颜色
                    },{
                        offset: 0.3,
                        color: '#1e3575' // 30% 处的颜色
                    }, {
                        offset: 1,
                        color: '#0E2342' // 100% 处的颜色
                    }],
                }
            },
            itemStyle: {
                normal: {
                    opacity: 1,
                    label: {
                        show:false,
                        color: '#fff',
                        insideColor: '#fff',
                        fontSize: 15,
                        fontWeight: 500,
                    },
                }
            },
        }]
    };
阅读 3.9k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题