Change: Improve graph period markings #8732
Conversation
I didn't center labels on their column because they skip three months at a time. Left-align labels seem to denote the left grid line as the start of that three-month data period without confusing the user who might think the data point is only January data, for example. I tried the Roman numerals suggested in #8690 but it was a bit messy. Financial quarter markings (Q1, etc) would have been nice but fiscal years IRL don't often match calendar years and differ by country. Centering years might look odd when you're partway through a year, and would have to center on however many periods exist. I'm not opposed to eliminating vertical grid lines, but right now my skills support iterative improvement much better than reinventing the wheel. |
I meant centering labels on the grid line, not on the column/data point itself. Having the point itself in the middle to mean the period is fine. Highcharts image I posted is a monthly chart so ofc I don't suggest copying it completely. |
I really appreciate you thought this through; the additional information you give in your comment would be nice to have in the motivation next time, but creating PRs is also an iterative process :D Personally:
So +1 for me! (and of course, @ldpl has some nice suggestions to further improve it, but I am so-so if that should be done in this PR or in a later; for me, that is up to you :)) |
Ah, I misunderstood your centering suggestion. Centered labels would mean the very first month (Apr) would collide with the text for $0. Even if that were solved, I am not a fan of centered text in this case, but won't argue against it if you or someone else makes a PR to change it in the future. @TrueBrain Separate PRs are good, I think. Ready for review. |
Tried to implement what is suggested: https://pastebin.com/DnK9QPij (also removes vert lines in cargo payment graph but I think it's fine) Also noticed a bug that if the font is large enough year gets clipped (it's been there before as well). |
Personally, if you go this route, you should also move the points to the left. Now you see Edit: correction, my issue is not with the location of the dot, but with the fact it is a dot while it is a value of the whole quarter. But that is a completely different can of worms :P |
I like the centered years, but am still not a fan of centered months. Edit: I don't disagree with TB that the points could be moved to the vertical grid lines (which are no longer drawn) but then it almost looks like the data points are cherry-picked from January, April, July, and October, with the months in between discarded, rather than taking the average of each three-month period. To keep vertical lines in the cargo payment graph, just put the vertical line code inside |
I did some experimentation with @ldpl's suggestions and ran into some design issues. I'd like to move forward as-is and leave those for a future PR.
I did fix one more colour constant and included my changes in |
LGTM. Are there eints considerations regarding the translations? |
I checked with boss-man, there is not. |
Motivation / Problem
Periods of graphs are hard to read, due to lots of small text.
Description
This PR simplifies the text and adds brighter grid lines separating each year.
Closes #8632.
There is also some code cleanup of colour definitions which I missed in #8690.
Limitations
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.