Question T13378
Visible to All Users

How To Hide Html Q-type

created 2 years ago

Hello SurveyJS Team,

How To Hide All Html Q-type from Dashboard Clipboard-File-1.png

Kind Regards,
Amro

Answers approved by surveyjs Support

created 2 years ago

Hi Amro,
SurveyJS Dashboard displays charts corresponding to each survey question. If you wish to hide certain questions from a dashboard, filter out these questions from a list of questions which you pass to a visualization panel. Consider this example:

JavaScript
let questions = survey.getAllQuestions().filter((question) => question.getType() != "html"); const vizPanel = new VisualizationPanel( questions, surveyResults, vizPanelOptions );

Please let me know if you have further questions.

    Show previous comments (2)

      Updated

      Hi Amro,
      If you don't want to visualize questions of HTML and Expression types, filter out a list of survey questions using the following lambda function:

      JavaScript
      let questions = survey.getAllQuestions().filter((question) => question.getType() != "expression" && question.getType() != "html");

      Thanks

        I changed it to && here :

        JavaScript
        let questions = survey.getAllQuestions().filter((question) => question.getType() != "expression" && question.getType() != "html");

        and it works.

        Many thanks Jane.

          Yes, correct. Thank you for the correction.

          Please feel free to contact us if you have any questions or require further assistance.