Dashboard gadget: chart foundation and pie chart

Description

Background

Extend the approvals gadget (AP-626) with chart output types. Realised first: carries the common chart foundation shared by all chart types (pie, bar, line, table, 2D table) plus the pie type. Other chart tickets specify only their type and refer here. Gadget core (layout, tabs, viewer experience, persistence, visibility model) stays in AP-626.

Common chart foundation

Applies to every chart type unless a type states otherwise.

Configuration model

Header controls, with UI labels in brackets:

  • Chart by (CHART BY): mandatory primary dimension whose values split the data. Visual role per type: slices (pie), X axis (bar, line), rows (2D table).

  • Group by (GROUP BY): optional breakout splitting each Chart by value further. Visual role: series (bar, line), columns (2D table). Pie has none. When a type supports Group by, its per-series settings live in a Group by tab that appears once Group by is set.

  • Calculations (CALCULATIONS): the measure. The approval count by default; other measures (average, median, sum, durations, rates) are specified in AP-2342.

Before Chart by is set, the preview shows a greyed-out template; once set, the actual chart renders.

Dimension fields

Only fields resolvable from the approval database are offered (server-side aggregation on the entitled set). Work item fields and Confluence page author are out of scope (external data per approval). Available (to be verified during development):

  • Status, Priority, Approval name

  • Definition: by identifier, name resolved from the app database.

  • Originator: by user, display name from the user cache (fallback account id / "Unknown user").

  • Created, Decision deadline, Validity expiration, Resolved: time fields, bucketed by granularity. Resolved from AP-2338.

  • Approver, Current step: in separate step tables, need a join (AP-2339). Fan-out fields (one approval maps to several), so segments do not sum to the total; offered on bar, line and 2D table, not on pie.

Not offered on any type: Space (no readable name in the approval database). Grouping is by identifier; names resolved afterward.

Common mechanisms

  • Empty / Undefined bucket: null/empty axis values grouped into one bucket per axis.

  • Granularity (time fields): Day, Week, Month, Quarter, Year (default Month). Date format: date label format, independent of granularity. Both apply per axis.

  • Ordering: Big to Small, Small to Big, A to Z, Z to A, Custom order (Custom unlocks manual drag).

  • Value list options: Labels (Heading default Chart by name, Count default "Approvals"); Show zero counts (off); Show total row / totals (on); Show number column (off); Limit rows (default 5, overflow collapsed to "Show more (12) ... 360 . 22.1%"); Number format (Auto / Compact).

  • Enable hyperlinks in chart (Enable hyperlinks in table for tabular types): on by default; controls clickability.

  • Drilldown: clicking a value opens, in a new tab, the approvals list with the chart's filters narrowed to the selected Chart by value (and Group by value where applicable), in the viewer's context.

  • Auto-refresh: per AP-626.

Data and visibility

Aggregations run server-side on the entitled set and respect the AP-626 visibility model. Fan-out fields (Approver, Current step) count each approval once per segment, so totals may exceed the number of distinct approvals. Performance covered by AP-2340.

Pie type

Chart by only, no Group by (a pie must sum to the whole; Approver and Current step therefore not offered).

  • Pie with a value list beside it: each value with count and percentage share, plus a total row.

  • Format: color per value (changeable) and Ordering.

  • Display options: Show total in center (donut with configurable total number format, off by default); Show slice labels (off); Show tooltip on name hover (name in the list by default, in a tooltip on the chart when on); Percentages (on chart / in legend / off).

  • Drilldown: clicking a legend value (count or percentage, same link) narrows to that Chart by value.

Acceptance criteria

  • A chart is configured by Chart by (mandatory), an optional Group by where supported, and Calculations (approval count by default; other measures per AP-2342); header labels CHART BY / GROUP BY / CALCULATIONS; greyed-out template until Chart by is set.

  • Dimensions offer Status, Priority, Definition, Originator, Approval name, the time fields (incl. Resolved), and Approver / Current step where the type allows; Space, work item fields and Confluence page author never offered.

  • Time fields expose Granularity (default Month) and Date format per axis; null/empty values go to an "Empty" / "Undefined" bucket; Ordering as specified.

  • Shared display options behave as specified (Show zero counts off, totals on, number column off, Limit rows 5 with the "Show more" summary, Number format Auto / Compact).

  • Enable hyperlinks (on) controls clickability; clicking narrows the approvals list to the selected value(s) in the viewer's context.

  • Aggregations are server-side on the entitled set, respect the visibility model, and count each approval once per segment for fan-out fields.

  • Pie: Chart by only, no Group by, Approver / Current step not offered; value list with count and percentage and a total row; Format has color per value and Ordering; Display options as listed; legend click (count or percentage) narrows to that value.

Notes

Depends on AP-626 (core), AP-2338 (Resolved), AP-2339 (approver / current step), AP-2340 (performance). Measures beyond count are specified in AP-2342.