这是我的api,存储在url中
[
{
"Name": "A",
"X":10
"Y":30
"Z":20
},
{
"Name": "B",
"X":10
"Y":30
"Z":40
},
{
"Name": "C",
"X":10
"Y":30
"Z":10
},
]
我正在尝试将这些值放在堆积图中
in this sandbox code, i have tried to take the value of countryRegion from the api, but it appears as undefied in the console.
https://codesandbox.io/s/react-chartjs-2-p1gjo
看起来您的结构破坏不正确。
const { data: { countryRegion }, } = await axios.get(changeableUrl);
在您的api中执行此操作