A6 - Bar Chart w/ Sequential Color Scale
✓ Published1🌍 Public
This example visualizes new AIDS diagnoses in 2020 for six countries, using a horizontal bar chart where bar height encodes the diagnosis count and a sequential red color scale encodes the same quantitative value. The visualization includes an axis, gridlines, and a legend for the color scale. The chart is built with D3 v7, using `d3.scaleBand` for the categorical x-axis, `d3.scaleLinear` for the y-axis, and `d3.scaleSequential` with `d3.interpolateReds` for the color mapping. The legend is generated via the `d3.legendColor` API. Data comes from UNAIDS via CORGIS.
AI-generated descriptionData provided by UNAIDS (United Nations AIDS Council)
(Side scrolling for legend)
References:
- d3 SVG Legend (v4)
- D3 Sequential Schemes
- D3 Color Interpolation
- Working with Color
- Prior assignments
MIT Licensed