import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { ChartSeriesComponent } from './series.component';
import * as i0 from "@angular/core";
const _c0 = ["aclAreaSeries", ""];
function ChartAreaSeriesComponent__svg_ng_container_1__svg_stop_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵnamespaceSVG();
    i0.ɵɵelement(0, "stop");
} if (rf & 2) {
    const stop_r3 = ctx.$implicit;
    i0.ɵɵattribute("offset", stop_r3.offset + "%")("stop-color", stop_r3.color)("stop-opacity", stop_r3.opacity);
} }
function ChartAreaSeriesComponent__svg_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵnamespaceSVG();
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "defs")(2, "linearGradient", 2);
    i0.ɵɵtemplate(3, ChartAreaSeriesComponent__svg_ng_container_1__svg_stop_3_Template, 1, 3, "stop", 1);
    i0.ɵɵpipe(4, "pure");
    i0.ɵɵelementEnd()();
    i0.ɵɵelement(5, "path", 3);
    i0.ɵɵpipe(6, "pure");
    i0.ɵɵpipe(7, "pure");
    i0.ɵɵpipe(8, "pure");
    i0.ɵɵelement(9, "path", 4);
    i0.ɵɵpipe(10, "pure");
    i0.ɵɵpipe(11, "pure");
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const item_r1 = ctx.$implicit;
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("id", item_r1.gradientFillId);
    i0.ɵɵattribute("x1", ctx_r0.linearGradientXY.x1)("y1", ctx_r0.linearGradientXY.y1)("x2", ctx_r0.linearGradientXY.x2)("y2", ctx_r0.linearGradientXY.y2);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngForOf", i0.ɵɵpipeBind2(4, 16, item_r1.color, ctx_r0.gradient));
    i0.ɵɵadvance(2);
    i0.ɵɵattribute("d", item_r1.areaPath)("fill", i0.ɵɵpipeBind2(6, 19, item_r1.gradientFillId, ctx_r0.getGradientFillId))("visibility", item_r1.visibility)("opacity", i0.ɵɵpipeBind3(7, 22, item_r1.name, ctx_r0.handleOpacity, ctx_r0.activateLegend))("stroke-width", i0.ɵɵpipeBind4(8, 26, item_r1.name, ctx_r0.handleStrokeWidth, ctx_r0.activateLegend, ctx_r0.lineWidth) + "px");
    i0.ɵɵadvance(4);
    i0.ɵɵattribute("d", item_r1.path)("stroke", item_r1.color)("visibility", item_r1.visibility)("opacity", i0.ɵɵpipeBind3(10, 31, item_r1.name, ctx_r0.handleOpacity, ctx_r0.activateLegend))("stroke-width", i0.ɵɵpipeBind4(11, 35, item_r1.name, ctx_r0.handleStrokeWidth, ctx_r0.activateLegend, ctx_r0.lineWidth) + "px");
} }
export class ChartAreaSeriesComponent extends ChartSeriesComponent {
    constructor() {
        super(...arguments);
        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.ɵfac = /*@__PURE__*/ function () { let ɵChartAreaSeriesComponent_BaseFactory; return function ChartAreaSeriesComponent_Factory(t) { return (ɵChartAreaSeriesComponent_BaseFactory || (ɵChartAreaSeriesComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ChartAreaSeriesComponent)))(t || ChartAreaSeriesComponent); }; }();
ChartAreaSeriesComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ChartAreaSeriesComponent, selectors: [["g", "aclAreaSeries", ""]], inputs: { seriesType: "seriesType", startOpacity: "startOpacity", endOpacity: "endOpacity" }, features: [i0.ɵɵInheritDefinitionFeature], attrs: _c0, decls: 2, vars: 1, consts: [[1, "acl-series"], [4, "ngFor", "ngForOf"], [3, "id"], [1, "area"], ["fill", "none", 1, "line"]], template: function ChartAreaSeriesComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵnamespaceSVG();
        i0.ɵɵelementStart(0, "g", 0);
        i0.ɵɵtemplate(1, ChartAreaSeriesComponent__svg_ng_container_1_Template, 12, 40, "ng-container", 1);
        i0.ɵɵelementEnd();
    } if (rf & 2) {
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngForOf", ctx.seriesData);
    } }, encapsulation: 2, changeDetection: 0 });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ChartAreaSeriesComponent, [{
        type: Component,
        args: [{ selector: 'g[aclAreaSeries]', changeDetection: ChangeDetectionStrategy.OnPush, 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" }]
    }], null, { seriesType: [{
            type: Input
        }], startOpacity: [{
            type: Input
        }], endOpacity: [{
            type: Input
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 