0

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

Suresh Kumar
  • 227
  • 1
  • 11
  • 29

1 Answers1

2

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

Community
  • 1
  • 1
sushil10018
  • 126
  • 8