From 71216fda88f6a9beb3d7ea3a235d547519fa8caa Mon Sep 17 00:00:00 2001 From: Abderrahmane Smimite Date: Mon, 15 Apr 2024 18:21:17 +0200 Subject: [PATCH] fix miss-alignment in bar chart --- backend/core/helpers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/core/helpers.py b/backend/core/helpers.py index 2a12568c2..34a63f808 100644 --- a/backend/core/helpers.py +++ b/backend/core/helpers.py @@ -494,6 +494,8 @@ def assessment_per_status(user: User, model: RiskAssessment | ComplianceAssessme v = {"value": count, "itemStyle": {"color": color_map[st[0]]}} values.append(v) labels.append(st[1]) + #add undefined as the first element in the labels to balance the values + labels.insert(0, "undefined") local_lables = [camel_case(str(label)) for label in labels] return {"localLables": local_lables, "labels": labels, "values": values}