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

Inconsistent Default Padding for Different Charts #31033

Open
3 tasks done
tatiana-cherne opened this issue Nov 22, 2024 · 14 comments
Open
3 tasks done

Inconsistent Default Padding for Different Charts #31033

tatiana-cherne opened this issue Nov 22, 2024 · 14 comments
Assignees
Labels
#bug:cosmetic Cosmetic/layout/design tweak needed good first issue Good first issues for new contributors viz:charts:bar Related to the Bar chart viz:charts:table Related to the Table chart

Comments

@tatiana-cherne
Copy link
Contributor

tatiana-cherne commented Nov 22, 2024

Bug description

Depending on the type selected, the Superset UI will display charts with different alignments. Ideally they would be centered inside the card. Currently the padding differs on both sides leading to more whitespace on the left or right.

For Example:

  1. Go to Dashboard
  2. Click + Chart
  3. Select Table
  4. Click + Chart
  5. Select Bar Chart

Screenshots/recordings

Screenshot 2024-11-19 at 11 37 05 AM

Superset version

4.1.0

Python version

3.11

Node version

Not applicable

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
@dosubot dosubot bot added #bug:cosmetic Cosmetic/layout/design tweak needed viz:charts:bar Related to the Bar chart viz:charts:table Related to the Table chart labels Nov 22, 2024
Copy link

dosubot bot commented Nov 22, 2024

Hey @tatiana-cherne! I'm here to help you with any bugs, questions, or contributions you have for Superset. Feel free to ask me anything! Dosu

The issue of inconsistent default padding for different chart types in Superset can be addressed by examining the padding settings in the codebase. The default padding for different chart types is set in the file superset-frontend/plugins/plugin-chart-echarts/src/defaults.ts, where the defaultLegendPadding object defines padding values for different legend orientations [1]. Additionally, the getPadding function in superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts is used to determine the padding for timeseries charts, taking into account parameters like axis title offsets and zoomability [2].

For the Table component, specific CSS classes and styles affect its alignment, such as text alignment for header and metric cells, global filter alignment, and pagination alignment [3][4]. However, there is no specific information about the Bar Chart component's alignment in the provided context.

To achieve consistent alignment across different chart types, you may need to adjust these padding settings and CSS styles to ensure that all charts are centered within their cards.

To continue talking to Dosu, mention @dosu.

@geido geido added the good first issue Good first issues for new contributors label Nov 25, 2024
@sahiladit
Copy link

can you assign it to me?

@tatiana-cherne
Copy link
Contributor Author

I have begun working on the issue and I hope that I can continue

@sahiladit
Copy link

Sure

@shivanikashyapp
Copy link

can you assign it to me?

@Dronesh77
Copy link

Hi @tatiana-cherne ,
I noticed that you’ve also started working on this issue, and I was wondering if you’ve found a solution. I’ve been working on a potential fix involving a dynamic layout adjustment inspired by plt.tight_layout() from Matplotlib and would love to coordinate efforts if you’re still working on this.

@sahilkumar100
Copy link

sahilkumar100 commented Jan 8, 2025

Hyy @tatiana-cherne I want to work on this issues please assignees me this issues.

@Vam-tech-star
Copy link

Hi I'm Vam. I started to contribute from today please help me to find issues.

@Vam-tech-star
Copy link

How can we ensure consistent padding and alignment for all chart types in Apache Superset?

@osamaahmed17
Copy link

Hi @tatiana-cherne ,
I'm interested in working on this issue. Could you kindly assign it to me? Looking forward to contributing!

@tatiana-cherne
Copy link
Contributor Author

I do not have authority to assign this issue to anyone unfortunately, I just opened the issue. I ended up fixing a similar issue, but this one remains open if anyone wants to jump on it.

@rusackas
Copy link
Member

Asignment isn't really necessary, we welcome PRs at any time. But... done!

@osamaahmed17
Copy link

ok

@shashank0470
Copy link

Is the issue resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug:cosmetic Cosmetic/layout/design tweak needed good first issue Good first issues for new contributors viz:charts:bar Related to the Bar chart viz:charts:table Related to the Table chart
Projects
None yet
Development

No branches or pull requests

10 participants