Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A Bar Chart displays the percentage of a specific option among the subset of responses that include that question #383

Closed
JaneSjs opened this issue Dec 11, 2023 · 1 comment
Labels
question user issue An issue or bug reported by users

Comments

@JaneSjs
Copy link
Contributor

JaneSjs commented Dec 11, 2023

User Issue: T15958 - SurveyJS Dashboard - Checkbox question displays percentages with wrong base
https://surveyjs.answerdesk.io/internal/ticket/details/T15958


A Bar Chart displays the percentage of a specific option among the subset of responses that include that question. It is expected that the chart calculates percentages based on the total number of survey submissions, considering all the responses as part of the dataset.

Consider this example: View CodeSandbox.

const surveyResults = [
  {
    question1: 1,
    question2: ["Item 2"],
  },
  {
    question1: 2,
    question2: ["Item 2"],
  },
  {
    question1: 3,
    question2: ["Item 1"],
  },
  {
    question1: 4,
  },
  {
    question1: 5,
  },
];

You can see that a survey was submitted five times, however, the chart calculates the percentage only over those three question2 submissions:
image

It is expected that the chart calculates the percentage based on all survey submittions. So it should appear as follows:
image

@JaneSjs JaneSjs added the user issue An issue or bug reported by users label Dec 11, 2023
@JaneSjs
Copy link
Contributor Author

JaneSjs commented Mar 19, 2024

SurveyJS Dashboard displays percentage of a specific option among the subset of responses that include the related question. We do this because when there are many submissions, the total number might make percentages less meaningful.

Therefore, a Bar Chart displays percentages based on the subset of responses with that specific question. We don't plan to change this for now but may reconsider in the future.

@tsv2013 tsv2013 closed this as completed Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question user issue An issue or bug reported by users
Projects
None yet
Development

No branches or pull requests

2 participants