Barplot
✓ Published0🌍 Public
This example shows a horizontal bar plot ranking the ten most populous countries, with population values read from a local CSV file and displayed on a linear scale. The code uses D3 v5 APIs including `csv`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` to render an SVG chart. Population numbers are formatted using `format('.3s')` with a custom replace for billions, and the chart includes a title and axis label styled via CSS, with grid lines drawn from the x-axis ticks.
AI-generated descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.
MIT Licensed