From c967a0b9a41409cf8ebcd2663edf873a66ab6a54 Mon Sep 17 00:00:00 2001 From: Henne Vogelsang Date: Tue, 15 Feb 2022 19:06:26 +0100 Subject: [PATCH] Update chartkick to 4.1.3 --- Gemfile.lock | 2 +- Gemfile.next.lock | 2 +- app/views/application/_donut_chart.haml | 14 +++----------- app/views/application/_line_chart.html.haml | 9 +-------- 4 files changed, 6 insertions(+), 21 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index c87dd5a2..c4caaf9a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -133,7 +133,7 @@ GEM caxlsx_rails (0.6.2) actionpack (>= 3.1) caxlsx (>= 3.0) - chartkick (3.4.2) + chartkick (4.1.3) childprocess (3.0.0) chronic (0.10.2) chunky_png (1.4.0) diff --git a/Gemfile.next.lock b/Gemfile.next.lock index 91ef7565..4eb5fb1d 100644 --- a/Gemfile.next.lock +++ b/Gemfile.next.lock @@ -156,7 +156,7 @@ GEM caxlsx_rails (0.6.2) actionpack (>= 3.1) caxlsx (>= 3.0) - chartkick (3.4.2) + chartkick (4.1.3) childprocess (3.0.0) chronic (0.10.2) chunky_png (1.4.0) diff --git a/app/views/application/_donut_chart.haml b/app/views/application/_donut_chart.haml index 351ff216..8a65e390 100644 --- a/app/views/application/_donut_chart.haml +++ b/app/views/application/_donut_chart.haml @@ -1,16 +1,8 @@ :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 + %h4 + = title + = pie_chart data, donut: true, legend: 'bottom', download: true, messages: { empty: 'No data' }, colors: chart_colors(combined_data) diff --git a/app/views/application/_line_chart.html.haml b/app/views/application/_line_chart.html.haml index b3dbf7be..7fc2cdfd 100644 --- a/app/views/application/_line_chart.html.haml +++ b/app/views/application/_line_chart.html.haml @@ -1,10 +1,3 @@ -:ruby - options = { - legend: 'bottom', - download: true, - messages: { empty: 'No data' } - } - .row .col-md-12 .text-center @@ -12,4 +5,4 @@ = title .row .col-md-12 - = line_chart data, options + = line_chart data, legend: 'bottom', download: true, messages: { empty: 'No data' }