Poor handling for non-integer values on the y-axis
See original GitHub issueWhen making charts that have float/decimal values, the values always round. This makes it extremely annoying for plotting data under 1. Right now I have a workaround so that I can see the actual value on hover by setting the formatter like:
options.yaxis.labels.formatter = val => val.toFixed(2)
However there doesn’t seem a way to get any non integer ticks to show up. Therefore if all data is between 0 and 1, you’ll only be able to see two ticks: 0 and 1.
P.S. Thanks for the great library! A lot easier to use than chart.js for simple stuff.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
How to show only integer values on yAxis of HighChart?
These can only be integers. When we display data that has a high enough yValue the yAxis labels are integers. However, when we...
Read more >Force bar chart Y axis scale to be integer-only
I have a bar chart that shows a count of items, by category. When the counts are small, the axis tickmark values show...
Read more >[R] suppressing non-integer labels for plot x-axis
[R] suppressing non-integer labels for plot x-axis ... difficulty making R plot only integer labels on the x-axis > of a simple graph....
Read more >Axis not displaying integers - pgfplots - LaTeX Stack Exchange
I've built a plot using PGFPlots where I've told it to display axis numbers every 10 units and for some reason instead of...
Read more >Handling Missing Data | Python Data Science Handbook
There are a number of schemes that have been developed to indicate the presence of ... Common special values like NaN are not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Updated the “fraction/decimal” part to allow the user to give a default value. Currently, the default is set to 2 - https://github.com/apexcharts/apexcharts.js/commit/b37f2490f28bd1d41f95ec14c4b6bfafb91a76a4 The option can be set at
options.yaxis.decimalsInFloat
Need to add in the docs@MichaelDanielTom Removed the condition where smaller values were generating no ticks / single tick on y-axis. Now, You can control the number of ticks that can be generated by this option
options.yaxis.tickAmount = 6
However, the way you have handled the float values by
.toFixed(2)
is required for now. I will check whether the series contains float numbers and based on that - decide whether to round off or not.Thanks