/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { Base, Point_$type, EnumUtil, markType } from "igniteui-angular-core";
import { IDataChartVisualDataManager_$type } from "./IDataChartVisualDataManager";
import { ChartVisualData } from "./ChartVisualData";
import { RectData } from "igniteui-angular-core";
import { VisualExportHelper } from "./VisualExportHelper";
import { ChartTitleVisualData } from "./ChartTitleVisualData";
import { HorizontalAlignment_$type } from "igniteui-angular-core";
import { AppearanceHelper } from "igniteui-angular-core";
import { FontUtil } from "igniteui-angular-core";
/**
 * @hidden
 */
export class DataChartVisualDataManager extends Base {
    exportVisualData(a) {
        let b = new ChartVisualData();
        for (let c = 0; c < a.axes.count; c++) {
            let d = a.axes._inner[c].e3();
            b.axes.add1(d);
        }
        for (let e = 0; e < a.series.count; e++) {
            let f = a.series._inner[e].fo();
            b.series.add1(f);
        }
        b.name = a.name;
        this.b(a, b);
        this.c(a, b);
        return b;
    }
    c(a, b) {
        let c = a.bn;
        b.width = c.a6;
        b.height = c.a5;
        b.contentArea = RectData.b(c.e3());
        b.centralArea = new RectData(c.a2, 0, c.a6 - (c.a2 + c.a3), c.a5 - (c.a4 + c.a1));
        b.plotArea = RectData.b(a.m3);
    }
    d(a, b) {
        let c = VisualExportHelper.a(a);
        return c;
    }
    b(a, b) {
        let c = a.bn;
        let d = null;
        b.title = null;
        b.subtitle = null;
        let e = c.fb();
        let f = 0;
        let g = 0;
        if (c.en != null) {
            d = c.t();
            let h = this.a(c, c.en, d);
            let i = { $type: Point_$type, x: 0, y: 0 };
            g = c.en.l + e.bottom + e.top;
            let j = new ChartTitleVisualData();
            let k = c.e3();
            j.viewport = new RectData(k.left, k.top, k.width, g);
            j.textPlotArea = RectData.b(this.d(c.en, a));
            j.textPlotArea = new RectData(c.en.n, c.en.o, c.en.m, c.en.l);
            f = j.height;
            j.appearance = AppearanceHelper.c(c.en, h);
            let l = c.fb();
            j.appearance.marginTop = l.top;
            j.appearance.marginLeft = l.left;
            j.appearance.marginRight = l.right;
            j.appearance.marginBottom = l.bottom;
            let m = c.ep();
            j.appearance.horizontalAlignment = EnumUtil.getName(HorizontalAlignment_$type, m);
            b.title = j;
        }
        if (c.em != null) {
            d = c.s();
            let n = this.a(c, c.em, d);
            let o = { $type: Point_$type, x: 0, y: f };
            let p = c.fa();
            let q = c.em.l + p.bottom + p.top;
            let r = new ChartTitleVisualData();
            let s = c.e3();
            r.viewport = new RectData(s.left, s.top + g, s.width, q);
            r.textPlotArea = RectData.b(this.d(c.em, a));
            r.appearance = AppearanceHelper.c(c.em, n);
            let t = c.fa();
            r.appearance.marginTop = t.top;
            r.appearance.marginLeft = t.left;
            r.appearance.marginRight = t.right;
            r.appearance.marginBottom = t.bottom;
            let u = c.eo();
            r.appearance.horizontalAlignment = EnumUtil.getName(HorizontalAlignment_$type, u);
            b.subtitle = r;
        }
    }
    a(a, b, c) {
        return FontUtil.getFontInfo(a.i.ae, b, c);
    }
}
DataChartVisualDataManager.$t = markType(DataChartVisualDataManager, 'DataChartVisualDataManager', Base.$, [IDataChartVisualDataManager_$type]);
//# sourceMappingURL=DataChartVisualDataManager.js.map