/**
 * @fileoverview added by tsickle
 * Generated from: business-component/chart/gauge/index-gauge/index-gauge.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { Component, Input, Output, EventEmitter } from '@angular/core';
import { IndexGaugeService } from './index-gauge.service';
import { fromEvent } from 'rxjs';
import { debounceTime } from 'rxjs/operators';
import { ChartResizeService } from '../../service/chart-resize.service';
import { CommonService } from '../../service/common.service';
import { ChartOptionService } from '../../service/chart-option.service';
var IndexGaugeComponent = /** @class */ (function () {
    function IndexGaugeComponent(commonService, indexGaugeService, chartOptionService, chartResizeService) {
        this.commonService = commonService;
        this.indexGaugeService = indexGaugeService;
        this.chartOptionService = chartOptionService;
        this.chartResizeService = chartResizeService;
        this.chartTitle = {
            show: true,
            label: '图表标题'
        };
        // 布局设置
        // cardpadding
        this.cardPadding = "1rem";
        this.cardBgColor = "#fff";
        this.chartTitleColor = "";
        // echarts 图表元素
        this.chartBackgroundColor = "#fff";
        this.chartColors = this.chartOptionService.getChartColors("default");
        this.chartTitles = this.chartOptionService.getChartTitle();
        this.chartGrid = this.commonService.changeFontSize().interval;
        // chartVisualMap = this.multiDimensionBarService.getPiecewiseVisualMap();
        this.gaugeChartSeries = this.indexGaugeService.getDefaultGaugeService();
        // chartTooltip: EChartOption.Tooltip = this.multiDimensionBarService.getAxisChartWithMultiDimensionTooltip();
        this.chartTooltip = this.chartOptionService.getTooltipOfIndexGauge();
        this.chartSeriesList = [];
        this.chartOption = {
            backgroundColor: this.chartBackgroundColor,
            title: this.chartTitles,
            tooltip: this.chartTooltip,
            series: this.chartSeriesList
        };
        this.initOpts = this.chartOptionService.getInitOpts();
        this.dataSourceSelectData = [];
        this.bcacDataSourceSelectEmit = new EventEmitter();
        // 加载等待
        this._bcacChartLoading = false;
    }
    /**
     * @param {?} ec
     * @return {?}
     */
    IndexGaugeComponent.prototype.onOptionInit = /**
     * @param {?} ec
     * @return {?}
     */
    function (ec) {
        this.optionInit = ec;
    };
    // echarts配置项
    // echarts配置项
    /**
     * @return {?}
     */
    IndexGaugeComponent.prototype.initEchart = 
    // echarts配置项
    /**
     * @return {?}
     */
    function () {
        this.options = this.chartOption;
    };
    /**
     * @return {?}
     */
    IndexGaugeComponent.prototype.updateOption = /**
     * @return {?}
     */
    function () {
        if (this.optionInit) {
            this.optionInit.setOption(this.options, true);
        }
    };
    Object.defineProperty(IndexGaugeComponent.prototype, "bcacDarkMode", {
        // Input 输入区
        set: 
        // Input 输入区
        /**
         * @param {?} darkMode
         * @return {?}
         */
        function (darkMode) {
            this.indexGaugeService.changeChartTitleDark(this, darkMode);
            this.indexGaugeService.chartBackgroundColorDarkMode(this.chartOption);
            this.indexGaugeService.colorsDarkMode(this.chartColors);
            this.indexGaugeService.seriesDarkMode(this.gaugeChartSeries);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IndexGaugeComponent.prototype, "bcacSmallMode", {
        set: /**
         * @param {?} smallMode
         * @return {?}
         */
        function (smallMode) {
            if (smallMode) {
                this.indexGaugeService.setSmallModePadding(this);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IndexGaugeComponent.prototype, "bcacTitle", {
        set: /**
         * @param {?} title
         * @return {?}
         */
        function (title) {
            this.chartTitle.label = title;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IndexGaugeComponent.prototype, "bcacColors", {
        set: /**
         * @param {?} colorList
         * @return {?}
         */
        function (colorList) {
            this.indexGaugeService.chartColorsChange(this.chartColors, colorList);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IndexGaugeComponent.prototype, "bcacMin", {
        set: /**
         * @param {?} min
         * @return {?}
         */
        function (min) {
            this.indexGaugeService.setSeriesMin(this.gaugeChartSeries, min);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IndexGaugeComponent.prototype, "bcacMax", {
        set: /**
         * @param {?} max
         * @return {?}
         */
        function (max) {
            this.indexGaugeService.setSeriesMax(this.gaugeChartSeries, max);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IndexGaugeComponent.prototype, "bcacSplitLineSwitch", {
        set: /**
         * @param {?} splitLine
         * @return {?}
         */
        function (splitLine) {
            this.indexGaugeService.setSplitLine(this.gaugeChartSeries, splitLine);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IndexGaugeComponent.prototype, "bcacAxisTickSwitch", {
        set: /**
         * @param {?} axisTick
         * @return {?}
         */
        function (axisTick) {
            this.indexGaugeService.setAxisTick(this.gaugeChartSeries, axisTick);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IndexGaugeComponent.prototype, "bcacChartData", {
        set: /**
         * @param {?} chartData
         * @return {?}
         */
        function (chartData) {
            if (chartData) {
                this.indexGaugeService.buildSeries(chartData, this.chartSeriesList, this.gaugeChartSeries);
                this.updateOption();
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IndexGaugeComponent.prototype, "bcacDataSourceList", {
        set: /**
         * @param {?} value
         * @return {?}
         */
        function (value) {
            this.dataSourceSelectData = value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IndexGaugeComponent.prototype, "bcacTitleSwitch", {
        set: /**
         * @param {?} titleSwitch
         * @return {?}
         */
        function (titleSwitch) {
            this.chartTitle.show = titleSwitch;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IndexGaugeComponent.prototype, "bcacDetailText", {
        set: /**
         * @param {?} detailText
         * @return {?}
         */
        function (detailText) {
            this.indexGaugeService.setDetailText(detailText, this.gaugeChartSeries, this.chartTooltip);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IndexGaugeComponent.prototype, "bcacSplitNum", {
        set: /**
         * @param {?} splitNum
         * @return {?}
         */
        function (splitNum) {
            this.indexGaugeService.setSplitNumber(this.gaugeChartSeries, splitNum);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IndexGaugeComponent.prototype, "bcacColorRange", {
        set: /**
         * @param {?} colorRange
         * @return {?}
         */
        function (colorRange) {
            this.indexGaugeService.setColorRange(this.gaugeChartSeries, colorRange);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IndexGaugeComponent.prototype, "bcacLabelSwitch", {
        set: /**
         * @param {?} labelSwitch
         * @return {?}
         */
        function (labelSwitch) {
            this.indexGaugeService.setAxisLabel(this.gaugeChartSeries, labelSwitch);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IndexGaugeComponent.prototype, "bcacRadius", {
        set: /**
         * @param {?} radius
         * @return {?}
         */
        function (radius) {
            this.indexGaugeService.setRadius(this.gaugeChartSeries, radius);
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @param {?} $event
     * @return {?}
     */
    IndexGaugeComponent.prototype.dataSourceChange = /**
     * @param {?} $event
     * @return {?}
     */
    function ($event) {
        this.bcacDataSourceSelectEmit.emit($event);
    };
    Object.defineProperty(IndexGaugeComponent.prototype, "bcacChartLoading", {
        set: /**
         * @param {?} loading
         * @return {?}
         */
        function (loading) {
            this._bcacChartLoading = loading;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @return {?}
     */
    IndexGaugeComponent.prototype.ngOnInit = /**
     * @return {?}
     */
    function () {
        var _this = this;
        this.initEchart();
        this.updateOption();
        fromEvent(window, 'resize').pipe(debounceTime(200)).subscribe((/**
         * @return {?}
         */
        function () {
            _this.chartResizeService.autoResizeAdaptGauge(_this.optionInit, _this.options);
        }));
    };
    IndexGaugeComponent.decorators = [
        { type: Component, args: [{
                    selector: 'bcac-index-gauge',
                    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-select-group *ngIf=\"dataSourceSelectData.length>0\" [bcacSelectList]=\"dataSourceSelectData\" (bcacSelectedChange)=\"dataSourceChange($event)\">\r\n            </bcac-select-group>\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;height:100%}.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 */
    IndexGaugeComponent.ctorParameters = function () { return [
        { type: CommonService },
        { type: IndexGaugeService },
        { type: ChartOptionService },
        { type: ChartResizeService }
    ]; };
    IndexGaugeComponent.propDecorators = {
        bcacDarkMode: [{ type: Input }],
        bcacSmallMode: [{ type: Input }],
        bcacTitle: [{ type: Input }],
        bcacColors: [{ type: Input }],
        bcacMin: [{ type: Input }],
        bcacMax: [{ type: Input }],
        bcacSplitLineSwitch: [{ type: Input }],
        bcacAxisTickSwitch: [{ type: Input }],
        bcacChartData: [{ type: Input }],
        bcacDataSourceList: [{ type: Input }],
        bcacTitleSwitch: [{ type: Input }],
        bcacDetailText: [{ type: Input }],
        bcacSplitNum: [{ type: Input }],
        bcacColorRange: [{ type: Input }],
        bcacLabelSwitch: [{ type: Input }],
        bcacRadius: [{ type: Input }],
        bcacDataSourceSelectEmit: [{ type: Output }],
        bcacChartLoading: [{ type: Input }]
    };
    return IndexGaugeComponent;
}());
export { IndexGaugeComponent };
if (false) {
    /** @type {?} */
    IndexGaugeComponent.prototype.chartTitle;
    /** @type {?} */
    IndexGaugeComponent.prototype.cardPadding;
    /** @type {?} */
    IndexGaugeComponent.prototype.cardBgColor;
    /** @type {?} */
    IndexGaugeComponent.prototype.chartTitleColor;
    /** @type {?} */
    IndexGaugeComponent.prototype.chartBackgroundColor;
    /** @type {?} */
    IndexGaugeComponent.prototype.chartColors;
    /** @type {?} */
    IndexGaugeComponent.prototype.chartTitles;
    /** @type {?} */
    IndexGaugeComponent.prototype.chartGrid;
    /** @type {?} */
    IndexGaugeComponent.prototype.gaugeChartSeries;
    /** @type {?} */
    IndexGaugeComponent.prototype.chartTooltip;
    /** @type {?} */
    IndexGaugeComponent.prototype.chartSeriesList;
    /** @type {?} */
    IndexGaugeComponent.prototype.chartOption;
    /** @type {?} */
    IndexGaugeComponent.prototype.initOpts;
    /** @type {?} */
    IndexGaugeComponent.prototype.optionInit;
    /** @type {?} */
    IndexGaugeComponent.prototype.options;
    /** @type {?} */
    IndexGaugeComponent.prototype.dataSourceSelectData;
    /** @type {?} */
    IndexGaugeComponent.prototype.bcacDataSourceSelectEmit;
    /** @type {?} */
    IndexGaugeComponent.prototype._bcacChartLoading;
    /**
     * @type {?}
     * @private
     */
    IndexGaugeComponent.prototype.commonService;
    /**
     * @type {?}
     * @private
     */
    IndexGaugeComponent.prototype.indexGaugeService;
    /**
     * @type {?}
     * @private
     */
    IndexGaugeComponent.prototype.chartOptionService;
    /**
     * @type {?}
     * @private
     */
    IndexGaugeComponent.prototype.chartResizeService;
}
//# sourceMappingURL=data:application/json;base64, 