Skip to content

fix(chart): prevent stacking bars on a logarithmic axis - #44556

Merged
rusackas merged 5 commits into
apache:masterfrom
deepujain:fix-25829-stacked-log-axis
Sep 29, 2026
Merged

rusackas merged 5 commits into
apache:masterfrom
deepujain:fix-25829-stacked-log-axis

Conversation

@deepujain

Copy link
Copy Markdown
Contributor

SUMMARY

Stacked bars on a logarithmic axis can lose visible segments, as reported in #25829. This applies the requested control-panel guard: logarithmic mode disables the Stacked Style selector, and choosing a stacked style hides the logarithmic option. Turning the active setting off makes the other option available again.

A saved chart with both values already set keeps both controls accessible so the user can clear either setting. Its stored configuration and existing rendering are not silently rewritten. The change is limited to the ECharts Bar panel; shared controls, line/area charts and Mixed Timeseries remain unchanged. The logarithmic option uses the panel's visibility mechanism because the shared CheckboxControl does not support a disabled state.

Fixes #25829

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Isolated production SelectControl and CheckboxControl components in Storybook, using the Bar panel configuration. These show the control interaction, not a full Explore page or a database-backed chart.

Before: stacking selectable with log enabled After: stacking disabled with log enabled
Before After

Stacked mode and a saved invalid combination with a recovery path.

TESTING INSTRUCTIONS

  1. In an ECharts Bar chart, enable Logarithmic axis. Stacked Style is disabled; turning logarithmic mode off restores it.
  2. Select Stack. The logarithmic toggle is hidden; clearing stacking restores it. Check horizontal and vertical orientations.
  3. Open a saved chart whose stack and log settings are both enabled. Either setting can be cleared, without trapping the user behind two disabled controls.

Local checks:

  • jest plugins/plugin-chart-echarts/test/Timeseries/Bar/controlPanel.test.ts plugins/plugin-chart-echarts/test/Timeseries/Bar/transformProps.test.ts plugins/plugin-chart-echarts/test/MixedTimeseries/controlPanel.test.ts --runInBand: 61 tests passed with Node 24.16.0. The five new guard cases fail against the original panel.
  • npm run plugins:build: passed, including declaration generation.
  • Staged-file pre-commit run: all applicable hooks passed, including frontend type checking.
  • Chromium exercised the real production controls in isolated Storybook for normal, logarithmic, stacked and saved-invalid states, including recovery interactions. Full application E2E and database-backed chart rendering were not run locally.

ADDITIONAL INFORMATION

  • Has associated issue: Incomplete chart drawing in logarithmic scale #25829
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@bito-code-review

bito-code-review Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #723478

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/Bar/controlPanel.test.ts - 1
    • Missing truth-table test case · Line 371-374
      This `test.each` enumerates the `logAxis` x `stack` interaction for `controlOverrides.stack.mapStateToProps` (`disabled: Boolean(logAxis) && !stack` in `src/Timeseries/Regular/Bar/controlPanel.tsx`), but omits the `logAxis=false, stack=Stack` row. The three present rows cover each factor individually plus the conjunction; adding the fourth row pins the last quadrant so a future operator change (e.g. `&&` becoming `||`) cannot slip through silently.
Review Details
  • Files reviewed - 2 · Commit Range: b7f5c8e..b7f5c8e
    • superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx
    • superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/Bar/controlPanel.test.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers an incremental AI Review.

  • /review full - Manually triggers a full AI Review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@github-actions github-actions Bot added the i18n Namespace | Anything related to localization label Sep 23, 2026
@deepujain

Copy link
Copy Markdown
Contributor Author

Added both new control messages to messages.pot in 32494b9. The new Babel job no longer reports either Bar-control string. Its remaining failure is the pre-existing credential-destination message rename: the same missing/stale pair is present at base 61fffbe. I verified the patch and base with the pinned Babel 2.17 extractor; no additional message drift is introduced by this change.

The focused 61-test run and staged frontend hooks passed. The public screenshots exercise the production controls in isolated Storybook; they do not claim full application or database-backed chart validation.

@codecov

codecov Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.05%. Comparing base (61fffbe) to head (c313d0e).
⚠️ Report is 32 commits behind head on master.

Files with missing lines Patch % Lines
...charts/src/Timeseries/Regular/Bar/controlPanel.tsx 85.71% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #44556       +/-   ##
===========================================
+ Coverage   66.22%   81.05%   +14.82%     
===========================================
  Files        2949     2954        +5     
  Lines      177381   178119      +738     
  Branches    41107    41248      +141     
===========================================
+ Hits       117469   144367    +26898     
+ Misses      57409    31042    -26367     
- Partials     2503     2710      +207     
Flag Coverage Δ
hive 36.79% <ø> (-0.14%) ⬇️
javascript 76.37% <85.71%> (-0.01%) ⬇️
mysql 55.98% <ø> (-0.17%) ⬇️
postgres 55.98% <ø> (-0.17%) ⬇️
presto 38.69% <ø> (-0.18%) ⬇️
python 85.37% <ø> (+28.89%) ⬆️
sqlite 55.71% <ø> (-0.17%) ⬇️
unit 77.64% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bito-code-review

bito-code-review Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #0c1f7b

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: b7f5c8e..32494b9
    • superset/translations/messages.pot
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers an incremental AI Review.

  • /review full - Manually triggers a full AI Review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

…rol truth table

