@@ -71,7 +71,7 @@ export function UsersStackedBar({ surveyUserStats }: { surveyUserStats: SurveyUs
{[
{
count: seen,
- label: 'Viewed',
+ label: 'Shown',
classes: `rounded-l ${dismissed === 0 && sent === 0 ? 'rounded-r' : ''}`,
style: { backgroundColor: '#1D4AFF', width: `${seenPercentage}%` },
},
@@ -87,7 +87,7 @@ export function UsersStackedBar({ surveyUserStats }: { surveyUserStats: SurveyUs
},
{
count: sent,
- label: 'Submitted',
+ label: 'Sent',
classes: `rounded-r ${seen === 0 && dismissed === 0 ? 'rounded-l' : ''}`,
style: {
backgroundColor: '#529B08',
@@ -378,6 +378,7 @@ export function MultipleChoiceQuestionBarChart({
}): JSX.Element {
const { loadSurveyMultipleChoiceResults } = useActions(surveyLogic)
const { survey } = useValues(surveyLogic)
+ const [chartHeight, setChartHeight] = useState(200)
const barColor = '#1d4aff'
const question = survey.questions[questionIndex]
@@ -389,6 +390,12 @@ export function MultipleChoiceQuestionBarChart({
loadSurveyMultipleChoiceResults({ questionIndex })
}, [questionIndex])
+ useEffect(() => {
+ if (surveyMultipleChoiceResults?.[questionIndex]?.data?.length) {
+ setChartHeight(100 + 20 * surveyMultipleChoiceResults[questionIndex].data.length)
+ }
+ }, [surveyMultipleChoiceResults])
+
return (
{!surveyMultipleChoiceResultsReady[questionIndex] ? (
@@ -399,7 +406,12 @@ export function MultipleChoiceQuestionBarChart({
Multiple choice
{question.question}
-