Hi guys,
I’m working on a barChart plugin (that I will be sharing here) and I’m having a brain fart moment, so looking for input.
How would I best go about “order of magnitude” detection for the scale and division of the vertical axis and subdivision?
For instance:
If the highest value in my barChart would be 86.000 then it’s kind of logical to have my y-Axis go to 100.000 and have division lines for 20.000, 40.000, 60.000 and 80.000.
If the highest value in my barChart would be 17 then it’s probably logical to have my y-Axis go to 20 and have division lines for 5, 10 and 15.
If the highest value in my barChart would be 320 then it’s probably logical to have my y-Axis go to 400 and have division lines for 100, 200 and 300.
When you look at the values as a human it’s easy, but how would I code the logic to have Lua do this?
All input is welcome! Thanks!