StatisticsTable not able to render rating & boolean question types
StatisticsTable should be able to visualize both rating & boolean types, since they are also a closed selection of values and thus similar to dropdown.
Currently it throws an exception ("this.valuesSource() is undefined"):
Ticket in support: T20124
Hello, In the meantime, a visualizer is assigned to a question based on a question type. To support a StatisticsTable visualizer for Rating and Boolean question types it will be required to rewrite this logic and resolve a visualizer not by a question type but by the actual question data.
We will consider this feature in the future. In the meantime, please consider using a Radiogroup question to implement single-select questions. For the record: you can set the colCount to 0 to display radiogroup items in a row.
Should you have any further question, please let me know.
Actually, I have the following code:
<script setup>
import 'survey-analytics/survey.analytics.css'
import { QuestionHtmlModel, Model } from 'survey-core'
import { VisualizationPanel } from 'survey-analytics'
import { onMounted } from 'vue'
const surveyJson = window.SurveySchema.content
const surveyResults = window.SurveyResponses.map(response => response.content)
const vizPanelOptions = {
allowHideQuestions: false
}
onMounted(_ => {
const survey = new Model(surveyJson)
const vizPanel = new VisualizationPanel(
survey.getAllQuestions(),
surveyResults,
vizPanelOptions
)
vizPanel.render('surveyVizPanel')
})
</script>
<template>
<div id="surveyVizPanel" />
</template>
And I get the same error for radio group. If I filter out radio groups, everything is fine.