Bug #18912
closedWhite empty segment in compliance bar due to computation bug
Description
The width of the progressbar segments is calculated incorrectly.
If a segment gets a fixed width (I guess to prevent it from becoming too small), then the rest of the calculations are no longer correct.
Example:
A progress bar with three segments:
- green (Compliant 83.43% + not applicable 12.39%)
- orange (non compliant 1,5%)
- gray (no report 2,69%)
The generated CSS:
<div class="progress"> <div class="progress-bar progress-bar-success" style="width:calc( (100% - 8px) * 0.96)" title="Compliant: 83.43% <br> Not applicable (audit): 12.39% <br> "><span>96%</span></div> <div class="progress-bar progress-bar-audit-noncompliant" style="width:8px" title="Non compliance: 1.50%"><span></span></div> <div class="progress-bar progress-bar-no-report" style=" width:calc( (100% - 8px) * 0.03)" title="No report: 2.69%"><span></span></div> </div>
If one segment is treated specially and is no longer taken into account in the percentage calculation, then the remaining segments must again add up to 100%.
The whole progress bar div has a width of 711px
711px - 8px - ((711px - 8px) * (0.96 + 0.03)) = 7.03
So in this example, 7px are shown as a white empty "segment" at the end of the progress bar.
Updated by Alexis Mousset almost 4 years ago
- Subject changed from Math in Progressbars is wrong to Math in compliance bar is wrong
- Assignee set to Raphael GAUTHIER
Updated by Alexis Mousset almost 4 years ago
- Subject changed from Math in compliance bar is wrong to White empty segment in compliance bar dur to computation bug
Updated by Alexis Mousset almost 4 years ago
Thank you for the detailed bug report!
Updated by François ARMAND almost 4 years ago
- Related to Bug #12643: Compliance bar appears partially white in some graphes added
Updated by François ARMAND almost 4 years ago
- Related to Bug #10773: Rounding error in compliance bar can hide error with very small percent added
Updated by François ARMAND almost 4 years ago
- Related to Bug #10761: Screen estate in compliance graph added
Updated by François ARMAND almost 4 years ago
I added the old related tickets on compliance bar computing and rounding errors.
@Lars: you are right that we keep some segment at a given size to avoid having them become too small, we had some cases where when there was just one error on thousand of components, the error was not viewable at all, which was a risk.
Updated by François ARMAND almost 4 years ago
- Subject changed from White empty segment in compliance bar dur to computation bug to White empty segment in compliance bar due to computation bug
Updated by Vincent MEMBRÉ over 3 years ago
- Target version changed from 6.2.3 to 6.2.4
Updated by Vincent MEMBRÉ over 3 years ago
- Target version changed from 6.2.4 to 6.2.5
Updated by Vincent MEMBRÉ over 3 years ago
- Target version changed from 6.2.5 to 6.2.6
Updated by Vincent MEMBRÉ over 3 years ago
- Target version changed from 6.2.6 to 6.2.7
Updated by Vincent MEMBRÉ over 3 years ago
- Target version changed from 6.2.7 to 6.2.8
- Priority changed from 50 to 49
Updated by Vincent MEMBRÉ over 3 years ago
- Target version changed from 6.2.8 to 6.2.9
- Priority changed from 49 to 48
Updated by Vincent MEMBRÉ over 3 years ago
- Target version changed from 6.2.9 to 6.2.10
- Priority changed from 48 to 47
Updated by Vincent MEMBRÉ about 3 years ago
- Target version changed from 6.2.10 to 6.2.11
- Priority changed from 47 to 46
Updated by Vincent MEMBRÉ about 3 years ago
- Target version changed from 6.2.11 to 6.2.12
- Priority changed from 46 to 44
Updated by Vincent MEMBRÉ almost 3 years ago
- Target version changed from 6.2.12 to 6.2.13
Updated by François ARMAND almost 3 years ago
- Status changed from New to Resolved
- Priority changed from 44 to 42
This is corrected in 7.0.