Repository navigation
Fix white ApexCharts backgrounds under dark themes (deepness) by setting chart.background from the theme - #54
Merged
Conversation
…emes (deepness) no longer render white chart surfaces
TheWitness
requested review from
bmfmancini and
xmacan
and
a balanced review from Copilot
October 9, 2026 20:44
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused implementation is consistent across all chart types and adequately covered by existing theme tests.
0 open findings
What changed in this PR
Adds theme-aware ApexCharts backgrounds so charts blend correctly with dark Cacti themes.
Changes:
- Resolves chart backgrounds from
back, thencanvas, then white. - Applies the background to bar, box, and upload donut charts.
- Extends theme tests and documents the fix.
| File | Description |
|---|---|
includes/functions.php |
Adds normalized background color resolution. |
slowlog.php |
Applies the background to all ApexCharts instances. |
tests/Unit/ApexThemeTest.php |
Tests theme backgrounds and fallback behavior. |
CHANGELOG.md |
Records the dark-theme rendering fix. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
cigamit
approved these changes
Oct 9, 2026
bmfmancini
approved these changes
Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR #53 skinned the ApexCharts views from the active Cacti theme's
rrdtheme.php,but only wired up the text (
foreColor), gridlines (gridColor), and thedonut track. It never set the ApexCharts
chart.background, so ApexCharts keptpainting its default white plot surface regardless of the computed
theme.mode. Under any dark theme (e.g.deepness) the By Method / By Table barand box charts — and the import upload donut — still rendered as white boxes on a
dark page.
Details
slowlog_apex_theme()now also resolves the active theme's own panelbackground: the
rrdtheme.phpbackcolor, falling back to the plottingcanvas, then to white for light-theme defaults. It is normalized the same wayas the font/grid colors and returned as a new
backgroundkey.chart.backgroundon all three charts: the barchart (
renderChart), the box chart (renderBoxChart), and the upload donut(
initDonut).deepness, this resolves to#11161d(itsback), so the charts now matchthe surrounding dark panels instead of showing white.
No behavioral change to data, imports, or chart contents — colors only.
Testing
php -lclean onincludes/functions.php,slowlog.php, and the test file.tests/Unit/ApexThemeTest.phpextended:backadded to the dark fixture, a newcanvas-only fixture to cover the
back→canvasfallback, andbackgroundassertions on the light, dark, canvas-fallback, and missing-theme cases.