-
Notifications
You must be signed in to change notification settings - Fork 902
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(web): axis units overflowing graphcard #6754
Conversation
@@ -20,7 +20,7 @@ import GraphHoverLine from './GraphHoverline'; | |||
import ValueAxis from './ValueAxis'; | |||
|
|||
const X_AXIS_HEIGHT = 20; | |||
const Y_AXIS_WIDTH = 20; | |||
const Y_AXIS_WIDTH = 26; |
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.
Just an idea here, but not sure if it should be in this PR or just a future improvement but it would be nice to calculate the actual width needed instead of having to use a constant.
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.
Yes that would be nice! In the design review meeting we discussed units which will also affect how much space is needed, so I think it is a future thing.
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!
I just changed some things after we discussed it in the meeting. I should have let you know, sorry @VIKTORVAV99 |
It should be ready for review again now! |
Wow, you very quickly and easily just fixed the disabled message - you're awesome! 💪 |
Co-authored-by: Viktor Andersson <30777521+VIKTORVAV99@users.noreply.github.com>
Ready for review again ⭐ |
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! 🎉
Issue
These two pictures show 2 issues related to axis units overflowing.
This issue is caused by the
formatCo2
function not handling negative values correctly, partly because the value to match set inNetExchangeChart
was not taking into account that the number could be negative, and partly because the method itself didn't account for negative values.The second issue is that the gray overlay was not wide enough to cover the axis units.
Description
This PR fixes these two issues so that the axis show negative values correctly and it widens the gray overlay.
Preview
Double check
poetry run test_parser "zone_key"
pnpx prettier@2 --write .
andpoetry run format
in the top level directory to format my changes.