The test.each for controlOverrides.stack.mapStateToProps covered three of
the four logAxis x stack quadrants. Add the missing logAxis=false,
stack=Stack row (disabled=false per Boolean(logAxis) && !stack).
@deepujain

Copy link
Copy Markdown
Contributor Author

Good catch on the missing truth-table row (bito review #0c1f7b). Added the missing [false, StackControlsValue.Stack, false] row in eb418e3 and verified all four rows against the mapStateToProps formula (disabled: Boolean(logAxis) && !stack).

@netlify

netlify Bot commented Sep 23, 2026

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit eb418e3
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6ab39e3c7cdda00008980dca
😎 Deploy Preview https://deploy-preview-44556--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@bito-code-review

bito-code-review Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #07f66a

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 32494b9..eb418e3
    • superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/Bar/controlPanel.test.ts
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers an incremental AI Review.

  • /review full - Manually triggers a full AI Review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

Upstream apache#44574 landed the messages.pot regeneration on master; the
babel-extract and unit-tests (check_pot_drift_test.py) failures on this PR
were base drift, not contributor code. Fresh CI will run against the new
merge commit with the fixed base pot.

@EnxDev EnxDev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went through this against the explore wiring and it holds up. controlOverrides merges shallowly onto the shared stack control, SelectControl does forward disabled and warning, and CheckboxControl really has no disabled state, so hiding the checkbox is a fair call. The saved-chart recovery path works the way the description says.

Two small notes inline: the new checkbox tooltip mostly shows up in the state where it's wrong, and the tests don't pin the warning text, which is the only explanation users get.

renderTrigger: true,
default: logAxis,
description: t('Logarithmic axis'),
description: t('Logarithmic axis is not available for stacked bars'),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The checkbox is hidden whenever bars are stacked, so outside the saved stack+log case this tooltip is only seen when log is available, and there it reads as if it isn't.

I'd keep the original description here and let the stack warning carry the explanation.

Suggested change
description: t('Logarithmic axis is not available for stacked bars'),
description: t('Logarithmic axis'),

(That also drops the new msgid from messages.pot.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in c313d0e: restored the original description and removed the new translation entry. The stack warning carries the explanation. Current-head checks have completed successfully.

type: 'SelectControl',
value: stack,
}),
).toMatchObject({ disabled });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, take it or leave it. This only checks disabled, but the warning is the one thing telling the user why Stacked Style is greyed out, and nothing fails if it goes missing.

Suggested change
).toMatchObject({ disabled });
).toMatchObject({
disabled,
warning: logAxis ? expect.any(String) : null,
});

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in c313d0e: the four-row test now also checks that warning is a string with log enabled and null otherwise. Current-head checks have completed successfully.

Address EnxDev's review notes on the Bar log-axis/stack guard: the new
checkbox tooltip only surfaced in the state where it reads wrong, so the
original description is kept (also dropping its new msgid from
messages.pot), and the stack-control test now pins the warning text via
toMatchObject.

Signed-off-by: Deepak Jain <[email protected]>
@deepujain

Copy link
Copy Markdown
Contributor Author

Addressed both EnxDev review notes in commit c313d0e:

  1. Tooltip: reverted to the original t('Logarithmic axis') description in controlPanel.tsx (the stack warning carries the explanation now), and dropped the new msgid from messages.pot.
  2. Test: controlPanel.test.ts now pins the warning text via toMatchObject({ disabled, warning: logAxis ? expect.any(String) : null }), verified against the exact mapStateToProps formula for all four truth-table rows.

Fresh CI is running on the new head.

@bito-code-review

bito-code-review Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #254560

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx - 1
    • Redundant control description · Line 249-249
      The new `description` on the `logAxis` control is identical to its `label` (both `t('Logarithmic axis')`), so the helper text adds no information. Either drop the `description` or give it meaningful guidance (e.g. about the stack interaction now surfaced via the `stack` control warning).
Review Details
  • Files reviewed - 3 · Commit Range: eb418e3..c313d0e
    • superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx
    • superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/Bar/controlPanel.test.ts
    • superset/translations/messages.pot
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers an incremental AI Review.

  • /review full - Manually triggers a full AI Review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@deepujain

Copy link
Copy Markdown
Contributor Author

No change needed here. The identical description is upstream master's original text (controlPanel.tsx line 249), restored verbatim per EnxDev's review note on this PR to drop the new tooltip. The stack interaction it suggests documenting is already surfaced by the stack control's warning text pinned in the test. Closing as pre-existing, reviewer-directed.

@EnxDev EnxDev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up to my earlier pass.

Both notes are handled in c313d0e: the log checkbox is back to its original description with the extra msgid gone from messages.pot, and the truth-table test now pins warning alongside disabled for all four rows. Agree with leaving Bito's redundant-description point alone, that text is what master already ships.

Took another look at the rest and nothing new from me. Nothing on master has touched the Bar panel or the shared stack control since you branched, so this looks good to go from my side.

@EnxDev
EnxDev requested a review from rusackas September 28, 2026 13:15

@rusackas rusackas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Checked the mechanism EnxDev called out, SelectControl does forward disabled/warning, and CheckboxControl really has no disabled prop, so hiding logAxis instead of disabling it is the right call. The stack override's four-row truth table checks out too. Nothing left open from either round of review.

@rusackas
rusackas merged commit 697b056 into apache:master Sep 29, 2026
83 checks passed
villebro pushed a commit that referenced this pull request Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

i18n Namespace | Anything related to localization plugins risk:chart-metadata size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incomplete chart drawing in logarithmic scale

3 participants