codeant-ai-for-open-source[bot] commented on PR #38675:
URL: https://github.com/apache/superset/pull/38675#issuecomment-4067106809
## **Sequence Diagram**
This PR centralizes plain legend layout estimation and uses it across
ECharts chart plugins to avoid clipped legends in dashboards. When a plain
legend would overflow, the transform switches to scroll legend mode, with an
extra recalculation pass for horizontal bottom timeseries legends.
```mermaid
sequenceDiagram
participant ChartPlugin
participant LegendUtils
participant ECharts
participant Dashboard
ChartPlugin->>LegendUtils: Send legend items chart size and requested
plain type
LegendUtils->>LegendUtils: Estimate legend rows and required margin
LegendUtils-->>ChartPlugin: Return effective legend type and margin
opt Horizontal bottom timeseries case
ChartPlugin->>LegendUtils: Recompute using expanded margin
LegendUtils-->>ChartPlugin: Return final legend type and margin
end
ChartPlugin->>ECharts: Build options with effective legend and padding
ECharts-->>Dashboard: Render legend without clipping
```
---
*Generated by [CodeAnt AI](https://codeant.ai)*
--
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]