Skip to content

fix: correct severity bar chart position in open_findings chart - #15601

Open
tejas0077 wants to merge 1 commit into
DefectDojo:bugfixfrom
tejas0077:fix/severity-chart-bar-position
Open

fix: correct severity bar chart position in open_findings chart#15601
tejas0077 wants to merge 1 commit into
DefectDojo:bugfixfrom
tejas0077:fix/severity-chart-bar-position

Conversation

@tejas0077

Copy link
Copy Markdown
Contributor

Fixes #15547

Severity bars in the open_findings chart were always rendered under the first X-axis category (Critical) regardless of actual severity.

The root cause was _vals() extracting only the count value d[1] from each [x, count] pair, discarding the x-position. Chart.js then placed every dataset's single value at index 0 (Critical).

Added _sevVals(data, labels) which maps each [x, count] pair to the correct position in a zero-filled array matching the labels length, so each severity bar now renders under its correct X-axis category.

Manually traced the bug through _vals() and _sevStackedBar(). The fix correctly maps severity index to chart position. No automated tests needed for a JS chart rendering fix.

No documentation changes needed.

Bars were always rendered under the first X-axis category (Critical)
regardless of actual severity. _vals() only extracted count values,
discarding x-position info. Chart.js then placed all bars at index 0.

Added _sevVals() which maps each [x, count] pair to the correct
position in a zero-filled array of length equal to number of labels,
so each severity bar renders under its correct X-axis category.

Fixes DefectDojo#15547
@github-actions github-actions Bot added the ui label Aug 10, 2026
@mtesauro mtesauro added this to the 3.2.200 milestone Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants