private postProcess()

in src/converter/data/dataConverter.ts [791:862]


    private postProcess(
        seriesArray: IDataRepresentationSeries[],
        subtotalSettings: SubtotalSettings,
        tableStyle: TableStyle,
        settings: Settings,
        type: DataRepresentationTypeEnum,
        baseAxis: IDataRepresentationAxis,
    ): IDataRepresentationSeries[] {
        let filteredSeries: IDataRepresentationSeries[] = [];
        let areThereAnyFilledSeries: boolean = false;

        seriesArray.forEach((series: IDataRepresentationSeries, seriesIndex: number) => {
            if (series.hasBeenFilled) {
                this.updateYScale(series, baseAxis);

                this.updateXScale(
                    series,
                    type,
                );

                areThereAnyFilledSeries = true;

                if (series.settings && series.settings.metricName) {
                    if (series.hyperlink) {
                        series.settings.metricName.hideCommonProperties();
                        settings.metricName.updateHyperlinkVisibility(true);
                    }

                    if (series.image) {
                        settings.metricName.updateImageVisibility(true);
                    }
                }

                filteredSeries.push(series);
            } else {
                series.children = this.postProcess(
                    series.children,
                    subtotalSettings,
                    tableStyle,
                    settings,
                    type,
                    baseAxis,
                );

                if (subtotalSettings.show) {
                    this.countSubtotal(series, subtotalSettings.type);
                }

                if (series.children && series.children.length) {
                    filteredSeries.push(series);
                }
            }
        });

        filteredSeries = this.seriesUtils.sortSeriesBySortOrder(filteredSeries, settings.table.sortOrder);

        if (areThereAnyFilledSeries) {
            filteredSeries.forEach((series: IDataRepresentationSeries) => {
                if (series.hasBeenFilled) {
                    if ((tableStyle === TableStyle.AlternatingMetrics || tableStyle === TableStyle.BoldHeaderAndAlternatingMetrics)
                        && this.amountOfFilledSeries % 2
                    ) {
                        series.settings.applyAlternativeBackgroundColor();
                    }

                    this.amountOfFilledSeries++;
                }
            });
        }

        return filteredSeries;
    }