Fork of Butter Macronutrients
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.