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

Regression in 3.7.1 in calculating label floats compared to 2.9.3 #10194

Closed
hartator opened this issue Feb 23, 2022 · 2 comments
Closed

Regression in 3.7.1 in calculating label floats compared to 2.9.3 #10194

hartator opened this issue Feb 23, 2022 · 2 comments

Comments

@hartator
Copy link

hartator commented Feb 23, 2022

Expected behavior

Before in 2.9.3:

image

Current behavior

Same code and same data in 3.7.1:

image

Reproducible sample

https://serpapi.com/status

Optional extra steps/info to reproduce

https://serpapi.com/status is still on 2.9.3 but you can upgrade the Chart.js then re-run the graph.

Possible solution

No response

Context

No response

chart.js version

v3.7.1

Browser name and version

Chrome latest

Link to your project

https://serpapi.com/

@LeeLenaleee
Copy link
Collaborator

Can you add a reproducable sample with the template provided in the issue template. Since I dont see any way in the site you linked to switch between V3 and V2

@etimberg
Copy link
Member

etimberg commented Apr 3, 2022

I'm guessing this is coming from the formatter that's been added to add the % symbol. See https://jsfiddle.net/5n312Laf/1/ as an example. if the callback is removed, the labels show with the proper precision.

It probably makes sense to have the callback call the default and append the % sign. The default formatter is https://github.com/chartjs/Chart.js/blob/master/src/core/core.ticks.js#L28-L54.

Example calling the internal formatter first: https://jsfiddle.net/uvwf3zkg/

@etimberg etimberg closed this as completed Apr 3, 2022
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