Example #1
0
        instanceManager.getById(layout.id, function(_layout) {
            _layout = new api.Layout(instanceRefs, objectApplyIf(layout, _layout));

            if (!util.dom.validateTargetDiv(_layout.el)) {
                return;
            }

            // special handling for YEAR_OVER_YEAR chart types
            if (_layout.type.match(/^YEAR_OVER_YEAR/i)) {
                const options = {};

                if (_layout.aggregationType && _layout.aggregationType !== 'DEFAULT') {
                    options.aggregationType = _layout.aggregationType;
                }

                if (_layout.completedOnly) {
                    options.completedOnly = _layout.completedOnly;
                }

                apiFetchAnalyticsForYearOverYear(_layout, options).then(
                    ({ responses, yearlySeriesLabels }) => {
                        // set responses in layout object so getReport does not perform analytics requests
                        _layout.setResponse(responses);

                        // extra options to pass to createChart() special for YOY chart types
                        extraOptions.yearlySeries = yearlySeriesLabels;
                        extraOptions.xAxisLabels = computeGenericPeriodNames(responses);

                        instanceManager.getReport(_layout);
                    }
                );
            } else {
                instanceManager.getReport(_layout);
            }
        });
Example #2
0
Table.prototype.getUuidObjectMap = function() {
    return objectApplyIf((this.colAxis ? this.colAxis.uuidObjectMap || {} : {}), (this.rowAxis ? this.rowAxis.uuidObjectMap || {} : {}));
};