Failed prop type: The prop `dataKey` is marked as required in `Pie`, but its value is `undefined`. in Pie (created by PieChartContainer)
See original GitHub issueMy current implementation of the PieChart component works, but throws the following error in the console.
Failed prop type: The prop
dataKey
is marked as required inPie
, but its value isundefined
. in Pie (created by PieChartContainer)
I’ve bumped my Recharts version to the latest build of Recharts 1.0.0.alpha.1 which allowed the Pie chart to render, but didn’t suppress the error.
Is this working as intended?
See a snippet of my implementation below…
```
<PieChart onMouseEnter={this.onPieEnter}>
<Pie data={this.props.data} labelLine={false} label={renderCustomizedLabel} innerRadius={60} outerRadius={120} fill="#8884d8">
{ this.props.data.map((entry, index) => <Cell key={index} fill={this.COLORS[index % this.COLORS.length]}/>) }
</Pie>
<Tooltip/>
<Legend />
</PieChart>
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Failed prop type: The prop `dataKey` is marked as required in `Pie ...
Failed prop type : The prop `dataKey` is marked as required in `Pie`, but its value is `undefined`. in Pie (created by PieChartContainer)...
Read more >Prop is marked as required in component, but its value is ...
In console, I am getting an error : Warning: Failed prop type: The prop item is marked as required in Details , but...
Read more >the prop is marked as required in but its value is undefined
Failed prop type: The prop `dataKey` is marked as required in `Pie`, but its value is `undefined`. in Pie (created by PieChartContainer) #740....
Read more >mozilla-central: changeset 166805 ...
Turn a DOM Node and offset into a character offset into this hypertext. ... + "A pie chart container was created successfully."); +...
Read more >Legacy examples | Donut / Pie chart - Developer - SEMrush
import { PieChart, Pie, Cell, Tooltip as TooltipChart, getColor } from '@semcore/chart' ... commonValue = data.reduce((acc, entry) => acc + entry.value, 0);.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
you should add prop ‘dataKey’ in ‘Pie’ component.
example
@xile611
adding prop ‘dataKey’='value in ‘Pie’ component solved the problem, please update the following example. Thanks
http://recharts.org/#/en-US/examples/CustomActiveShapePieChart