Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart

Public visualization

Viewing a saved revision (read-only)

89d071e878074c7991184de6bcd36be9

Making a Bar Chart

0 stars0🌍 Public
AAmanda Appiah
Last edited Dec 3, 2018
Created on Dec 3, 2018

This example shows a horizontal bar chart comparing the populations of Australian cities, with each bar’s length proportional to the city’s population. The chart is rendered as SVG using D3 v5, with data loaded from a CSV file and scaled using `d3.scaleLinear` for the x-axis and `d3.scaleBand` for the y-axis. The bars are drawn by appending `rect` elements to the SVG, with their widths computed via the linear scale and heights from the band scale.

AI-generated description