In the Homepage display the hotel occupation. This will allow the hotel clerk to plan the next days, and better allocate the available resources. The chart should display the hotel occupation in percentage (Y-axis) for the next 7 days (X-axis).
By the end of this exercise, your application should look like this:
- Use the grid, containers, styles, and the calendar icon to create the layout for the chart;
- Use a Line Chart, and set its height to 200;
- In the Preparation, create the logic to build the data to be plotted on the chart:
- Get all rooms in the hotel to be able to calculate the percentage of occupation;
- Use a local variable to hold the date we’re calculating the occupation. Start on today’s date;
- If the date in the local variable is within the next 7 days:
- Get all rooms Booked or Checked-in on the date;
- Build a DataPoint with the percentage of occupation for the date;
- Append the DataPoint to a list of data points;
- Add one day to the date on the local variable;
- Go back to the If.
- Pass the list of data points to the chart.