You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2018/10/31 12:36:28 UTC

[GitHub] shuxinyun opened a new issue #9315: pie用dataset设置数据,tooltip模板显示值显示为对象而不是数字

shuxinyun opened a new issue #9315: pie用dataset设置数据,tooltip模板显示值显示为对象而不是数字
URL: https://github.com/apache/incubator-echarts/issues/9315
 
 
   var option={
      type: 0,
      title: {
         text: "本页引用部件",
         left: "center"
      },
      tooltip: {
         trigger: "item",
         formatter: "{a} <br/>{b}: {c} ({d}%)"
      },
      dataset:[{
          id:"shufu",
          dimensions: ['category','count'],
          source:[{category:"直达",count:335}, {category:"营销广告",count:679},{category:"搜索引擎",count:1548}]
      },{
          id:"duoer",
          dimensions: ['name','value'],
          source:[
              {count:1,value: 335,name: "直达",selected:true },
              {count:2,value: 310,name: "邮件营销"},
              {count:3,value: 234,name: "联盟广告"},
              {count:4,value: 135,name: "视频广告"},
              {count:5,value: 1048,name: "百度"},
              {count:6,value: 251,name: "谷歌"},
              {count:7,value: 147,name: "必应"},
              {count:8,value: 102,name: "其他"}
          ]
      }],
    series: [{
         id:"shufu",
         name: "访问来源",
         type: "pie",
         radius: ["0", "30%"],
         selectedMode: "single",
         label: {
            normal: {
               position: "inner"
            }
         },
         labelLine: {
            normal: {
               show: false
            }
         },
         datasetIndex:0
      }, {
         id:"duoer",
         name: "访问来源",
         type: "pie",
         radius: ["40%", "55%"],
         label: {
            normal: {
               formatter: "{a|{a}}{abg|}\n{hr|}\n  {b|{b}:}{c}  {per|{d}%}  ",
               backgroundColor: "#eee",
               borderColor: "#aaa",
               borderWidth: 1,
               borderRadius: 4,
               rich: {
                  a: {
                     color: "#999",
                     lineHeight: 22,
                     align: "center"
                  },
                  hr: {
                     borderColor: "#aaa",
                     width: "100%",
                     borderWidth: 0.5,
                     height: 0
                  },
                  b: {
                     fontSize: 16,
                     lineHeight: 33
                  },
                  per: {
                     color: "#eee",
                     backgroundColor: "#334455",
                     padding: [2, 4],
                     borderRadius: 2
                  }
               }
            }
         },
         labelLine: {
            normal: {
               show: true
            }
         },
         datasetIndex:1
      }]
   };

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@echarts.apache.org
For additional commands, e-mail: dev-help@echarts.apache.org