Using Chartkick in Rails 4.0

前端 未结 5 1578
失恋的感觉
失恋的感觉 2020-12-30 06:58

How can i use Chartkick in rails 4.0.

in Gem I added:

gem \"chartkick\"

and in my view for example i added this:

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-30 07:46

    Loading your charts superfast

    i am using highcharts here as it do not require you to connect each time to google server

    add this gem

    gem "chartkick"
    

    then download highchart.js from here http://www.highcharts.com/download

    paste the file in your app/vendor/assets/javascript/highchart.js

    open your application.js and require these two files

    //= require highcharts.js
    //= require chartkick
    

    after this you are good to go and your charts will load within a blink

提交回复
热议问题