Charts
Payments Overview
Weeks Profit
Used Devices
Modifying data
The data being shown in each chart can be modified. For example, if you go to used-devices component, you’ll see an asynchronous function returning data for the chart. Something like this:
const data = await getDevicesUsedData(timeFrame); // timeFrame being "montly" | "yearly" in this case.
Now go to the definition of getDevicesUsedData()
, from there return data using your own business logic.
At the moment we’re simply returning mock data, you can fetch data from an external API or make db call(we’re using RSC, so you can safely do that) and return the data.
Based on the returned data shape update the used-devices component.