Making a barchart
✓ Published0🌍 Public
This example shows a horizontal bar chart ranking the populations of ten countries, from China at the top to Mexico at the bottom, scaled to thousands. The visualization uses D3 v5’s `csv` loader to parse the data, `scaleBand` for the y-axis categories, `scaleLinear` and `max` for the x-axis magnitude, and `axisLeft`/`axisBottom` for the ticks. Bars are rendered as SVG `<rect>` elements with a steelblue fill, positioned within a margin-based coordinate system.
AI-generated descriptionMIT Licensed