kmartynak
Posts: 69
Joined: Tue Dec 14, 2021 9:31 pm

data labels - instead of 602.0 it is 602

Hi.


As in Title. in data labels truncates the last zero.

data: [677.7, 397.3, 672.0, 731.9, 1238.8],


I have 672.0 in the data but 672 is shown ...


https://jsfiddle.net/kmartynak/wx02ezun/1/
jakub.s
Posts: 1228
Joined: Fri Dec 16, 2022 11:45 am

Re: data labels - instead of 602.0 it is 602

Hi,

Thanks for the question!

You're right, that seems to be related to methods used with Highcharts formatter.

You can override this behavior like in this demo:: https://jsfiddle.net/BlackLabel/1ksL9ygw/

Let me know if that solves your problem.

Best regards,
Jakub
Jakub
Highcharts Developer
kmartynak
Posts: 69
Joined: Tue Dec 14, 2021 9:31 pm

Re: data labels - instead of 602.0 it is 602

yes, thank you very much!
jakub.s
Posts: 1228
Joined: Fri Dec 16, 2022 11:45 am

Re: data labels - instead of 602.0 it is 602

I'm glad it helped!

Jakub
Jakub
Highcharts Developer
kmartynak
Posts: 69
Joined: Tue Dec 14, 2021 9:31 pm

Re: data labels - instead of 602.0 it is 602

when I add this code, unfortunately, values ​​other than 0 disappear. For example, instead of 456.4 there is nothing. :( https://jsfiddle.net/kmartynak/3z17jn9h/
kmartynak
Posts: 69
Joined: Tue Dec 14, 2021 9:31 pm

Re: data labels - instead of 602.0 it is 602

very strange... in ELSE {return (`${this.y}`)} this works... but this return this. y not...
I don't understand why. it's important that it works. thanks again
jakub.s
Posts: 1228
Joined: Fri Dec 16, 2022 11:45 am

Re: data labels - instead of 602.0 it is 602

I'm sorry but your demo does not seem to work.

Please make it work, then I'll gladly take a look and see what's the issue.

Everything seems to work fine in the demo I've sent you.

Regards,
Jakub
Jakub
Highcharts Developer

Return to “Highcharts Usage”