Loading charts via ajax
connor-t opened this issue · comments
Connor commented
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?
Winston commented
$('#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!