google-code-export / gchartrb

Automatically exported from code.google.com/p/gchartrb
0 stars 0 forks source link

line chart issue #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
   lcxy =  GoogleChart::LineChart.new('520x400', "Occupation", true,
:max_value => 100)
    lcxy.data key, [[1,0], [2,0], [3,0], [4,0],
                    [5,0], [6,0], [7,0]  [8,0],
                    [9,0], [10,0],[11,0],[12,0]], 'ff00ff'

What is the expected output? What do you see instead?

ZeroDivisionError (divided by 0):

C:/ruby/lib/ruby/gems/1.8/gems/gchartrb-0.3.0/lib/google_chart/base.rb:296:in
`/'

C:/ruby/lib/ruby/gems/1.8/gems/gchartrb-0.3.0/lib/google_chart/base.rb:296:in
`simple_encode'

C:/ruby/lib/ruby/gems/1.8/gems/gchartrb-0.3.0/lib/google_chart/base.rb:293:in
`collect'

C:/ruby/lib/ruby/gems/1.8/gems/gchartrb-0.3.0/lib/google_chart/base.rb:293:in
`simple_encode'

C:/ruby/lib/ruby/gems/1.8/gems/gchartrb-0.3.0/lib/google_chart/base.rb:279:in
`encode_data'

C:/ruby/lib/ruby/gems/1.8/gems/gchartrb-0.3.0/lib/google_chart/line_chart.rb:59:
in
`process_data'

C:/ruby/lib/ruby/gems/1.8/gems/gchartrb-0.3.0/lib/google_chart/line_chart.rb:57:
in
`times'

C:/ruby/lib/ruby/gems/1.8/gems/gchartrb-0.3.0/lib/google_chart/line_chart.rb:57:
in
`process_data'

C:/ruby/lib/ruby/gems/1.8/gems/gchartrb-0.3.0/lib/google_chart/base.rb:262:in
`add_data'

C:/ruby/lib/ruby/gems/1.8/gems/gchartrb-0.3.0/lib/google_chart/base.rb:48:in
`to_url'
    /app/controllers/statistics_controller.rb:213:in
`occupation_par_consultant'

Please provide any additional information below.
Hope I did not miss something. I think max value should be passed in params
and not picking in array values.

Than you for wrapper. I would like help you more, but I am not a great
rubyiste.

regards
cedric

Original issue reported on code.google.com by cedric.b...@gmail.com on 12 Dec 2007 at 12:06

GoogleCodeExporter commented 9 years ago
Yes, there is something wrong here. The maximum value is being picked up from 
the 
series, which is not working in this case. 

Thanks for the report. I will look into it.

Original comment by deepak.j...@gmail.com on 12 Dec 2007 at 12:44

GoogleCodeExporter commented 9 years ago
This is fixed now.

Original comment by deepak.j...@gmail.com on 12 Dec 2007 at 5:18

GoogleCodeExporter commented 9 years ago
Damn quick !! thanks. I will try it this evening. 

Is y-axis max value is being picked up from series too?

Again great job, deepack.

Original comment by cedric.b...@gmail.com on 12 Dec 2007 at 10:56

GoogleCodeExporter commented 9 years ago
Normally, the x and y max values are picked up from the series.

I just committed a change which allows you to set custom maximum values to 
control 
the plotting of the axis and the encoding.

Will make a release soon.

Original comment by deepak.j...@gmail.com on 12 Dec 2007 at 11:17