Making a Bar Chart
✓ Published1🌍 Public
This example shows a horizontal bar chart of the populations of ten countries, using data from a CSV file. The chart renders as SVG, with country names on the y-axis and population totals on the x-axis, scaled linearly. The code uses D3 v5 methods like `csv`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` to load data, compute scales, and draw axes, while appending rectangles for each bar. Population values are multiplied by 1000 after parsing.
AI-generated descriptionA bare minimum HTML page.
See also React Starter.
MIT Licensed