Skip to content

Fix Highcharts column chart not rendering second series when first series is all zeros#964

Merged
Redjaw merged 2 commits intomasterfrom
copilot/fix-column-chart-display-issue
Feb 25, 2026
Merged

Fix Highcharts column chart not rendering second series when first series is all zeros#964
Redjaw merged 2 commits intomasterfrom
copilot/fix-column-chart-display-issue

Conversation

Copy link
Contributor

Copilot AI commented Feb 25, 2026

In a Highcharts column chart with multiple series, if the first series contains all-zero values, the second series fails to render correctly (shows flat columns). This is a Velocity 2.x truthiness bug: #if(0) evaluates to false, so every data point of the zero-valued series is silently dropped, producing an empty data: [] array that corrupts subsequent series rendering.

Proposed changes

Root cause: In column_chart.vm, the guard condition #if($row.get($serieColumnsMapped)) skips rows where the series value is 0 because Velocity 2.3 treats integer/double zero as falsy.

Fix: Move the #set before the #if and replace the falsy guard with a null-safe string check:

## Before (buggy — drops zero values)
#foreach($row in $rows)
    #if( $row.get($serieColumnsMapped))
        #set ($serieValue = $row.get($serieColumnsMapped))

## After (fixed — includes zeros, excludes only null/empty)
#foreach($row in $rows)
    #set ($serieValue = $row.get($serieColumnsMapped))
    #if("$!serieValue" != "")

"$!serieValue" uses Velocity's null-safe interpolation: outputs "" for null (excluded) and "0" for zero (included). Consistent with the pattern already used in scatter_chart.vm.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Further comments

The reverse case (first series non-zero, second series all-zero) already worked correctly — it only fails when the first series is all zeros, because the empty data array shifts Highcharts' internal series index alignment. The fix is a 2-line change with no behavioral impact on non-zero or null values.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…ll-zero values

Co-authored-by: Redjaw <4438516+Redjaw@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix display issue in column chart with zero values Fix Highcharts column chart not rendering second series when first series is all zeros Feb 25, 2026
Copilot AI requested a review from Redjaw February 25, 2026 16:45
@Redjaw Redjaw marked this pull request as ready for review February 25, 2026 16:46
@github-actions
Copy link
Contributor

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request

@Redjaw Redjaw merged commit 0b2ded4 into master Feb 25, 2026
2 of 3 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants