圆环图中当某个图例的值是0时,能否显示图例但是在图上不显示数值0?原来2.0的版本有这个功能,但是升到3.0好像就不行了。
配置项如下
option =
{
"toolbox": {
"feature": {
"saveAsImage": {
"type": "png"
}
}
},
"grid": {
"show": false,
"top": "65px",
"height": "340px",
"left": "20%",
"right": "20%",
"width": "500px",
"z": 2,
"zlevel": 0,
"bottom": 30
},
"legend": {
"selectedMode": false,
"itemWidth": 14,
"itemHeight": 14,
"itemGap": 20,
"bottom": 180,
"top": "middle",
"left": "0px",
"orient": "vertical",
"data": [
"初中及以下",
"高中",
"专科",
"本科",
"硕士及以上"
]
},
"series": [
{
"type": "pie",
"radius": [
110,
170
],
"avoidLabelOverlap": false,
"hoverAnimation": false,
"stillShowZeroSum": false,
"height": 230,
"label": {
"normal": {
"position": "inside",
"textStyle": {
"color": "#fff"
}
}
},
"data": [
{
"value": 2,
"name": "初中及以下",
"realValue": 2,
"percent": 50
},
{
"value": 0,
"name": "高中",
"realValue": 0,
"percent": 0
},
{
"value": 0,
"name": "专科",
"realValue": 0,
"percent": 0
},
{
"value": 1,
"name": "本科",
"realValue": 1,
"percent": 25
},
{
"value": 1,
"name": "硕士及以上",
"realValue": 1,
"percent": 25
}
]
}
],
"color": [
"#732FC3",
"#824DD2",
"#9067E0",
"#9D82EF",
"#ADA1FF",
"#C0B7FF",
"#B7B1DD",
"#A099D0",
"#8A83BB"
],
"unit": "人",
"title": [
{
"text": "受教育程度",
"subtext": "%",
"textStyle": {
"color": "#000",
"fontStyle": "normal",
"fontWeight": "bolder",
"fontFamily": "Microsoft YaHei",
"fontSize": 16
},
"left": 0,
"bottom": 0,
"top": "0px"
},
{
"text": "",
"subtext": "基数: 所有被访者 n=4 \n\n数据来源:Q3",
"textStyle": {
"color": "#000",
"fontStyle": "normal",
"fontWeight": "bolder",
"fontFamily": "Microsoft YaHei",
"fontSize": "12"
},
"left": 0,
"bottom": "30px",
"top": "510px"
}
],
"chartHeight": "568"
}