Division Comparison Widget ========================== The Division Comparison widget displays a line graph comparing one division's attendance to another's over the past twelve weeks. The comparison is represented with the first division's attendance as a percentage of the second division's. Up to three years (the current year and the previous two) can be displayed with color-coded lines. Alternatively, the first division can be compare to a fixed number -- such as a target attendance or the seating capacity of your facilities. The widget utilizes an HTML file, SQL script and Python script as shown below. Since the attendance data is the same for all users, Caching should be set to **all users**. - To customize the widget to compare two divisions, you will need to change the division names and IDs on lines 7 & 8 of the Python script. Attendance for the first division will be shown as a percentage of attendance for the second division. No more than two divisions should be entered in the script. - To customize the widget to compare a division's attendance to a fixed number, enter the division name and ID on line 7 of the Python script and the fixed number and description on lines 14 & 15. In addition, you will also need to change the value of **displayAttendanceVsAttendance** to **true**. - To configure the number of years (lines) to display on the graph, Modify line 11 setting **startyear** with the first year to include. Only three years can be displayed, so you can select the past year (to compare only last year and this year) or the year before that (to compare the previous two years and the current year). Video ----- Below is a short video demonstrating some of the features of this widget. .. raw:: html | HTML Code --------- Below is the HTML code for the Division Comparison widget. As supplied by TouchPoint, the file name is **WidgetCurrentRatioByWeekHTML**. .. literalinclude:: Files/WidgetCurrentRatioByWeek.html :linenos: SQL Script ---------- Below is the SQL script for the Division Comparison widget. As supplied by TouchPoint, the file name is **WidgetCurrentRatioByWeekSQL**. .. literalinclude:: Files/WidgetCurrentRatioByWeek.sql :linenos: Python Script ------------- Below is the Python script for the Division Comparison widget. As supplied by TouchPoint, the file name is **WidgetCurrentRatioByWeekPython**. .. literalinclude:: Files/WidgetCurrentRatioByWeek.py :linenos: | | +--------------------+------------------+ | **Latest Update** | **08/12/2020** | +--------------------+------------------+ Added video.