Skip to content

Commit

Permalink
replace const with var for chart update
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandermeindl committed Nov 26, 2024
1 parent c070b57 commit 109d091
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions app/models/additionals_chart.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ def build_chart_data(datasets, **options)
data[:value_link_method] = '_project_issues_path' unless options.key? :value_link_method
data[:color_schema] = color_schema

values = Array(datasets).first[:data]
data[:data_sum] = values.present? ? values.sum : 0
unless options[:skip_data_sum]
values = Array(datasets).first[:data]
data[:data_sum] = values.present? ? values.sum : 0
end

data.merge options
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/additionals/charts/_pie_with_value_table.slim
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
.clear-both

javascript:
const pie_chart_#{{@chart[:id]}} = new Chart(document.getElementById("#{@chart[:id]}"), {
var pie_chart_#{{@chart[:id]}} = new Chart(document.getElementById("#{@chart[:id]}"), {
type: 'pie',
data: {
label_ids: #{raw json_escape(@chart[:label_ids])},
Expand Down

0 comments on commit 109d091

Please sign in to comment.