Skip to main content
100%

Making a Bar Chart

✓ Published0🌍 Public
Ddtrikannad
Last edited May 31, 2021
Created on May 30, 2021
Forked from HTML Starter

This example demonstrates a horizontal bar chart comparing the populations of ten countries, with China leading and Mexico trailing. The chart is built using D3 version 6’s `scaleLinear`, `scaleBand`, `axisBotom`, and `axisLeft` to position bars and ticks. Data is loaded from a JSON file via `d3.json`, with population values multiplied by 1000. Axis labels and a chart title are added as SVG text elements, styled via CSS classes.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes