Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Color and Size Legends

Public visualization

Viewing a saved revision (read-only)

38f6548e31c444e18c4a75e56b50fb8e

Color and Size Legends

0 stars0🌍 Public
MMatthiasVanCampen
Last edited Feb 13, 2020
Created on Feb 13, 2020
Forked from Fruitsalad

This example demonstrates two types of chart legends: a color legend for ordinal categories (apple, lemon, lime, orange) and a size legend for a continuous square-root scale. Interactive selection works through clicking any object to highlight its identity. The visualization uses D3 v5 with `scaleOrdinal`, `scaleSqrt`, and the `tick` pattern for legend construction, rendering SVG circles and text. Both legends are composed using the data-join pattern with `.enter()` and `.merge()` to update groups.

AI-generated description

Click Any Object to select it's identity