Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Butter Macronutrients

Public visualization

Viewing a saved revision (read-only)

2d84595fd1b04fbc90e7e1a31e099126

Fork of Butter Macronutrients

0 stars0🌍 Public
224cs077@kpriet.ac.in
Last edited Aug 18, 2025
Created on Aug 18, 2025
Forked from Clickable Circles

This example shows a reusable pie chart that displays two different macronutrient datasets, toggled by a button. The chart renders SVG arcs with white text labels at each slice’s centroid, using `d3.pie()` and `d3.arc()`. It demonstrates a function-based reusable chart pattern with getter/setter methods for width, height, value, label, and color scales. The `d3.schemeCategory10` ordinal scale assigns colors to slices, and the button switches between the two sample datasets.

AI-generated description