Question T5424
Visible to All Users

Analytics | Angular | Register visualizer as "SelectBasePlotly" for rating type question

created 4 years ago

Hello Team,

How can register visualizer for rating type question with SelectBasePlotly?
I am trying with this but it throws error.

TypeScript
SurveyAnalytics.VisualizationManager.registerVisualizer('rating', SurveyAnalytics.SelectBasePlotly);

Thanks!

Answers approved by surveyjs Support

created 4 years ago

Hello,

I've created a live sample for you on our site https://surveyjs.io/Examples/Analytics?id=text-chart illustrating how to show a text question with a chart visualizer. Hope it solves your scenario.

Thanks, Serge
SurveyJS Team

    Comments (2)

      Hello Serge,

      The text type question render as expected but the following behaviors are not reflect though I have already configured in options.

      TypeScript
      1) answersOrder: 'desc', 2) showPercentages: true, 3) allowTopNAnswers: true // Sample Code let options = { labelTruncateLength: 27, allowTopNAnswers: true, hideEmptyAnswers: true, answersOrder: 'desc', showPercentages: true }; const visPanel = new SurveyAnalytics.VisualizationPanel(allQuestions, data, options);

      Thanks!

        Hello,

        I've created a separate ticket on your behalf (T5454: Some panel options are not applied). It has been placed in our processing queue and will be answered shortly.

        Thanks, Serge
        SurveyJS Team

        created 4 years ago

        Hello,

        QuestionRatingModel class is not inherited from QuestionSelectBase and doesn't have activeChoices property, which is used in the valuesSource method of the SelectBasePlotly class. You can override this method in the inherited class from SelectBasePlotly. Here is an example .

        Thanks,
        Dmitry
        SurveyJS Team

          Show previous comments (1)

            Hello,

            Unfortunately, you can't use the SelectBasePlotly class for text type questions. SelectBasePlotly uses choices to generate its data, which are not present in the text type question.

            Thanks,
            Dmitry
            SurveyJS Team

              Hello Dmitry,

              I want to render visualization with bar/pie/doughnut for text type question.
              (For example: the question is for postal_code)
              How can I achieve this?

              Thanks!

                Hello,

                In general case it's hard to visualize the text question answers as chart. For the case of finite text alternatives we'll create a sample and share it here.

                Thanks, Serge
                SurveyJS Team