/**
 * @fileoverview added by tsickle
 * Generated from: business-component/chart/combiination/basic-bar-line/basic-bar-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 { BasicBarLineService } from './basic-bar-line.service';
import { ChartOptionService } from '../../service/chart-option.service';
import { ChartResizeService } from '../../service/chart-resize.service';
var BasicBarLineComponent = /** @class */ (function () {
    function BasicBarLineComponent(commonService, basicBarLineService, chartOptionService, chartResizeService) {
        this.commonService = commonService;
        this.basicBarLineService = basicBarLineService;
        this.chartOptionService = chartOptionService;
        this.chartResizeService = chartResizeService;
        this.chartTitle = {
            show: true,
            label: "图表标题"
        };
        // 布局设置
        // cardpadding
        this.cardPadding = "1rem";
        this.cardBgColor = "#fff";
        this.chartTitleColor = '';
        // eachrt图表元素
        this.chartBackgroundColor = "#fff";
        this.chartColors = this.chartOptionService.getChartColors("default");
        this.chartTitles = this.chartOptionService.getChartTitle();
        this.chartLegend = this.chartOptionService.getChartLegend();
        this.chartGrid = this.commonService.changeFontSize().interval;
        this.chartxAxis = this.basicBarLineService.getChartxAxis();
        this.chartyAxis = this.chartOptionService.getChartyAxis(2);
        this.chartTextStyle = this.chartOptionService.getTextStyle();
        this.lineChartSeries = this.basicBarLineService.getDefaultLineSeries();
        this.barChartSeries = this.basicBarLineService.getDefaultBarSeries();
        this.chartTooltip = this.basicBarLineService.getDefaultTooltip();
        this.chartSeriesList = [];
        this.chartOption = {
            backgroundColor: this.chartBackgroundColor,
            title: this.chartTitles,
            legend: this.chartLegend,
            grid: this.chartGrid,
            xAxis: this.chartxAxis,
            yAxis: this.chartyAxis,
            series: this.chartSeriesList,
            tooltip: this.chartTooltip,
            color: this.chartColors,
            textStyle: this.chartTextStyle
        };
        this.initOpts = this.chartOptionService.getInitOpts();
        // 图例位置印象grid，所以图例位置接口必须放在smallMode接口后面
        this.legendPosition = "right";
        this.dataSourceSelectData = [];
        this.bcacDataSourceSelectEmit = new EventEmitter();
        // X轴刻度间隔
        this.intervalDatas = [];
        // 加载等待
        this._bcacChartLoading = false;
    }
    /**
     * @param {?} ec
     * @return {?}
     */
    BasicBarLineComponent.prototype.onOptionInit = /**
     * @param {?} ec
     * @return {?}
     */
    function (ec) {
        this.optionInit = ec;
    };
    // echart配置项
    // echart配置项
    /**
     * @return {?}
     */
    BasicBarLineComponent.prototype.initEchart = 
    // echart配置项
    /**
     * @return {?}
     */
    function () {
        this.options = this.chartOption;
    };
    /**
     * @return {?}
     */
    BasicBarLineComponent.prototype.updateOption = /**
     * @return {?}
     */
    function () {
        if (this.optionInit) {
            this.optionInit.setOption(this.options, true);
        }
    };
    Object.defineProperty(BasicBarLineComponent.prototype, "bcacDarkMode", {
        //接口区
        set: 
        //接口区
        /**
         * @param {?} darkMode
         * @return {?}
         */
        function (darkMode) {
            this.basicBarLineService.changeChartTitleDark(this, darkMode);
            this.basicBarLineService.chartBackgroundColorDarkMode(this.chartOption);
            this.basicBarLineService.xAxisDarkMode(this.chartxAxis);
            this.basicBarLineService.yAxisDarkMode(this.chartyAxis);
            this.basicBarLineService.colorsDarkMode(this.chartColors);
            this.basicBarLineService.legendDarkMode(this.chartLegend);
            this.basicBarLineService.seriesDarkMode(this.lineChartSeries);
            this.basicBarLineService.seriesDarkMode(this.barChartSeries);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BasicBarLineComponent.prototype, "bcacSmallMode", {
        // 小边距模式
        set: 
        // 小边距模式
        /**
         * @param {?} smallMode
         * @return {?}
         */
        function (smallMode) {
            if (smallMode) {
                this.basicBarLineService.setSmallModeGrid(this.chartGrid);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BasicBarLineComponent.prototype, "bcacLegendPosition", {
        set: /**
         * @param {?} legendPosition
         * @return {?}
         */
        function (legendPosition) {
            this.legendPosition = legendPosition;
            this.basicBarLineService.setLegendPosition(this.chartGrid, this.chartLegend, legendPosition);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BasicBarLineComponent.prototype, "bcacTitleSwitch", {
        // title开关
        set: 
        // title开关
        /**
         * @param {?} titleSwitch
         * @return {?}
         */
        function (titleSwitch) {
            this.chartTitle.show = titleSwitch;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BasicBarLineComponent.prototype, "bcacTitle", {
        // title文字
        set: 
        // title文字
        /**
         * @param {?} title
         * @return {?}
         */
        function (title) {
            this.chartTitle.label = title;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BasicBarLineComponent.prototype, "bcacXaxisName", {
        // x轴name
        set: 
        // x轴name
        /**
         * @param {?} xAxisname
         * @return {?}
         */
        function (xAxisname) {
            this.basicBarLineService.setXaxisName(this.chartxAxis, xAxisname);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BasicBarLineComponent.prototype, "bcacYaxisName", {
        // y轴name
        set: 
        // y轴name
        /**
         * @param {?} yAxisNames
         * @return {?}
         */
        function (yAxisNames) {
            this.basicBarLineService.setYaxisName(this.chartyAxis, yAxisNames);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BasicBarLineComponent.prototype, "bcacYnameGap", {
        // y轴name与坐标轴的距离
        set: 
        // y轴name与坐标轴的距离
        /**
         * @param {?} yNameGap
         * @return {?}
         */
        function (yNameGap) {
            this.basicBarLineService.setYnameGap(this.chartyAxis, yNameGap);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BasicBarLineComponent.prototype, "bcacColors", {
        // 颜色
        set: 
        // 颜色
        /**
         * @param {?} colorList
         * @return {?}
         */
        function (colorList) {
            this.basicBarLineService.chartColorsChange(this.chartColors, colorList);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BasicBarLineComponent.prototype, "bcacAreaStyleSwitch", {
        // 折线区域开关
        set: 
        // 折线区域开关
        /**
         * @param {?} areaStyleSwitch
         * @return {?}
         */
        function (areaStyleSwitch) {
            if (areaStyleSwitch) {
                this.lineChartSeries['areaStyle'] = {};
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BasicBarLineComponent.prototype, "bcacSeriesLabelSwitch", {
        // 系列label显示开关 （柱状图上的值）
        set: 
        // 系列label显示开关 （柱状图上的值）
        /**
         * @param {?} seriesLabelSwitch
         * @return {?}
         */
        function (seriesLabelSwitch) {
            if (seriesLabelSwitch == false) {
                this.barChartSeries['label']['show'] = false;
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BasicBarLineComponent.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.name,
                        value: e.name,
                        checked: true
                    });
                }));
            }
            this.legendDataList = legendDataList;
            this.basicBarLineService.buildSeries(chartData, this.chartSeriesList, this.chartxAxis, this.lineChartSeries, this.barChartSeries);
            this.updateOption();
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @param {?} e
     * @return {?}
     */
    BasicBarLineComponent.prototype.legendChange = /**
     * @param {?} e
     * @return {?}
     */
    function (e) {
        this.basicBarLineService.topLegendChange(e, this.optionInit);
    };
    Object.defineProperty(BasicBarLineComponent.prototype, "bcacDataSourceList", {
        set: /**
         * @param {?} value
         * @return {?}
         */
        function (value) {
            this.dataSourceSelectData = value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BasicBarLineComponent.prototype, "bcacYAxisMin", {
        set: /**
         * @param {?} min
         * @return {?}
         */
        function (min) {
            this.basicBarLineService.setYAxisMin(this.chartyAxis, min);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BasicBarLineComponent.prototype, "bcacYAxisMax", {
        set: /**
         * @param {?} max
         * @return {?}
         */
        function (max) {
            this.basicBarLineService.setYAxisMax(this.chartyAxis, max);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BasicBarLineComponent.prototype, "bcacYAxisInterval", {
        set: /**
         * @param {?} interval
         * @return {?}
         */
        function (interval) {
            this.basicBarLineService.setYAxisInterval(this.chartyAxis, interval);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BasicBarLineComponent.prototype, "bcacYAxisSplitLine", {
        set: /**
         * @param {?} splitLine
         * @return {?}
         */
        function (splitLine) {
            this.basicBarLineService.setYAxisSplitLine(this.chartyAxis, splitLine);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BasicBarLineComponent.prototype, "bcacUnit", {
        set: /**
         * @param {?} units
         * @return {?}
         */
        function (units) {
            this.basicBarLineService.setUnit(this.chartTooltip, units);
            this.updateOption();
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @param {?} e
     * @return {?}
     */
    BasicBarLineComponent.prototype.dataSourceChange = /**
     * @param {?} e
     * @return {?}
     */
    function (e) {
        this.bcacDataSourceSelectEmit.emit(e);
    };
    /**
     * @param {?} e
     * @return {?}
     */
    BasicBarLineComponent.prototype.intervalSelectedDataChange = /**
     * @param {?} e
     * @return {?}
     */
    function (e) {
        // 跟新图表interval
        this.basicBarLineService.setInterval(this.chartOption, e);
        this.updateOption();
    };
    /**
     * @param {?} e
     * @return {?}
     */
    BasicBarLineComponent.prototype.axisScaleChange = /**
     * @param {?} e
     * @return {?}
     */
    function (e) {
        this.basicBarLineService.setInterval(this.chartOption, e);
        this.updateOption();
    };
    Object.defineProperty(BasicBarLineComponent.prototype, "bcacInterValDatas", {
        set: /**
         * @param {?} value
         * @return {?}
         */
        function (value) {
            this.intervalDatas = value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BasicBarLineComponent.prototype, "bcacChartLoading", {
        set: /**
         * @param {?} loading
         * @return {?}
         */
        function (loading) {
            this._bcacChartLoading = loading;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @return {?}
     */
    BasicBarLineComponent.prototype.test = /**
     * @return {?}
     */
    function () {
    };
    /**
     * @return {?}
     */
    BasicBarLineComponent.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);
        }));
    };
    BasicBarLineComponent.decorators = [
        { type: Component, args: [{
                    selector: 'bcac-basic-bar-line',
                    template: "<!-- <div class=\"chart-card\">\r\n  <div nz-row class=\"chart-title\" *ngIf=\"_bcacChartTitle.show\">\r\n    <div nz-col nzSpan=\"10\">\r\n      {{ _bcacChartTitle.label }}\r\n    </div>\r\n  </div>\r\n  <div class=\"chart-body\">\r\n    <bcac-toolbox\r\n      [fileName]=\"_bcacChartFileName\"\r\n      [chartInstance]=\"optionInit\"\r\n    ></bcac-toolbox>\r\n    <div\r\n      echarts\r\n      [options]=\"chartOption\"\r\n      class=\"echarts echartfontsize\"\r\n      [loading]=\"_bcacChartLoading\"\r\n      [autoResize]=\"true\"\r\n      [initOpts]=\"{ renderer: 'canvas', devicePixelRatio: 2 }\"\r\n      (chartInit)=\"onOptionInit($event)\"\r\n    ></div>\r\n  </div>\r\n</div> -->\r\n<div\r\n  class=\"chart-card\"\r\n  [ngStyle]=\"{ 'background-color': cardBgColor, padding: cardPadding }\"\r\n>\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\r\n        [nzTooltipTitle]=\"chartTitle.label\"\r\n        nz-tooltip\r\n        [ngStyle]=\"{ color: chartTitleColor ? chartTitleColor : 'unset' }\"\r\n      >\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\"\r\n      [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=\"intervalDatas.length>0\"\r\n      [bcacSelectData]=\"intervalDatas\"\r\n      (bcacSelectedEmit)=\"axisScaleChange($event)\">\r\n      </bcac-single-select-icon>\r\n      <bcac-legend-toolbox *ngIf=\"legendPosition==='top'\"\r\n      [bcacSelectValue]=\"legendDataList\"\r\n      (bcacSelectValueEmit)=\"legendChange($event)\">\r\n      </bcac-legend-toolbox>\r\n      <!-- <bcac-toolbox\u00A0[fileName]=\"chartTitle.label\"\u00A0[chartInstance]=\"optionInit\"></bcac-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\r\n        echarts\r\n        [options]=\"chartOption\"\r\n        class=\"echarts echartfontsize\"\r\n        [loading]=\"_bcacChartLoading\"\r\n        [autoResize]=\"true\"\r\n        [initOpts]=\"{ renderer: 'canvas', devicePixelRatio: 2 }\"\r\n        (chartInit)=\"onOptionInit($event)\"\r\n      ></div>\r\n  </div>\r\n</div>\r\n",
                    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{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;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;align-items:center;position:absolute;z-index:2;right:3.5rem;top:-.3rem;min-height:3.2rem}.chart-card .chart-body .customToolBox>bcac-icon{font-size:2.2rem}.chart-card .echarts{width:100%;height:100%!important}.chart-card .echartfontsize{font-size:1.2rem}"]
                }] }
    ];
    /** @nocollapse */
    BasicBarLineComponent.ctorParameters = function () { return [
        { type: CommonService },
        { type: BasicBarLineService },
        { type: ChartOptionService },
        { type: ChartResizeService }
    ]; };
    BasicBarLineComponent.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 }],
        bcacAreaStyleSwitch: [{ type: Input }],
        bcacSeriesLabelSwitch: [{ type: Input }],
        bcacChartData: [{ type: Input }],
        bcacDataSourceList: [{ type: Input }],
        bcacYAxisMin: [{ type: Input }],
        bcacYAxisMax: [{ type: Input }],
        bcacYAxisInterval: [{ type: Input }],
        bcacYAxisSplitLine: [{ type: Input }],
        bcacUnit: [{ type: Input }],
        bcacDataSourceSelectEmit: [{ type: Output }],
        bcacInterValDatas: [{ type: Input }],
        bcacChartLoading: [{ type: Input }]
    };
    return BasicBarLineComponent;
}());
export { BasicBarLineComponent };
if (false) {
    /** @type {?} */
    BasicBarLineComponent.prototype.chartTitle;
    /** @type {?} */
    BasicBarLineComponent.prototype.cardPadding;
    /** @type {?} */
    BasicBarLineComponent.prototype.cardBgColor;
    /** @type {?} */
    BasicBarLineComponent.prototype.chartTitleColor;
    /** @type {?} */
    BasicBarLineComponent.prototype.chartBackgroundColor;
    /** @type {?} */
    BasicBarLineComponent.prototype.chartColors;
    /** @type {?} */
    BasicBarLineComponent.prototype.chartTitles;
    /** @type {?} */
    BasicBarLineComponent.prototype.chartLegend;
    /** @type {?} */
    BasicBarLineComponent.prototype.chartGrid;
    /** @type {?} */
    BasicBarLineComponent.prototype.chartxAxis;
    /** @type {?} */
    BasicBarLineComponent.prototype.chartyAxis;
    /** @type {?} */
    BasicBarLineComponent.prototype.chartTextStyle;
    /** @type {?} */
    BasicBarLineComponent.prototype.lineChartSeries;
    /** @type {?} */
    BasicBarLineComponent.prototype.barChartSeries;
    /** @type {?} */
    BasicBarLineComponent.prototype.chartTooltip;
    /** @type {?} */
    BasicBarLineComponent.prototype.chartSeriesList;
    /** @type {?} */
    BasicBarLineComponent.prototype.chartOption;
    /** @type {?} */
    BasicBarLineComponent.prototype.initOpts;
    /** @type {?} */
    BasicBarLineComponent.prototype.optionInit;
    /** @type {?} */
    BasicBarLineComponent.prototype.options;
    /** @type {?} */
    BasicBarLineComponent.prototype.legendPosition;
    /** @type {?} */
    BasicBarLineComponent.prototype.legendDataList;
    /** @type {?} */
    BasicBarLineComponent.prototype.dataSourceSelectData;
    /** @type {?} */
    BasicBarLineComponent.prototype.bcacDataSourceSelectEmit;
    /** @type {?} */
    BasicBarLineComponent.prototype.intervalDatas;
    /** @type {?} */
    BasicBarLineComponent.prototype.intervalSelectedData;
    /** @type {?} */
    BasicBarLineComponent.prototype._bcacChartLoading;
    /**
     * @type {?}
     * @private
     */
    BasicBarLineComponent.prototype.commonService;
    /**
     * @type {?}
     * @private
     */
    BasicBarLineComponent.prototype.basicBarLineService;
    /**
     * @type {?}
     * @private
     */
    BasicBarLineComponent.prototype.chartOptionService;
    /**
     * @type {?}
     * @private
     */
    BasicBarLineComponent.prototype.chartResizeService;
}
//# sourceMappingURL=data:application/json;base64, 