Commit ca814dca by archer

fix: admin chart

parent 1367ba9d
......@@ -77,13 +77,16 @@ export const Dashboard: React.FC = React.memo(() => {
}).then((res) => res.json())
]);
const data = userResponse.map((item, i) => ({
date: dayjs(item.date).format('MM/DD'),
userCount: item.count,
userIncrease: item.increase,
userIncreaseRate: item.increaseRate,
payCount: payResponse[i].count / PRICE_SCALE
}));
const data = userResponse.map((item, i) => {
const pay = payResponse.find((pay) => item.date === pay.date);
return {
date: dayjs(item.date).format('MM/DD'),
userCount: item.count,
userIncrease: item.increase,
userIncreaseRate: item.increaseRate,
payCount: pay ? pay.count / PRICE_SCALE : 0
};
});
setChatData(data);
};
......@@ -199,6 +202,9 @@ const CustomTooltip = ({ active, payload }: any) => {
}}
>
<p className="label">
日期: <strong>{data.date}</strong>
</p>
<p className="label">
用户总数: <strong>{data.userCount}</strong>
</p>
<p className="label">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment