The scale on my bar chart is showing incorrectly

Post a reply

Posted by Jerry at 17:22 on Friday 19th May 2023 [link]

My Bar chart is showing the scale as 0,0,0,1,1,1 instead of 0,0.2,0.4,0.6,0.8,1.0 - how can I fix this?

Posted by Richard at 17:39 on Friday 19th May 2023 [link]
The scale is showing like that because of rounding. The maximum value on the scale is being set to 1 - and then divided by five to come up with a scale like this: [0,0.2,0.4,0.6,0.8,1.0]. However, the numbers are rounded in order to fit in with the number of decimals - which by default is zero. So the numbers are being rounded to what you're seeing.

The solution here is to set the yaxisScaleDecimals propety to 1 - that way you'll see your Y axis labels as expected: [0,0.2,0.4,0.6,0.8,1.0].

Post a reply

What's your name?
What do you want to say?