Skip to main content
100%

....................

✓ Published0🌍 Public
KKeerthiAnnem
Last edited Jul 16, 2023
Created on Jul 16, 2023
Forked from Hello VizHub

This horizontal bar chart visualizes the top 10 countries by beauty product spending from a 2018 United Nations population estimate, highlighting the cosmetic industry's revenue. The D3 v5 code uses `scaleLinear` and `scaleBand` to map spending values and country names, with `axisLeft` and `axisBottom` for customized axes. The bars are rendered as SVG rectangles, colored steelblue via CSS, and a `format('.3s')` tick label transforms numbers into readable units. Data is loaded from a CSV file, and the chart title and axis label are added as SVG text elements.

AI-generated description

This bar chart shows population of the top 10 most populous countries. The data comes from the year 2018 estimate in United Nations: World Population Prospects 2017. It also demonstrates customization of D3 axes.

See also the first bar chart visualization that this one builds on: Making a Bar Chart.

MIT Licensed

Similar vizzes