0
点赞
收藏
分享

微信扫一扫

echarts 饼状图的常用设置

陌岛 2022-04-19 阅读 71

option = {
          title: {
            text: '标题',//标题
            
            left: 'center',//标题显示位置center居中,left居左,right居右
             textStyle: {
                color: '#ffffff'//标题颜色
             },
          },
          color:['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc'],//饼图的颜色范围
          
          tooltip: {
            trigger: 'item',
          },
          legend: {
            orient: 'vertical',
            left: 'right',//颜色图标显示的位置,right居右
            top:'30%',//上面距离
            "textStyle":{"fontFamily":"sans-serif","color":"#ffffff"},//设置样式
          },
          series: [
            {
              name: '张三',//名称
              type: 'pie',
            
             radius: ['30%', '50%'],//饼状设置
             center: ['30%', '50%'],//饼状位置设置
             avoidLabelOverlap: false,
              itemStyle: {
                borderRadius: 1,
                borderColor: '#fff',
                borderWidth: 0
              },
              label: {
                show: false,
                position: 'center'
              },
              emphasis: {
                label: {//鼠标放上饼状显示内容样式设置
                  show: true,
                  fontSize: '40',
                  fontWeight: 'bold'
                }
              },
              labelLine: {
                show: false
              },
              data: [
             
                    { value:‘ ’, name:' ' },//内容
         
                
                
              ],
            
            }
          ]
        };
    

举报

相关推荐

0 条评论