Skip to content

fix(echarts): format mixed timeseries value labels by assigned axis#40420

Open
innovark37 wants to merge 1 commit into
apache:masterfrom
innovark37:innovark/fix/mixed-timeseries-value-label-axis-format
Open

fix(echarts): format mixed timeseries value labels by assigned axis#40420
innovark37 wants to merge 1 commit into
apache:masterfrom
innovark37:innovark/fix/mixed-timeseries-value-label-axis-format

Conversation

@innovark37
Copy link
Copy Markdown
Contributor

SUMMARY

Fixes Mixed Timeseries value labels using the wrong Y-axis formatter when Query A and Query B are assigned to different Y axes.

Previously, value labels were formatted based on the query slot instead of the assigned axis:

  • Query A used the primary Y-axis formatter.
  • Query B used the secondary Y-axis formatter.

This was incorrect when a query was assigned to the opposite axis. The fix selects the formatter from the series’ assigned yAxisIndex / yAxisIndexB, matching tooltip and Y-axis tick formatting behavior.

Bar value-label clipping is also aligned with the assigned Y-axis bounds.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

BEFORE
image
image

AFTER
{1984C82B-389C-49BE-B8E3-8927D5D2D69D}
{43516732-6307-4374-B0CA-F1E83BCF1F55}

TESTING INSTRUCTIONS

Manual verification:

  1. Create a Mixed Timeseries chart.
  2. Configure Query A as a line chart and assign it to the secondary Y-axis.
  3. Configure Query B as a bar chart and assign it to the primary Y-axis.
  4. Enable value labels with Show Values.
  5. Set the primary Y-axis format to .0%.
  6. Set the secondary Y-axis format to ,.1f.
  7. Verify Query A line value labels use the secondary Y-axis format.
  8. Verify Query B bar value labels use the primary Y-axis format.
  9. Reverse the Y-axis assignments and verify labels follow the assigned axis.

ADDITIONAL INFORMATION

  • Has associated issue: Fixes [Bug] Mixed Timeseries Chart value labels use the wrong Y-axis formatter #40419
  • 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

@dosubot dosubot Bot added viz:charts:echarts Related to Echarts viz:charts:timeseries Related to Timeseries labels May 25, 2026
@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented May 25, 2026

Code Review Agent Run #b07504

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/transformProps.test.ts - 1
    • Naming: Inconsistent verb prefix · Line 164-172
      The function name `getSeriesWithLabelFormatter` uses `get` prefix while related extraction helpers in this codebase (e.g., `getYAxisFormatter` in Timeseries/transformProps.test.ts:84, `extractSeries` in series.ts) use `extract` or `get` consistently. For verb consistency across related helper functions, prefer `extractSeriesWithLabelFormatter` or `getSeriesLabelFormatter`. ([CWE-1104](https://cwe.mitre.org/data/definitions/1104.html))
Review Details
  • Files reviewed - 2 · Commit Range: 7d62155..7d62155
    • superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts
    • superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/transformProps.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 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 evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.20%. Comparing base (33585b0) to head (7d62155).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #40420   +/-   ##
=======================================
  Coverage   64.20%   64.20%           
=======================================
  Files        2592     2592           
  Lines      139226   139234    +8     
  Branches    32326    32329    +3     
=======================================
+ Hits        89386    89394    +8     
  Misses      48305    48305           
  Partials     1535     1535           
Flag Coverage Δ
javascript 67.34% <100.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

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.

[Bug] Mixed Timeseries Chart value labels use the wrong Y-axis formatter

1 participant