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

Fixes #5324.

@plotly/plotly_js

@alexcjohnson
Copy link
Collaborator

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 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
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it! 💃

@archmoj archmoj merged commit 0dd5467 into master Dec 8, 2020
@archmoj archmoj deleted the date-head-label-on-sides branch December 8, 2020 16:04
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.

x-axis second line date formatting edge case
2 participants