Skip to main content
100%

Bar Chart

✓ Published0🌍 Public
NNikithakatta30
Last edited May 13, 2023
Created on May 13, 2023
Forked from Making A Bar Chart

This bar chart displays the top 10 countries by Happiness Score from the World Happiness Report data, sorted in descending order before rendering. The chart uses a linear scale for the x-axis (Happiness Score) and a band scale for the y-axis (Country names), with bars filled in steelblue. The code leverages D3 v5’s `scaleLinear`, `scaleBand`, `axisLeft`, `axisBottom`, and `csv` to load and process the data, while React handles the component structure. The y-axis labels are cleaned by removing gridlines and domain paths, and the x-axis is labeled “Happiness Score.”

AI-generated description
MIT Licensed

Similar vizzes