Skip to content

fix(plugin-chart-echarts): prevent trendline stroke clipping at chart edges#37918

Merged
EnxDev merged 6 commits into
masterfrom
fix-bignumber-trendline-stroke
Jul 3, 2026
Merged

fix(plugin-chart-echarts): prevent trendline stroke clipping at chart edges#37918
EnxDev merged 6 commits into
masterfrom
fix-bignumber-trendline-stroke

Conversation

@mistercrunch

Copy link
Copy Markdown
Member

SUMMARY

The Big Number with Trendline chart clips/truncates the line stroke at the edges of the viewport (especially at X=0). This happens because when axes are hidden, the ECharts grid is set to zero padding on all sides. Since the line stroke extends beyond the data point by half its width, pixels at the boundary get cut off.

This fix:

  • Explicitly sets lineStyle.width on the trendline series (was previously relying on ECharts default)
  • Adds strokeWidth / 2 padding to the grid on all sides when axes are hidden, so the full stroke is visible

The padding is derived from the line width rather than hardcoded, so it scales correctly if the stroke width changes.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before: Trendline stroke is truncated at the left edge (X=0) by ~1px
After: Full stroke is visible with minimal padding that accommodates the stroke width

TESTING INSTRUCTIONS

  1. Create a Big Number with Trendline chart
  2. Ensure "Show X Axis" and "Show Y Axis" are both unchecked (default)
  3. Observe that the trendline stroke is no longer clipped at the left/right/top/bottom edges
  4. Enable either axis and verify the chart still uses the standard TIMESERIES_CONSTANTS grid offsets

ADDITIONAL INFORMATION

  • Has associated issue: Fixes [cosmetic] Big Number with Trendline viewport truncates stroke where X=0 #33454
  • 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 Feb 12, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #3d4613

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: f14114b..f14114b
    • superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/transformProps.ts
    • superset-frontend/plugins/plugin-chart-echarts/test/BigNumber/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

@mistercrunch
mistercrunch force-pushed the fix-bignumber-trendline-stroke branch from f14114b to 0a64ec2 Compare February 12, 2026 01:57
@bito-code-review

bito-code-review Bot commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #6ac3b5

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 0a64ec2..0a64ec2
    • superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/transformProps.ts
    • superset-frontend/plugins/plugin-chart-echarts/test/BigNumber/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

… edges

The BigNumber with Trendline chart was clipping the line stroke at the
edges (especially X=0) because the ECharts grid had zero padding when
axes were hidden. The stroke extends beyond the data point by half its
width, so pixels at the boundary were truncated by the viewport.

Add half-strokeWidth padding to the grid on all sides when axes are
hidden, and explicitly set lineStyle.width so the padding stays in sync
with the actual stroke size.

Fixes #33454

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@mistercrunch
mistercrunch force-pushed the fix-bignumber-trendline-stroke branch from 0a64ec2 to 12e1917 Compare February 12, 2026 15:18
@bito-code-review

bito-code-review Bot commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #a030e8

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 12e1917..12e1917
    • superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/transformProps.ts
    • superset-frontend/plugins/plugin-chart-echarts/test/BigNumber/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

@rusackas
rusackas requested review from EnxDev and rusackas February 24, 2026 18:22
@EnxDev EnxDev added the 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR label Feb 24, 2026
@github-actions github-actions Bot added 🎪 12e1917 🚦 building 🎪 ⌛ 48h Environment expires after 48 hours (default) and removed 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR labels Feb 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime is building environment on GHA for 12e1917

@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime deployed environment on GHA for 12e1917

Environment: http://16.148.73.141:8080 (admin/admin)
Lifetime: 48h auto-cleanup
Updates: New commits create fresh environments automatically

@EnxDev

EnxDev commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

From manual testing, I see that a scroll bar has appeared.

after.mov

@bito-code-review

bito-code-review Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #1ae351

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 12e1917..d42d6c8
    • superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/transformProps.ts
    • superset-frontend/plugins/plugin-chart-echarts/test/BigNumber/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

@pull-request-size pull-request-size Bot added size/M and removed size/S labels Jul 1, 2026
@rusackas rusackas added merge-if-green If approved and tests are green, please go ahead and merge it for me and removed size/M labels Jul 1, 2026
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

🎪 Showtime is building environment on GHA for 44a0738

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

🎪 Showtime deployed environment on GHA for 44a0738

Environment: http://35.89.211.85:8080 (admin/admin)
Lifetime: 48h auto-cleanup
Updates: New commits create fresh environments automatically

@EnxDev EnxDev removed size/M 🎪 ⌛ 48h Environment expires after 48 hours (default) labels Jul 1, 2026
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.45%. Comparing base (692f81d) to head (7674163).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #37918    +/-   ##
========================================
  Coverage   64.45%   64.45%            
========================================
  Files        2670     2670            
  Lines      147343   147201   -142     
  Branches    33988    33953    -35     
========================================
- Hits        94966    94882    -84     
+ Misses      50650    50610    -40     
+ Partials     1727     1709    -18     
Flag Coverage Δ
javascript 69.14% <100.00%> (-0.02%) ⬇️

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-if-green If approved and tests are green, please go ahead and merge it for me plugins size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[cosmetic] Big Number with Trendline viewport truncates stroke where X=0

5 participants