surveyjs / survey-analytics

Customizable JavaScript library to create interactive survey data dashboards and facilitate survey results analysis for your end-users.
https://surveyjs.io/dashboard/examples/plain-data
Other
98 stars 49 forks source link

Visualize Rating scale with string values using the choice-based question visualizer (SelectBasePlotly) #458

Open JaneSjs opened 1 month ago

JaneSjs commented 1 month ago

T19387 - Dashboard not displaying rating-type question string values https://surveyjs.answerdesk.io/internal/ticket/details/T19387


Usage scenario: A rating scale has a string/textual rate item values.

{
          "type": "rating",
          "name": "question2",
          "title": "String values",
          "autoGenerate": false,
          "rateCount": 3,
          "rateValues": [
            {
              "value": "val1",
              "text": "Value 1"
            },
            {
              "value": "val2",
              "text": "Value 2"
            },
            {
              "value": "vale",
              "text": "Value 3"
            }
          ]
}

Issue: When strings are used as rate item values, SurveyJS Dashboard cannot visualize textual rating scale values using the default Histogram visualizer. View Demo image

A histogram is designed for numerical data and represents the distribution of continuous or discrete numerical variables. Since histograms require dividing data into bins (ranges of numerical values), they aren't directly applicable to categorical data (such as strings), where there is no natural numerical ordering or range.

Suggestion: When a Rating scale uses string values, visualize a rating scale using the SelectBasePlotly visualizer, which is used for single- and multi-select questions (Checkboxes, Tagbox, Dropdown, Radiogroup).

tsv2013 commented 3 weeks ago

At this moment visualizers are bound to question type: e.g. rating -> gauge, rating -> histogram and we don't chack whether this visualizer fit certain question: in this case rating question choice has string value instead of expected numeric type.

We need to implement another, more intelligent visualizers registration and creation flow, may be like a fit function for vizualizers. Most likely we'll implement it a bit later.