Skip to content

Fix bug when data is all small numbers#5723

Merged
simonbrunel merged 4 commits intochartjs:masterfrom
costerwi:small_numbers
Sep 16, 2018
Merged

Fix bug when data is all small numbers#5723
simonbrunel merged 4 commits intochartjs:masterfrom
costerwi:small_numbers

Conversation

@costerwi
Copy link
Contributor

@costerwi costerwi commented Sep 8, 2018

This fixes #5653 where nothing would be plotted if the tick spacing (increment between tick marks) came out too small such as when all the data is nearly zero as in this example

The proposed change permits plotting of data down to very small values using scientific notation.

Besides the fix, I also added a test which flags the problem.

@etimberg etimberg requested a review from simonbrunel September 9, 2018 13:34
@simonbrunel simonbrunel added this to the Version 2.8 milestone Sep 16, 2018
@simonbrunel simonbrunel merged commit 7a65546 into chartjs:master Sep 16, 2018
@simonbrunel
Copy link
Member

Thanks @costerwi

exwm pushed a commit to exwm/Chart.js that referenced this pull request Apr 30, 2021
* Add test for correct handling of small numbers

* Calculate tick precision for arbitrarily small numbers

* Use scientific notation for very small tick numbers

* Calculate significant digits for exponential tick values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Chart is not drawn if values are smaller than 0.000001

3 participants