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.
2 parents 0dfae09 + 7a48833 commit b5dc78fCopy full SHA for b5dc78f
src/charts/PieChart/PieChart.tsx
@@ -119,6 +119,11 @@ export default function PieChart({
119
.value((d: any) => d[value]);
120
121
const pie: any = pieGenerator(data);
122
+ const propsData = useMemo(
123
+ () =>
124
+ pie.map((d: any) => ({ [label]: d.data[label], [value]: d.data[value] })),
125
+ [data]
126
+ );
127
128
// ********************
129
// STEP 4. Define styles
@@ -237,7 +242,7 @@ export default function PieChart({
237
242
{pie.map((d: any, i: number) => (
238
243
<g key={`g + ${i}`}>
239
244
<Arc
240
- data={{ [label]: d.data[label], [value]: d.data[value] }}
245
+ data={propsData[i]}
241
246
dataTestId={`pie-chart-arc-${i}`}
247
key={d.label}
248
fill={colorScale(keys[i])}
0 commit comments