igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
1,433 lines (1,432 loc) • 164 kB
JavaScript
/*
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 { __extends, __read, __spreadArray, __values } from "tslib";
import { Brush } from "igniteui-angular-core";
import { XYChart } from "./XYChart";
import { IndicatorPane } from "./IndicatorPane";
import { Base, BaseError, EventArgs, runOn, delegateRemove, delegateCombine, fromEnum, typeCast, EnumUtil, Number_$type, String_$type, enumGetBox, markType, TypeRegistrar, fromEn } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { DataSeriesType_$type } from "igniteui-angular-core";
import { IDataSeriesAdapterRule_$type } from "igniteui-angular-core";
import { SimpleFinancialPriceSeriesRule } from "igniteui-angular-core";
import { SubCollectionsRule } from "igniteui-angular-core";
import { XamDataChart } from "./XamDataChart";
import { FinancialChartVolumeType_$type } from "./FinancialChartVolumeType";
import { FinancialChartXAxisMode_$type } from "./FinancialChartXAxisMode";
import { FinancialChartYAxisMode_$type } from "./FinancialChartYAxisMode";
import { FinancialChartType_$type } from "./FinancialChartType";
import { NumericYAxis } from "./NumericYAxis";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { FinancialChartZoomSliderType_$type } from "./FinancialChartZoomSliderType";
import { BrushCollection } from "igniteui-angular-core";
import { FinancialChartRangeSelectorOptionCollection } from "./FinancialChartRangeSelectorOptionCollection";
import { ObservableCollection$1 } from "igniteui-angular-core";
import { TemplatedHtmlControl } from "./TemplatedHtmlControl";
import { FinancialChartContext } from "./FinancialChartContext";
import { FinancialChartToolbarContext } from "./FinancialChartToolbarContext";
import { FinancialChartViewModel } from "./FinancialChartViewModel";
import { FinancialChartToolbarViewModel } from "./FinancialChartToolbarViewModel";
import { AxisDefaults } from "./AxisDefaults";
import { Defaults } from "./Defaults";
import { BrushUtil } from "igniteui-angular-core";
import { Series } from "./Series";
import { Rect } from "igniteui-angular-core";
import { Axis } from "./Axis";
import { AxisLabelSettings } from "./AxisLabelSettings";
import { MarkerSeries } from "./MarkerSeries";
import { IZoomableCategoryAxis_$type } from "./IZoomableCategoryAxis";
import { SyncSettings } from "./SyncSettings";
import { SyncManager } from "./SyncManager";
import { FinancialOverlayType_$type } from "./FinancialOverlayType";
import { ArrayExtension } from "igniteui-angular-core";
import { FinancialIndicatorType_$type } from "./FinancialIndicatorType";
import { IndicatorDisplayType_$type } from "./IndicatorDisplayType";
import { ITimeRangeSelectorAxis_$type } from "./ITimeRangeSelectorAxis";
import { FinancialChartVisualData } from "./FinancialChartVisualData";
import { FinancialChartCustomIndicatorArgs } from "./FinancialChartCustomIndicatorArgs";
import { ScalerParams } from "./ScalerParams";
import { stringReplace, stringJoin, stringIsNullOrEmpty } from "igniteui-angular-core";
import { timeSpanFromDays } from "igniteui-angular-core";
import { dateMaxValue, dateMinValue } from "igniteui-angular-core";
import { isNaN_, isInfinity } from "igniteui-angular-core";
import { FinancialChartTypePicker } from "./FinancialChartTypePicker";
import { FinancialChartIndicatorMenu } from "./FinancialChartIndicatorMenu";
import { TrendLineType_$type } from "igniteui-angular-core";
import { FinancialChartIndicatorMenuContext } from "./FinancialChartIndicatorMenuContext";
import { FinancialChartTypePickerContext } from "./FinancialChartTypePickerContext";
import { FinancialChartRangeSelectorContext } from "./FinancialChartRangeSelectorContext";
import { FinancialChartToolbarVisualData } from "./FinancialChartToolbarVisualData";
import { FinancialChartRangeSelectorViewModel } from "./FinancialChartRangeSelectorViewModel";
import { FinancialChartRangeSelectorView } from "./FinancialChartRangeSelectorView";
/**
* @hidden
*/
var FinancialChart = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(FinancialChart, _super);
function FinancialChart() {
var _this = _super.call(this) || this;
_this.ajp = null;
_this.amn = null;
_this.aml = null;
_this.ami = null;
_this.amk = null;
_this.amm = null;
_this.amj = null;
_this.aiv = null;
_this.am5 = null;
_this.am6 = null;
_this.am2 = null;
_this.am7 = null;
_this.am8 = null;
_this.am3 = null;
_this.am4 = null;
_this.akd = null;
_this.aln = 40;
_this.ajj = null;
_this.ajh = null;
_this.ajl = null;
_this.ajq = null;
_this.ang = null;
_this.aj9 = null;
_this.akz = false;
_this.aky = false;
_this.ak6 = false;
_this.akl = false;
_this.amt = 10;
_this.alu = NaN;
_this.alw = NaN;
_this.alv = NaN;
_this.alx = 0;
_this.ai1 = 0;
_this.ai4 = 0;
_this.alp = 3;
_this.als = NaN;
_this.alq = NaN;
_this.alr = NaN;
_this.alt = NaN;
_this.ai6 = 0;
_this.akg = true;
_this.aix = 0;
_this.akh = false;
_this.ajb = null;
_this.ajd = null;
_this.ak8 = null;
_this.akj = true;
_this.aki = false;
_this.akk = false;
_this.aka = null;
_this.ai8 = 1;
_this.ahz = null;
_this.ah0 = null;
_this.ah1 = null;
_this.ah2 = null;
_this.ah4 = null;
_this.ah3 = null;
_this.ahy = null;
_this.ahx = null;
_this.alo = 1;
_this.alm = 1;
_this.all = 2;
_this.alk = 1;
_this.ajn = null;
_this.amp = -2147483648;
_this.alj = 2;
_this.ams = 3;
_this.amq = 10;
_this.amo = 30;
_this.amr = 9;
_this.ais = null;
_this.ait = null;
_this.aio = null;
_this.applyCustomIndicators = null;
_this.ara = null;
_this.aly = 1;
_this.akf = false;
_this.ajf = null;
_this.alg = dateMinValue();
_this.alf = dateMaxValue();
_this.ald = null;
_this.u2();
_this.ald = new ObservableCollection$1(Base.$, 0);
if (_this.xAxisBreaks != null) {
var a = _this.xAxisBreaks;
a.collectionChanged = delegateCombine(a.collectionChanged, function (a, b) { return _this.aqz(); });
}
_this.aqk();
return _this;
}
FinancialChart.prototype.wi = function (a, b, c) {
_super.prototype.wi.call(this, a, b, c);
switch (a) {
case "ToolbarTemplate":
case "RangeSelectorTemplate":
this.aiw = new FinancialChartToolbar(this, this.and);
break;
case "Toolbar":
var d = b;
if (d != null) {
d.chartTypeChanged = delegateRemove(d.chartTypeChanged, runOn(this, this.ap7));
d.trendLineTypeChanged = delegateRemove(d.trendLineTypeChanged, runOn(this, this.aqa));
d.volumeTypeChanged = delegateRemove(d.volumeTypeChanged, runOn(this, this.aqb));
d.l(null);
}
if (this.aiw != null) {
this.aiw.ac = this.ai3;
this.aiw.ai = this.ec;
this.aiw.y = this.aiy;
this.aiw.al = this.akw;
if (this.amk != null) {
this.aiw.l(this.amk);
}
var e = this.aiw;
e.chartTypeChanged = delegateCombine(e.chartTypeChanged, runOn(this, this.ap7));
;
var f = this.aiw;
f.trendLineTypeChanged = delegateCombine(f.trendLineTypeChanged, runOn(this, this.aqa));
var g = this.aiw;
g.volumeTypeChanged = delegateCombine(g.volumeTypeChanged, runOn(this, this.aqb));
}
break;
case "ChartType":
if (this.aiw != null) {
this.aiw.y = this.aiy;
}
break;
case "VolumeType":
if (this.aiw != null) {
this.aiw.ac = this.ai3;
}
break;
case "TrendLineType":
if (this.aiw != null) {
this.aiw.ai = this.ec;
}
break;
case "IsToolbarVisible":
if (this.aiw == null) {
break;
}
this.aiw.al = this.akw;
this.setGridRows();
break;
}
};
FinancialChart.prototype.aqb = function (a, b) {
this.ai3 = this.aiw.ac;
};
FinancialChart.prototype.aqa = function (a, b) {
this.ec = this.aiw.ai;
};
FinancialChart.prototype.ap7 = function (a, b) {
this.aiy = this.aiw.y;
};
FinancialChart.prototype.aqk = function () {
this.ajp = new IndicatorPane();
this.ajg = TypeRegistrar.create("FinancialLegend");
};
FinancialChart.prototype.provideGrid = function (a) {
this.amn = a;
this.aq5();
this.setGridRows();
if (this.aiw != null) {
this.aiw.bg(a);
}
};
FinancialChart.prototype.onDocumentClick = function (a) {
if (this.aiw != null) {
this.aiw.bl(a);
}
};
FinancialChart.prototype.getContext = function () {
var a = this.aiw.v();
var b = new FinancialChartContext();
b.vm = new FinancialChartViewModel();
b.vm.toolbar = a;
b.container = this.l4;
b.toolbarContainer = this.amk;
b.legendContainer = this.amj;
b.indicatorsContainer = this.ami;
b.volumeContainer = this.aml;
b.zoomContainer = this.amm;
return b;
};
FinancialChart.prototype.provideContainer = function (a) {
var b = a;
if (b != null) {
var c = "financialChartMainGrid";
var d = b.createElement("div");
d.setStyleProperty("width", "100%");
d.setStyleProperty("height", "100%");
if (this.aiw == null) {
this.aiw = new FinancialChartToolbar(this, this.and);
}
this.aiw.w.isIndicatorMenuVisible = this.akn && this.ako;
this.amk = b.getSubRenderer(d);
this.aiw.l(this.amk);
var e = b.createElement("div");
e.setStyleProperty("width", "100%");
e.setStyleProperty("height", "100%");
var f = b.createElement("div");
f.setStyleProperty("width", "100%");
f.setStyleProperty("height", "100%");
this.amj = b.getSubRenderer(f);
var g = b.createElement("div");
g.setStyleProperty("width", "100%");
g.setStyleProperty("height", "100%");
this.ami = b.getSubRenderer(g);
var h = b.createElement("div");
h.setStyleProperty("width", "100%");
h.setStyleProperty("height", "100%");
this.aml = b.getSubRenderer(h);
var i = b.createElement("div");
i.setStyleProperty("width", "100%");
i.setStyleProperty("height", "100%");
this.amm = b.getSubRenderer(i);
a = b.getSubRenderer(e);
}
else {
this.amk = null;
if (this.aiw != null) {
this.aiw.l(null);
}
if (this.ake != null) {
this.ake.provideContainer(null);
this.ake = null;
}
if (this.ajg != null) {
this.ajg.provideContainer(null);
}
}
_super.prototype.provideContainer.call(this, a);
if (b != null) {
if (this.volumeChart != null) {
this.volumeChart.c9.b4(this.aml);
}
if (this.ajp != null) {
this.ajp.h(this.ami);
}
if (this.zoomSliderChart != null) {
this.zoomSliderChart.c9.b4(this.amm);
if (a != null) {
this.apr();
}
else {
this.ake = null;
}
}
if (this.ajg != null) {
this.ajg.provideContainer(this.amj);
}
this.setGridRows();
}
};
FinancialChart.prototype.aqv = function (a, b, c) {
if (a != null) {
a.provideContainer(null);
}
if (b != null) {
b.c9.b4(c);
}
this.setGridRows();
};
FinancialChart.prototype.aq9 = function (a, b) {
this.aqv(a, b, this.amm);
if (b == null) {
return;
}
this.apr();
};
FinancialChart.prototype.apr = function () {
var _this = this;
if (this.amm == null) {
return;
}
if (this.ake != null) {
this.ake.provideContainer(null);
}
this.ake = TypeRegistrar.create("ZoomSlider");
this.ake.provideContainer(this.amm);
var a = this.ake;
a.windowRectChanged = delegateCombine(a.windowRectChanged, function (a, b) {
if (_this.dataChart != null) {
_this.dataChart.w0 = new Rect(0, _this.ake.windowRect.left, _this.dataChart.wh.top, _this.ake.windowRect.width, _this.dataChart.wh.height);
}
});
this.aps();
};
FinancialChart.prototype.aq7 = function (a, b) {
this.aqv(a, b, this.aml);
};
FinancialChart.prototype.setGridRows = function () {
if (this.amn == null) {
return;
}
var a = new Array(6);
a[0] = (this.akw ? this.al4 : 0) + "px";
a[1] = this.aks ? "min-content" : "0px";
a[2] = "auto";
a[3] = this.indicatorCharts == null || this.indicatorCharts.count == 0 ? "0px" : this.indicatorCharts.count * 150 + "px";
a[4] = this.volumeChart == null ? "0px" : "100px";
a[5] = this.zoomSliderChart == null ? "0px" : "100px";
if (this.ake != null) {
if (a[5] == "0px") {
this.ake.hide();
}
else {
this.ake.show();
}
}
this.amn.setStyleProperty("-ms-grid-rows", stringReplace(stringJoin.apply(void 0, __spreadArray([" "], __read(a))), "auto", "1fr"));
this.amn.setStyleProperty("grid-template-rows", stringJoin.apply(void 0, __spreadArray([" "], __read(a))));
if (this.l4 == null) {
return;
}
if (this.dataChart != null) {
this.dataChart.notifyContainerResized();
}
if (this.ajp != null) {
this.ajp.f();
}
if (this.volumeChart != null) {
this.volumeChart.notifyContainerResized();
}
if (this.zoomSliderChart != null) {
this.zoomSliderChart.notifyContainerResized();
}
if (this.ake != null) {
this.ake.notifySizeChanged();
}
};
FinancialChart.prototype.vm = function () {
var e_1, _a;
_super.prototype.vm.call(this);
this.aaz = 1;
this.agq = 0;
this.ac4 = 0;
this.ahk = null;
this.ahd = AxisDefaults.axis_LineBrush;
this.acm = AxisDefaults.axis_TickStroke;
this.acl = AxisDefaults.categoryAxis_TickLength;
this.ahe = AxisDefaults.axis_TickBrush;
this.aha = null;
this.arb = AxisDefaults.axis_MajorBrush;
this.amh = AxisDefaults.axis_MajorStroke;
this.finalValueAnnotationsVisible = true;
this.crosshairsAnnotationEnabled = true;
this.gq = false;
this.crosshairsDisplayMode = 0;
this.jq = Defaults.crosshairLineThickness;
this.yy = Defaults.crosshairLineBrush;
this.yt = Defaults.crosshairXAxisAnnotationBackground;
this.yu = Defaults.crosshairXAxisAnnotationTextColor;
this.ka = NaN;
this.j2 = 40;
this.g6 = true;
this.he = false;
if (this.dataChart != null) {
var a = this.dataChart.c9.j.e();
this.ah7 = a.d;
this.ah8 = a.e;
this.ah6 = a.d;
this.arb = this.dataChart.aa5;
}
var b = new BrushCollection();
b.add(((function () {
var $ret = new Brush();
$ret.fill = "#8BDC5C";
return $ret;
})()));
b.add(((function () {
var $ret = new Brush();
$ret.fill = "#8961A9";
return $ret;
})()));
b.add(((function () {
var $ret = new Brush();
$ret.fill = "#6DB1FF";
return $ret;
})()));
b.add(((function () {
var $ret = new Brush();
$ret.fill = "#82E9D9";
return $ret;
})()));
b.add(((function () {
var $ret = new Brush();
$ret.fill = "#EA3C63";
return $ret;
})()));
b.add(((function () {
var $ret = new Brush();
$ret.fill = "#735656";
return $ret;
})()));
b.add(((function () {
var $ret = new Brush();
$ret.fill = "#F8CE4F";
return $ret;
})()));
b.add(((function () {
var $ret = new Brush();
$ret.fill = "#A8A8B7";
return $ret;
})()));
b.add(((function () {
var $ret = new Brush();
$ret.fill = "#E051A9";
return $ret;
})()));
b.add(((function () {
var $ret = new Brush();
$ret.fill = "#FF903B";
return $ret;
})()));
var c = new BrushCollection();
try {
for (var _b = __values(fromEnum(b)), _c = _b.next(); !_c.done; _c = _b.next()) {
var d = _c.value;
c.add(BrushUtil.p(d, 0.3));
}
}
catch (e_1_1) {
e_1 = { error: e_1_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_1)
throw e_1.error;
}
}
this.ah9 = c;
this.aia = b;
};
FinancialChart.prototype.aqr = function () {
if (this.ajp != null) {
this.ajp.b = null;
this.ajp.b = this.indicatorCharts;
}
this.setGridRows();
};
FinancialChart.prototype.aqs = function () {
this.setGridRows();
};
FinancialChart.prototype.aq1 = function () {
this.aqr();
};
FinancialChart.prototype.apq = function () {
if (this.ake == null || this.zoomSliderChart == null || this.dataChart == null || this.dataChart.series.count == 0) {
return;
}
var a = this.l4.rootWrapper.width();
var b = this.dataChart.wz.left + this.dataChart.wz.width;
var c = this.dataChart.wz.left;
var d = a - b;
this.ake.startInset = c - this.ake.trackStartInset;
this.ake.endInset = d - this.ake.trackEndInset;
if (this.ake.endInset < 0) {
var e = this.ake.endInset;
this.ake.endInset = 0;
this.dataChart.h9 += (e * -1);
}
if (this.ake.startInset < 0) {
var f = this.ake.startInset;
this.ake.startInset = 0;
this.dataChart.h4 += (f * -1);
}
this.zoomSliderChart.h4 = c;
this.zoomSliderChart.h9 = d;
this.zoomSliderChart.hr = this.ake.barExtent;
};
FinancialChart.prototype.aqh = function () {
this.apq();
};
FinancialChart.prototype.vj = function (a) {
_super.prototype.vj.call(this, a);
if (a != null) {
a.hq = 0;
}
};
FinancialChart.prototype.arc = function (a) {
return a.wa();
};
FinancialChart.prototype.arf = function () {
return this.amj == null ? null : this.are(this.amj.rootWrapper);
};
FinancialChart.prototype.ard = function (a) {
if (a == null || a.d == null) {
return null;
}
return this.are(a.d.rootWrapper);
};
FinancialChart.prototype.are = function (a) {
if (a == null) {
return null;
}
var b = a.getOffset();
return new Rect(0, b.left, b.top, a.width(), a.height());
};
FinancialChart.prototype.alz = function () {
if (this.amn == null) {
return NaN;
}
var a = this.amn.getOffset();
return this.amn.width() + (a == null ? 0 : a.left);
};
FinancialChart.prototype.vv = function (source_, a, b) {
_super.prototype.vv.call(this, source_, a, b);
if (this.zoomSliderChart != null) {
this.zoomSliderChart.on(source_, a, b);
}
};
FinancialChart.prototype.vw = function (source_, a, b) {
_super.prototype.vw.call(this, source_, a, b);
if (this.zoomSliderChart != null) {
this.zoomSliderChart.oo(source_, a, b);
}
};
FinancialChart.prototype.vu = function (source_) {
_super.prototype.vu.call(this, source_);
if (this.zoomSliderChart != null) {
this.zoomSliderChart.og(source_);
}
};
FinancialChart.prototype.vy = function (source_, a, b, c) {
_super.prototype.vy.call(this, source_, a, b, c);
if (this.zoomSliderChart != null) {
this.zoomSliderChart.op(source_, a, b, c);
}
};
FinancialChart.prototype.vp = function (a, b) {
_super.prototype.vp.call(this, a, b);
if (this.akt(a)) {
a.toolTip = null;
}
};
Object.defineProperty(FinancialChart.prototype, "aiw", {
get: function () {
return this.aiv;
},
set: function (a) {
var b = this.aiw;
if (a != b) {
this.aiv = a;
this.wd("Toolbar", b, this.aiw);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChart.prototype, "anc", {
get: function () {
return this.am5;
},
set: function (a) {
var b = this.anc;
if (a != b) {
this.am5 = a;
this.wd("RangeSelectorTemplate", b, this.anc);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChart.prototype, "and", {
get: function () {
return this.am6;
},
set: function (a) {
var b = this.and;
if (a != b) {
this.am6 = a;
this.wd("ToolbarTemplate", b, this.and);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChart.prototype, "am9", {
get: function () {
return this.am2;
},
set: function (a) {
var b = this.am9;
if (a != b) {
this.am2 = a;
this.wd("ChartTypePickerTemplate", b, this.am9);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChart.prototype, "ane", {
get: function () {
return this.am7;
},
set: function (a) {
var b = this.ane;
if (a != b) {
this.am7 = a;
this.wd("TrendLineTypePickerTemplate", b, this.ane);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChart.prototype, "anf", {
get: function () {
return this.am8;
},
set: function (a) {
var b = this.anf;
if (a != b) {
this.am8 = a;
this.wd("VolumeTypePickerTemplate", b, this.anf);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChart.prototype, "ana", {
get: function () {
return this.am3;
},
set: function (a) {
var b = this.ana;
if (a != b) {
this.am3 = a;
this.wd("IndicatorMenuTemplate", b, this.ana);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChart.prototype, "anb", {
get: function () {
return this.am4;
},
set: function (a) {
var b = this.anb;
if (a != b) {
this.am4 = a;
this.wd("OverlayPickerTemplate", b, this.anb);
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChart.prototype, "ake", {
get: function () {
return this.akd;
},
set: function (a) {
var b = this.ake;
if (a != b) {
this.akd = a;
this.wd("ZoomSlider", b, this.ake);
}
},
enumerable: false,
configurable: true
});
FinancialChart.prototype.get_j2 = function () {
return _super.prototype.get_j2.call(this);
};
FinancialChart.prototype.set_j2 = function (a) {
_super.prototype.set_j2.call(this, a);
};
FinancialChart.prototype.get_g6 = function () {
return _super.prototype.get_g6.call(this);
};
FinancialChart.prototype.set_g6 = function (a) {
_super.prototype.set_g6.call(this, a);
};
Object.defineProperty(FinancialChart.prototype, "al4", {
get: function () {
return this.aln;
},
set: function (a) {
var b = this.al4;
if (a != b) {
this.aln = a;
this.wd("ToolbarHeight", b, this.al4);
}
},
enumerable: false,
configurable: true
});
FinancialChart.prototype.aao = function () {
return this.xAxis;
};
FinancialChart.prototype.aap = function () {
return this.yAxis;
};
FinancialChart.prototype.onAttachedToUI = function () {
_super.prototype.onAttachedToUI.call(this);
if (this.ake != null) {
this.ake.onAttachedToUI();
}
};
FinancialChart.prototype.onDetachedFromUI = function () {
_super.prototype.onDetachedFromUI.call(this);
if (this.ake != null) {
this.ake.onDetachedFromUI();
}
};
FinancialChart.prototype.be = function (a) {
return 20;
};
FinancialChart.prototype.get_h2 = function () {
return ((function () {
var $ret = new List$1(DataSeriesType_$type, 0);
$ret.add(20);
return $ret;
})());
};
Object.defineProperty(FinancialChart.prototype, "h2", {
get: function () {
return this.get_h2();
},
enumerable: false,
configurable: true
});
FinancialChart.prototype.get_h1 = function () {
return ((function () {
var $ret = new List$1(IDataSeriesAdapterRule_$type, 0);
$ret.add(new SimpleFinancialPriceSeriesRule());
$ret.add(new SubCollectionsRule());
return $ret;
})());
};
Object.defineProperty(FinancialChart.prototype, "h1", {
get: function () {
return this.get_h1();
},
enumerable: false,
configurable: true
});
FinancialChart.prototype.aii = function (a) {
return this.aij(a);
};
FinancialChart.prototype.ajw = function (a) {
return this.ajx(a);
};
FinancialChart.prototype.aih = function (a) {
var b = this.aii(0);
b.name = a;
return b;
};
FinancialChart.prototype.ux = function () {
this.xAxis = this.aih("xAxis");
this.yAxis = this.ajw(0);
this.yAxis.name = "yAxis";
this.volumeAxis = this.ajw(0);
this.volumeAxis.name = "volumeAxis";
this.volumeXAxis = this.aih("volumeXAxis");
this.ala = new List$1(NumericYAxis.$, 0);
this.alc = new List$1(CategoryAxisBase.$, 0);
this.indicatorAxis = this.ajw(0);
this.indicatorAxis.name = "indicatorAxis";
this.indicatorXAxis = this.aih("indicatorXAxis_0");
this.ala.add(this.indicatorAxis);
this.alc.add(this.indicatorXAxis);
if (this.xAxis.az == null) {
this.xAxis.az = new AxisLabelSettings();
}
if (this.yAxis.az == null) {
this.yAxis.az = new AxisLabelSettings();
}
if (this.volumeAxis.az == null) {
this.volumeAxis.az = new AxisLabelSettings();
}
if (this.volumeXAxis.az == null) {
this.volumeAxis.az = new AxisLabelSettings();
}
if (this.indicatorAxis.az == null) {
this.indicatorAxis.az = new AxisLabelSettings();
}
if (this.indicatorXAxis.az == null) {
this.indicatorXAxis.az = new AxisLabelSettings();
}
this.zoomSliderAxis = this.ajw(0);
this.zoomSliderAxis.name = "zoomSliderAxis";
this.zoomSliderXAxis = this.aih("zoomSliderXAxis");
if (this.zoomSliderAxis.az == null) {
this.zoomSliderAxis.az = new AxisLabelSettings();
}
if (this.zoomSliderXAxis.az == null) {
this.zoomSliderXAxis.az = new AxisLabelSettings();
}
};
FinancialChart.prototype.ur = function (a, b) {
var c = typeCast(MarkerSeries.$, a);
if (c != null) {
c.xf = this.c2(a, b);
}
};
FinancialChart.prototype.c1 = function (a) {
if (a != null) {
return 1;
}
return _super.prototype.c1.call(this, a);
};
FinancialChart.prototype.w8 = function (a) {
if (a.suggestedSecondaryAxis == 2) {
this.yAxis.lo = true;
this.yAxis.mm = 10;
}
};
FinancialChart.prototype.xb = function () {
this.yAxis.lo = this.ak3;
this.yAxis.mm = this.am1;
};
FinancialChart.prototype.ai0 = function (a) {
var b;
if (this.aiy == 0) {
if (a == null || a.index > 0 || stringIsNullOrEmpty(a.getMemberPathFor(12))) {
b = 4;
}
else {
b = 2;
}
}
else {
b = this.aiy;
}
b = this.aiz(b);
return b;
};
FinancialChart.prototype.aiz = function (a) {
if ((a == 1 || a == 2)) {
if (TypeRegistrar.isRegistered("FinancialPriceSeries")) {
return a;
}
a = 4;
}
if (a == 4) {
if (TypeRegistrar.isRegistered("LineSeries")) {
return a;
}
a = 3;
}
if (a == 3) {
if (TypeRegistrar.isRegistered("ColumnSeries")) {
return a;
}
}
return a;
};
FinancialChart.prototype.ai9 = function (a) {
if ((a == 2 || a == 3)) {
if (TypeRegistrar.isRegistered("FinancialPriceSeries")) {
return a;
}
a = 5;
}
if (a == 5) {
if (TypeRegistrar.isRegistered("LineSeries")) {
return a;
}
a = 6;
}
if (a == 6) {
if (TypeRegistrar.isRegistered("AreaSeries")) {
return a;
}
a = 4;
}
if (a == 4) {
if (TypeRegistrar.isRegistered("ColumnSeries")) {
return a;
}
}
return a;
};
FinancialChart.prototype.ai2 = function (a) {
if (a == 2) {
if (TypeRegistrar.isRegistered("LineSeries")) {
return a;
}
a = 3;
}
if (a == 3) {
if (TypeRegistrar.isRegistered("AreaSeries")) {
return a;
}
a = 1;
}
if (a == 1) {
if (TypeRegistrar.isRegistered("ColumnSeries")) {
return a;
}
}
return a;
};
FinancialChart.prototype.ano = function (a) {
var b = a.getMemberPathFor(14);
if (stringIsNullOrEmpty(b)) {
b = a.getMemberPathFor(11);
}
return b;
};
FinancialChart.prototype.aij = function (axisType_) {
if ((this.externalObject)) {
return (this.externalObject.createXAxis(axisType_).i);
}
else {
var a = void 0;
switch (axisType_) {
case 0:
if (TypeRegistrar.isRegistered("OrdinalTimeXAxis")) {
a = TypeRegistrar.create("OrdinalTimeXAxis");
}
else if (TypeRegistrar.isRegistered("TimeXAxis")) {
a = TypeRegistrar.create("TimeXAxis");
}
else {
throw new BaseError(1, "no valid axes loaded");
}
return a;
case 1:
if (TypeRegistrar.isRegistered("TimeXAxis")) {
a = TypeRegistrar.create("TimeXAxis");
}
else if (TypeRegistrar.isRegistered("OrdinalTimeXAxis")) {
a = TypeRegistrar.create("OrdinalTimeXAxis");
}
else {
throw new BaseError(1, "no valid axes loaded");
}
return a;
}
return null;
}
};
FinancialChart.prototype.ajx = function (axisType_) {
if ((this.externalObject)) {
return (this.externalObject.createYAxis(axisType_).i);
}
else {
var a = void 0;
switch (axisType_) {
case 0:
if (TypeRegistrar.isRegistered("NumericYAxis")) {
a = TypeRegistrar.create("NumericYAxis");
}
else if (TypeRegistrar.isRegistered("PercentChangeYAxis")) {
a = TypeRegistrar.create("PercentChangeYAxis");
}
else {
throw new BaseError(1, "no valid axes loaded");
}
return a;
case 1:
if (TypeRegistrar.isRegistered("PercentChangeYAxis")) {
a = TypeRegistrar.create("PercentChangeYAxis");
}
else if (TypeRegistrar.isRegistered("NumericYAxis")) {
a = TypeRegistrar.create("NumericYAxis");
}
else {
throw new BaseError(1, "no valid axes loaded");
}
return a;
}
return null;
}
};
FinancialChart.prototype.aj3 = function () {
return this.df(1);
};
FinancialChart.prototype.aj4 = function () {
return this.df(0);
};
FinancialChart.prototype.aj2 = function () {
return this.df(2);
};
FinancialChart.prototype.aj5 = function () {
return this.df(20);
};
Object.defineProperty(FinancialChart.prototype, "akm", {
get: function () {
return (TypeRegistrar.isRegistered("HorizontalAnchoredCategorySeriesProxy"));
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChart.prototype, "ajk", {
get: function () {
if (TypeRegistrar.isRegistered("HorizontalAnchoredCategorySeriesProxy")) {
return TypeRegistrar.create("HorizontalAnchoredCategorySeriesProxy");
}
else {
throw new BaseError(1, "horizontal series module is not loaded, but is required.");
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChart.prototype, "akp", {
get: function () {
return (TypeRegistrar.isRegistered("FinancialPriceSeriesProxy"));
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChart.prototype, "aji", {
get: function () {
if (TypeRegistrar.isRegistered("FinancialPriceSeriesProxy")) {
return TypeRegistrar.create("FinancialPriceSeriesProxy");
}
else {
throw new BaseError(1, "financial series module is not loaded, but is required.");
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChart.prototype, "akn", {
get: function () {
return (TypeRegistrar.isRegistered("IndicatorProxy"));
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChart.prototype, "ajm", {
get: function () {
if (TypeRegistrar.isRegistered("IndicatorProxy")) {
return TypeRegistrar.create("IndicatorProxy");
}
else {
throw new BaseError(1, "financial series module is not loaded, but is required.");
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChart.prototype, "ako", {
get: function () {
return (TypeRegistrar.isRegistered("OverlayProxy"));
},
enumerable: false,
configurable: true
});
Object.defineProperty(FinancialChart.prototype, "ajr", {
get: function () {
if (TypeRegistrar.isRegistered("OverlayProxy")) {
return TypeRegistrar.create("OverlayProxy");
}
else {
throw new BaseError(1, "overlay series module is not loaded, but is required.");
}
},
enumerable: false,
configurable: true
});
FinancialChart.prototype.dc = function (a, b) {
var c = this.ano(a);
switch (this.ai0(a)) {
case 3:
var d = this.aj3();
this.ajk.setValueMemberPath(d, c);
this.ajk.setXAxis(d, this.xAxis);
this.ajk.setYAxis(d, this.yAxis);
this.ajk.setCategoryMode(d, 1);
return d;
case 4:
var e = this.aj4();
this.ajk.setValueMemberPath(e, c);
this.ajk.setXAxis(e, this.xAxis);
this.ajk.setYAxis(e, this.yAxis);
this.ajk.setCategoryMode(e, 1);
return e;
default:
case 1:
case 2:
var f = this.aj5();
this.aji.setOpenMemberPath(f, a.getMemberPathFor(11));
this.aji.setHighMemberPath(f, a.getMemberPathFor(12));
this.aji.setLowMemberPath(f, a.getMemberPathFor(13));
this.aji.setCloseMemberPath(f, a.getMemberPathFor(14));
this.aji.setVolumeMemberPath(f, a.getMemberPathFor(15));
this.aji.setXAxis(f, this.xAxis);
this.aji.setYAxis(f, this.yAxis);
this.aji.setDisplayType(f, this.aiy == 1 ? 1 : 0);
this.aji.setCategoryMode(f, 1);
return f;
}
};
FinancialChart.prototype.xa = function () {
_super.prototype.xa.call(this);
this.aqf(this.xAxis);
this.aq3(false);
if (this.ai3 != 0 && this.volumeChart != null) {
this.aqm();
}
this.aqf(this.volumeXAxis);
this.aqf(this.indicatorXAxis);
this.aq0();
this.aq2();
if (this.aja != 0) {
this.aqn();
this.aqf(this.zoomSliderXAxis);
}
};
FinancialChart.prototype.agc = function (a, b) {
var e_2, _a;
_super.prototype.agc.call(this, a, b);
a(this.volumeXAxis);
if (this.alc != null) {
try {
for (var _b = __values(fromEnum(this.alc)), _c = _b.next(); !_c.done; _c = _b.next()) {
var c = _c.value;
a(c);
}
}
catch (e_2_1) {
e_2 = { error: e_2_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_2)
throw e_2.error;
}
}
}
var d = true;
switch (b) {
case "XAxisMajorStroke":
case "XAxisMajorStrokeThickness":
d = false;
break;
}
if (d) {
a(this.zoomSliderXAxis);
}
};
FinancialChart.prototype.agh = function (a, b) {
var e_3, _a;
_super.prototype.agh.call(this, a, b);
if (b) {
a(this.volumeAxis);
if (this.ala != null) {
try {
for (var _b = __values(fromEnum(this.ala)), _c = _b.next(); !_c.done; _c = _b.next()) {
var c = _c.value;
a(c);
}
}
catch (e_3_1) {
e_3 = { error: e_3_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_3)
throw e_3.error;
}
}
}
a(this.zoomSliderAxis);
}
};
FinancialChart.prototype.aqj = function (a) {
var b = typeCast(IZoomableCategoryAxis_$type, this.xAxis);
if (b != null) {
a(b);
}
};
FinancialChart.prototype.agf = function (a) {
_super.prototype.agf.call(this, a);
this.af6(this.volumeXAxis, a);
this.af6(this.indicatorXAxis, a);
this.af6(this.zoomSliderXAxis, a);
};
FinancialChart.prototype.agk = function (a) {
_super.prototype.agk.call(this, a);
this.af6(this.volumeAxis, a);
this.af6(this.indicatorAxis, a);
this.af6(this.zoomSliderAxis, a);
};
FinancialChart.prototype.agi = function (a) {
_super.prototype.agi.call(this, a);
this.af5(this.volumeAxis, a);
this.af5(this.indicatorAxis, a);
this.af5(this.zoomSliderAxis, a);
};
FinancialChart.prototype.agd = function (a) {
_super.prototype.agd.call(this, a);
this.af5(this.volumeXAxis, a);
this.af5(this.indicatorXAxis, a);
this.af5(this.zoomSliderXAxis, a);
};
FinancialChart.prototype.vi = function (a) {
var _this = this;
_super.prototype.vi.call(this, a);
if (a == null) {
return;
}
if (a == this.zoomSliderChart) {
a.xv = a.xy = false;
a.legend = null;
if (this.dataChart != null) {
a.ag = this.dataChart.ag;
a.aj = this.dataChart.aj;
}
}
else {
SyncManager.d(a, ((function () {
var $ret = new SyncSettings();
$ret.syncChannel = _this.aoj();
$ret.synchronizeHorizontally = true;
$ret.synchronizeVertically = false;
return $ret;
})()));
SyncManager.c(a);
}
a.cw = 2;
};
FinancialChart.prototype.aoj = function () {
if (this.ang == null) {
FinancialChart.am0++;
this.ang = FinancialChart.am0.toString();
}
return this.ang;
};
FinancialChart.prototype.ap1 = function (a, b) {
this.apn();
this.aqh();
};
FinancialChart.prototype.apn = function () {
var e_4, _a;
if (this.yAxis.b8()) {
return;
}
var a = this.yAxis.aw.bd;
if (this.ai3 != 0) {
a = Math.max(a, this.volumeAxis.aw.bd);
}
try {
for (var _b = __values(fromEnum(this.ala)), _c = _b.next(); !_c.done; _c = _b.next()) {
var b = _c.value;
a = Math.max(a, b.aw.bd);
}
}
catch (e_4_1) {
e_4 = { error: e_4_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_4)
throw e_4.error;
}
}
this.apo(a);
};
FinancialChart.prototype.apo = function (a) {
var e_5, _a;
if (this.yAxis.b8()) {
return;
}
this.yAxis.eu = this.volumeAxis.eu = a;
try {
for (var _b = __values(fromEnum(this.ala)), _c = _b.next(); !_c.done; _c = _b.next()) {
var b = _c.value;
b.eu = a;
}
}
catch (e_5_1) {
e_5 = { error: e_5_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_5)
throw e_5.error;
}
}
this.zoomSliderAxis.eu = this.yAxis.eu;
};
FinancialChart.prototype.apt = function (a) {
if (this.indicatorCharts == null) {
return;
}
for (var b = 0; b < this.indicatorCharts.count; b++) {
var c = this.indicatorCharts._inner[b];
for (var d = 0; d < c.series.count; d++) {
var e = c.series._inner[d];
if (!(this.akr(e))) {
continue;
}
a(c.series._inner[d], b);
}
}
};
FinancialChart.prototype.apw = function (a) {
if (this.volumeChart == null) {
return;
}
for (var b = 0; b < this.volumeChart.series.count; b++) {
var c = this.volumeChart.series._inner[b];
if (c.eu) {
continue;
}
a(this.volumeChart.series._inner[b], b);
}
};
FinancialChart.prototype.apu = function (a) {
if (this.dataChart == null) {
return;
}
for (var b = 0; b < this.dataChart.series.count; b++) {
var c = this.dataChart.series._inner[b];
if (!this.akt(c)) {
continue;
}
a(c, b);
}
};
FinancialChart.prototype.apv = function (a, b) {
if (this.dataChart == null) {
return;
}
for (var c = 0; c < this.dataChart.series.count; c++) {
var d = this.dataChart.series._inner[c];
if (this.akt(d)) {
continue;
}
var e = this.amu(d, c);
a(d, e);
}
if (b) {
this.apx(a);
}
};
FinancialChart.prototype.apx = function (a) {
if (this.zoomSliderChart == null) {
return;
}
for (var b = 0; b < this.zoomSliderChart.series.count; b++) {
var c = this.zoomSliderChart.series._inner[b];
if (c.eu) {