Skip to main content
100%

Making a Bar Chart

✓ Published0🌍 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
MIT Licensed

Similar vizzes