topfunky / gruff

Gruff graphing library for Ruby

Home Page:http://gruff.rubyforge.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Side bar still uses scientific notation

dusterio opened this issue · comments

If you take a look at your own test output:
https://github.com/topfunky/gruff/blob/master/test/output/side_bar_data_range.png

You can see that side bar still applies scientific notation for the numbers of X axis - a notation that nobody really uses in the web world.

Is there any particular reason for that? I don't see how 0.8E1 is better than 8 - it's 5 times longer (5 characters instead of one) and I'm sure some users cannot read the scientific notation

Interestingly, the first/default test outputs numbers fine even though it doesn't seem to be any different in code. Is this behaviour semi-random?

I can see it's not a direct fault of this package - it's Ruby's default behaviour. Having said that, the ultimate responsibility is definitely on Gruff - if you are providing charts, you might as well render them right :)

Moreover, you already have label_formatting property in the side bar class, you are just not using it. You could replace marker_label.to_s with @label_formatting % marker_label.to_s and that's it - a flexible fix in just a few extra characters.

Related to #74