Advanced
The Advanced tab allows you to define JavaScript handlers of events which raise during data processing.
init(data, logger, processor, el, model)
Occurs right after processing is started and before data is requested. You should initialize data in this handler if you don’t use a SharePoint list or library as a data source.
data is an object that will be populated with data. If you use an alternative data source or static data, you should assign an array of objects to its items field and clear the site URL on the SharePoint List tab.
data.items = [item1, item2, item3 …]
logger is a Logger instance.
processor is a chart builder which is currently processing your data.
el is a jQuery object wrapping an HTML-container where the chart will be rendered.
model is an object containing data source configuration.
Returns Deferred, Promiseor another object. If you need to retrieve data from an alternative data return Deferred or Promise object and resolve it when the data will be retrieved and passed to the data object.
requestInit(query, logger, processor, el)
Occurs when the CAML-query is initialized and before data is requested. You can replace tokens in your CAML-query by dynamic values in this handler.
query is a CamlQuery object which will be used to retrieve data.
logger is a Loggerobject.
processor is a chart builder which is currently processing your data.
el is a jQuery object wrapping an HTML-container where the chart will be rendered.
Returns Deferred, Promiseor another object. If you need to perform an asynchronous operation, you can return a Deferred or Promise object and resolve it when the operation is completed.
requestSuccess(data, logger, processor, el)
Occurs when data is retrieved successfully. You can add extra fields to the data items and calculate their values based on other fields in this handler.
data is an object that contains the retrieved data in its items array:
data.items = [item1, item2, item3 …]
logger is a Logger instance.
processor is the chart builder that is currently processing your data.
el is a jQuery object wrapping an HTML-container where the chart will be rendered.
Returns Deferred, Promiseor another object. If you need to call an asynchronous operation, you can return a Deferred or Promise object and resolve it when the operation completes.
requestError(error, logger, processor, el)
Occurs if an error has occurred during the data request.
error is a string representation of the error.
logger is a Logger instance.
processor is a chart builder which is currently processing your data.
el is a jQuery object wrapping an HTML-container where the chart will be rendered.
Returns Deferred, Promise or other object. If you need to call an asynchronous operation, you can return a Deferred or Promise object and resolve it when the operation completes.
aggregationSuccess(data, logger, processor, el)
Occurs when the data is aggregated successfully. You can add extra fields to each group and calculate their values based on the group items in this handler.
data is an object that contains the aggregated data in its groups array:
data.groups = [group1, group2,group3 …]
logger is a Logger instance.
processor is a chart builder which is currently processing your data.
el is a jQuery object wrapping an HTML-container where the chart will be rendered.
Returns Deferred, Promiseor another object. If you need to call an asynchronous operation, you can return a Deferred or Promise object and resolve it when the operation completes.
aggregationError(error, logger, processor, el)
Occurs if an error has occurred during the data aggregation.
error is a string representation of the error.
logger is a Logger instance.
processor is the chart builder which is currently processing your data.
el is a jQuery object wrapping an HTML-container where the chart will be rendered.
Returns Deferred, Promiseor another object. If you need to call an asynchronous operation, you can return a Deferred or Promise object and resolve it when the operation completes.
finish(data, logger, processor, el)
Occurs when the data is processed.
data is an object that contains the data.
logger is a Logger instance.
processor is a chart builder which is currently processing your data.
el is a jQuery object wrapping an HTML-container where the chart will be rendered.
Returns Deferred, Promiseor another object. If you need to call an asynchronous operation, you can return a Deferred or Promise object and resolve it when the operation completes.
Logger
Traces and logs information to the browser console and the console of Dashboard Designer.
Methods:
debug(object)
Outputs the specified object to the Dashboard Designer console only.
info(message)
Outputs the specified message to both the browser and the Dashboard Designer consoles.
warn(message)
Outputs the specified warning to both the browser and the Dashboard Designer consoles.
error(message)
Outputs the specified error to both the browser and the Dashboard Designer consoles.