D3 - Sequential scale bar chart
✓ Published0🌍 Public
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 descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.
MIT Licensed