Skip to content

Fix #658: rename tick-label formatter styler methods to proper Java case#971

Merged
timmolter merged 1 commit into
developfrom
timmolter-fix-658-tick-formatter-naming
Jun 19, 2026
Merged

Fix #658: rename tick-label formatter styler methods to proper Java case#971
timmolter merged 1 commit into
developfrom
timmolter-fix-658-tick-formatter-naming

Conversation

@timmolter

Copy link
Copy Markdown
Member

Problem

Issue #658 asks whether a custom tick-label API exists. It does — but users couldn't find it because setxAxisTickLabelsFormattingFunction starts with a lowercase x, making it invisible in IDE autocompletion next to all the other setX… / setY… styler methods.

To make things worse, the nicer convenience methods setCustomXAxisTickLabelsFormatter / setCustomYAxisTickLabelsFormatter on AxesChart were marked @Deprecated, pushing users toward the hard-to-find styler methods.

Changes

AxesChartStyler

  • Add setXAxisTickLabelsFormattingFunction / getXAxisTickLabelsFormattingFunction (uppercase X — proper Java convention)
  • Add setYAxisTickLabelsFormattingFunction / getYAxisTickLabelsFormattingFunction (uppercase Y)
  • Deprecate the old lowercase setxAxis… / setyAxis… variants; they now delegate to the new methods (no behaviour change)

AxesChart

  • Remove the erroneous @Deprecated tag from setCustomXAxisTickLabelsFormatter / setCustomYAxisTickLabelsFormatter
  • Add proper Javadoc to both
  • Update internal calls to the new styler method names

Internal callers

  • Axis_X, Axis_Y updated to call the new getter names

Demos & tests

  • All existing callsites updated to the new names
  • TestForIssue658.java added — shows the map-to-label pattern (build a Map<Double, String> and pass a lookup lambda as the formatter)

Usage after this fix

// Via the chart convenience method (recommended)
chart.setCustomXAxisTickLabelsFormatter(x -> myLabels.getOrDefault(x, ""));

// Or directly via the styler
chart.getStyler().setXAxisTickLabelsFormattingFunction(x -> myLabels.getOrDefault(x, ""));

Closes #658

- Add setXAxisTickLabelsFormattingFunction / setYAxisTickLabelsFormattingFunction
  (and matching getters) to AxesChartStyler with uppercase X/Y following Java
  conventions, so they are discoverable in IDEs alongside other setX/setY methods.
- Deprecate old lowercase setxAxisTickLabelsFormattingFunction /
  setyAxisTickLabelsFormattingFunction; they now delegate to the new methods.
- Update Axis_X and Axis_Y internal callers to use the new method names.
- Remove erroneous @deprecated tag from AxesChart.setCustomXAxisTickLabelsFormatter
  and setCustomYAxisTickLabelsFormatter; add proper Javadoc to both.
- Update all demo and test callsites to the new names.
- Add TestForIssue658.java demo showing the map-to-label pattern.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@timmolter timmolter merged commit a26eb76 into develop Jun 19, 2026
1 check 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.

Is setXAxisTickLocationLabelMap still usable?

1 participant