Skip to content
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

Merged

Conversation

michael-s-molina
Copy link
Member

@michael-s-molina michael-s-molina commented Jun 24, 2024

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. @yousoph

An alternative solution, would be to fix the ECharts bug. @villebro

Fixes #29342

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screenshot 2024-06-24 at 11 16 37 Screenshot 2024-06-24 at 11 16 02 Screenshot 2024-06-24 at 10 51 52 Screenshot 2024-06-24 at 10 51 27

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

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • 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

@@ -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
Copy link
Member

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?

Copy link
Member Author

@michael-s-molina michael-s-molina Jun 24, 2024

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.

@rusackas rusackas changed the title fix: Excess padding in horizontal Bar charts fix(revert 27883): Excess padding in horizontal Bar charts Jun 24, 2024
Copy link
Member

@rusackas rusackas left a 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.

@michael-s-molina
Copy link
Member Author

Approving to unblock, but wondering if the fix-forward is simply changing a number.

Before merging this, I still want @villebro's input. Maybe we can fix the bug in ECharts and avoid reverting #23273.

@michael-s-molina michael-s-molina added the hold! On hold label Jun 24, 2024
Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@michael-s-molina michael-s-molina removed the hold! On hold label Jun 25, 2024
@michael-s-molina michael-s-molina merged commit 708afb7 into apache:master Jun 25, 2024
36 of 37 checks passed
@michael-s-molina michael-s-molina added the v4.0 Label added by the release manager to track PRs to be included in the 4.0 branch label Jun 25, 2024
michael-s-molina added a commit that referenced this pull request Jun 26, 2024
@mistercrunch mistercrunch added 🍒 4.0.2 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels labels Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels plugins size/S v4.0 Label added by the release manager to track PRs to be included in the 4.0 branch viz:charts:bar Related to the Bar chart viz:charts:echarts Related to Echarts 🍒 4.0.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Excess Padding in Horizontal Bar Charts When Legend is Added
4 participants