Closed Mahesha999 closed 2 years ago
I guess the doc specifies it incorrectly, it should be have been:
"data": { "name": "table" },
instead of
"data": [{ "name": "table" }],
in radialChart.js.
Changing this fixes the issue as you can see in the corresponding sandbox, the visualization is rendered.
Now that I have resolved it myself, I will be happy if someone tells me how one can come up with this from the source code of react-vega.
The example in the docs is Vega. Your spec here is Vega-Lite, which uses a different way to add data as you noticed.
Attempt 1 - data hardcoded in spec (working)
When I hardcode data in specs, it works. (check on codesandbox):
radialChart.js
index.js
It renders:
Attempt 2 - dynamic data as suggested by docs (not working)
I tried to dynamically pass the data. Approach#1 here suggests the following changes:
radialChart.js
radialData.js
index.js
However its not working. It gives following error:
and a warnings:
Here is the codesandbox. Here is the line in github where it is breaking which corresponds to line 86 in this bundled file. Did I make any mistake?
Update
Even passing data directly to
RadialChart
doesn't work (sandbox link):