import { ChangeDetectionStrategy, Component, Injector, Input, } from '@angular/core';
import { ChartSeriesComponent } from './series.component';
export class ChartAreaSeriesComponent extends ChartSeriesComponent {
    constructor(injector) {
        super(injector);
        this.injector = injector;
        this.seriesType = 'area';
        this.startOpacity = 0.2;
        this.endOpacity = 0;
        this.linearGradientXY = {
            x1: '0%',
            x2: '0%',
            y1: '0%',
            y2: '100%',
        };
        this.gradient = (color) => [
            {
                offset: 0,
                color,
                opacity: this.startOpacity,
            },
            {
                offset: 100,
                color,
                opacity: this.endOpacity,
            },
        ];
    }
    getGradientFillId(id) {
        return `url(#${id})`;
    }
}
ChartAreaSeriesComponent.decorators = [
    { type: Component, args: [{
                // eslint-disable-next-line @angular-eslint/component-selector
                selector: 'g[aclAreaSeries]',
                template: "<svg:g class=\"acl-series\">\n  <ng-container *ngFor=\"let item of seriesData\">\n    <svg:defs>\n      <svg:linearGradient\n        [id]=\"item.gradientFillId\"\n        [attr.x1]=\"linearGradientXY.x1\"\n        [attr.y1]=\"linearGradientXY.y1\"\n        [attr.x2]=\"linearGradientXY.x2\"\n        [attr.y2]=\"linearGradientXY.y2\"\n      >\n        <svg:stop\n          *ngFor=\"let stop of item.color | pure: gradient\"\n          [attr.offset]=\"stop.offset + '%'\"\n          [attr.stop-color]=\"stop.color\"\n          [attr.stop-opacity]=\"stop.opacity\"\n        />\n      </svg:linearGradient>\n    </svg:defs>\n\n    <svg:path\n      class=\"area\"\n      [attr.d]=\"item.areaPath\"\n      [attr.fill]=\"item.gradientFillId | pure: getGradientFillId\"\n      [attr.visibility]=\"item.visibility\"\n      [attr.opacity]=\"item.name | pure: handleOpacity:activateLegend\"\n      [attr.stroke-width]=\"\n        (item.name | pure: handleStrokeWidth:activateLegend:lineWidth) + 'px'\n      \"\n    ></svg:path>\n\n    <svg:path\n      class=\"line\"\n      [attr.d]=\"item.path\"\n      [attr.stroke]=\"item.color\"\n      [attr.visibility]=\"item.visibility\"\n      [attr.opacity]=\"item.name | pure: handleOpacity:activateLegend\"\n      [attr.stroke-width]=\"\n        (item.name | pure: handleStrokeWidth:activateLegend:lineWidth) + 'px'\n      \"\n      fill=\"none\"\n    ></svg:path>\n  </ng-container>\n</svg:g>\n",
                changeDetection: ChangeDetectionStrategy.OnPush
            },] }
];
ChartAreaSeriesComponent.ctorParameters = () => [
    { type: Injector }
];
ChartAreaSeriesComponent.propDecorators = {
    seriesType: [{ type: Input }],
    startOpacity: [{ type: Input }],
    endOpacity: [{ type: Input }]
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXJlYS1zZXJpZXMuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvYWxhdWRhLWNvbW1vbi1saWIvc3JjL2NoYXJ0L2NvbW1vbi9zZXJpZXMvYXJlYS1zZXJpZXMuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCx1QkFBdUIsRUFDdkIsU0FBUyxFQUNULFFBQVEsRUFDUixLQUFLLEdBQ04sTUFBTSxlQUFlLENBQUM7QUFFdkIsT0FBTyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFRMUQsTUFBTSxPQUFPLHdCQUF5QixTQUFRLG9CQUFvQjtJQWNoRSxZQUFtQixRQUFrQjtRQUNuQyxLQUFLLENBQUMsUUFBUSxDQUFDLENBQUM7UUFEQyxhQUFRLEdBQVIsUUFBUSxDQUFVO1FBYjVCLGVBQVUsR0FBNEIsTUFBTSxDQUFDO1FBRTdDLGlCQUFZLEdBQUcsR0FBRyxDQUFDO1FBRW5CLGVBQVUsR0FBRyxDQUFDLENBQUM7UUFFeEIscUJBQWdCLEdBQUc7WUFDakIsRUFBRSxFQUFFLElBQUk7WUFDUixFQUFFLEVBQUUsSUFBSTtZQUNSLEVBQUUsRUFBRSxJQUFJO1lBQ1Is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