echarts饼图怎么显示百分比
时间: 2023-10-17 08:28:53 浏览: 224
要在echarts饼图上显示百分比,你可以在series的配置中添加label标签,并设置其formatter属性来自定义显示格式。具体的用法如下:
```
option = {
series: [{
name: '项目进度数据分析',
type: 'pie',
radius: '55%',
center: ['50%', '60%'],
label: {
normal: {
show: true,
formatter: '{b}: {c}({d}%)' // 自定义显示格式,其中b代表name,c代表value,d代表百分比
}
},
data: datas // datas是你之前赋值的数据
}]
};
```
这样配置后,echarts饼图中每个扇形图块的label标签就会显示名称、数值和百分比。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [echarts 圆环图 中间显示数据 下边显示标题](https://download.csdn.net/download/weixin_38661650/14038109)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [实现在echart饼状图上显示百分比,数据](https://blog.csdn.net/a10039/article/details/80590938)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [Echarts饼图显示数值和百分比](https://blog.csdn.net/yayayu_/article/details/105657717)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文