osem-fcy/app/views/application/_donut_chart.haml

17 lines
329 B
Text
Raw Normal View History

:ruby
combined_data ||= {}
data ||= chart_values(combined_data)
colors ||= chart_colors(combined_data)
options = {
donut: true,
legend: 'bottom',
download: true,
messages: { empty: 'No data' }
}
options[:colors] = colors if colors.present?
.text-center
%h4= title
= pie_chart data, options