diff --git a/lib/google_visualr/base_chart.rb b/lib/google_visualr/base_chart.rb index 6ae00ca..f88d64b 100644 --- a/lib/google_visualr/base_chart.rb +++ b/lib/google_visualr/base_chart.rb @@ -37,10 +37,10 @@ def to_js(element_id) js << "\n google.load('visualization','1', {packages: ['#{package_name}'], callback: function() {" js << "\n #{@data_table.to_js}" js << "\n var chart = new google.visualization.#{chart_name}(document.getElementById('#{element_id}'));" - js << "\n chart.draw(data_table, #{js_parameters(@options)});" @listeners.each do |listener| js << "\n google.visualization.events.addListener(chart, '#{listener[:event]}', #{listener[:callback]});" end + js << "\n chart.draw(data_table, #{js_parameters(@options)});" js << "\n }});" js << "\n" js diff --git a/spec/support/common.rb b/spec/support/common.rb index 2789a29..0e0b445 100644 --- a/spec/support/common.rb +++ b/spec/support/common.rb @@ -30,8 +30,8 @@ def base_chart_with_listener_js(div_class="div_class") js = "\n" end