Skip to main content
100%

Fork of Flowers with D3

✓ Published1🌍 Public
Mmadipadiga.raviteja@gmail.com
Last edited Feb 28, 2024
Created on Feb 28, 2024
Forked from Flowers with D3

This example uses D3 to create a bar chart where each bar is rendered as a flower with five colored petals and a yellow center atop a green stem. The chart displays three categorical data points—Malta, Outer Space, and Netherlands—with scores from 33 to 100, controlling the y-axis height of each flower. The code imports `select`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` from D3, and builds the visualization by appending SVG `rect` elements for stems and `circle` elements for petals positioned using trigonometry. The x-axis uses `scaleBand` to space flowers, while the y-axis uses `scaleLinear` to map scores to heights.

AI-generated description

Creating flowers with D3.

The height of each individual flower can be changed by editing an array.

MIT Licensed

Similar vizzes