Making a Bar Chart
✓ Published0🌍 Public
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 descriptionMIT Licensed