我正在构建一个React仪表板Web应用程序,并从中获取数据 api。将数据传递给组件时,会产生上述错误。预期数字为“…0 A 25 25 0 1 1 NaN NaN”。
import PieChart from 'react-minimal-pie-chart';
render() {
const { totalBudget, expenses } = this.state.jsonData;
const total_Budget = this.state.jsonData.totalBudget;
function noOfPage() {
return Math.ceil(expenses.length / pageSize);
}
return (
<div className="row">
<div className="col-md-6">
<PieChart
data={[
{ title: 'Total Budget', value: {totalBudget}, color: '#ccc' },
{ title: 'Total Expenses', value: 1200000, color: '#C13C37' }
]}
/>
</div>
</div>)
}