zoukankan      html  css  js  c++  java
  • echarts 饼状图legend数据显示

    option = {
        title: {
            text: ''
        },
        color:['#FE7E00','#FEC400','#22DACE'],
        tooltip: {},
        legend: {
      icon: "circle",   //  字段控制形状  类型包括 circle,rect,line,roundRect,triangle,diamond,pin,arrow,none
          itemWidth: 10,  // 设置宽度
          itemHeight: 10, // 设置高度
          itemGap: 40 // 设置间距
           x : '46%',
            y : '28%',
            orient : 'vertical',
            data:['aa','bb','cc'],
            formatter: function(name) {
                                    var index = 0;
                                    var clientlabels = ['aa','bb','cc'];
                                    var clientcounts = [9,1,10];
                                    clientlabels.forEach(function(value,i){
                                        if(value == name){
                                            index = i;
                                        }
                                    });
                                    return name + "  " + clientcounts[index];
                                }
        },
     
        calculable : false,
        series: [{
     
            name: 'myCharts',
            type: 'pie',
           radius : '50%',
            center: ['25%', '47%'],
            startAngle:90,  //开始 的旋转角度
     
            itemStyle: {
                normal: {
                    label: {
                        show: false,
                        position: 'inner'
     
                    },
                    labelLine: {
                        show: false,
                    }
                }
            },
            data: [
                {value:800, name:'aa'},
                {value:300, name:'bb'},
                 {value:200, name:'cc'},
            ]
     
        }
       ]
      }
      
    

      

  • 相关阅读:
    文件层次结构思维导图
    root的密码破解.linux
    常用Linux命令
    设计模式之-状态模式
    ThreadLocal详解及仿写实例
    SpringBoot资料
    27.枚举
    菜鸟python---元组
    菜鸟python---列表的增删改查嵌套
    菜鸟python---字符串详解
  • 原文地址:https://www.cnblogs.com/wasbg/p/12220763.html
Copyright © 2011-2022 走看看