Skip to content

fix: add setter for rendererXAxis to match rendererLeftYAxis/rendererRightYAxis API#797

Merged
hannesa2 merged 1 commit into
AppDevNext:masterfrom
mvanhorn:fix/782-xaxis-renderer-setter
Jun 19, 2026
Merged

fix: add setter for rendererXAxis to match rendererLeftYAxis/rendererRightYAxis API#797
hannesa2 merged 1 commit into
AppDevNext:masterfrom
mvanhorn:fix/782-xaxis-renderer-setter

Conversation

@mvanhorn

Copy link
Copy Markdown
Contributor

Summary

  • Converts rendererXAxis from a read-only val (getter only) to a var with both getter and setter in BarLineChartBase
  • The setter writes to the protected xAxisRenderer backing field, following the identical pattern already used by rendererLeftYAxis and rendererRightYAxis
  • Adds KDoc comment on the property consistent with the Y-axis renderer docs

Why this matters

Issue #782 reports that callers cannot substitute a custom XAxisRenderer subclass the same way they can for Y-axis renderers. The asymmetry is a gap in the API: rendererLeftYAxis and rendererRightYAxis are both var with setters, while rendererXAxis was val. This is a common customization (e.g., custom label formatting or line drawing). The backing field xAxisRenderer is already declared protected var, so this change requires no visibility changes - only the property accessor needed updating.

Testing

  • Verified the new setter mirrors the rendererLeftYAxis setter pattern exactly (backing field assignment)
  • Kotlin syntax inspection confirms no errors - xAxisRenderer is a protected var accepting XAxisRenderer assignment
  • Full Android Gradle build was not run locally (requires Android SDK); the change is a single property accessor addition with no logic

Fixes #782

…RightYAxis API

Converts rendererXAxis from a val (getter-only) to a var with a setter
that writes to the protected xAxisRenderer backing field, mirroring the
identical pattern used by rendererLeftYAxis and rendererRightYAxis.

Fixes AppDevNext#782
@hannesa2 hannesa2 merged commit c59e68e into AppDevNext:master Jun 19, 2026
2 checks passed
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.

Setter for rendererXAxis is missing

2 participants