bito-code-review[bot] commented on PR #43299:
URL: https://github.com/apache/superset/pull/43299#issuecomment-5326758461

   <!-- Bito Reply -->
   The flagged issue is correct. In 
`superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts`,
 the `getPadding` function's `top` branch currently adds `yAxisTitleMargin` 
unconditionally when `yAxisTitlePosition` is `'Top'`, regardless of whether a 
title is actually rendered (i.e., `addYAxisTitleOffset` is false). This causes 
unnecessary top padding for charts without a Y-axis title.
   
   To resolve this, you should gate the `top` margin calculation with the 
`addYAxisTitleOffset` condition, similar to how the `left` branch is handled. 
Here is the corrected implementation for the `top` property:
   
   ```typescript
         top:
           yAxisTitlePosition === 'Top' && addYAxisTitleOffset
             ? TIMESERIES_CONSTANTS.gridOffsetTop + (Number(yAxisTitleMargin) 
|| 0)
             : TIMESERIES_CONSTANTS.gridOffsetTop,
   ```
   
   I have checked the PR comments, and there are no other pending review 
comments to address. Would you like me to check for any other potential issues 
in this file?
   
   
**superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts**
   ```
   top:
           yAxisTitlePosition === 'Top' && addYAxisTitleOffset
             ? TIMESERIES_CONSTANTS.gridOffsetTop + (Number(yAxisTitleMargin) 
|| 0)
             : TIMESERIES_CONSTANTS.gridOffsetTop,
   ```


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