From 3d5b1831a63c61ac5755c88dfc41cf87872e98ba Mon Sep 17 00:00:00 2001 From: Aashwin Ranjan Date: Wed, 23 Oct 2024 22:37:30 +0530 Subject: [PATCH] fix(surveys): Show 1-7 linkert scale in survey view (#25703) Rating type surveys (NPS & CES) configured for the 1 - 7 rating scale display the 1 - 5 rating bar chart in the results section. Co-authored-by: Phani Raj --- frontend/src/scenes/surveys/surveyViewViz.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/frontend/src/scenes/surveys/surveyViewViz.tsx b/frontend/src/scenes/surveys/surveyViewViz.tsx index 2d9b5357df722..324c53958dca3 100644 --- a/frontend/src/scenes/surveys/surveyViewViz.tsx +++ b/frontend/src/scenes/surveys/surveyViewViz.tsx @@ -204,7 +204,13 @@ export function RatingQuestionBarChart({ ) : (
{`${ - question.scale === 10 ? '0 - 10' : '1 - 5' + question.scale === 10 + ? '0 - 10' + : question.scale === 7 + ? '1 - 7' + : question.scale === 5 + ? '1 - 5' + : '1 - 3' } rating`}
{question.question}
@@ -238,7 +244,11 @@ export function RatingQuestionBarChart({ labels={ question.scale === 10 ? ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] - : ['1', '2', '3', '4', '5'] + : question.scale === 7 + ? ['1', '2', '3', '4', '5', '6', '7'] + : question.scale === 5 + ? ['1', '2', '3', '4', '5'] + : ['1', '2', '3'] } />