Skip to content

Commit e76fc38

Browse files
committed
Draft chart of dojo number
1 parent a609fff commit e76fc38

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

app/controllers/static_pages_controller.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ def stats
3232
EventHistory.where(evented_at:
3333
Time.zone.local(year).beginning_of_year..Time.zone.local(year).end_of_year).sum(:participants)
3434
end
35+
36+
@graph = LazyHighCharts::HighChart.new('graph') do |f|
37+
f.title(text: '全国の道場数の推移')
38+
f.xAxis(categories: @range.to_a)
39+
f.series(name: '道場数', yAxis: 0, data: @dojos.values)
40+
f.chart(width: 600)
41+
end
3542
end
3643

3744
def letsencrypt

app/views/static_pages/stats.html.haml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
- @range.each do |year|
6161
%td= @participants[year]
6262
%td= @participants.values.inject(:+)
63+
= high_chart("charts", @graph)
6364

6465
%h3 関連リンク
6566
%ul{:style => "list-style: none; margin-left: -40px;"}

0 commit comments

Comments
 (0)