Use chartkick globally
* Clean up legacy charting imports * Update existing donut and line charts * Create helpers for parsing out existing chart data * Move chart partials to a more common path
This commit is contained in:
parent
3bbac3667f
commit
516e53d9df
29 changed files with 331 additions and 577 deletions
17
app/helpers/chart_helper.rb
Normal file
17
app/helpers/chart_helper.rb
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ChartHelper
|
||||
def chart_values(distribution_hash)
|
||||
Hash[
|
||||
distribution_hash.collect do |key, data|
|
||||
[key, data['value']]
|
||||
end
|
||||
]
|
||||
end
|
||||
|
||||
def chart_colors(distribution_hash)
|
||||
distribution_hash.collect do |_key, data|
|
||||
data['color']
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue