Friday, 27 September 2019

Line Chart

Line Chart 

1.  Add this line to your application's Gemfile:
     # ======= Chart ========
         gem 'chartkick'
         gem 'groupdate'

2.  After run the bundle install 

3.  Sprockets, in app/assets/javascripts/application.js, add:
         //= require chartkick
         //= require Chart.bundle

4.  For View Page :- 
          <%= line_chart User.group_by_day(:created_at).count %>
          <%= line_chart Order.all.group_by_day() { |order| order.created_at    
                }.map{ |date, orders, | [date, orders.size] } 
           %>

No comments:

Post a Comment

  Common Git Commands   Take clone of a repository git clone <remote-repository-url> ex: git clone  https://github.com/agricor/RegTech...