Skip to content

fix: improve the logic of ticks for datetime x-axis#386

Draft
Alutery wants to merge 12 commits intomainfrom
line-ticks
Draft

fix: improve the logic of ticks for datetime x-axis#386
Alutery wants to merge 12 commits intomainfrom
line-ticks

Conversation

@Alutery
Copy link
Contributor

@Alutery Alutery commented Jan 29, 2026

No description provided.

@gravity-ui-bot
Copy link
Contributor

Preview is ready.

@gravity-ui
Copy link

gravity-ui bot commented Jan 29, 2026

Visual Tests Report is ready.

@Alutery Alutery marked this pull request as ready for review January 30, 2026 14:56
@Alutery Alutery marked this pull request as draft February 2, 2026 06:58
Copy link
Collaborator

@korvin89 korvin89 left a comment

Choose a reason for hiding this comment

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

I would probably change the name of the PR to something like "fix: improve the logic of counting the number of ticks for datetime x-axis"

}

const estimatedLabelWidth =
labelCharCount * fontHeight * AVG_CHAR_WIDTH_RATIO + padding * 2;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we use this logic for html labels as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for mentioning that. I didn't know about them...

I could revert the logic to only look at pixelInterval as it was originally
Or, if html labels are used, the user can add a pixelInterval with the maximum possible width if something doesn't fit (nothing changes here)

What would be better?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can get the maximum possible width of label (we calculate it before scales handling)

@Alutery Alutery changed the title fix: line chart ticks number fix: improve the logic of counting the number of ticks for datetime x-axis Feb 3, 2026
@Alutery Alutery changed the title fix: improve the logic of counting the number of ticks for datetime x-axis fix: improve the logic of ticks for datetime x-axis Feb 3, 2026
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.

3 participants