Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XRange item labels sometimes display percentages with too many decimal places #9291

Closed
objorkli opened this issue Nov 5, 2018 · 2 comments
Closed
Assignees

Comments

@objorkli
Copy link

objorkli commented Nov 5, 2018

How to reproduce.

Change the partialFill of a single dataset of an xrange chart to 0.28.

Expected behaviour

The dataset label should show 28%

Actual behaviour

The dataset label shows 28.0000000000004%

Live demo with steps to reproduce

template: https://jsfiddle.net/02rtqxp6/

Product version

Highcharts JS v6.2.0 (2018-10-17)

Affected browser(s)

Chrome, Firefox, Internet explorer, Edge

@KacperMadej
Copy link

Hi @objorkli

Thank you for reporting about the problem.

Workaround: set custom dataLabels.formatter. Demo: https://jsfiddle.net/BlackLabel/02rtqxp6/1/

Internal note: return H.correctFloat(amount * 100) + '%'; should be enough here.

@TorsteinHonsi
Copy link
Collaborator

return H.correctFloat(amount * 100) + '%'; should be enough here.

Yes, agreed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants