Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Shapes and Colors with SVG and CSS

Public visualization

Viewing a saved revision (read-only)

175bf8b05aee46b38ecde5a57fe6be66

Shapes and Colors with SVG and CSS

0 stars1🌍 Public
OOsekovS
Last edited Aug 17, 2020
Created on Aug 12, 2020

This example shows a horizontal bar chart of population data for ten countries, using SVG rectangles rendered with D3 v5. The visualization scales bar lengths with `d3.scaleLinear` and spaces categories using `d3.scaleBand`, while `d3.axisBottom` and `d3.axisLeft` provide labeled axes. CSS styles the bars in pink, and the code reads from a CSV file, formats tick labels with `d3.format`, and logs clicked elements to the console.

AI-generated description

An example including some commonly used features of SVG.