You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like the {c} reference in the formatter is referring to the whole object instead of the mapped value. In this case, it is e.g."{count:6,value: 251,name: "谷歌"}.
var option={
type: 0,
title: {
text: "本页引用部件",
left: "center"
},
tooltip: {
trigger: "item",
formatter: "{a}
{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
}]
};
The text was updated successfully, but these errors were encountered: