Skip to main content
100%

Sortable Table with Bars

✓ Published0🌍 Public
AAlainRo
Last edited Nov 17, 2017
Created on Nov 17, 2017

This example shows a sortable data table of U.S. state populations by age group. Each cell contains a horizontal bar, drawn as an SVG rectangle, whose length is proportional to the percentage of that state’s total population falling into the corresponding age bracket. Clicking a column header sorts the table rows in descending order by the selected age group’s share of the total, allowing quick comparison across states. Hovering over a row highlights its bars in brown. The table is implemented with D3 v3, binding CSV data to an HTML table and using SVG rects for the in-cell bar charts.

AI-generated description

forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/3719724'>Sortable Table with Bars</a>

forked from <a href='http://bl.ocks.org/zanarmstrong/'>zanarmstrong</a>'s block: <a href='http://bl.ocks.org/zanarmstrong/c5c00a4a3cd208254da2'>Sortable Table with Bars</a>

forked from <a href='http://bl.ocks.org/anonymous/'>anonymous</a>'s block: <a href='http://bl.ocks.org/anonymous/758059634b42ebb0c1e6589c9862e188'>Sortable Table with Bars</a>

mit Licensed

Similar vizzes