Open flaming-cl opened 6 days ago
You can set what is displayed in legend using legendLabelText
and legendValueText
.
Docs: https://www.amcharts.com/docs/v5/charts/percent-charts/legend-percent-series/#Setting_content
E.g.:
var series = chart.series.push(
am5percent.PieSeries.new(root, {
name: "Series",
valueField: "sales",
categoryField: "country",
legendValueText: "{currency}{valuePercentTotal.formatNumber('0.00p')}"
})
);
https://www.amcharts.com/docs/v5/charts/percent-charts/legend-percent-series/#Setting_content
Thanks @martynasma! btw, possible to include an external variable for legendValueText?
e.g.
{
legendValueText: `${someExternalVariable}{valuePercentTotal.formatNumber('0.00p')}`
}
Yes, you can include external value using ${yyy}
notation. Or if you want to reference to a key in data you can use just curly brackets {customValueFromData}
.
hey, would you please let us know how to dynamically add number formatter prefix for the legend values? assume my values are
USD $1,000, GBP £2,000, EUR €3,000