Skip to main content
100%

Dot Plot: Goals: MessiVRonaldo

✓ Published0🌍 Public
SSimon Hackbert
Last edited Nov 16, 2022
Created on Oct 31, 2022
Forked from D3 Starter

This dot plot compares Lionel Messi and Cristiano Ronaldo’s goal totals by season, with each year on the y-axis and a grey line connecting the two players’ goal counts. The visualization overlays the plot on a football pitch diagram, using SVG rectangles and lines for field markings. Built with D3 v4, it uses `d3.scaleLinear` and `d3.scaleBand` for axes, while circles are colored green for Messi and purple for Ronaldo. Clicking the player labels toggles the corresponding data points’ opacity via `d3.selectAll` and `.transition()`. Data is loaded from a CSV via `d3.csv`.

AI-generated description

A demonstration of how to start using D3 version 6.

MIT Licensed

Similar vizzes