Skip to main content
100%

Activity 7 - Bar Chart

✓ Published0🌍 Public
Ppasyasahas
Last edited Jul 6, 2023
Created on Jun 28, 2023
Forked from Hello VizHub

This example shows a horizontal bar chart comparing population figures for 20 countries in 2010, with each bar representing a country’s population sorted alphabetically. It uses React to render SVG elements with D3 scales (scaleBand for the y-axis and scaleLinear for the x-axis), along with the csv loader from D3 v5 to fetch data from a GitHub-hosted CSV file. Custom axis components render tick marks and labels, while formatted tick values convert large numbers into abbreviated units like “B” for billions.

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