Export widget data as CSV and chart as image #28

Closed
opened 2026-07-28 16:54:39 +00:00 by claude-bot · 1 comment
Collaborator

Problem

DialectTheme.baseOptions(...) sets:

chart.put("toolbar", Map.of("show", false));

which disables ApexCharts' built-in toolbar — and with it the built-in PNG / SVG / CSV export. That was the right call visually (the default toolbar does not match the Dialect design system), but it means the dashboard currently offers no export at all.

Proposal

Two options, not mutually exclusive:

  1. Server-side CSV — a StreamResource behind an Anchor or menu action, generated from the same data the widget is rendering. Clean, testable, no client roundtrip.
  2. Chart image — call ApexCharts' dataURI() on the client via a @ClientCallable roundtrip and hand the result back as a download.

Either way the entry point should be the per-widget action menu rather than re-enabling the unstyled ApexCharts toolbar.

Acceptance criteria

  • CSV export contains the same values the widget is currently displaying, including any active global filter (#24).
  • Filenames are meaningful (widget title + period), not chart.csv.
  • Chart styling is unchanged — the ApexCharts toolbar stays hidden.
  • Export copy in German, keys in all three bundles.

Depends on

#27 (per-widget action menu, as the entry point), #20 (CSV needs the underlying data, not the rendered options map).

Scope

Small to medium. CSV first; image export is optional follow-up.

## Problem `DialectTheme.baseOptions(...)` sets: ```java chart.put("toolbar", Map.of("show", false)); ``` which disables ApexCharts' built-in toolbar — and with it the built-in PNG / SVG / CSV export. That was the right call visually (the default toolbar does not match the Dialect design system), but it means the dashboard currently offers no export at all. ## Proposal Two options, not mutually exclusive: 1. **Server-side CSV** — a `StreamResource` behind an `Anchor` or menu action, generated from the same data the widget is rendering. Clean, testable, no client roundtrip. 2. **Chart image** — call ApexCharts' `dataURI()` on the client via a `@ClientCallable` roundtrip and hand the result back as a download. Either way the entry point should be the per-widget action menu rather than re-enabling the unstyled ApexCharts toolbar. ## Acceptance criteria - CSV export contains the same values the widget is currently displaying, including any active global filter (#24). - Filenames are meaningful (widget title + period), not `chart.csv`. - Chart styling is unchanged — the ApexCharts toolbar stays hidden. - Export copy in German, keys in all three bundles. ## Depends on #27 (per-widget action menu, as the entry point), #20 (CSV needs the underlying data, not the rendered options map). ## Scope Small to medium. CSV first; image export is optional follow-up.
claude-bot added the enhancement label 2026-07-28 16:54:39 +00:00
pitfriedrich added the ai-ready label 2026-07-28 18:54:59 +00:00
claude-bot added ai-wip and removed ai-ready labels 2026-07-28 19:29:50 +00:00
Author
Collaborator

PR: #38

CSV-Export liegt im Per-Widget-Aktionsmenü („Als CSV exportieren"), serverseitig über einen DownloadHandler — die Daten werden erst beim Klick gelesen, also inkl. aktivem globalem Filter. Dateiname = Widget-Titel + Zeitraum (umsatz-entwicklung-halbjahr.csv). ApexCharts-Toolbar bleibt aus, Chart-Styling unverändert.

Der Bild-Export (dataURI()) ist nicht dabei — das Issue nennt ihn optionalen Follow-up; kann bei Bedarf als eigenes Issue nachgezogen werden.

Tests: ./mvnw test 67/67 grün, inkl. echtem Browser-Download im Playwright-E2E.

PR: https://gitea.pitfriedrich.net/pitfriedrich/chart-app/pulls/38 CSV-Export liegt im Per-Widget-Aktionsmenü („Als CSV exportieren"), serverseitig über einen `DownloadHandler` — die Daten werden erst beim Klick gelesen, also inkl. aktivem globalem Filter. Dateiname = Widget-Titel + Zeitraum (`umsatz-entwicklung-halbjahr.csv`). ApexCharts-Toolbar bleibt aus, Chart-Styling unverändert. Der Bild-Export (`dataURI()`) ist nicht dabei — das Issue nennt ihn optionalen Follow-up; kann bei Bedarf als eigenes Issue nachgezogen werden. Tests: `./mvnw test` 67/67 grün, inkl. echtem Browser-Download im Playwright-E2E.
claude-bot added ai-review and removed ai-wip labels 2026-07-28 19:46:21 +00:00
Sign in to join this conversation.