-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(revert 27883): Excess padding in horizontal Bar charts #29345
fix(revert 27883): Excess padding in horizontal Bar charts #29345
Conversation
@@ -571,10 +571,6 @@ export function getPadding( | |||
? TIMESERIES_CONSTANTS.yAxisLabelTopOffset | |||
: 0; | |||
const xAxisOffset = addXAxisTitleOffset ? Number(xAxisTitleMargin) || 0 : 0; | |||
const showLegendTopOffset = | |||
isHorizontal && showLegend && legendOrientation === LegendOrientation.Top | |||
? 100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to revert the whole thing, or should this 100px just be a more reasonable number?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You cannot set a fixed padding because it will depend on the size of each bar generated by ECharts, which will also vary depending on the number of bars. This calculation should be done automatically by ECharts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving to unblock, but wondering if the fix-forward is simply changing a number.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
(cherry picked from commit 708afb7)
SUMMARY
This PR reverts #27883 which incorrectly calculated the chart's padding and introduced #29342.
There's a bug with
yAxis.inverse
in ECharts and we don't know when a fix will be provided. To fix this issue, this PR partially reverts #23273 which introduced said configuration. I'm purposefully not adding a migration to this PR, as #23273 did, so it can be cherry-picked as it's affecting all 4.0.x versions. This will change the default y-axis order of horizontal bar charts. @yousophAn alternative solution, would be to fix the ECharts bug. @villebro
Fixes #29342
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
1 - Create an horizontal bar chart using a time column in the x-axis
2 - Check that the chart is displayed correctly.
ADDITIONAL INFORMATION