Skip to content

Commit

Permalink
fix(*): fix the percentage issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayush8923 committed Aug 25, 2024
1 parent 5ea7317 commit c54dcef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fill_survey/survey_analysis.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ function calculate_pie_chart_data_by_question_category($interpretationdata, $que
$pieChartLabels = [];

foreach ($interpretationCounts as $interpretation => $count) {
$percentage = (1 / count($interpretationCounts)) * 100;
$percentage = ($count / array_sum($interpretationCounts)) * 100;
$pieChartData[] = number_format($percentage, 1);
$pieChartLabels[] = $interpretation;
}
Expand Down

0 comments on commit c54dcef

Please sign in to comment.