Making a Bar Chart
✓ Published0🌍 Public
This example shows a scatterplot of automobile data, mapping each car’s horsepower on the x-axis and its weight on the y-axis, with a title and labeled axes. It uses D3 v5’s `scaleLinear`, `axisBottom`, and `axisLeft` APIs, loading CSV data via `d3.csv` from a VizHub dataset. The SVG render draws red, semi-transparent circles for each car, with margins, tick marks, and custom text labels styled via CSS. The code explicitly parses numeric columns before rendering.
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