We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0dfae09 commit c8b963dCopy full SHA for c8b963d
src/charts/PieChart/PieChart.tsx
@@ -119,6 +119,8 @@ export default function PieChart({
119
.value((d: any) => d[value]);
120
121
const pie: any = pieGenerator(data);
122
+ const propsData = useMemo(() => pie.map((d: any) => ({[label]: d.data[label], [value]: d.data[value]})), [data])
123
+
124
125
// ********************
126
// STEP 4. Define styles
@@ -237,7 +239,7 @@ export default function PieChart({
237
239
{pie.map((d: any, i: number) => (
238
240
<g key={`g + ${i}`}>
241
<Arc
- data={{ [label]: d.data[label], [value]: d.data[value] }}
242
+ data={propsData[i]}
243
dataTestId={`pie-chart-arc-${i}`}
244
key={d.label}
245
fill={colorScale(keys[i])}
0 commit comments