Skip to main content
๐ŸŒ Public

Share visualization

Send this visualization to others.

Making a bar chart

Public visualization

Making a bar chart

0 stars1๐ŸŒ Public
Yyoghurtx
Last edited Nov 4, 2019
Created on Nov 4, 2019

This example shows a horizontal bar chart ranking countries by population, with bars ordered alphabetically along the y-axis and population values on the x-axis. It uses d3.csv to load the data, d3.scaleLinear for the x-scale, d3.scaleBand for the y-scale, and d3.axisLeft and d3.axisBottom to render the axes. The SVG rect elements are filled with steelblue, and the chart is positioned within margins. Population values are converted from thousands to raw numbers before rendering.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed