0

I am trying to add Highcharts to my Rails 4 project that already has the chartkick gem installed.

When I use the Google charting library, all charts seem to function as expected. When I add Highcharts instead, I am not able to see any charts.

I have identified the following: 1) If I add '= javascript_include_tag "components/highcharts.js", "chartkick" ' to my layout footer I am prompted by Rails to also add this asset as an initializer. 2) If I add this to the initializer, I am able to load the page, but charts aren't loaded. If I look in Firebug I get an error stating that Highcharts has been loaded twice.

I have also tried adding Highcharts JS to my application.js, without any luck (The page is loaded, but still no charts are displayed)

Any ideas?

HermannHH
  • 1,732
  • 1
  • 27
  • 57

1 Answers1

0

You have to download highcharts.js from here http://api.highcharts.com/highcharts, you can customize it.

You have to put it on /assets/javascript/ folder of your rails application (saving as .js, do not create new file and copy content).

Now on your view you have to write:

And now you can work with it.