Pivot Table with D3.js
✓ Published1🌍 Public
This example builds a pivot table with D3.js v6, grouping expense records by head group and expense type and summing their amounts. It uses `d3.group()` with `.key()` and `.rollup()` to aggregate the nested data, then renders the result as an HTML table with `thead`, `tbody`, `tr`, and `td` elements. The table shows three columns—Head Group, Expense Type, and Total—with sub-rows for each expense type beneath its group, and a cell for the aggregated sum. The data is hardcoded as an array of objects with fields for group, type, date, and amount.
AI-generated descriptionA bare minimum HTML page.
MIT Licensed