statistics: add parentheses around percentage in horizontal bars

For better visual guidance, format labels as "count (percentage)"
in horizontal bar charts. In vertical bar charts two lines are used
anyway.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-01-03 11:19:56 +01:00 committed by Dirk Hohndel
parent e47878cbce
commit 9759d5b21a

View file

@ -287,7 +287,7 @@ static std::vector<QString> makePercentageLabels(int count, int total, bool isHo
QString countString = QString("%L1").arg(count);
QString percentageString = QString("%L1%").arg(percentage, 0, 'f', 1);
if (isHorizontal)
return { QString("%1 %2").arg(countString, percentageString) };
return { QString("%1 (%2)").arg(countString, percentageString) };
else
return { countString, percentageString };
}