🌍 Public
Viewing a saved revision (read-only)
c552b74282eb4d97a3a7df8f10cbe9f9
Basic Bar Chart
This example displays a horizontal bar chart comparing the populations of ten countries, with bars extending from a shared baseline. The visualization maps each country’s population to bar length using D3’s `scaleLinear` for the x-axis and `scaleBand` for the categorical y-axis. It reads the data from a CSV file, multiplies each population value by 1000, and renders the SVG elements with `axisLeft`, `axisBottom`, and appended `rect` shapes. The chart uses a steelblue fill for the bars.
AI-generated description