Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Idempotent Reusable Barchart 101 with Lines

Public visualization

Viewing a saved revision (read-only)

36c422612a884baabba1bbaf1a2effaa

Idempotent Reusable Barchart 101 with Lines

0 stars0🌍 Public
AAlex
Last edited Apr 11, 2023
Created on Apr 11, 2023

A reusable, idempotent bar chart with an overlaid line encodes the proportion of single-detached houses in Canada from 1986 to 2021. Built with D3 v7, it uses `scaleBand` for the year categories, `scaleLinear` for percentages, and `axisLeft` with tick lines for the grid. The chart renders as SVG, with teal bars and a maroon line generated via `line()`. The reusable component pattern exposes setters for data, dimensions, margins, labels, and title, allowing the chart to be called on a new selection each time.

AI-generated description