Hi,
I have registered SelectBasePlotly visualizer for questions of rating type, this works as expected however one thing I have noticed is that the other comments and items are rendered twice for any questions that have the comments property enabled.
Is there a way I can make this only appear the once?
I have attached my JS and a screenshot of the issue for reference.
Thanks,
Greg
JavaScriptclass RatingPlotly extends SurveyAnalytics.SelectBasePlotly {
valuesSource() {
return this.question.visibleRateValues;
}
}
SurveyAnalytics.VisualizationManager.registerVisualizer("rating", RatingPlotly);
SurveyAnalytics.localization.locales["en"]["visualizer_selectBase"] =
"Plotly";
SurveyAnalytics.localization.locales["en"]["visualizer_number"] =
"Average";
var survey = new Survey.Model(@Html.Raw(Model.CadetModule.Survey.SurveyJson));
var allQuestions = survey.getAllQuestions();
var summary = document.getElementById("summary");
summary.innerHTML = "";
var table = document.getElementById("table");
table.innerHTML = ""
var data = @Html.Raw(Model.Results);
console.log(data);
var visPanel = new SurveyAnalytics.VisualizationPanel(
allQuestions.filter(q => q.getType() !== "html"),
data,
);
//used to filter out html question types from table view
var columns = allQuestions.filter(function(question) { return question.getType() !== "html"; }).map(function (question) {
return {
name: question.name,
displayName: (question.title || "").trim() || question.name,
dataType:
question.getType() !== "file" ? 0 : 1,
isVisible: true,
isPublic: true,
location: 0, // column
};
});
var surveyAnalyticsTabulator = new SurveyAnalyticsTabulator.Tabulator(survey, data, undefined, columns);
visPanel.showHeader = true;
surveyAnalyticsTabulator.render(table)
$("#graphLoadingIndicator").hide();
visPanel.render(summary);
$("#tableLoadingIndicator").hide();