Suresh Kumar
Suresh Kumar

Reputation: 227

Rails 4.1 Error Loading Chart: No adapter found highcharts

Hello I am using Chartkick to load charts in my rails application

But I am keep getting Error Loading Chart: No adapter found

My application.html.erb

 <%= stylesheet_link_tag    'application', media: 'all' %>
    <%= javascript_include_tag "path/to/highcharts.js", "chartkick" %>  
    <%= javascript_include_tag 'application'  %>
    <%= csrf_meta_tags %> 

I am trying to use highcharts.js to my application why is there an error?

so after editing my application .html.erb to

 <%= stylesheet_link_tag    'application', media: 'all' %>
    <%= javascript_include_tag "highcharts", "chartkick" %>  
    <%= javascript_include_tag 'application'  %>
    <%= csrf_meta_tags %> 

and moving my highcharts.js to /app/assets/javascripts i am getting error

Error Loading Chart: N is not a function

Upvotes: 0

Views: 2793

Answers (1)

sushil10018
sushil10018

Reputation: 126

Be sure to include the javascript files before the charts.

<%= javascript_include_tag "//www.google.com/jsapi", "chartkick" %>

as suggested in Using Chartkick in Rails 4.0.

Also, I found this guide, might be helpful: http://richonrails.com/articles/charting-with-chartkick

Upvotes: 2

Related Questions