/**
 * @fileoverview added by tsickle
 * Generated from: business-component/chart/pie/progress-pie/progress-pie.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { Component, Input } from '@angular/core';
import { fromEvent } from 'rxjs';
import { debounceTime } from 'rxjs/operators';
import { CommonService } from '../../service/common.service';
import { ProgressPieService } from './progress-pie.service';
import { ChartOptionService } from '../../service/chart-option.service';
import { ChartResizeService } from '../../service/chart-resize.service';
var ProgressPieComponent = /** @class */ (function () {
    function ProgressPieComponent(commonService, progressPieService, chartOptionService, chartResizeService) {
        this.commonService = commonService;
        this.progressPieService = progressPieService;
        this.chartOptionService = chartOptionService;
        this.chartResizeService = chartResizeService;
        this.chartTitle = {
            show: true,
            label: '图表标题'
        };
        // 布局设置
        this.cardPadding = "1rem";
        this.cardBgColor = "#fff";
        this.chartTitleColor = "";
        // echart图表元素
        this.chartBackgroundColor = "#FFF";
        this.chartColors = this.chartOptionService.getChartColors('default');
        this.chartTitles = this.progressPieService.getDefaultChartTitle();
        this.chartTextStyle = this.chartOptionService.getTextStyle();
        this.pieSeries = this.progressPieService.getProgressPieSeries();
        this.chartSeriesList = [];
        this.chartOption = {
            backgroundColor: this.chartBackgroundColor,
            title: this.chartTitles,
            series: this.chartSeriesList,
            color: this.chartColors,
            textStyle: this.chartTextStyle
        };
        this.initOpts = this.chartOptionService.getInitOpts();
        // 加载等待
        this._bcacChartLoading = false;
        this.dataSourceSelectData = [];
    }
    /**
     * @param {?} ec
     * @return {?}
     */
    ProgressPieComponent.prototype.onOptionInit = /**
     * @param {?} ec
     * @return {?}
     */
    function (ec) {
        this.optionInit = ec;
    };
    Object.defineProperty(ProgressPieComponent.prototype, "bcacDarkMode", {
        set: /**
         * @param {?} darkMode
         * @return {?}
         */
        function (darkMode) {
            if (darkMode == true) {
                this.progressPieService.changeChartTitleDark(this, darkMode);
                this.progressPieService.chartBackgroundColorDarkMode(this.chartOption);
                this.progressPieService.colorsDarkMode(this.chartColors);
                this.progressPieService.seriesDarkMode(this.pieSeries);
                this.progressPieService.chartTitleDarkMode(this.chartTitles);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ProgressPieComponent.prototype, "bcacSmallMode", {
        set: /**
         * @param {?} smallMode
         * @return {?}
         */
        function (smallMode) {
            if (smallMode) {
                this.progressPieService.setSmallModePadding(this);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ProgressPieComponent.prototype, "bcacTitleSwithch", {
        // 标题开关
        set: 
        // 标题开关
        /**
         * @param {?} titleSwitch
         * @return {?}
         */
        function (titleSwitch) {
            this.chartTitle.show = titleSwitch;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ProgressPieComponent.prototype, "bcacTitle", {
        // 标题
        set: 
        // 标题
        /**
         * @param {?} title
         * @return {?}
         */
        function (title) {
            this.chartTitle.label = title;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ProgressPieComponent.prototype, "bcacColors", {
        set: /**
         * @param {?} colorList
         * @return {?}
         */
        function (colorList) {
            this.progressPieService.chartColorsChange(this.chartColors, colorList);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ProgressPieComponent.prototype, "bcacChartLoading", {
        set: /**
         * @param {?} loading
         * @return {?}
         */
        function (loading) {
            this._bcacChartLoading = loading;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ProgressPieComponent.prototype, "bcacRadius", {
        set: /**
         * @param {?} radius
         * @return {?}
         */
        function (radius) {
            this.progressPieService.changeChartRadius(this.pieSeries, radius);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ProgressPieComponent.prototype, "bcacClockWise", {
        // 选择图形方向 true:顺时针 
        set: 
        // 选择图形方向 true:顺时针 
        /**
         * @param {?} clockWise
         * @return {?}
         */
        function (clockWise) {
            this.progressPieService.changePieClockWise(clockWise, this.pieSeries);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ProgressPieComponent.prototype, "bcacChartData", {
        set: /**
         * @param {?} chartData
         * @return {?}
         */
        function (chartData) {
            this.progressPieService.buildSeries(chartData, this.chartSeriesList, this.pieSeries);
            this.updateOption();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ProgressPieComponent.prototype, "bcacDataSourceList", {
        set: /**
         * @param {?} value
         * @return {?}
         */
        function (value) {
            this.dataSourceSelectData = value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ProgressPieComponent.prototype, "bcacChartTitle", {
        set: /**
         * @param {?} chartTitle
         * @return {?}
         */
        function (chartTitle) {
            this.progressPieService.setChartTitle(chartTitle, this.chartTitles);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ProgressPieComponent.prototype, "bcacCenter", {
        set: /**
         * @param {?} center
         * @return {?}
         */
        function (center) {
            this.progressPieService.setPieCenter(center, this.pieSeries);
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @param {?} $event
     * @return {?}
     */
    ProgressPieComponent.prototype.legendChange = /**
     * @param {?} $event
     * @return {?}
     */
    function ($event) {
        this.progressPieService.topLegendChange($event, this.optionInit);
    };
    // echart配置项  
    // echart配置项  
    /**
     * @return {?}
     */
    ProgressPieComponent.prototype.initEchart = 
    // echart配置项  
    /**
     * @return {?}
     */
    function () {
        this.options = this.chartOption;
    };
    /**
     * @return {?}
     */
    ProgressPieComponent.prototype.updateOption = /**
     * @return {?}
     */
    function () {
        if (this.optionInit) {
            this.optionInit.setOption(this.options, true);
        }
    };
    /**
     * @return {?}
     */
    ProgressPieComponent.prototype.ngOnInit = /**
     * @return {?}
     */
    function () {
        var _this = this;
        this.initEchart();
        this.updateOption();
        fromEvent(window, 'resize').pipe(debounceTime(200)).subscribe((/**
         * @return {?}
         */
        function () {
            _this.chartResizeService.autoResizeAdaptPieWithRichLabel(_this.optionInit, _this.options);
        }));
    };
    ProgressPieComponent.decorators = [
        { type: Component, args: [{
                    selector: 'bcac-progress-pie',
                    template: "<div\u00A0class=\"chart-card\" [ngStyle]=\"{'background-color': cardBgColor, 'padding': cardPadding}\">\r\n    <div\u00A0nz-row\u00A0class=\"chart-header\" \u00A0*ngIf=\"chartTitle.show\">\r\n        <div\u00A0nz-col\u00A0nzSpan=\"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            <bcac-chart-menu [fileName]=\"chartTitle.label\" [chartInstance]=\"optionInit\"></bcac-chart-menu>\r\n        </div>\r\n    </div>\r\n    <div\u00A0class=\"chart-body\" [ngClass]=\"{'chart-body-full': !chartTitle.show}\">\r\n        <div echarts [options]=\"options\" class=\"echarts echartfontsize\" [loading]=\"_bcacChartLoading\" [autoResize]=\"true\"\r\n            [initOpts]=\"initOpts\" (chartInit)=\"onOptionInit($event)\">\r\n        </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;overflow:hidden;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 */
    ProgressPieComponent.ctorParameters = function () { return [
        { type: CommonService },
        { type: ProgressPieService },
        { type: ChartOptionService },
        { type: ChartResizeService }
    ]; };
    ProgressPieComponent.propDecorators = {
        bcacDarkMode: [{ type: Input }],
        bcacSmallMode: [{ type: Input }],
        bcacTitleSwithch: [{ type: Input }],
        bcacTitle: [{ type: Input }],
        bcacColors: [{ type: Input }],
        bcacChartLoading: [{ type: Input }],
        bcacRadius: [{ type: Input }],
        bcacClockWise: [{ type: Input }],
        bcacChartData: [{ type: Input }],
        bcacDataSourceList: [{ type: Input }],
        bcacChartTitle: [{ type: Input }],
        bcacCenter: [{ type: Input }]
    };
    return ProgressPieComponent;
}());
export { ProgressPieComponent };
if (false) {
    /** @type {?} */
    ProgressPieComponent.prototype.chartTitle;
    /** @type {?} */
    ProgressPieComponent.prototype.cardPadding;
    /** @type {?} */
    ProgressPieComponent.prototype.cardBgColor;
    /** @type {?} */
    ProgressPieComponent.prototype.chartTitleColor;
    /** @type {?} */
    ProgressPieComponent.prototype.chartBackgroundColor;
    /** @type {?} */
    ProgressPieComponent.prototype.chartColors;
    /** @type {?} */
    ProgressPieComponent.prototype.chartTitles;
    /** @type {?} */
    ProgressPieComponent.prototype.chartTextStyle;
    /** @type {?} */
    ProgressPieComponent.prototype.pieSeries;
    /** @type {?} */
    ProgressPieComponent.prototype.chartSeriesList;
    /** @type {?} */
    ProgressPieComponent.prototype.chartOption;
    /** @type {?} */
    ProgressPieComponent.prototype.initOpts;
    /** @type {?} */
    ProgressPieComponent.prototype.optionInit;
    /** @type {?} */
    ProgressPieComponent.prototype._bcacChartLoading;
    /** @type {?} */
    ProgressPieComponent.prototype.dataSourceSelectData;
    /** @type {?} */
    ProgressPieComponent.prototype.options;
    /**
     * @type {?}
     * @private
     */
    ProgressPieComponent.prototype.commonService;
    /**
     * @type {?}
     * @private
     */
    ProgressPieComponent.prototype.progressPieService;
    /**
     * @type {?}
     * @private
     */
    ProgressPieComponent.prototype.chartOptionService;
    /**
     * @type {?}
     * @private
     */
    ProgressPieComponent.prototype.chartResizeService;
}
//# sourceMappingURL=data:application/json;base64, 