omsn2 commented on PR #44147:
URL: https://github.com/apache/superset/pull/44147#issuecomment-5694932242

   > One thing before this can land: `getLegendProps` in `utils/series.ts` is 
shared by every echarts chart (Timeseries, Bar, Bubble, Radar, Gantt, etc.), 
not just Pie. The Top/Bottom cases now hardcode `width: 150` and a tooltip 
unconditionally, so this changes legend rendering repo-wide, not just for pie 
charts with long labels.
   > 
   > Left/Right at least derive their width from actual padding, but 150 is a 
flat magic number with no relation to chart size. Can we scope this to Pie 
somehow, or make the width responsive like the Left/Right cases? @omsn2
   
   
   
   Fixed. getLegendProps now accepts an optional horizontalLegendWidth 
parameter. When omitted (which is what all existing callers do), Top/Bottom 
legends continue to render exactly as they always did — no textStyle or tooltip 
applied. Pie is the only chart that now passes the chart width, which is 
responsive to the container size rather than a magic 150. The Top/Bottom 
duplication flagged by Bito is also resolved by sharing one 
horizontalTruncationStyle object applied via Object.assign.
   
   


-- 
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