From c314d31b7040746536ef9b902eedf56fb4a33a60 Mon Sep 17 00:00:00 2001 From: Andro Gvivradze Date: Thu, 29 Jun 2023 09:04:12 +0000 Subject: [PATCH] [FIX] survey: improve bar chart visuals This commit makes sure that graph result starts at 0 in survey results. Before the commit it would start at the lowest number of answers, which was not the best way to visualize survey result data. task-3389003 closes odoo/odoo#129488 X-original-commit: 8bde5f102bdbdf923c5c4d4cdd63bfdaadd7bf2b Signed-off-by: Thibault Delavallee (tde) --- addons/survey/static/src/js/survey_result.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/survey/static/src/js/survey_result.js b/addons/survey/static/src/js/survey_result.js index c835e7e46e3..fe626ad8457 100644 --- a/addons/survey/static/src/js/survey_result.js +++ b/addons/survey/static/src/js/survey_result.js @@ -153,6 +153,7 @@ publicWidget.registry.SurveyResultChart = publicWidget.Widget.extend({ }], yAxes: [{ ticks: { + beginAtZero: true, precision: 0, }, }], @@ -203,7 +204,8 @@ publicWidget.registry.SurveyResultChart = publicWidget.Widget.extend({ }], yAxes: [{ ticks: { - precision: 0, + beginAtZero: true, + precision: 0, }, }], }, @@ -341,6 +343,7 @@ publicWidget.registry.SurveyResultChart = publicWidget.Widget.extend({ display: false, }, ticks: { + beginAtZero: true, precision: 0, callback: function (label) { return label + '%'; @@ -348,7 +351,7 @@ publicWidget.registry.SurveyResultChart = publicWidget.Widget.extend({ suggestedMin: 0, suggestedMax: 100, maxTicksLimit: 5, - stepSize: 25 + stepSize: 25, }, }], },