Insights Accumulated Chart With Missing Data Points
Custom script for adding missing values to accumulative YTD chart
Custom widget scripts can only be done by Professional Services and not supported by Maximizer Customer Service.
Custom scripts increase dashboard loading time.
Use case: create a widget with the accumulative number of opportunities by month. No opportunities were registered in July; August; December; and January. By default; months with missing activities won't be shown on X-axis.
This article explains how to add missing data points when Accumulating Values by Month with help of the custom script.
Company's fiscal year in this example starts in February.
Step by step How-to
- Create a widget. For accumulated values by month use Quick Function > Rolling Dates > From the Beginning of the Year
- Go to the 'Edit script' on the top right:
- Copy the Script below
Note: This script automatically makes adjustments for the Fiscal Year Start.
Code
|
widget.on('queryend'; function(widget; args){ |
Pay attention to the correct syntax. In the script editor the script should look like this:
Note: The hardcoded values are only visible on the live dashboards and on widget exports as PNG and not visible on the reports; such as scheduled email delivery or PDFs.
Tips: you can even add hardcoded values to the missing months by changing this part of the script (in pink): cloneData[1].data = 0;