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

[Bug]: Bar chart inside Data Table should align to the right when Column aligns right #2725

Open
kmitchener opened this issue Nov 5, 2024 · 6 comments
Assignees
Labels
bug Something isn't working customer request An Evidence customer has requested this

Comments

@kmitchener
Copy link

kmitchener commented Nov 5, 2024

Describe the bug

Current behavior when column is aligned right with a bar chart in it:

<Column id=last_month_cost fmt=usd title="Last Month AWS Cost" align=right contentType=bar />

Current behaviour

Image

Desired behavior

Image

Steps to Reproduce

Create datatable with column aligned right with bar chart inside. Example column description above.

Severity

annoyance

@kmitchener kmitchener added bug Something isn't working to-review Evidence team to review labels Nov 5, 2024
@github-actions github-actions bot added the customer request An Evidence customer has requested this label Nov 5, 2024
@archiewood archiewood removed the to-review Evidence team to review label Nov 5, 2024
@archiewood
Copy link
Member

Hey @kmitchener, what would your expected behaviour be here for negative values?

@hughess
Copy link
Member

hughess commented Nov 5, 2024

Can you achieve this by making the values in the column negative, then adjust the fmt?

@archiewood
Copy link
Member

archiewood commented Nov 5, 2024

Negative values could be flipped in the opposite direction, but this might be confusing

Image

Current left align behaviour for reference

Image

@archiewood
Copy link
Member

@kmitchener
Copy link
Author

That looks great to me. In my use case, I won't have mixed positive and negative values. For your POC, I wonder how that would look with much larger negative values?

@archiewood
Copy link
Member

I'm not loving this approach honestly. I wonder if it would be better to introduce a new independent prop to control this eg barAlign=right
I think some users are likely to want the text to be right aligned, but the bar not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working customer request An Evidence customer has requested this
Projects
None yet
Development

No branches or pull requests

3 participants