Skip to main content
100%

Color and Size Legends

✓ Published0🌍 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

MIT Licensed

Similar vizzes