From 4926771a8ae7425c2f9a68c35ff877f480e9f408 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Thu, 3 Mar 2022 14:17:19 +0000 Subject: Update Chart.js to 3.7.1 (#36701). Patch by Maciej Pankanin. git-svn-id: http://svn.redmine.org/redmine/trunk@21446 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/reports/_details.html.erb | 21 ++++++++++++--------- app/views/repositories/stats.html.erb | 29 +++++++++++++++++------------ 2 files changed, 29 insertions(+), 21 deletions(-) (limited to 'app') diff --git a/app/views/reports/_details.html.erb b/app/views/reports/_details.html.erb index 701591c74..3361117fc 100644 --- a/app/views/reports/_details.html.erb +++ b/app/views/reports/_details.html.erb @@ -41,21 +41,24 @@ chartData.datasets[i].borderWidth = 1; } new Chart($(canvas_id), { - type: 'horizontalBar', + type: 'bar', data: chartData, options: { + indexAxis: 'y', elements: { - rectangle: {borderWidth: 2} + bar: {borderWidth: 2} }, responsive: true, - legend: {position: 'right'}, - title: { - display: true, - text: title + plugins: { + legend: {position: 'right'}, + title: { + display: true, + text: title + } }, scales: { - yAxes: [{ stacked: true }], - xAxes: [{ stacked: true }] + yAxis: {stacked: true}, + xAxis: {stacked: true} } } }); @@ -74,6 +77,6 @@ }); <% end %> <% content_for :header_tags do %> - <%= javascript_include_tag "Chart.bundle.min" %> + <%= javascript_include_tag "chart.min" %> <% end %> <% end %> diff --git a/app/views/repositories/stats.html.erb b/app/views/repositories/stats.html.erb index 2020976e1..5266dc262 100644 --- a/app/views/repositories/stats.html.erb +++ b/app/views/repositories/stats.html.erb @@ -36,13 +36,15 @@ $(document).ready(function(){ data: chartData, options: { elements: { - rectangle: {borderWidth: 2} + bar: {borderWidth: 2} }, responsive: true, - legend: {position: 'right'}, - title: { - display: true, - text: <%= raw l(:label_commits_per_month).to_json %> + plugins: { + legend: {position: 'right'}, + title: { + display: true, + text: <%= raw l(:label_commits_per_month).to_json %> + } } } }); @@ -70,17 +72,20 @@ $(document).ready(function(){ }; new Chart(document.getElementById("commits_per_author").getContext("2d"), { - type: 'horizontalBar', + type: 'bar', data: chartData, options: { + indexAxis: 'y', elements: { - rectangle: {borderWidth: 2} + bar: {borderWidth: 2} }, responsive: true, - legend: {position: 'right'}, - title: { - display: true, - text: <%= raw l(:label_commits_per_author).to_json %> + plugins: { + legend: {position: 'right'}, + title: { + display: true, + text: <%= raw l(:label_commits_per_author).to_json %> + } } } }); @@ -94,5 +99,5 @@ $(document).ready(function(){ <% html_title(l(:label_repository), l(:label_statistics)) -%> <% content_for :header_tags do %> - <%= javascript_include_tag "Chart.bundle.min" %> + <%= javascript_include_tag "chart.min" %> <% end %> -- cgit v1.2.3