Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart

Public visualization

Viewing a saved revision (read-only)

fc1b32e85bce4f3db3e00718f1b59798

Making a Bar Chart

0 stars1🌍 Public
PPenguin-jpg
Last edited Sep 13, 2023
Created on Sep 13, 2023

This example displays a horizontal bar chart ranking ten countries by population, with population values on the x-axis and country names on the y-axis. It uses d3.csv to load the data, d3.scaleLinear and d3.scaleBand for the scales, and d3.axisLeft and d3.axisBottom to render the axes. The bars are drawn as SVG rectangles scaled by population, and the visualization updates through a render function. The code also demonstrates ES6 module imports and local data loading in a VizHub context.

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.