Skip to main content
100%

Barplot

✓ Published0🌍 Public
MMauradion
Last edited May 17, 2021
Created on May 17, 2021

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 description

An example showing the capabilities of VizHub:

  • Loads D3 via UNPKG.
  • Demonstrates use of import from "d3".
  • Demonstrates use of import from local ES6 modules.
MIT Licensed

Similar vizzes