Skip to main content
100%

Pivot Table with D3.js

✓ Published1🌍 Public
Hhelbizfy
Last edited Oct 23, 2023
Created on Oct 23, 2023
Forked from Hello HTML

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 description

A bare minimum HTML page.

MIT Licensed

Similar vizzes