Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Line Graph

Public visualization

Line Graph

0 stars0🌍 Public
NNikithakatta30
Last edited May 14, 2023
Created on May 14, 2023

This example visualizes car sales data from 2013–2021 as a grid of colored rectangles, mapping years to the x-axis and countries to the y-axis, with fill intensity reflecting Happiness_Score. Using D3 v5, it employs `scaleBand` for both axes, `scaleLinear` with an `interpolateRgb`-based range for color encoding, and `axisTop`/`axisLeft` to render axes without tick lines. The chart loads a CSV from a GitHub gist, parses years as dates and scores as numbers, and renders SVG rectangles with a steelblue-to-lightgray color gradient. The code highlights D3’s modular imports (`select`, `csv`, `scaleBand`, `scaleLinear`) and SVG rendering for a heatmap-style matrix.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed