Skip to main content
100%

Making a Colour Legend

✓ Published1🌍 Public
HHollyClarke19
Last edited Apr 11, 2021
Created on Apr 11, 2021

This example displays the Iris dataset as a scatter plot of petal length against sepal width, with points colored by species. A custom color legend built from the ordinal color scale sits to the right of the plot. The visualization uses React to render SVG elements, with D3 v6 scales and axes. The iris data is loaded from a CSV URL using `d3.csv`, and the legend maps each species name to a colored circle using `scaleOrdinal`.

AI-generated description

A scatter plot showing the Iris dataset and the relationship between Petal Length and Sepal Width (adaptable to any variable) using D3 and React.

MIT Licensed

Similar vizzes