Skip to content

Fix x-axis labels overlapping - #5243

Closed
yaugenka wants to merge 1 commit into
PhilJay:masterfrom
yaugenka:patch-2
Closed

yaugenka wants to merge 1 commit into
PhilJay:masterfrom
yaugenka:patch-2

Conversation

@yaugenka

@yaugenka yaugenka commented Jan 15, 2022

Copy link
Copy Markdown

Fixes #3298, Fixes #2980, Fixes #4640, Fixes #4557, Fixes #3673.

For those who are looking for a workaround solution, have posted one into #3298.

The fix required modification of AxisRender.ComputeAxisValues just for XAxis.
In order to avoid code duplication, the following refactoring was done.
ComputeAxisValues was split into CompleteAxisInterval (the part which differs for X and Y axis) and ComputeAxisValues (the common part). The resulting workflow is X/YAxisRenderer.ComputeAxis -> X/YAxisRenderer.CompleteAxisInterval -> AxisRender.ComputeAxisValues.

@yaugenka yaugenka changed the title Add spaceBetweenLabelsMin property to XAxis; fix xAsis labels overlapping Fix x-axis labels overlapping Jan 26, 2022
@hannesa2

hannesa2 commented Feb 25, 2022

Copy link
Copy Markdown
Contributor

Nice changes, what do you think about this ? #5268

@PhilJay

PhilJay commented Sep 20, 2026

Copy link
Copy Markdown
Owner

Thank you. This is in 4.0.0-beta01: the x axis keeps its labels at least one label width apart, through a minimumInterval hook on AxisRenderer. 4.0 is a rewrite in Kotlin, so the Java sources this patch touches no longer exist and it cannot be merged as it stands. It was reimplemented rather than merged, so the credit is yours.

https://github.com/PhilJay/MPAndroidChart/releases/tag/v4.0.0-beta01

@PhilJay PhilJay closed this Sep 20, 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

3 participants