CoralineAda / seer

Seer is a lightweight, semantically rich wrapper for the Google Visualization API. It allows you to easily create a visualization of data in a variety of formats, including area charts, bar charts, column charts, gauges, line charts, and pie charts.
http://www.idolhands.com/ruby-on-rails/gems-plugins-and-engines/graphing-for-ruby-on-rails-with-seer
MIT License
133 stars 15 forks source link

Problems with using seer in partials #2

Open bruskiza opened 14 years ago

bruskiza commented 14 years ago

Hi,

I have a normal view that is as follows:

<table>
<tr>
        <th>Date:</th>
        <th>Count:</th>
</tr>
<% @events.each do |event| %>
<tr>
        <td><%= event.foo %></td>
        <td><%= event.count %></td>

</tr>
<% end%>
</table>

<div id="chart" class="chart"></div>

<%= Seer::visualize(
      @events,
      :as => :column_chart,
      :in_element =>'chart',
      :series => {:series_label => 'foo', :data_method => 'count'},
      :chart_options => {
        :height => 300,
        :width => 100 * @events.size,
        :is_3_d => true,
        :legend => 'none',
        :colors => "[{color:'#990000', darker:'#660000'}]",
        :title => "Widget Quantities",
        :title_x => 'Widgets',
        :title_y => 'Quantities'
      }
    )
 -%>

Which works fine. But when taking the same code and placing it in a partial, the render does not work. The whole page goes blank and the status bar says: transferring data from google.com...

Thanks in advance. Anything that I am missing?

kulesa commented 14 years ago

Hi. That is strange. Make sure you didn't change div's id from 'chart' to something else!

CoralineAda commented 14 years ago

How are you passing your @events instance variable through to the partial?