Skip to content

Commit

Permalink
Refactored display_volume_metric_chart
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Mar 22, 2024
1 parent a7466d8 commit 8980cb0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions app/helpers/review_mapping_helper.rb
Expand Up @@ -211,7 +211,13 @@ def initialize_chart_elements(reviewer)
# The data of all the reviews is displayed in the form of a bar chart
def display_volume_metric_chart(reviewer)
labels, reviewer_data, all_reviewers_data = initialize_chart_elements(reviewer)
data = {
data = prepare_chart_data(labels, reviewer_data, all_reviewers_data)
options = prepare_chart_options
bar_chart data, options
end

def prepare_chart_data(labels, reviewer_data, all_reviewers_data)
{
labels: labels,
datasets: [
{
Expand All @@ -230,7 +236,10 @@ def display_volume_metric_chart(reviewer)
}
]
}
options = {
end

def prepare_chart_options
{
legend: {
position: 'top',
labels: {
Expand Down Expand Up @@ -266,7 +275,6 @@ def display_volume_metric_chart(reviewer)
}]
}
}
bar_chart data, options
end

# E2082 Generate chart for review tagging time intervals
Expand Down
2 changes: 1 addition & 1 deletion db/schema.rb
Expand Up @@ -528,7 +528,7 @@
t.float "Hamer", limit: 24, default: 1.0
t.float "Lauw", limit: 24, default: 0.0
t.integer "duty_id"
t.boolean "can_mentor"
t.boolean "can_mentor", default: false
t.index ["duty_id"], name: "index_participants_on_duty_id"
t.index ["user_id"], name: "fk_participant_users"
end
Expand Down

0 comments on commit 8980cb0

Please sign in to comment.