Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

A6 Diverging Color Scale Bar Chart

Public visualization

Viewing a saved revision (read-only)

f2ecbc6f408a42318b23238a5251ab78

A6 Diverging Color Scale Bar Chart

0 stars0🌍 Public
AAllen Jake Polintan
Last edited Mar 2, 2024
Created on Mar 2, 2024
Forked from HTML Starter

This example visualizes life expectancy in 1960 for a selection of countries using a diverging color scale bar chart. The bars are colored on a green-to-red gradient via a sequential scale with an RdYlGn interpolator, where higher life expectancies appear greener and lower ones redder. The chart uses D3 v7 to load data from a CSV file, create SVG bars with band and linear scales, and render axes with tick labels. A custom legend and axis titles are added using D3’s selection and axis methods, while the underlying data is sourced from a shortened TidyTuesday dataset.

AI-generated description