Conversation
Previously, the ticklabelindex property itself was used in boolean tests which can be confusing.
…tible with minor ticks. E.g. if major ticks are daily and minor ticks are hourly, tick labels on minor ticks should include hourly information.
…eriod labels The longer period labels need more space.
my-tien
force-pushed
the
7933-minor-ticklabel-format
branch
from
August 5, 2026 14:50
b701674 to
77d7d26
Compare
ticklabelindex
camdecoster
reviewed
Sep 24, 2026
| @@ -0,0 +1 @@ | |||
| - Fix tick label format sometimes being incompatible with the labeled tick when using ticklabelindex [[#7934](https://github.com/plotly/plotly.js/pull/7935)] | |||
Contributor
There was a problem hiding this comment.
Suggested change
| - Fix tick label format sometimes being incompatible with the labeled tick when using ticklabelindex [[#7934](https://github.com/plotly/plotly.js/pull/7935)] | |
| - Fix tick label format sometimes being incompatible with the labeled tick when using ticklabelindex [[#7935](https://github.com/plotly/plotly.js/pull/7935)] |
| var fmt = (hover && ax.hoverformat) || axes.getTickFormat(ax); | ||
|
|
||
| var tr = ax._useTicklabelIndex ? ax.minor._tickround : ax._tickround; | ||
| var fmt = ax._useTicklabelIndex ? "" : (hover && ax.hoverformat) || axes.getTickFormat(ax); |
Contributor
There was a problem hiding this comment.
Why do you use an empty string for a ticklabelindex? This ignores hoverformat and could erase a user specified tick format.
| // axis is just necessary when using ticklabelindex. | ||
| autoTickRound(mockAx); | ||
| delete mockAx.minor; // prevent self-reference | ||
| Lib.extendFlat(ax.minor, mockAx); |
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #7933 by determining the tick format using the rounded ticks of the minor axis instead of the major axis when
ticklabelindexis set.Stacks on top of #7934.