Property decimals:0 is not working in a bar chart

Problem:
In this demo, we can't seem to get rid of the decimals on scaleY by setting the decimals property to 0. Is there a way to fix this?


Solution:
This problem you're experiencing happens because the library generates values for the scaleY like [0, 0.5, 1, 1.5, ....]. If you would force decimals=0, you would get [0, 0, 1, 1, 2, 2, ...] which is wrong.

In that PARTICULAR example(the demo you shared), you could set (on scaleY), "step":1 or scaleFactor:2. The first forces the step, the second does some sort of step "stretching" and here you kind of get same result. Please use this demo for reference.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us