Skip to main content
๐ŸŒ Public

Share visualization

Send this visualization to others.

Color and Size Legends

Public visualization

Color and Size Legends

0 stars0๐ŸŒ Public
EEllednera
Last edited Nov 17, 2020
Created on Nov 15, 2020

This example demonstrates two types of legends for scatterplot-like data. A color legend uses an ordinal scale to map fruit names to distinct colors, displayed with evenly spaced circles and labels. A size legend uses a square-root scale to map numeric values to circle radii, showing larger circles at the top with tick marks. Both legends are built with D3 v6 selections, using `.enter().append()`, `.merge()`, and `.exit()` to manage groups, with SVG circles and text rendered in an HTML page.

AI-generated description

Color Legend

Comments

Sign in to join the discussion.

MIT Licensed