Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Dot Plot: Goals: MessiVRonaldo

Public visualization

Viewing a saved revision (read-only)

9cc2defc87984b7398e50080fcb34a0f

Dot Plot: Goals: MessiVRonaldo

1 star0🌍 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.