-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Cleaner formatting for trading charts date axes #4715
Conversation
Thanks for opening this pull request! |
Clean up date axes style for easy reading. Made date labels shorter, with clear visual correspondance to relevant axes tick mark. Tick marks with labels are now larger than those without. Signed-off-by: Deus Max <[email protected]>
@deusmax I think this is a good idea! Maybe we can get it even cleaner by getting rid of the day & month when year is selected. |
@ripcurlx Thanks. Agree these are good points and indeed the charts would be even better. I'll start working on the labels as you point out.... and get back. |
Provide specific formats for each trade chart interval period, for added precision and flexibility in formatting the X-axis. Covers suggestion in Bisq PR#4715 for more compact date formats.
Implemented the suggestions by @ripcurlx . |
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.
I tested it, looks nice. If I could (I'm not a JFX expert), I would center-align the labels where possible, e.g.,
29/Oct
2020
But I would not block approval and merging without that.
I will add a Tested ACK
if the switch statement styling is changed.
case HOUR : | ||
case MINUTE_10: fmt = "HH:mm\ndd/MMM"; | ||
break; | ||
default: // nothing here |
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.
You might want to reformat the style of the switch statement so fmt = "..."
are on separate lines. Not sure codacy will complain about this, but other devs might want the switch style to be consistent with the rest of the code base.
(This is the 1st time I've seen this style in Bisq; I'm not saying there may be other examples in the code base.)
switch (model.tickUnit) {
case YEAR:
fmt = "yyyy";
break;
case MONTH:
fmt = "MMMyy";
break;
case WEEK:
case DAY:
fmt = "dd/MMM\nyyyy";
break;
case HOUR:
case MINUTE_10:
fmt = "HH:mm\ndd/MMM";
break;
default: // nothing here
}
Fixed a switch statement formatting to conform with Bisq code style.
@ghubstan : pushed the formatting block changes. Still looking into centering the labels. |
Awesome work, congrats on your first merged pull request! |
Clean up date axes style for easy reading. Made date labels shorter,
with clear visual correspondence to relevant axes tick mark.
Tick marks with labels are now larger than those without.
Currently, the X-axis for the Price and Volume charts is not well designed. The labels are large, all the tick marks are the same. It is difficult to estimate to which tick mark the date label corresponds. Here is a typical example for the DAY interval:

The fix proposed here draws the labels more compact and the respective ticks stand-out. The chart view becomes cleaner and more visually intuitive. Above example, becomes:

The labels take less horizontal space by splitting into 2-levels, using 24-hour time instead of AM/PM. The examples here show English locale, though localization for the month names is maintained, as before.
Of course, further customization is possible, but the above, I feel, provides an acceptable improvement to chart display, without deviating from the current UI or introducing new features.
Similar results are obtained with the other chart interval values. Examples (10min, HOUR, WEEK, MOTH):




Bisq is a unique tool. It deserves better charts.
Hope you find this a small improvement in the right direction.