Skip to content

fix(radar): correct legend margin control in the radar chart#39414

Open
vhogberg wants to merge 2 commits intoapache:masterfrom
vhogberg:fix/radar-chart-legend-margin-control
Open

fix(radar): correct legend margin control in the radar chart#39414
vhogberg wants to merge 2 commits intoapache:masterfrom
vhogberg:fix/radar-chart-legend-margin-control

Conversation

@vhogberg
Copy link
Copy Markdown

@vhogberg vhogberg commented Apr 16, 2026

SUMMARY

Margin control on the legend of radar charts had no effect. Compute a shifted center based on legendMargin and legendOrientation to move the chart in the appropriate direction and make room for the legend.

What changed

  • Added LegendOrientation import and used it to compute radar center offsets.
  • Introduced legend-margin-based positioning logic:
  • resolvedMargin from legendMargin (only when showLegend is true).
  • offsetX / offsetY calculated from chart width/height.
  • centerX / centerY defaults (50, 50) adjusted by legend orientation.
  • New radarCenter passed into radar config via center.

TESTING INSTRUCTIONS

Create a Radar Chart with at least 3–5 categories/series so legend is visible. Then, in the control panel:

  • Enable Show legend.
  • Set legend position to Left, then vary Legend margin (e.g. 0, 20, 60, 120).
  • Repeat for Right, Top, and Bottom.
  • The radar plot center shifts in the expected axis direction based on legend orientation.
  • Increasing legend margin increases separation from the legend area.
  • No overlap/clipping regressions for labels or radar shape.

ADDITIONAL INFORMATION

  • Has associated issue:
  • 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 the viz:charts:radar Related to the Radar chart label Apr 16, 2026
Copy link
Copy Markdown
Contributor

@bito-code-review bito-code-review bot left a comment

Choose a reason for hiding this comment

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

Code Review Agent Run #93a151

Actionable Suggestions - 1
  • superset-frontend/plugins/plugin-chart-echarts/src/Radar/transformProps.ts - 1
Review Details
  • Files reviewed - 1 · Commit Range: 345ea28..345ea28
    • superset-frontend/plugins/plugin-chart-echarts/src/Radar/transformProps.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

@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review bot commented Apr 16, 2026

Code Review Agent Run #b2da41

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 345ea28..94f210c
    • superset-frontend/plugins/plugin-chart-echarts/src/Radar/transformProps.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 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

@vhogberg vhogberg changed the title fix: correct legend margin control in the radar chart fix(radar): correct legend margin control in the radar chart Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugins size/S viz:charts:radar Related to the Radar chart

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant