apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.56k stars 19.61k forks source link

[Bug] cannot show percentage in sunburst label #18773

Open yuxuejiao opened 1 year ago

yuxuejiao commented 1 year ago

Version

5.4.2

Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?c=sunburst-borderRadius

Steps to Reproduce

add formatter in sunburst label in the following link: option = { series: { type: 'sunburst', data: data, radius: [60, '90%'], itemStyle: { borderRadius: 7, borderWidth: 2 }, label: { show: true, formatter: '{b}: {d}%', } } };

Current Behavior

cannot show {d}% in chart

Expected Behavior

show {d}% in charts correctly

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

vikas-6 commented 1 year ago

hello i want to work on this so please give me permission to fix this problem.....

susiwen8 commented 1 year ago

@vikas-6 Feel free to solve this issue, you don't need a permission

vikas-6 commented 1 year ago

https://codepen.io/VIKAS-KUMAR-the-vuer/pen/NWEpdOY ----------- I fixed it now it show {d}% in charts correctly....

anandbhaskaran commented 1 year ago

@vikas-6 Thank you for this amazing fix. It does work. But it would be awesome if you can round it to 2 decimals like in the other charts.