1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-01-31 19:47:14 +00:00

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
This commit is contained in:
Go MAEDA 2022-03-03 14:17:19 +00:00
parent 05714ab18a
commit 4926771a8a
4 changed files with 42 additions and 28 deletions

View File

@ -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 %>

View File

@ -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 %>

File diff suppressed because one or more lines are too long

13
public/javascripts/chart.min.js vendored Normal file

File diff suppressed because one or more lines are too long