Skip to main content
100%

barchart

✓ Published0🌍 Public
Ssh1shk1n
Last edited Aug 30, 2021
Created on Aug 24, 2021
Forked from testefaenskap

This bar chart displays the population of ten countries in millions, using horizontal bars sorted in descending order from China to Mexico. The visualization loads data from a local CSV file and renders it as an SVG using D3 v7, applying linear scaling for the x-axis and band scaling for the categorical y-axis. The code employs D3’s `select`, `csv`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` APIs, with steelblue rectangles styled via CSS. The chart’s axes and margins are configured programmatically, and the population values are multiplied by 1,000 before rendering.

AI-generated description
MIT Licensed

Similar vizzes