lumean / svg-graph2

SVG:::Graph is a pure Ruby library for generating charts, which are a type of graph where the values of one axis are not scalar. SVG::Graph has a verry similar API to the Perl library SVG::TT::Graph, and the resulting charts also look the same. This isn't surprising, because SVG::Graph started as a loose port of SVG::TT::Graph.
Other
50 stars 20 forks source link

Bar graphs are rounding bars to nearest Y axis label number #4

Closed adamalbrecht closed 7 years ago

adamalbrecht commented 7 years ago

When scale_integers is true, Vertical Bar graphs always round the bars to the nearest axis label number (and dotted line). This wasn't happening with horizontal bar graphs.

The fix was to make the height calculation first convert the y_scale_division value to a float before multiplying it with the current value.

See the example before and after the fix.

chart_before chart_after
lumean commented 7 years ago

many thanks for the PR, I'll release a fixed gem probably tomorrow

lumean commented 7 years ago

I just released the new gem