Incubator-echarts: How to add percentage to legend data?

Created on 2 Aug 2017  ·  2Comments  ·  Source: apache/incubator-echarts

I am trying to add percentage to legend data of pie chart.
Using this pie chart demo:
https://ecomfe.github.io/echarts-examples/public/editor.html?c=pie-doughnut

Tried to add formatter ( formatter: "{a}
{b}: {c} ({d}%)") to legend but does not work.

How to do this?

All 2 comments

Legend formatter can't get percentage data. You need calculate it by yoursef

I have just needed this. If you are simply trying to add the '%' symbol as a suffix to the legend name then formatter: "{name} %" worked for me

Was this page helpful?
0 / 5 - 0 ratings