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

Position the head of dates for ticklabels in respect to axis side and ticklabelposition on x-axis #5326

Merged
merged 4 commits into from Dec 8, 2020

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Dec 7, 2020

@alexcjohnson
Copy link
Contributor

@alexcjohnson alexcjohnson commented Dec 8, 2020

This flips the date upside down - so whatever is normally the second line is the first line in these cases where the labels are bottom-aligned. I don't think that's what we want - we want the order to remain as it was, just move the single-line labels up one line worth.

Perhaps we can do that by, instead of deleting the second line, replacing it (just in these bottom-aligned cases) with a blank line? The logic for whether or not to include the second line is here:

} else if(!ax._inCalcTicks || (headStr !== ax._prevDateHead)) {
dateStr += '<br>' + headStr;
ax._prevDateHead = headStr;
}

@archmoj
Copy link
Contributor Author

@archmoj archmoj commented Dec 8, 2020

This flips the date upside down - so whatever is normally the second line is the first line in these cases where the labels are bottom-aligned. I don't think that's what we want - we want the order to remain as it was, just move the single-line labels up one line worth.

Perhaps we can do that by, instead of deleting the second line, replacing it (just in these bottom-aligned cases) with a blank line? The logic for whether or not to include the second line is here:

} else if(!ax._inCalcTicks || (headStr !== ax._prevDateHead)) {
dateStr += '<br>' + headStr;
ax._prevDateHead = headStr;
}

Good call. Addressed in 11dcbf5.

Copy link
Contributor

@alexcjohnson alexcjohnson left a comment

Love it! 💃

@archmoj archmoj merged commit 0dd5467 into master Dec 8, 2020
9 checks passed
@archmoj archmoj deleted the date-head-label-on-sides branch Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants