richardfogaca opened a new pull request, #38675:
URL: https://github.com/apache/superset/pull/38675

   ### SUMMARY
   This change prevents ECharts plain/list legends from getting clipped in 
dashboards when there are too many legend entries to fit in the available space.
   
   It centralizes plain-legend layout estimation in the shared ECharts series 
utilities, falls back to scroll legends when plain legends would overflow, and 
applies the behavior across the affected chart plugins. It also adds the extra 
timeseries pass needed for horizontal bottom legends, where legend margin 
expansion can further reduce the available legend width after the first layout 
decision.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   Skipped per request.
   
   ### TESTING INSTRUCTIONS
   1. In Explore, create a Bar Chart using the example dataset with:
      - X-axis: `product_line`
      - Metric: `COUNT(*)`
      - Dimension: `contact_first_name`
      - Legend enabled
      - Legend type set to plain/list
   2. Save the chart and add it to a dashboard.
   3. Verify the dashboard legend is not clipped and falls back to paged/scroll 
legend behavior when it does not fit.
   4. Verify the horizontal bar plus bottom legend case still renders without 
clipping.
   
   Automated validation run locally:
   - `pre-commit run --all-files`
     - repo-wide run was attempted, but it is still blocked in this environment 
by missing `oxlint` native bindings and missing `helm-docs`
   - `npm run type -- --pretty false`
   - `npx jest --runInBand --silent --runTestsByPath 
plugins/plugin-chart-echarts/test/utils/series.test.ts 
plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts 
plugins/plugin-chart-echarts/test/Timeseries/Bar/transformProps.test.ts 
plugins/plugin-chart-echarts/test/Gantt/transformProps.test.ts 
plugins/plugin-chart-echarts/test/Pie/transformProps.test.ts`
   
   Manual validation run locally:
   - Reproduced the reported dashboard scenario in local Superset using 
`cleaned_sales_data`, which exposes the same `product_line` and 
`contact_first_name` fields needed for the repro
   - Verified the dashboard chart no longer clips the legend
   - Verified the horizontal bar + bottom legend boundary case
   - Verified one non-timeseries spot check with Pie Chart
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] 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
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to