Contact Trend Widget ==================== The Contact Trend widget displays a bar graph showing the trend of monthly contacts with breakdown by type. The types are those specified in the lookup codes for Contact Type. The widget utilizes an HTML file, SQL script and Python script as shown below. Since the contact data displayed is the same for all users, Caching should be set to **all users**. To customize the widget, make the following changes primarily to the SQL script: * **Change the number of months to display** by modifying line 2 of the SQL script. The maximum (and also the default) is twelve, but you can have fewer months displayed if desired. Subtract lines from lines 13-25 to match the new number of months you have set. Make sure the final line does not have ``UNION ALL`` at the end. * **Specify the Contact Types to display** by modifying lines 51-57, adding or subtracting lines as necessary and specifying the ContactType (which must exactly match a type in the lookup codes) and the display name at the end of the line (immediately following ``Type_``). * **List the Contact Types** in line 60. Any contact types not in this list will be included under "Other". * **Adjust the HTML code to match** by modifying lines 23-31 of the HTML code. If you have added, deleted or modified contact types in the SQL script, make corresponding adjustments to these lines in the HTML code. 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 Contact Trend widget. As supplied by TouchPoint, the name of the file is WidgetContractsCountTrendHTML. .. literalinclude:: Files/WidgetContactsCountTrend.html :linenos: SQL Script ---------- Below is the SQL script for the Contract Trend widget. As supplied by TouchPoint, the name of the file is WidgetContractsCountTrendSQL. .. literalinclude:: Files/WidgetContactsCountTrend.sql :linenos: Python Script ------------- Below is the Python script for the Contact Trend widget. As supplied by TouchPoint, the name of the file is WidgetContractsCountTrendPython. .. literalinclude:: Files/WidgetContactsCountTrend.py :linenos: | | +--------------------+------------------+ | **Latest Update** | **01/21/2020** | +--------------------+------------------+ Corrected names of the files.