mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
* 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
17 lines
319 B
Ruby
17 lines
319 B
Ruby
# 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
|