Skip to main content
100%

Activity 6 Question 1.1

✓ Published0🌍 Public
HHarshita Vairagade
Last edited Apr 14, 2024
Created on Apr 14, 2024

This example renders a horizontal bar chart comparing the population of ten countries for the year 2000. The visualization uses React to construct SVG elements, with D3's `scaleBand` and `scaleLinear` functions mapping categorical country names and continuous population values to the chart's axes. The bars display a tooltip with the formatted population value. The code imports D3 functions like `csv`, `scaleBand`, `scaleLinear`, and `format`, and loads data asynchronously from a GitHub-hosted CSV file.

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