winston / google_visualr

A Ruby Gem for the Google Visualization API. Write Ruby code. Generate Javascript. Display a Google Chart.

Home Page:http://googlevisualr.heroku.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Loading charts via ajax

connor-t opened this issue · comments

I load the charts on the page via ajax, the chart script loads correctly in the html source but doesn't appear on the page.
This is how I load the chart;
$('#geochart').html("<%= render_chart @countries_chart, 'geochart' %>");

what am I doing wrong?

$('#geochart').html("<%= render_chart @countries_chart, 'geochart' %>");

The render_chart method should be used within your erb views, not your JavaScript. Do check out http://googlevisualr.heroku.com/ for more examples on how to use the gem. Thank you!