mattetti / googlecharts

Ruby Google Chart API
http://mattetti.github.com/googlecharts/
MIT License
699 stars 108 forks source link

1.5.1 breaks axis_range #15

Open betelgeuse opened 14 years ago

betelgeuse commented 14 years ago

In 1.4.0 you can do axis_range like:

 >> Gchart.line(:data => [1,3,8], :axis_with_labels => 'x', :axis_range => [[0,10,2]])
 => "http://chart.apis.google.com/chart?chxr=0,0,10,2&chxt=x&chd=s:HW9&cht=lc&chs=300x200"

In 1.5.1 you get:

>> Gchart.line(:data => [1,3,8], :axis_with_labels => 'x', :axis_range => [[0,10,2]])
=> "http://chart.apis.google.com/chart?chxt=x&chd=s:HX9&cht=lc&chs=300x200&chxr=1,8"

Here chxr is taken from the dataset instead of the specified axis_range values.

mattetti commented 14 years ago

confirmed, I need to look into it, feel free to send a patch tho.

miaout17 commented 14 years ago

I think it is because of axis index. I made a pull request http://github.com/mattetti/googlecharts/pull/29 Please check it :)

x37v commented 13 years ago

horizontal bar charts with data that is sorted in reverse gives garbage too:

    ruby-1.9.2-p0 > Gchart.bar(:data => [123,50,1], :axis_labels => [["1", "50", "123"]], :axis_with_labels => 'y', :orientation => 'horizontal')
     => "http://chart.apis.google.com/chart?chxl=0:|1|50|123&chxt=y&chd=s:9ZA&cht=bhs&chs=300x200&chxr=0,123,50,1"