Skip to main content
100%

Making a basic bar chart with D3.js!

✓ Published4🌍 Public
RRoman Polulekh
Last edited Dec 12, 2022
Created on Dec 5, 2022

This example shows a horizontal bar chart ranking seven countries by count, with purple bars, light gray gridlines, and labeled axes. The data loads from a CSV file and multiplies each count by 1,000 before sorting countries in descending order. Rendering uses SVG elements created with D3 v7, employing `scaleLinear` for the x-axis, `scaleBand` for the y-axis, and `axisLeft`/`axisBottom` for ticks. A custom axis label and title are added via appended text elements.

AI-generated description
MIT Licensed

Similar vizzes