/**
 * @fileoverview added by tsickle
 * Generated from: business-component/chart/pie/index-pie/index-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 { IndexPieService } from './index-pie.service';
import { ChartOptionService } from '../../service/chart-option.service';
import { ChartResizeService } from '../../service/chart-resize.service';
var IndexPieComponent = /** @class */ (function () {
    function IndexPieComponent(commonService, indexPieService, chartOptionService, chartResizeService) {
        this.commonService = commonService;
        this.indexPieService = indexPieService;
        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.indexPieService.getDefaultChartTitle();
        this.chartTextStyle = this.chartOptionService.getTextStyle();
        this.pieSeries = this.indexPieService.getIndexPieSeries();
        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.dataSourceSelectData = [];
        // 加载等待
        this._bcacChartLoading = false;
    }
    /**
     * @param {?} ec
     * @return {?}
     */
    IndexPieComponent.prototype.onOptionInit = /**
     * @param {?} ec
     * @return {?}
     */
    function (ec) {
        this.optionInit = ec;
    };
    Object.defineProperty(IndexPieComponent.prototype, "bcacDarkMode", {
        set: /**
         * @param {?} darkMode
         * @return {?}
         */
        function (darkMode) {
            if (darkMode == true) {
                this.indexPieService.changeChartTitleDark(this, darkMode);
                this.indexPieService.chartBackgroundColorDarkMode(this.chartOption);
                this.indexPieService.colorsDarkMode(this.chartColors);
                this.indexPieService.seriesDarkMode(this.pieSeries);
                this.indexPieService.chartTitleDarkMode(this.chartTitles);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IndexPieComponent.prototype, "bcacSmallMode", {
        set: /**
         * @param {?} smallMode
         * @return {?}
         */
        function (smallMode) {
            if (smallMode) {
                this.indexPieService.setSmallModePadding(this);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IndexPieComponent.prototype, "bcacTitleSwithch", {
        // 标题开关
        set: 
        // 标题开关
        /**
         * @param {?} titleSwitch
         * @return {?}
         */
        function (titleSwitch) {
            this.chartTitle.show = titleSwitch;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IndexPieComponent.prototype, "bcacTitle", {
        // 标题
        set: 
        // 标题
        /**
         * @param {?} title
         * @return {?}
         */
        function (title) {
            this.chartTitle.label = title;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IndexPieComponent.prototype, "bcacColors", {
        set: /**
         * @param {?} colorList
         * @return {?}
         */
        function (colorList) {
            this.indexPieService.chartColorsChange(this.chartColors, colorList);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IndexPieComponent.prototype, "bcacRadius", {
        set: /**
         * @param {?} radius
         * @return {?}
         */
        function (radius) {
            this.indexPieService.changeChartRadius(this.pieSeries, radius);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IndexPieComponent.prototype, "bcacClockWise", {
        // 选择图形方向 true:顺时针 
        set: 
        // 选择图形方向 true:顺时针 
        /**
         * @param {?} clockWise
         * @return {?}
         */
        function (clockWise) {
            this.indexPieService.changePieClockWise(clockWise, this.pieSeries);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IndexPieComponent.prototype, "bcacChartData", {
        set: /**
         * @param {?} chartData
         * @return {?}
         */
        function (chartData) {
            this.indexPieService.buildSeries(chartData, this.chartSeriesList, this.pieSeries);
            this.updateOption();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IndexPieComponent.prototype, "bcacDataSourceList", {
        set: /**
         * @param {?} value
         * @return {?}
         */
        function (value) {
            this.dataSourceSelectData = value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IndexPieComponent.prototype, "bcacChartTitle", {
        set: /**
         * @param {?} chartTitle
         * @return {?}
         */
        function (chartTitle) {
            this.indexPieService.setChartTitle(chartTitle, this.chartTitles);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IndexPieComponent.prototype, "bcacCenter", {
        set: /**
         * @param {?} center
         * @return {?}
         */
        function (center) {
            this.indexPieService.setPieCenter(center, this.pieSeries);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IndexPieComponent.prototype, "bcacChartLoading", {
        set: /**
         * @param {?} loading
         * @return {?}
         */
        function (loading) {
            this._bcacChartLoading = loading;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @param {?} $event
     * @return {?}
     */
    IndexPieComponent.prototype.legendChange = /**
     * @param {?} $event
     * @return {?}
     */
    function ($event) {
        this.indexPieService.topLegendChange($event, this.optionInit);
    };
    // echart配置项  
    // echart配置项  
    /**
     * @return {?}
     */
    IndexPieComponent.prototype.initEchart = 
    // echart配置项  
    /**
     * @return {?}
     */
    function () {
        this.options = this.chartOption;
    };
    /**
     * @return {?}
     */
    IndexPieComponent.prototype.updateOption = /**
     * @return {?}
     */
    function () {
        if (this.optionInit) {
            this.optionInit.setOption(this.options, true);
        }
    };
    /**
     * @return {?}
     */
    IndexPieComponent.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);
        }));
    };
    IndexPieComponent.decorators = [
        { type: Component, args: [{
                    selector: 'bcac-index-pie',
                    template: "\r\n<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 [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\" [initOpts]=\"initOpts\"\r\n            (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 */
    IndexPieComponent.ctorParameters = function () { return [
        { type: CommonService },
        { type: IndexPieService },
        { type: ChartOptionService },
        { type: ChartResizeService }
    ]; };
    IndexPieComponent.propDecorators = {
        bcacDarkMode: [{ type: Input }],
        bcacSmallMode: [{ type: Input }],
        bcacTitleSwithch: [{ type: Input }],
        bcacTitle: [{ type: Input }],
        bcacColors: [{ type: Input }],
        bcacRadius: [{ type: Input }],
        bcacClockWise: [{ type: Input }],
        bcacChartData: [{ type: Input }],
        bcacDataSourceList: [{ type: Input }],
        bcacChartTitle: [{ type: Input }],
        bcacCenter: [{ type: Input }],
        bcacChartLoading: [{ type: Input }]
    };
    return IndexPieComponent;
}());
export { IndexPieComponent };
if (false) {
    /** @type {?} */
    IndexPieComponent.prototype.chartTitle;
    /** @type {?} */
    IndexPieComponent.prototype.cardPadding;
    /** @type {?} */
    IndexPieComponent.prototype.cardBgColor;
    /** @type {?} */
    IndexPieComponent.prototype.chartTitleColor;
    /** @type {?} */
    IndexPieComponent.prototype.chartBackgroundColor;
    /** @type {?} */
    IndexPieComponent.prototype.chartColors;
    /** @type {?} */
    IndexPieComponent.prototype.chartTitles;
    /** @type {?} */
    IndexPieComponent.prototype.chartTextStyle;
    /** @type {?} */
    IndexPieComponent.prototype.pieSeries;
    /** @type {?} */
    IndexPieComponent.prototype.chartSeriesList;
    /** @type {?} */
    IndexPieComponent.prototype.chartOption;
    /** @type {?} */
    IndexPieComponent.prototype.initOpts;
    /** @type {?} */
    IndexPieComponent.prototype.optionInit;
    /** @type {?} */
    IndexPieComponent.prototype.dataSourceSelectData;
    /** @type {?} */
    IndexPieComponent.prototype._bcacChartLoading;
    /** @type {?} */
    IndexPieComponent.prototype.options;
    /**
     * @type {?}
     * @private
     */
    IndexPieComponent.prototype.commonService;
    /**
     * @type {?}
     * @private
     */
    IndexPieComponent.prototype.indexPieService;
    /**
     * @type {?}
     * @private
     */
    IndexPieComponent.prototype.chartOptionService;
    /**
     * @type {?}
     * @private
     */
    IndexPieComponent.prototype.chartResizeService;
}
//# sourceMappingURL=data:application/json;base64, 