Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Donut chart index prop does not render if value is different than "name" #663

Open
2 tasks done
decito opened this issue Jul 17, 2024 · 1 comment
Open
2 tasks done
Labels
bug Something isn't working

Comments

@decito
Copy link

decito commented Jul 17, 2024

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 the name value to data.name and not for the value passed in the index 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

System:
    OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (2) x64 AMD EPYC
    Memory: 1.78 GB / 4.01 GB
    Container: Yes
    Shell: Unknown
Binaries:
    Node: 18.20.4 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.7.0 - /usr/local/bin/npm
npmPackages:
    @vueuse/core: ^10.11.0 => 10.11.0 
    radix-vue: ^1.9.0 => 1.9.1 
    shadcn-vue: latest => 0.10.5 
    vue: latest => 3.4.32

Contributes

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests
@decito decito added the bug Something isn't working label Jul 17, 2024
@entl
Copy link

entl commented Jul 25, 2024

Hey, could you please double-check access rights to the codesandbox, thanks.

Devbox not found
It's likely that the Devbox you're trying to access doesn't exist or you don't have the required permissions to access it.
If the issue persists, please contact our support team at [[email protected]](mailto:[email protected]) for further assistance, making sure to copy the error details below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants