amcharts / amcharts5

The newest, fastest, and most advanced amCharts charting library for JavaScript and TypeScript apps.
Other
345 stars 92 forks source link

How to prevent several decimal points in total bullet value? #1721

Closed dmytro-kuz closed 2 weeks ago

dmytro-kuz commented 2 weeks ago

Question Is there a way to turn off the animation for the bullet label or a way to remove the extra decimal in the total bullet value during chart animation? Or may this value follow the format of the values ​​on the axis?

Environment (if applicable)

Additional context Codepen: https://codepen.io/team/amcharts/pen/dyJdQjW?editors=1010 Screenshot: Знімок екрана 2024-09-12 093428

martynasma commented 2 weeks ago

I suppose you can set a global number format:

root.numberFormatter.set("numberFormat", "#.#");
dmytro-kuz commented 2 weeks ago

I can't use this solution because we have an option for the user to specify a custom format. And for cases when, for example, there are such formats - "#.##', "#p', '#USD', '#,p', '#p' , '#' then it does not work. Perhaps there are other custom formats for this animation to be turned on again, but I did not consider them. Perhaps there is still a way to disable this animation, or make it possible for this value to appear smoothly after the animation time of the series is completed?

martynasma commented 2 weeks ago

Maybe you can just hide the "totals" series, and show it with a delay?

https://codepen.io/team/amcharts/pen/ExBJKRM/fe422d7a79583783d62ad20d466b6bf0

dmytro-kuz commented 2 weeks ago

This is probably the best solution. I think I can optimize it for my code and use it. Thank you for your help.