/**
 * @fileoverview added by tsickle
 * Generated from: business-component/chart/line/double-yaxis-line/double-yaxis-line.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { Component, Input, Output, EventEmitter } from '@angular/core';
import { fromEvent } from 'rxjs';
import { debounceTime } from 'rxjs/operators';
import { CommonService } from '../../service/common.service';
import { DoubleYaxisLineService } from './double-yaxis-line.service';
import { ChartOptionService } from '../../service/chart-option.service';
import { ChartResizeService } from '../../service/chart-resize.service';
var DoubleYaxisLineComponent = /** @class */ (function () {
    function DoubleYaxisLineComponent(commonService, lineService, chartOptionService, chartResizeService) {
        this.commonService = commonService;
        this.lineService = lineService;
        this.chartOptionService = chartOptionService;
        this.chartResizeService = chartResizeService;
        this.chartTitle = {
            show: true,
            label: '图表标题'
        };
        // 布局设置
        // cardPadding
        this.cardPadding = "1rem";
        this.cardBgColor = "#FFF";
        this.chartTitleColor = "";
        // echart图表元素
        this.chartBackgroundColor = "#fff";
        this.chartColors = this.chartOptionService.getChartColors("default");
        this.chartTitles = this.chartOptionService.getDefaultChartTitle();
        this.chartLegend = this.chartOptionService.getChartLegend();
        this.chartGrid = this.commonService.changeFontSize().interval;
        this.chartxAxis = this.lineService.getChartxAxis();
        this.chartyAxis = this.chartOptionService.getChartyAxis(2);
        this.chartTextStyle = this.chartOptionService.getTextStyle();
        this.lineChartSeries = this.lineService.getDefaultLineSeries();
        this.chartTooltip = this.chartOptionService.getDefaultTooltip();
        this.chartSeriesList = [];
        this.chartOption = {
            backgroundColor: this.chartBackgroundColor,
            title: this.chartTitles,
            legend: this.chartLegend,
            grid: this.chartGrid,
            xAxis: this.chartxAxis,
            yAxis: this.chartyAxis,
            tooltip: this.chartTooltip,
            color: this.chartColors,
            series: this.chartSeriesList,
            textStyle: this.chartTextStyle
        };
        this.initOpts = this.chartOptionService.getInitOpts();
        this.legendPosition = 'bottom';
        this.dataSourceSelectData = [];
        // x轴刻度间隔
        this.intervalData = [];
        // 加载等待
        this._bcacChartLoading = false;
        this.bcacDataSourceSelectEmit = new EventEmitter();
    }
    /**
     * @param {?} ec
     * @return {?}
     */
    DoubleYaxisLineComponent.prototype.onOptionInit = /**
     * @param {?} ec
     * @return {?}
     */
    function (ec) {
        this.optionInit = ec;
    };
    // echart配置项
    // echart配置项
    /**
     * @return {?}
     */
    DoubleYaxisLineComponent.prototype.initEchart = 
    // echart配置项
    /**
     * @return {?}
     */
    function () {
        this.options = this.chartOption;
    };
    /**
     * @return {?}
     */
    DoubleYaxisLineComponent.prototype.updateOption = /**
     * @return {?}
     */
    function () {
        if (this.optionInit) {
            this.optionInit.setOption(this.options, true);
        }
    };
    Object.defineProperty(DoubleYaxisLineComponent.prototype, "bcacDarkMode", {
        // 属性输入区
        set: 
        // 属性输入区
        /**
         * @param {?} darkMode
         * @return {?}
         */
        function (darkMode) {
            this.lineService.changeChartTitleDark(this, darkMode);
            this.lineService.chartBackgroundColorDarkMode(this.chartOption);
            this.lineService.xAxisDarkMode(this.chartxAxis);
            this.lineService.yAxisDarkMode(this.chartyAxis);
            this.lineService.colorsDarkMode(this.chartColors);
            this.lineService.legendDarkMode(this.chartLegend);
            this.lineService.seriesDarkMode(this.lineChartSeries);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DoubleYaxisLineComponent.prototype, "bcacSmallMode", {
        set: /**
         * @param {?} smallMode
         * @return {?}
         */
        function (smallMode) {
            if (smallMode) {
                this.lineService.setSmallModeGrid(this.chartGrid);
                this.lineService.setSmallModePadding(this);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DoubleYaxisLineComponent.prototype, "bcacLegendPosition", {
        set: /**
         * @param {?} legendPosition
         * @return {?}
         */
        function (legendPosition) {
            this.legendPosition = legendPosition;
            this.lineService.setLegendPosition(this.chartGrid, this.chartLegend, legendPosition);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DoubleYaxisLineComponent.prototype, "bcacTitleSwitch", {
        set: /**
         * @param {?} titleSwitch
         * @return {?}
         */
        function (titleSwitch) {
            this.chartTitle.show = titleSwitch;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DoubleYaxisLineComponent.prototype, "bcacTitle", {
        set: /**
         * @param {?} title
         * @return {?}
         */
        function (title) {
            this.chartTitle.label = title;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DoubleYaxisLineComponent.prototype, "bcacXaxisName", {
        set: /**
         * @param {?} xAxisname
         * @return {?}
         */
        function (xAxisname) {
            this.lineService.setXaxisName(this.chartxAxis, xAxisname);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DoubleYaxisLineComponent.prototype, "bcacYaxisName", {
        set: /**
         * @param {?} yAxisName
         * @return {?}
         */
        function (yAxisName) {
            this.lineService.setYaxisName(this.chartyAxis, yAxisName);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DoubleYaxisLineComponent.prototype, "bcacYnameGap", {
        set: /**
         * @param {?} yNameGap
         * @return {?}
         */
        function (yNameGap) {
            this.lineService.setYnameGap(this.chartyAxis, yNameGap);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DoubleYaxisLineComponent.prototype, "bcacColors", {
        set: /**
         * @param {?} colorList
         * @return {?}
         */
        function (colorList) {
            this.lineService.chartColorsChange(this.chartColors, colorList);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DoubleYaxisLineComponent.prototype, "bcacChartData", {
        set: /**
         * @param {?} chartData
         * @return {?}
         */
        function (chartData) {
            /** @type {?} */
            var legendDataList = [];
            if (chartData && chartData.hasOwnProperty('seriesName')) {
                chartData.seriesName.forEach((/**
                 * @param {?} e
                 * @return {?}
                 */
                function (e) {
                    legendDataList.push({
                        label: e,
                        value: e,
                        checked: true
                    });
                }));
            }
            this.legendDataList = legendDataList;
            this.lineService.buildSeries(chartData, this.chartSeriesList, this.chartxAxis, this.lineChartSeries);
            this.updateOption();
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @param {?} e
     * @return {?}
     */
    DoubleYaxisLineComponent.prototype.legendChange = /**
     * @param {?} e
     * @return {?}
     */
    function (e) {
        this.lineService.topLegendChange(e, this.optionInit);
    };
    Object.defineProperty(DoubleYaxisLineComponent.prototype, "bcacDataSourceList", {
        set: /**
         * @param {?} value
         * @return {?}
         */
        function (value) {
            this.dataSourceSelectData = value;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @param {?} e
     * @return {?}
     */
    DoubleYaxisLineComponent.prototype.intervalSelectedDataChange = /**
     * @param {?} e
     * @return {?}
     */
    function (e) {
        this.lineService.setInterval(this.chartOption, e);
        this.updateOption();
    };
    /**
     * @param {?} e
     * @return {?}
     */
    DoubleYaxisLineComponent.prototype.axisScaleChange = /**
     * @param {?} e
     * @return {?}
     */
    function (e) {
        this.lineService.setInterval(this.chartOption, e);
        this.updateOption();
    };
    Object.defineProperty(DoubleYaxisLineComponent.prototype, "bcacIntervalData", {
        set: /**
         * @param {?} value
         * @return {?}
         */
        function (value) {
            this.intervalData = value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DoubleYaxisLineComponent.prototype, "bcacChartLoading", {
        set: /**
         * @param {?} loading
         * @return {?}
         */
        function (loading) {
            this._bcacChartLoading = loading;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DoubleYaxisLineComponent.prototype, "bcacYAxisMin", {
        set: /**
         * @param {?} yAxisMin
         * @return {?}
         */
        function (yAxisMin) {
            this.lineService.setYAxisMin(yAxisMin, this.chartyAxis);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DoubleYaxisLineComponent.prototype, "bcacYAxisMax", {
        set: /**
         * @param {?} yAxisMax
         * @return {?}
         */
        function (yAxisMax) {
            this.lineService.setYAxisMax(yAxisMax, this.chartyAxis);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DoubleYaxisLineComponent.prototype, "bcacYAxisInterval", {
        set: /**
         * @param {?} yAxisInterval
         * @return {?}
         */
        function (yAxisInterval) {
            this.lineService.setYAxisInterval(yAxisInterval, this.chartyAxis);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DoubleYaxisLineComponent.prototype, "bcacYAxisMinInterval", {
        set: /**
         * @param {?} minInterval
         * @return {?}
         */
        function (minInterval) {
            this.lineService.setYAxisMinInterval(this.chartyAxis, minInterval);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DoubleYaxisLineComponent.prototype, "bcacYAxisSplitLine", {
        set: /**
         * @param {?} splitLine
         * @return {?}
         */
        function (splitLine) {
            this.lineService.setYAxisSplitline(this.chartyAxis, splitLine);
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @param {?} e
     * @return {?}
     */
    DoubleYaxisLineComponent.prototype.dataSourceChange = /**
     * @param {?} e
     * @return {?}
     */
    function (e) {
        this.bcacDataSourceSelectEmit.emit(e);
    };
    /**
     * @return {?}
     */
    DoubleYaxisLineComponent.prototype.ngOnInit = /**
     * @return {?}
     */
    function () {
        var _this = this;
        this.initEchart();
        this.updateOption();
        fromEvent(window, 'resize').pipe(debounceTime(200)).subscribe((/**
         * @return {?}
         */
        function () {
            _this.chartResizeService.autoResizeAdapt(_this.optionInit, _this.options);
        }));
    };
    DoubleYaxisLineComponent.decorators = [
        { type: Component, args: [{
                    selector: 'bcac-double-yaxis-line',
                    template: "<div class=\"chart-card\" [ngStyle]=\"{ 'background-color': cardBgColor, padding: cardPadding }\">\r\n    <div nz-row class=\"chart-header\" *ngIf=\"chartTitle.show\">\r\n        <div nz-col nzSpan=\"12\" class=\"chart-title-label\">\r\n            <span [nzTooltipTitle]=\"chartTitle.label\" nz-tooltip\r\n                [ngStyle]=\"{ color: chartTitleColor ? chartTitleColor : 'unset' }\">\r\n                {{ chartTitle.label }}\r\n            </span>\r\n        </div>\r\n        <div nz-col nzSpan=\"12\" class=\"custom-tool-box\">\r\n            <!-- \u6570\u636E\u6E90\u5207\u6362 -->\r\n            <bcac-select-group *ngIf=\"dataSourceSelectData.length>0\" [bcacSelectList]=\"dataSourceSelectData\"\r\n                (bcacSelectedChange)=\"dataSourceChange($event)\">\r\n            </bcac-select-group>\r\n            <!-- \u7C7B\u76EE\u8F74\u95F4\u9694 -->\r\n            <bcac-single-select-icon *ngIf=\"intervalData.length>0\" [bcacSelectData]=\"intervalData\"\r\n                (bcacSelectedEmit)=\"axisScaleChange($event)\">\r\n            </bcac-single-select-icon>\r\n            <bcac-legend-toolbox *ngIf=\"legendPosition==='top'\" [bcacSelectValue]=\"legendDataList\"\r\n                (bcacSelectValueEmit)=\"legendChange($event)\">\r\n            </bcac-legend-toolbox>\r\n            <bcac-chart-menu [fileName]=\"chartTitle.label\" \u00A0[chartInstance]=\"optionInit\"></bcac-chart-menu>\r\n        </div>\r\n\r\n    </div>\r\n    <div\u00A0class=\"chart-body\" [ngClass]=\"{'chart-body-full': !chartTitle.show}\">\r\n        <div echarts [options]=\"chartOption\" class=\"echarts echartfontsize\" [loading]=\"_bcacChartLoading\"\r\n            [autoResize]=\"true\" [initOpts]=\"{ renderer: 'canvas', devicePixelRatio: 2 }\"\r\n            (chartInit)=\"onOptionInit($event)\"></div>\r\n    </div>\r\n</div>",
                    styles: ["@font-face{font-family:notoSans;src:url(/assets/font/SourceHanSansCN-Regular.ttf) format(\"opentype\")}@font-face{font-family:roboto;src:url(/assets/font/Roboto-Regular.ttf) format(\"opentype\")}body,html{font-family:roboto,notoSans}.chart-card{padding:1rem;background:#fff;height:100%;font-family:notoSans}.chart-card .chart-header{font-size:1.4rem;color:#101010;line-height:1.5em;padding:.4rem}.chart-card .chart-header .chart-title-label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;line-height:1.5em}.chart-card .chart-header .custom-tool-box{text-align:right;display:flex;align-items:center;justify-content:flex-end}.chart-card .chart-body{position:relative;height:calc(100% - 2.9rem)}.chart-card .chart-body.chart-body-full{height:100%}.chart-card .chart-body .customToolBox{display:flex;position:absolute;z-index:2;right:3.8rem;top:-.3rem;min-height:3.2rem;align-items:center}.chart-card .chart-body .customToolBox>bcac-icon{font-size:1.6rem;line-height:1;cursor:pointer}.chart-card .echarts{width:100%;height:100%!important}.chart-card .echartfontsize{font-size:1.2rem}"]
                }] }
    ];
    /** @nocollapse */
    DoubleYaxisLineComponent.ctorParameters = function () { return [
        { type: CommonService },
        { type: DoubleYaxisLineService },
        { type: ChartOptionService },
        { type: ChartResizeService }
    ]; };
    DoubleYaxisLineComponent.propDecorators = {
        bcacDarkMode: [{ type: Input }],
        bcacSmallMode: [{ type: Input }],
        bcacLegendPosition: [{ type: Input }],
        bcacTitleSwitch: [{ type: Input }],
        bcacTitle: [{ type: Input }],
        bcacXaxisName: [{ type: Input }],
        bcacYaxisName: [{ type: Input }],
        bcacYnameGap: [{ type: Input }],
        bcacColors: [{ type: Input }],
        bcacChartData: [{ type: Input }],
        bcacDataSourceList: [{ type: Input }],
        bcacIntervalData: [{ type: Input }],
        bcacChartLoading: [{ type: Input }],
        bcacYAxisMin: [{ type: Input }],
        bcacYAxisMax: [{ type: Input }],
        bcacYAxisInterval: [{ type: Input }],
        bcacYAxisMinInterval: [{ type: Input }],
        bcacYAxisSplitLine: [{ type: Input }],
        bcacDataSourceSelectEmit: [{ type: Output }]
    };
    return DoubleYaxisLineComponent;
}());
export { DoubleYaxisLineComponent };
if (false) {
    /** @type {?} */
    DoubleYaxisLineComponent.prototype.chartTitle;
    /** @type {?} */
    DoubleYaxisLineComponent.prototype.cardPadding;
    /** @type {?} */
    DoubleYaxisLineComponent.prototype.cardBgColor;
    /** @type {?} */
    DoubleYaxisLineComponent.prototype.chartTitleColor;
    /** @type {?} */
    DoubleYaxisLineComponent.prototype.chartBackgroundColor;
    /** @type {?} */
    DoubleYaxisLineComponent.prototype.chartColors;
    /** @type {?} */
    DoubleYaxisLineComponent.prototype.chartTitles;
    /** @type {?} */
    DoubleYaxisLineComponent.prototype.chartLegend;
    /** @type {?} */
    DoubleYaxisLineComponent.prototype.chartGrid;
    /** @type {?} */
    DoubleYaxisLineComponent.prototype.chartxAxis;
    /** @type {?} */
    DoubleYaxisLineComponent.prototype.chartyAxis;
    /** @type {?} */
    DoubleYaxisLineComponent.prototype.chartTextStyle;
    /** @type {?} */
    DoubleYaxisLineComponent.prototype.lineChartSeries;
    /** @type {?} */
    DoubleYaxisLineComponent.prototype.chartTooltip;
    /** @type {?} */
    DoubleYaxisLineComponent.prototype.chartSeriesList;
    /** @type {?} */
    DoubleYaxisLineComponent.prototype.chartOption;
    /** @type {?} */
    DoubleYaxisLineComponent.prototype.initOpts;
    /** @type {?} */
    DoubleYaxisLineComponent.prototype.optionInit;
    /** @type {?} */
    DoubleYaxisLineComponent.prototype.options;
    /** @type {?} */
    DoubleYaxisLineComponent.prototype.legendPosition;
    /** @type {?} */
    DoubleYaxisLineComponent.prototype.legendDataList;
    /** @type {?} */
    DoubleYaxisLineComponent.prototype.dataSourceSelectData;
    /** @type {?} */
    DoubleYaxisLineComponent.prototype.intervalData;
    /** @type {?} */
    DoubleYaxisLineComponent.prototype.intervalSelectedData;
    /** @type {?} */
    DoubleYaxisLineComponent.prototype._bcacChartLoading;
    /** @type {?} */
    DoubleYaxisLineComponent.prototype.bcacDataSourceSelectEmit;
    /**
     * @type {?}
     * @private
     */
    DoubleYaxisLineComponent.prototype.commonService;
    /**
     * @type {?}
     * @private
     */
    DoubleYaxisLineComponent.prototype.lineService;
    /**
     * @type {?}
     * @private
     */
    DoubleYaxisLineComponent.prototype.chartOptionService;
    /**
     * @type {?}
     * @private
     */
    DoubleYaxisLineComponent.prototype.chartResizeService;
}
//# sourceMappingURL=data:application/json;base64, 