Skip to main content
100%

Color and Size Legends

✓ Published0🌍 Public
Pprincit
Last edited Mar 28, 2020
Created on Mar 28, 2020

This example demonstrates how D3 legends can visually encode data through both color and size. It uses a D3 ordinal color scale to map the categories "apple" and "lemon" to red and yellow swatches, while fixed circle radii and text offsets in the custom `colorLegend` function control the legend’s spatial layout. The SVG-based visualization is rendered using D3 v5, with the legend positioned via an SVG transform and styled through external CSS.

AI-generated description
MIT Licensed

Similar vizzes