Question T22663
Visible to All Users

Can the "pie / donut" chart flip axis?

created 8 days ago

Ideally, when you flip to a pie/donut chart for a matrix question, each pie/donut represents a "row" in the matrix, which is really a question on the survey. This is how the chart renders in a bar chart, which is correct:

Clipboard-File-1.png

However, when switching to a pie/donut (in order to see percentages of responses, which is important), the pies/donuts are organized by response type, not by question. Ideally each pie/donut below is a question vs a response type.

Clipboard-File-2.png

Answers approved by surveyjs Support

created 8 days ago (modified 8 days ago)

Hello,
I suggest that you use the allowTransposeData option to visualize a matrix by rows. Please refer to the following demo: View Plunker.

JavaScript
const vizPanel = new SurveyAnalytics.VisualizationPanel( survey.getAllQuestions(), dataFromServer, { allowDynamicLayout: false, allowHideQuestions: false, allowTransposeData: true } ); vizPanel.unregisterToolbarItem("resetFilter"); vizPanel.visualizers[0].setChartType("pie"); vizPanel.visualizers[0].transposeData = true;

Let me know if this option works for you.

    Comments (3)
    DR DR
    David Ruddall 8 days ago

      This is exactly what I was looking for. Thanks Jane!

        You're always welcome. May I mark this ticket as public?

        DR DR
        David Ruddall 8 days ago

          Yes