Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

D3 Reusable Part

Public visualization

D3 Reusable Part

0 stars1🌍 Public
SSubhendu Karmakar
Last edited Dec 28, 2023
Created on Dec 28, 2023

This example demonstrates a reusable bar chart component built with D3 v7, showing grouped bars for fruit data with animated updates. The chart visualizes multiple chemical element values (Nitrogen, Oxygen, Helium) across fruit categories using a grouped bar layout. The component uses D3 scales including `scaleBand`, `scaleLinear`, and `scaleOrdinal`, with transitions animating bar heights on enter and update. The code highlights a modular pattern where the chart is configured via a `config` object and bound to data using the `selection.call()` mechanism, with SVG rendering and staggered transition delays for a polished effect.

AI-generated description

A try to achieve a reusable chart for barplot and multibarplot

Comments

Sign in to join the discussion.

MIT Licensed