Skip to content

Move locale to base Styler; fix locale-aware number formatting in PieChart#964

Merged
timmolter merged 1 commit into
developfrom
timmolter/refactored-system
Jun 8, 2026
Merged

Move locale to base Styler; fix locale-aware number formatting in PieChart#964
timmolter merged 1 commit into
developfrom
timmolter/refactored-system

Conversation

@timmolter

Copy link
Copy Markdown
Member

Previously, locale lived only in AxesChartStyler, making it inaccessible to PieStyler (which extends Styler directly). This meant pie slice labels and tooltips always used the system default locale for decimal separators -- no way to override for non-English locales.

What changed:

  • locale field, getLocale(), and setLocale() moved from AxesChartStyler up to the base Styler class. All chart types now inherit locale support.
  • PlotContent_Pie constructs its DecimalFormat using DecimalFormatSymbols derived from pieStyler.getLocale(), so labels like percentages and values respect the configured locale.
  • Removed a stale // TODO tie this to the styler properties comment from ChartButton (Swing component -- deliberately not styled via Styler).

Users can now do:

pieChart.getStyler().setLocale(Locale.GERMAN);

...and get comma decimal separators in pie labels.

Closes #868

- Move locale field, getLocale(), and setLocale() from AxesChartStyler
  up to the base Styler class so all chart types (including Pie) can
  benefit from locale-aware number formatting
- PlotContent_Pie now constructs DecimalFormat with DecimalFormatSymbols
  derived from the styler locale, fixing locale-dependent decimal
  separators in pie slice labels and tooltips
- Remove stale TODO comment from ChartButton

Fixes #868

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@timmolter timmolter merged commit 0de7c76 into develop Jun 8, 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.

Ability to change locale in PieStyler missing?

1 participant