How to use ChartConfig with remote data? #4609
Unanswered
predofrazao
asked this question in
Q&A
Replies: 2 comments 1 reply
-
Hi Pedro, I'm in the same situation as you right now. Did you find any answers or suggestions? |
Beta Was this translation helpful? Give feedback.
1 reply
-
I solved this problem with a mix of @predofrazao's solution and reading the Rechart documentation. Instead of trying to pass the color inside the shadcn Chart component, I used the Cell component from rechart itself to set the color manually. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm quite confused about ChartConfig, especially in my case where the chart is created by the user. It seems like the same object handle the keys and some values of the chart data object.
I have this data:
And to create a
ChartConfig
from this data, I'm using:I can't even use
satisfies ChartConfig
because TS will give me this error:And with that, I could properly create a RadialBarChart
Despite it worked, I fell that it isn't right. I would appreciate some tips to better handle remote chart data in
ChartConfig
.Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions