🌍 Public
Viewing a saved revision (read-only)
faeb14b1bb2b4543bf14a9bf8f162363
Making a Bar Chart
This example shows a horizontal bar chart of population by country, using a CSV dataset with ten nations. The visualization renders as SVG within a React framework, with bars displayed in steel blue and axes labeled. The code builds the chart using D3 v5 APIs including `scaleLinear` for the x-axis, `scaleBand` for the y-axis categories, and `axisLeft` and `axisBottom` for tick marks. Data is loaded asynchronously with `csv`, then population values are multiplied by 1,000 before being mapped to bar widths.
AI-generated descriptionA bare minimum HTML page.
See also React Starter.