Question T14665
Visible to All Users

Visualization html + dropdown

created 2 years ago (modified 2 years ago)

Clipboard-File-1.png
Clipboard-File-2.png

  1. I know that i can hide q-type of html per filter function, but better would be to just display the html as default renderer or?
  2. the dropdown seems to be strange as it seem to have no translation and both values are the same, how can i hide it?

Answers approved by surveyjs Support

created 2 years ago (modified 2 years ago)

Hello Wolfgang,
The SurveyJS Dashboard visualizes survey responses. HTML questions are read-only questions - they don't receive any answers. Therefore, they should be basically excluded from visualization.

To exclude HTML questions from a dashboard, you can filter 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 );

Alternatively, register a custom visualizer and render HTML question's content within a dashboard. Please consider this example (View Demo):

JavaScript
function CustomHtmlVisualizer(question, data, options) { var renderContent = function (contentContainer, visualizer) { var qHtmlContainer = document.createElement("div"); qHtmlContainer.innerHTML = question.html; contentContainer.appendChild(qHtmlContainer); }; return new VisualizerBase( question, data, { renderContent: renderContent, dataProvider: options.dataProvider }, "htmlVisualizer" ); } VisualizationManager.registerVisualizer("html", CustomHtmlVisualizer);

I hope that either option works for you.

Regarding the second issue: to process it in the best manner, I created a separate ticket on your behalf.
Dropdown is not localized

Please refer to it for further correspondence.

Let me know if you have any questions regarding HTML visualization.

Thanks