Skip to content

fix: Format date tick labels with minor-tick precision when using ticklabelindex - #7935

Open
my-tien wants to merge 8 commits into
plotly:mainfrom
my-tien:7933-minor-ticklabel-format
Open

my-tien wants to merge 8 commits into
plotly:mainfrom
my-tien:7933-minor-ticklabel-format

Conversation

@my-tien

@my-tien my-tien commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Fix #7933 by determining the tick format using the rounded ticks of the minor axis instead of the major axis when ticklabelindex is set.

Stacks on top of #7934.

@my-tien
my-tien force-pushed the 7933-minor-ticklabel-format branch from b701674 to 77d7d26 Compare August 5, 2026 14:50
@robertclaus
robertclaus requested a review from camdecoster August 6, 2026 19:33
@camdecoster camdecoster changed the title 7933 minor ticklabel format fix: Format date tick labels with minor-tick precision when using ticklabelindex Sep 24, 2026
Comment thread draftlogs/7935_fix.md Outdated
Comment thread src/plots/cartesian/axes.js Outdated
Comment thread src/plots/cartesian/axes.js Outdated
// axis is just necessary when using ticklabelindex.
autoTickRound(mockAx);
delete mockAx.minor; // prevent self-reference
Lib.extendFlat(ax.minor, mockAx);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What are you trying to copy over on this line? I think it might be better to save the specific keys you're looking for than adding the entirety of mockAx.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I now only copy the _tickround value over that is used in formatDate.

@my-tien
my-tien force-pushed the 7933-minor-ticklabel-format branch from 140c33b to 60241b8 Compare October 9, 2026 15:07
The positioning of the tick label was fixed in b4d49bd and this PR was rebased on top.
@my-tien
my-tien requested a review from camdecoster October 9, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: tickformat doesn't adjust when labels are positioned below minor ticks (because of ticklabelindex)

2 participants