[Bug]: Donut chart index prop does not render if value is different than "name" #663
Open
2 tasks done
Labels
bug
Something isn't working
Reproduction
https://codesandbox.io/p/devbox/shadcn-vue-donutchartdemo-forked-8z4mt4
Describe the bug
Basically, unless the
index
property is equal to "name", it does not render the text passed in the property.Inspecting the code closely, the bug is due to the fact that the
const omittedData
of the ChartSingleTooltip component is assigning thename
value todata.name
and not for the value passed in theindex
prop of the DonutChart component.I managed to fix the bug in my project by changing the expected to
Object.values(data)[0]
. I don't have enough knowledge to understand whether this would be the best course of action, nor have I checked whether the ChartSingleTooltip component is being used by another and whether this change breaks the behavior in other imports. Nonetheless, I'll submit a PR.In the Reproduction, I described two objects, one with the name property and the other with any other. Hovering the chart, one of the names are rendered while the other one isn't.
This is my first bug report here on GitHub :)
System Info
Contributes
The text was updated successfully, but these errors were encountered: