Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Activity_6_Task_1_Q1.2

Public visualization

Viewing a saved revision (read-only)

2ae590421bb74815ae28f5658ba9ae21

Activity_6_Task_1_Q1.2

0 stars0🌍 Public
AAP19110020041-Pavan Kumar
Last edited Oct 25, 2024
Created on Oct 25, 2024
Forked from Hello VizHub

This chart presents a horizontal bar chart comparing the populations of 20 countries in 2010, using D3 v5 within a React framework. The bars are rendered as SVG rectangles, with the country names on the y-axis and a linear population scale on the x-axis; hovering reveals a tooltip with the formatted value. The code builds axes using `scaleBand` and `scaleLinear`, formats tick labels with `format('.2s')`, and loads data via `d3.csv` from a GitHub-hosted CSV file. Styling is applied through CSS classes for marks and gridline 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.