Extend DialectTheme with more chart types (area, donut, stacked bar, sparkline) #29

Open
opened 2026-07-28 16:54:47 +00:00 by claude-bot · 0 comments
Collaborator

Problem

DialectTheme.baseOptions(String chartType) only branches on two types:

if ("line".equals(chartType)) { ... }
else if ("bar".equals(chartType)) { ... }

Everything else falls through to the bare base options with no type-specific styling. In practice the app ships three chart classes: LineChart, BarChart (both via AxisChart) and PieChart.

CLAUDE.md already states the rule — "Add new chart types here, not by duplicating option maps" — the architecture is ready, nobody has extended it.

Proposal

Add styled support for the types a dashboard actually needs:

  • Area — line with gradient fill; trivial variant of the existing line branch.
  • DonutPieChart variant with a centre total label.
  • Stacked / grouped barplotOptions.bar.stacked, plus legend handling.
  • Sparkline — chrome-free variant for the KPI tile (#26).
  • Optionally: mixed line + bar, heatmap.

Each new type gets its option fragment in DialectTheme, and the corresponding component class extends AxisChart or ApexChart following the existing pattern. Palette stays DialectTheme.COLORS — no per-chart colour literals.

Acceptance criteria

  • New types render correctly in light and dark theme (the client-side applyThemeOverlay() path must cover them).
  • No option map duplicated outside DialectTheme.
  • Each new chart type is registered in the widget registry (#21) so it is actually reachable.
  • Browserless tests per new chart type.

Scope

Medium, but cleanly splittable — one chart type per PR is a reasonable unit.

## Problem `DialectTheme.baseOptions(String chartType)` only branches on two types: ```java if ("line".equals(chartType)) { ... } else if ("bar".equals(chartType)) { ... } ``` Everything else falls through to the bare base options with no type-specific styling. In practice the app ships three chart classes: `LineChart`, `BarChart` (both via `AxisChart`) and `PieChart`. CLAUDE.md already states the rule — "Add new chart types here, not by duplicating option maps" — the architecture is ready, nobody has extended it. ## Proposal Add styled support for the types a dashboard actually needs: - **Area** — line with gradient fill; trivial variant of the existing line branch. - **Donut** — `PieChart` variant with a centre total label. - **Stacked / grouped bar** — `plotOptions.bar.stacked`, plus legend handling. - **Sparkline** — chrome-free variant for the KPI tile (#26). - Optionally: mixed line + bar, heatmap. Each new type gets its option fragment in `DialectTheme`, and the corresponding component class extends `AxisChart` or `ApexChart` following the existing pattern. Palette stays `DialectTheme.COLORS` — no per-chart colour literals. ## Acceptance criteria - New types render correctly in light and dark theme (the client-side `applyThemeOverlay()` path must cover them). - No option map duplicated outside `DialectTheme`. - Each new chart type is registered in the widget registry (#21) so it is actually reachable. - Browserless tests per new chart type. ## Scope Medium, but cleanly splittable — one chart type per PR is a reasonable unit.
claude-bot added the enhancement label 2026-07-28 16:54:47 +00:00
pitfriedrich added this to the Fix dashboard imporvements milestone 2026-07-29 05:58:59 +00:00
pitfriedrich added this to the Dashboard improvements project 2026-07-29 06:00:13 +00:00
Sign in to join this conversation.