zoukankan      html  css  js  c++  java
  • echarts绘制饼图时的一点特殊设置

     

    最后的效果如图,需要在中间展示的部分换行然后字体大小不同。

    以下为option的设置,使用rich里面的参数来设置更多的文本样式,使用‘ ’来控制换行

    let option = {
                color: color,
                backgroundColor: '#082763',
                tooltip: {},
                legend: {
                    orient: 'vertical',
                    left: 10,
                    top: 10,
                    textStyle: {
                        color: '#fff'
                    },
                    data: lengendData
                },
                series: [{
                    name: '',
                    type: 'pie',
                    radius: ['45%', '75%'],
                    center: ['50%', '50%'],
                    avoidLabelOverlap: false,
                    label: {
                        normal: {
                            show: false,
                            position: 'center'
                        },
                        emphasis: {
                            show: true,
                            position: 'center',
                            textStyle: {
                                fontSize: 20,
                                fontWeight: 'bold',
                                color: '#ffffff'
                            },
                            formatter: [`{x|{b}}`, `{y|{d}%}`].join('
    '),
                            rich: {
                                x: {
                                    fontSize: 16, fontWeight: 'bold'
                                },
                                y: {
                                    fontSize: 24, fontWeight: 'bold'
                                }
                            }
                        }
    
                    }, labelLine: {
                        normal: {
                            show: false
                        }
                    },
                    data: pieData
                }]
            };
  • 相关阅读:
    P1541 乌龟棋 暴力DP
    HDU
    HDU-6608 Fansblog 数论 ,威尔逊定理,快速乘
    P3842 [TJOI2007]线段 思维 ,DP
    模板 BSGS
    Gym
    HDU
    HDU
    HDU
    P1095 守望者的逃离 暴力DP
  • 原文地址:https://www.cnblogs.com/viola-sh/p/11327766.html
Copyright © 2011-2022 走看看