Introduction
Technical Guides
Documentation
Create Doughnut
Tutorial
Here is a step-by-step tutorial on how to complete the function fn:
Define the initial SQL query: The SQL query should select the necessary data from the database. In this case, we want to count the number of users created in the last 30 days and group them by month and year.
Execute the SQL query: Use the query method provided in req to execute the SQL query and get the results.
Display the chart: Use the chartLine method provided in res to send the formatted data as a line chart response.
Final Result
With these steps, you have completed the fn function. Now, when this function is called, it will return a line chart showing the number of users created per month in the last 30 days. Make sure to adjust the code according to your application's specifications and structure.