File tree Expand file tree Collapse file tree 7 files changed +54
-0
lines changed Expand file tree Collapse file tree 7 files changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,10 @@ gem 'jquery-rails'
72
72
73
73
gem 'rubocop'
74
74
75
+ gem 'chartkick'
76
+
77
+ gem 'groupdate'
78
+
75
79
# Use Sass to process CSS
76
80
# gem "sassc-rails"
77
81
Original file line number Diff line number Diff line change 154
154
grape_logging (1.8.4 )
155
155
grape
156
156
rack
157
+ groupdate (6.4.0 )
158
+ activesupport (>= 6.1 )
157
159
haml (6.3.0 )
158
160
temple (>= 0.8.2 )
159
161
thor
@@ -381,6 +383,7 @@ DEPENDENCIES
381
383
bootsnap
382
384
byebug
383
385
capybara
386
+ chartkick
384
387
debug
385
388
devise
386
389
devise-jwt
@@ -390,6 +393,7 @@ DEPENDENCIES
390
393
grape
391
394
grape-swagger
392
395
grape_logging
396
+ groupdate
393
397
haml-rails
394
398
html2haml
395
399
importmap-rails
Original file line number Diff line number Diff line change 1
1
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
2
2
import "@hotwired/turbo-rails"
3
3
import "controllers"
4
+ import "chartkick"
5
+ import "Chart.bundle"
4
6
//= require jquery3
5
7
//= require popper
6
8
//= require bootstrap
Original file line number Diff line number Diff line change 1
1
.container.mt-5
2
2
%h1 Posts
3
+ = pie_chart Post.group(:status).count, library: { title: { text: 'Posts by status' } }
4
+ = line_chart Post.group(:id).sum(:total_view), library: { title: { text: 'Posts by total view' } }
3
5
= link_to 'New Post', new_post_path, class: 'btn btn-primary col-md-1 offset-md-11 mb-3'
4
6
5
7
%form .form-inline.mb-3.justify-content-end.offset-md-9
Original file line number Diff line number Diff line change 5
5
pin "@hotwired/stimulus" , to : "stimulus.min.js" , preload : true
6
6
pin "@hotwired/stimulus-loading" , to : "stimulus-loading.js" , preload : true
7
7
pin_all_from "app/javascript/controllers" , under : "controllers"
8
+ pin "chartkick" , to : "chartkick.js"
9
+ pin "Chart.bundle" , to : "Chart.bundle.js"
Original file line number Diff line number Diff line change
1
+ {
2
+ "dependencies" : {
3
+ "chart.js" : " ^4.4.1" ,
4
+ "chartkick" : " ^5.0.1"
5
+ }
6
+ }
Original file line number Diff line number Diff line change
1
+ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+ # yarn lockfile v1
3
+
4
+
5
+ " @kurkle/color@^0.3.0 " :
6
+ version "0.3.2"
7
+ resolved "https://registry.yarnpkg.com/@kurkle/color/-/color-0.3.2.tgz#5acd38242e8bde4f9986e7913c8fdf49d3aa199f"
8
+ integrity sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw==
9
+
10
+ chart.js@4, chart.js@^4.4.1 :
11
+ version "4.4.1"
12
+ resolved "https://registry.yarnpkg.com/chart.js/-/chart.js-4.4.1.tgz#ac5dc0e69a7758909158a96fe80ce43b3bb96a9f"
13
+ integrity sha512-C74QN1bxwV1v2PEujhmKjOZ7iUM4w6BWs23Md/6aOZZSlwMzeCIDGuZay++rBgChYru7/+QFeoQW0fQoP534Dg==
14
+ dependencies :
15
+ " @kurkle/color" " ^0.3.0"
16
+
17
+ chartjs-adapter-date-fns@>=3 :
18
+ version "3.0.0"
19
+ resolved "https://registry.yarnpkg.com/chartjs-adapter-date-fns/-/chartjs-adapter-date-fns-3.0.0.tgz#c25f63c7f317c1f96f9a7c44bd45eeedb8a478e5"
20
+ integrity sha512-Rs3iEB3Q5pJ973J93OBTpnP7qoGwvq3nUnoMdtxO+9aoJof7UFcRbWcIDteXuYd1fgAvct/32T9qaLyLuZVwCg==
21
+
22
+ chartkick@^5.0.1 :
23
+ version "5.0.1"
24
+ resolved "https://registry.yarnpkg.com/chartkick/-/chartkick-5.0.1.tgz#f557ff8560f974343dc65c7fc34ce1e8326d8ee7"
25
+ integrity sha512-4F3tWI3eBQgnjCYZIZ+fHOaJuNyxeyhDE2Tm+voOWB19hDjSJceys/spzN52DOn8bWepNESGXvPVTGU1jeFsbA==
26
+ optionalDependencies :
27
+ chart.js "4"
28
+ chartjs-adapter-date-fns ">=3"
29
+ date-fns ">=2"
30
+
31
+ date-fns@>=2 :
32
+ version "3.0.6"
33
+ resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-3.0.6.tgz#fe3aeb7592d359f075ffc41cb16139828810ca83"
34
+ integrity sha512-W+G99rycpKMMF2/YD064b2lE7jJGUe+EjOES7Q8BIGY8sbNdbgcs9XFTZwvzc9Jx1f3k7LB7gZaZa7f8Agzljg==
You can’t perform that action at this time.
0 commit comments