Skip to content

Commit

Permalink
fix(surveys): Show 1-7 linkert scale in survey view (#25703)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Aashw1n and Phanatic authored Oct 23, 2024
1 parent 8916faa commit 3d5b183
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions frontend/src/scenes/surveys/surveyViewViz.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,13 @@ export function RatingQuestionBarChart({
) : (
<div className="mb-8">
<div className="font-semibold text-muted-alt">{`${
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`}</div>
<div className="text-xl font-bold mb-2">{question.question}</div>
<div className=" h-50 border rounded pt-8">
Expand Down Expand Up @@ -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']
}
/>
</BindLogic>
Expand Down

0 comments on commit 3d5b183

Please sign in to comment.