Let's say I have a simple line chart with 5 values (a = 155, b = 200, c = 250, d = 300, e 0 345)
I need a way to calculate which values go on the Y-axis, in such a way that the values look nice. I also want to see the minor steps.
If I use a simple formula I would do this:
MaxValue - Minvalue = difference
300- 900 = 600
For 5 steps: 600/5 = 120 per step
That would lead to these values for the Y-axis:
Y0 = 200.0 (Rounding off to 200)
Y1 = 360.0 (Rounding off to 400)
Y2 = 520.0 (Rounding off to 600)
Y3 = 680.0 (Rounding off to 700)
Y4 = 840.0 (Rounding off to 900)
Y4 = 1000.0 (Rounding off to 1000)
What I actually would like is the values to be:
Y0 = 200
Y1 = 400
Y2 = 600
Y3 = 800
Y4 = 1000
But how do I calculate this?
Before calculation I don't know the magnitude of the values, it could be also like thousands, or tens.