What is the current behavior?
The dataKey does not exist in the payload of the Legend within the PieChart.
{
"value": "safari",
"color": "",
"payload": {
"browser": "safari",
"downloads": 2159,
"visits": 4048
},
"type": "rect"
}
The payload of the Tooltip contains a dataKey.
{
"stroke": "",
"dataKey": "visits",
"nameKey": "browser",
"name": "chrome",
"hide": false,
"graphicalItemId": "recharts-pie-_r_1_",
"payload": {
"browser": "chrome",
"downloads": 4545,
"visits": 2764
},
"value": 2764
}
Other charts (LineChart and AreaChart) have a dataKey in their payload. For compatibility, we should include dataKey within the payload.
Additionally, if multiple Pie elements exist within a PieChart, the payload of the Legend cannot determine which Pie the data belongs to if the dataKey is missing.
What is the expected behavior?
Please include the dataKey in the payload of Legend.
{
"dataKey": "visits",
"value": "safari",
"color": "",
"payload": {
"browser": "safari",
"downloads": 2159,
"visits": 4048
},
"type": "rect"
}
Which versions of Recharts, and which browser / OS are affected by this issue? Did this work in previous versions of Recharts?
The version is 3.7.0, and dataKey has likely never been provided.
What is the current behavior?
The
dataKeydoes not exist in thepayloadof theLegendwithin thePieChart.The
payloadof theTooltipcontains adataKey.Other charts (
LineChartandAreaChart) have adataKeyin theirpayload. For compatibility, we should includedataKeywithin thepayload.Additionally, if multiple
Pieelements exist within aPieChart, thepayloadof theLegendcannot determine whichPiethe data belongs to if thedataKeyis missing.What is the expected behavior?
Please include the
dataKeyin thepayloadofLegend.Which versions of Recharts, and which browser / OS are affected by this issue? Did this work in previous versions of Recharts?
The version is 3.7.0, and
dataKeyhas likely never been provided.