View Issue Details

This issue affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
13955Feature requestsStatisticspublic2026-11-19 19:32
Reportermikebb Assigned To 
PrioritynoneSeverityfeature 
Status closedResolutionfixed 
Summary13955: Add sub-question headings on simple statistics graphs
Description

Simple statistics would be much more useful if the graphs showing sub-question data had headings that matched the sub-question - not just the parent question heading that is currently shown.

More detail: In ‘simple statistics’ when viewing results for a sub-question, the graph heading show the parent question’s text when questions are arrays - even when the subquestions have their own texts. So all the subquestion graphs will show the same (parent) heading – and the user can’t easily tell which subquestion they are for. Its confusing.
Also if a sub-question’s parent does not have any text (ie it only has a title) then there is no heading shown for all sub-question graphs – so no indication of what the graph data is.

I've read that the devs are reluctant to patch the statistics code as it needs a re-write, but this could be fixed very easily with minimal coding - see additional info below.

there are there are two screenshots attached of a simple survey:

  • first with current code (LS 3.14.3+180809),
  • second with this suggested patch
Additional Information

following code in '/application/helpers/admin/statistics_helper.php':
/// ---------------
// insert at Line 1160- - before 'switch ($qtype){'
$parent_title = $qtitle;// save this as may use later for sub-question graph headings.

// insert before the return of buildOutputList(), line 1460
if (isset($atext ) && $atext){ // if there is subquestion text
$qquestion = rtrim($qquestion, $linefeed); // trim off the linefeed. (better if linefeed was added last, and not in switch conditions)
// shows parent-q text: sub-q text. or use parent title if need:
$qquestion .= ((trim($qquestion=='')) ? ucfirst($parent_title) : null) . ": " . $atext . $linefeed;
}
/// --------------------------

TagsNo tags attached.
Attached Files
Bug heat8
Git branch / Pull Request URL

Users monitoring this issue

There are no users monitoring this issue.

Activities

cdorin

cdorin

2019-07-17 16:43

reporter   ~52915

@dominikvitt, your thoughts?

markusd1984

markusd1984

2019-07-17 16:44

reporter   ~52916

great thanks, that worked a treat! Should be built into the new versions if it's not already.

Now an aggregated stacked bar chart would be ideal :) https://bugs.limesurvey.org/view.php?id=7420

gwdgls

gwdgls

2021-10-08 14:26

reporter   ~66812

Hi, is there any chance that this fix could be merged into the master branch? If the answer is yes, i could prepare an pull request with the solution mentioned here

c_schmitz

c_schmitz

2026-11-19 19:32

administrator   ~87464

This is available in current LimeSurvey: in the simple statistics view, each graph for an array subquestion now has a heading with the question text followed by the subquestion text in brackets, so you can tell the subquestion graphs apart. Closing this request. If you meant something different, feel free to reopen it.

Issue History

Date Modified Username Field Change
2018-08-12 11:46 mikebb New Issue
2018-08-12 11:46 mikebb File Added: simple stats - no subquestion headers.jpg
2018-08-12 11:46 mikebb File Added: simple stats MOD-parent and subquestion headers.jpg
2019-07-17 16:43 cdorin Note Added: 52915
2019-07-17 16:44 markusd1984 Note Added: 52916
2021-10-08 14:26 gwdgls Note Added: 66812
2021-10-08 14:26 gwdgls Bug heat 4 => 6
2026-11-19 19:32 c_schmitz Note Added: 87464
2026-11-19 19:32 c_schmitz Bug heat 6 => 8
2026-11-19 19:32 c_schmitz Status new => closed
2026-11-19 19:32 c_schmitz Resolution open => fixed