amCharts 4 (v4) 在饼图中显示值而不是百分比

Lea*_*rta 1 javascript graph amcharts

再次探索 Amcharts V4,我可以在 amcharts v3 中使用这样的数值显示图例(相信是标准的)

"legend":{ "position":"left", "fontSize": 22, },

但是在文档中的 V4 中,关于图例值的会话没有完成,当我声明标准是百分比时

pieChart.legend = 新 am4charts.Legend()

Amcharts V3 和 Amcharts V4 中的图例图像

提前致谢 =)

Hri*_*shi 6

您可以通过以下方式更改 amCharts v4 饼图中的模板文本:

pieSeries.labels.template.text = "{category}: {value}";
pieSeries.slices.template.tooltipText = "{category}: {value}";
Run Code Online (Sandbox Code Playgroud)