Assignment 8
Display the Occupation for the Next 7 Days
This lesson is part of the Developer Online Class for OutSystems 9 course.
LEARN MORE

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:

  1. Use the grid, containers, styles, and the calendar icon to create the layout for the chart;
  2. Use a Line Chart, and set its height to 200;
  3. 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:
  1. Get all rooms Booked or Checked-in on the date;
  2. Build a DataPoint with the percentage of occupation for the date;
  3. Append the DataPoint to a list of data points;
  4. Add one day to the date on the local variable;
  5. Go back to the If.
  • Pass the list of data points to the chart.