Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

D3 - Sequential scale bar chart

Public visualization

Viewing a saved revision (read-only)

cbfddb334e2d4b9a98a3d1a90376d666

D3 - Sequential scale bar chart

0 stars0🌍 Public
CChandana Srinivas
Last edited Mar 5, 2024
Created on Mar 4, 2024
Forked from HTML Starter

This example visualizes life expectancy across different countries using a bar chart where bar colors are mapped through D3’s `scaleSequential` with an `interpolateRgb` gradient from lightgreen to darkgreen. The chart loads CSV data via `d3.csv` from a GitHub gist, renders SVG bars with `d3.axisBottom` and `d3.axisLeft` for axes, and includes a sequential color legend generated by the `d3-legend` plugin. The code explicitly sets the color scale’s domain slightly beyond the data range and applies it to each bar’s fill, while the chart’s background, title, and axis labels are all configured inline.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.