Making a Bar Chart
✓ Published1🌍 Public
This example shows a purple bar chart of sound levels in decibels recorded across a seven-day period. The chart loads and maps data from a CSV file using d3.csv, then scales the values with d3.scaleLinear and d3.scaleBand. It renders axes through d3.axisLeft and d3.axisBottom, and appends rectangles to an SVG canvas to represent each day’s measurement. The bars are drawn dynamically based on the data, with a fixed chart margin and explicit width and height set in the SVG element.
AI-generated descriptionThis 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.
MIT Licensed