Skip to main content
Public

Share visualization

Loading preview…

Fork of Flowers with D3

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Fork of Flowers with D3

1
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.

Comments

Sign in to join the discussion.

MIT Licensed