Show scale results as average next to a donut chart
CI / Deploy / test (push) Successful in 1m8s
CI / Deploy / deploy (push) Skipped

Average and distribution now sit side by side: a big average figure with
its gauge or stars, and the distribution as a donut (CSS conic-gradient,
shades of one colour, legend with percent and count). A single dropdown
setting scale_view (both, average only, chart only) replaces the two
checkboxes; a single part is centred.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Opus 5.5 committed 2026-11-11 13:38:58 +01:00
1 parent bf16ac0d3b
commit b3c80ab79f
8 files changed
+185 -192

No files matched your search

+3 -4
View File
@@ -21,8 +21,8 @@ use Cake\ORM\Locator\LocatorAwareTrait;
* 'min', 'max', 'minLabel', 'maxLabel', 'private' (bool), 'stars' (bool: star rating, min = 1);
* 'comments' => [['id', 'text', 'value' (int|null)]] oldest first (only with the comment field, else [];
* 'value' is null unless the setting comment_ratings is on;
* 'showAverage', 'showDistribution' (bool): parts shown in the presentation (settings
* show_average/show_distribution, the data is always complete);
* 'view' (both|average|chart): parts shown in the presentation (setting scale_view,
* the data is always complete);
* presentation only: participants never get results of scale slides, see PollStateService);
* open/scale with 'private' (anonymous/internal feedback): contents are included for the
* presenter/embed, which start with the results hidden and may show them on demand;
@@ -337,8 +337,7 @@ class ResultsService
return $this->scaleResults($slide) + [
'private' => $slide->isPrivate(),
'comments' => $comments,
'showAverage' => (bool)$slide->setting('show_average'),
'showDistribution' => (bool)$slide->setting('show_distribution'),
'view' => $slide->setting('scale_view'),
];
}