igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
1,426 lines (1,425 loc) • 136 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 { Brush } from "igniteui-webcomponents-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-webcomponents-core";
import { List$1 } from "igniteui-webcomponents-core";
import { DataSeriesType_$type } from "igniteui-webcomponents-core";
import { IDataSeriesAdapterRule_$type } from "igniteui-webcomponents-core";
import { SimpleFinancialPriceSeriesRule } from "igniteui-webcomponents-core";
import { SubCollectionsRule } from "igniteui-webcomponents-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-webcomponents-core";
import { FinancialChartRangeSelectorOptionCollection } from "./FinancialChartRangeSelectorOptionCollection";
import { ObservableCollection$1 } from "igniteui-webcomponents-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-webcomponents-core";
import { Series } from "./Series";
import { Rect } from "igniteui-webcomponents-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-webcomponents-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-webcomponents-core";
import { timeSpanFromDays } from "igniteui-webcomponents-core";
import { dateMaxValue, dateMinValue } from "igniteui-webcomponents-core";
import { isNaN_, isInfinity } from "igniteui-webcomponents-core";
import { FinancialChartTypePicker } from "./FinancialChartTypePicker";
import { FinancialChartIndicatorMenu } from "./FinancialChartIndicatorMenu";
import { TrendLineType_$type } from "igniteui-webcomponents-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
*/
export let FinancialChart = /*@__PURE__*/ (() => {
class FinancialChart extends XYChart {
wi(a, b, c) {
super.wi(a, b, c);
switch (a) {
case "ToolbarTemplate":
case "RangeSelectorTemplate":
this.aik = new FinancialChartToolbar(this, this.am1);
break;
case "Toolbar":
let d = b;
if (d != null) {
d.chartTypeChanged = delegateRemove(d.chartTypeChanged, runOn(this, this.apv));
d.trendLineTypeChanged = delegateRemove(d.trendLineTypeChanged, runOn(this, this.apy));
d.volumeTypeChanged = delegateRemove(d.volumeTypeChanged, runOn(this, this.apz));
d.l(null);
}
if (this.aik != null) {
this.aik.ac = this.air;
this.aik.ai = this.ec;
this.aik.y = this.aim;
this.aik.al = this.akk;
if (this.al8 != null) {
this.aik.l(this.al8);
}
let e = this.aik;
e.chartTypeChanged = delegateCombine(e.chartTypeChanged, runOn(this, this.apv));
;
let f = this.aik;
f.trendLineTypeChanged = delegateCombine(f.trendLineTypeChanged, runOn(this, this.apy));
let g = this.aik;
g.volumeTypeChanged = delegateCombine(g.volumeTypeChanged, runOn(this, this.apz));
}
break;
case "ChartType":
if (this.aik != null) {
this.aik.y = this.aim;
}
break;
case "VolumeType":
if (this.aik != null) {
this.aik.ac = this.air;
}
break;
case "TrendLineType":
if (this.aik != null) {
this.aik.ai = this.ec;
}
break;
case "IsToolbarVisible":
if (this.aik == null) {
break;
}
this.aik.al = this.akk;
this.setGridRows();
break;
}
}
apz(a, b) {
this.air = this.aik.ac;
}
apy(a, b) {
this.ec = this.aik.ai;
}
apv(a, b) {
this.aim = this.aik.y;
}
ap8() {
this.ajd = new IndicatorPane();
this.ai4 = TypeRegistrar.create("FinancialLegend");
}
provideGrid(a) {
this.amb = a;
this.aqt();
this.setGridRows();
if (this.aik != null) {
this.aik.bg(a);
}
}
onDocumentClick(a) {
if (this.aik != null) {
this.aik.bl(a);
}
}
getContext() {
let a = this.aik.v();
let b = new FinancialChartContext();
b.vm = new FinancialChartViewModel();
b.vm.toolbar = a;
b.container = this.l4;
b.toolbarContainer = this.al8;
b.legendContainer = this.al7;
b.indicatorsContainer = this.al6;
b.volumeContainer = this.al9;
b.zoomContainer = this.ama;
return b;
}
provideContainer(a) {
let b = a;
if (b != null) {
let c = "financialChartMainGrid";
let d = b.createElement("div");
d.setStyleProperty("width", "100%");
d.setStyleProperty("height", "100%");
if (this.aik == null) {
this.aik = new FinancialChartToolbar(this, this.am1);
}
this.aik.w.isIndicatorMenuVisible = this.akb && this.akc;
this.al8 = b.getSubRenderer(d);
this.aik.l(this.al8);
let e = b.createElement("div");
e.setStyleProperty("width", "100%");
e.setStyleProperty("height", "100%");
let f = b.createElement("div");
f.setStyleProperty("width", "100%");
f.setStyleProperty("height", "100%");
this.al7 = b.getSubRenderer(f);
let g = b.createElement("div");
g.setStyleProperty("width", "100%");
g.setStyleProperty("height", "100%");
this.al6 = b.getSubRenderer(g);
let h = b.createElement("div");
h.setStyleProperty("width", "100%");
h.setStyleProperty("height", "100%");
this.al9 = b.getSubRenderer(h);
let i = b.createElement("div");
i.setStyleProperty("width", "100%");
i.setStyleProperty("height", "100%");
this.ama = b.getSubRenderer(i);
a = b.getSubRenderer(e);
}
else {
this.al8 = null;
if (this.aik != null) {
this.aik.l(null);
}
if (this.aj2 != null) {
this.aj2.provideContainer(null);
this.aj2 = null;
}
if (this.ai4 != null) {
this.ai4.provideContainer(null);
}
}
super.provideContainer(a);
if (b != null) {
if (this.volumeChart != null) {
this.volumeChart.c9.b4(this.al9);
}
if (this.ajd != null) {
this.ajd.h(this.al6);
}
if (this.zoomSliderChart != null) {
this.zoomSliderChart.c9.b4(this.ama);
if (a != null) {
this.apf();
}
else {
this.aj2 = null;
}
}
if (this.ai4 != null) {
this.ai4.provideContainer(this.al7);
}
this.setGridRows();
}
}
aqj(a, b, c) {
if (a != null) {
a.provideContainer(null);
}
if (b != null) {
b.c9.b4(c);
}
this.setGridRows();
}
aqx(a, b) {
this.aqj(a, b, this.ama);
if (b == null) {
return;
}
this.apf();
}
apf() {
if (this.ama == null) {
return;
}
if (this.aj2 != null) {
this.aj2.provideContainer(null);
}
this.aj2 = TypeRegistrar.create("ZoomSlider");
this.aj2.provideContainer(this.ama);
let a = this.aj2;
a.windowRectChanged = delegateCombine(a.windowRectChanged, (a, b) => {
if (this.dataChart != null) {
this.dataChart.w0 = new Rect(0, this.aj2.windowRect.left, this.dataChart.wh.top, this.aj2.windowRect.width, this.dataChart.wh.height);
}
});
this.apg();
}
aqv(a, b) {
this.aqj(a, b, this.al9);
}
setGridRows() {
if (this.amb == null) {
return;
}
let a = new Array(6);
a[0] = (this.akk ? this.als : 0) + "px";
a[1] = this.akg ? "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.aj2 != null) {
if (a[5] == "0px") {
this.aj2.hide();
}
else {
this.aj2.show();
}
}
this.amb.setStyleProperty("-ms-grid-rows", stringReplace(stringJoin(" ", ...a), "auto", "1fr"));
this.amb.setStyleProperty("grid-template-rows", stringJoin(" ", ...a));
if (this.l4 == null) {
return;
}
if (this.dataChart != null) {
this.dataChart.notifyContainerResized();
}
if (this.ajd != null) {
this.ajd.f();
}
if (this.volumeChart != null) {
this.volumeChart.notifyContainerResized();
}
if (this.zoomSliderChart != null) {
this.zoomSliderChart.notifyContainerResized();
}
if (this.aj2 != null) {
this.aj2.notifySizeChanged();
}
}
vm() {
super.vm();
this.aaz = 1;
this.age = 0;
this.acw = 0;
this.ag8 = null;
this.ag1 = AxisDefaults.axis_LineBrush;
this.acg = AxisDefaults.axis_TickStroke;
this.acf = AxisDefaults.categoryAxis_TickLength;
this.ag2 = AxisDefaults.axis_TickBrush;
this.agy = null;
this.aqz = AxisDefaults.axis_MajorBrush;
this.al5 = 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) {
let a = this.dataChart.c9.j.e();
this.ahv = a.d;
this.ahw = a.e;
this.ahu = a.d;
this.aqz = this.dataChart.aa5;
}
let b = new BrushCollection();
b.add(((() => {
let $ret = new Brush();
$ret.fill = "#8BDC5C";
return $ret;
})()));
b.add(((() => {
let $ret = new Brush();
$ret.fill = "#8961A9";
return $ret;
})()));
b.add(((() => {
let $ret = new Brush();
$ret.fill = "#6DB1FF";
return $ret;
})()));
b.add(((() => {
let $ret = new Brush();
$ret.fill = "#82E9D9";
return $ret;
})()));
b.add(((() => {
let $ret = new Brush();
$ret.fill = "#EA3C63";
return $ret;
})()));
b.add(((() => {
let $ret = new Brush();
$ret.fill = "#735656";
return $ret;
})()));
b.add(((() => {
let $ret = new Brush();
$ret.fill = "#F8CE4F";
return $ret;
})()));
b.add(((() => {
let $ret = new Brush();
$ret.fill = "#A8A8B7";
return $ret;
})()));
b.add(((() => {
let $ret = new Brush();
$ret.fill = "#E051A9";
return $ret;
})()));
b.add(((() => {
let $ret = new Brush();
$ret.fill = "#FF903B";
return $ret;
})()));
let c = new BrushCollection();
for (let d of fromEnum(b)) {
c.add(BrushUtil.p(d, 0.3));
}
this.ahx = c;
this.ahy = b;
}
aqf() {
if (this.ajd != null) {
this.ajd.b = null;
this.ajd.b = this.indicatorCharts;
}
this.setGridRows();
}
aqg() {
this.setGridRows();
}
aqp() {
this.aqf();
}
ape() {
if (this.aj2 == null || this.zoomSliderChart == null || this.dataChart == null || this.dataChart.series.count == 0) {
return;
}
let a = this.l4.rootWrapper.width();
let b = this.dataChart.wz.left + this.dataChart.wz.width;
let c = this.dataChart.wz.left;
let d = a - b;
this.aj2.startInset = c - this.aj2.trackStartInset;
this.aj2.endInset = d - this.aj2.trackEndInset;
if (this.aj2.endInset < 0) {
let e = this.aj2.endInset;
this.aj2.endInset = 0;
this.dataChart.h9 += (e * -1);
}
if (this.aj2.startInset < 0) {
let f = this.aj2.startInset;
this.aj2.startInset = 0;
this.dataChart.h4 += (f * -1);
}
this.zoomSliderChart.h4 = c;
this.zoomSliderChart.h9 = d;
this.zoomSliderChart.hr = this.aj2.barExtent;
}
ap5() {
this.ape();
}
vj(a) {
super.vj(a);
if (a != null) {
a.hq = 0;
}
}
aq0(a) {
return a.wa();
}
aq3() {
return this.al7 == null ? null : this.aq2(this.al7.rootWrapper);
}
aq1(a) {
if (a == null || a.d == null) {
return null;
}
return this.aq2(a.d.rootWrapper);
}
aq2(a) {
if (a == null) {
return null;
}
let b = a.getOffset();
return new Rect(0, b.left, b.top, a.width(), a.height());
}
aln() {
if (this.amb == null) {
return NaN;
}
let a = this.amb.getOffset();
return this.amb.width() + (a == null ? 0 : a.left);
}
vv(source_, a, b) {
super.vv(source_, a, b);
if (this.zoomSliderChart != null) {
this.zoomSliderChart.on(source_, a, b);
}
}
vw(source_, a, b) {
super.vw(source_, a, b);
if (this.zoomSliderChart != null) {
this.zoomSliderChart.oo(source_, a, b);
}
}
vu(source_) {
super.vu(source_);
if (this.zoomSliderChart != null) {
this.zoomSliderChart.og(source_);
}
}
vy(source_, a, b, c) {
super.vy(source_, a, b, c);
if (this.zoomSliderChart != null) {
this.zoomSliderChart.op(source_, a, b, c);
}
}
vp(a, b) {
super.vp(a, b);
if (this.akh(a)) {
a.toolTip = null;
}
}
get aik() {
return this.aij;
}
set aik(a) {
let b = this.aik;
if (a != b) {
this.aij = a;
this.wd("Toolbar", b, this.aik);
}
}
get am0() {
return this.amt;
}
set am0(a) {
let b = this.am0;
if (a != b) {
this.amt = a;
this.wd("RangeSelectorTemplate", b, this.am0);
}
}
get am1() {
return this.amu;
}
set am1(a) {
let b = this.am1;
if (a != b) {
this.amu = a;
this.wd("ToolbarTemplate", b, this.am1);
}
}
get amx() {
return this.amq;
}
set amx(a) {
let b = this.amx;
if (a != b) {
this.amq = a;
this.wd("ChartTypePickerTemplate", b, this.amx);
}
}
get am2() {
return this.amv;
}
set am2(a) {
let b = this.am2;
if (a != b) {
this.amv = a;
this.wd("TrendLineTypePickerTemplate", b, this.am2);
}
}
get am3() {
return this.amw;
}
set am3(a) {
let b = this.am3;
if (a != b) {
this.amw = a;
this.wd("VolumeTypePickerTemplate", b, this.am3);
}
}
get amy() {
return this.amr;
}
set amy(a) {
let b = this.amy;
if (a != b) {
this.amr = a;
this.wd("IndicatorMenuTemplate", b, this.amy);
}
}
get amz() {
return this.ams;
}
set amz(a) {
let b = this.amz;
if (a != b) {
this.ams = a;
this.wd("OverlayPickerTemplate", b, this.amz);
}
}
get aj2() {
return this.aj1;
}
set aj2(a) {
let b = this.aj2;
if (a != b) {
this.aj1 = a;
this.wd("ZoomSlider", b, this.aj2);
}
}
get_j2() {
return super.get_j2();
}
set_j2(a) {
super.set_j2(a);
}
get_g6() {
return super.get_g6();
}
set_g6(a) {
super.set_g6(a);
}
get als() {
return this.alb;
}
set als(a) {
let b = this.als;
if (a != b) {
this.alb = a;
this.wd("ToolbarHeight", b, this.als);
}
}
constructor() {
super();
this.ajd = null;
this.amb = null;
this.al9 = null;
this.al6 = null;
this.al8 = null;
this.ama = null;
this.al7 = null;
this.aij = null;
this.amt = null;
this.amu = null;
this.amq = null;
this.amv = null;
this.amw = null;
this.amr = null;
this.ams = null;
this.aj1 = null;
this.alb = 40;
this.ai7 = null;
this.ai5 = null;
this.ai9 = null;
this.aje = null;
this.am4 = null;
this.ajx = null;
this.akn = false;
this.akm = false;
this.aku = false;
this.aj9 = false;
this.amh = 10;
this.ali = NaN;
this.alk = NaN;
this.alj = NaN;
this.all = 0;
this.aip = 0;
this.ais = 0;
this.ald = 3;
this.alg = NaN;
this.ale = NaN;
this.alf = NaN;
this.alh = NaN;
this.aiu = 0;
this.aj4 = true;
this.ail = 0;
this.aj5 = false;
this.aiz = null;
this.ai1 = null;
this.akw = null;
this.aj7 = true;
this.aj6 = false;
this.aj8 = false;
this.ajy = null;
this.aiw = 1;
this.ahn = null;
this.aho = null;
this.ahp = null;
this.ahq = null;
this.ahs = null;
this.ahr = null;
this.ahm = null;
this.ahl = null;
this.alc = 1;
this.ala = 1;
this.ak9 = 2;
this.ak8 = 1;
this.ajb = null;
this.amd = -2147483648;
this.ak7 = 2;
this.amg = 3;
this.ame = 10;
this.amc = 30;
this.amf = 9;
this.aig = null;
this.aih = null;
this.aic = null;
this.applyCustomIndicators = null;
this.aqy = null;
this.alm = 1;
this.aj3 = false;
this.ai3 = null;
this.ak4 = dateMinValue();
this.ak3 = dateMaxValue();
this.ak1 = null;
this.u2();
this.ak1 = new ObservableCollection$1(Base.$, 0);
if (this.xAxisBreaks != null) {
let a = this.xAxisBreaks;
a.collectionChanged = delegateCombine(a.collectionChanged, (a, b) => this.aqn());
}
this.ap8();
}
aao() {
return this.xAxis;
}
aap() {
return this.yAxis;
}
onAttachedToUI() {
super.onAttachedToUI();
if (this.aj2 != null) {
this.aj2.onAttachedToUI();
}
}
onDetachedFromUI() {
super.onDetachedFromUI();
if (this.aj2 != null) {
this.aj2.onDetachedFromUI();
}
}
be(a) {
return 20;
}
get_h2() {
return ((() => {
let $ret = new List$1(DataSeriesType_$type, 0);
$ret.add(20);
return $ret;
})());
}
get h2() {
return this.get_h2();
}
get_h1() {
return ((() => {
let $ret = new List$1(IDataSeriesAdapterRule_$type, 0);
$ret.add(new SimpleFinancialPriceSeriesRule());
$ret.add(new SubCollectionsRule());
return $ret;
})());
}
get h1() {
return this.get_h1();
}
ah6(a) {
return this.ah7(a);
}
ajk(a) {
return this.ajl(a);
}
ah5(a) {
let b = this.ah6(0);
b.name = a;
return b;
}
ux() {
this.xAxis = this.ah5("xAxis");
this.yAxis = this.ajk(0);
this.yAxis.name = "yAxis";
this.volumeAxis = this.ajk(0);
this.volumeAxis.name = "volumeAxis";
this.volumeXAxis = this.ah5("volumeXAxis");
this.aky = new List$1(NumericYAxis.$, 0);
this.ak0 = new List$1(CategoryAxisBase.$, 0);
this.indicatorAxis = this.ajk(0);
this.indicatorAxis.name = "indicatorAxis";
this.indicatorXAxis = this.ah5("indicatorXAxis_0");
this.aky.add(this.indicatorAxis);
this.ak0.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.ajk(0);
this.zoomSliderAxis.name = "zoomSliderAxis";
this.zoomSliderXAxis = this.ah5("zoomSliderXAxis");
if (this.zoomSliderAxis.az == null) {
this.zoomSliderAxis.az = new AxisLabelSettings();
}
if (this.zoomSliderXAxis.az == null) {
this.zoomSliderXAxis.az = new AxisLabelSettings();
}
}
ur(a, b) {
let c = typeCast(MarkerSeries.$, a);
if (c != null) {
c.xf = this.c2(a, b);
}
}
c1(a) {
if (a != null) {
return 1;
}
return super.c1(a);
}
w8(a) {
if (a.suggestedSecondaryAxis == 2) {
this.yAxis.lo = true;
this.yAxis.mm = 10;
}
}
xb() {
this.yAxis.lo = this.akr;
this.yAxis.mm = this.amp;
}
aio(a) {
let b;
if (this.aim == 0) {
if (a == null || a.index > 0 || stringIsNullOrEmpty(a.getMemberPathFor(12))) {
b = 4;
}
else {
b = 2;
}
}
else {
b = this.aim;
}
b = this.ain(b);
return b;
}
ain(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;
}
aix(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;
}
aiq(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;
}
anc(a) {
let b = a.getMemberPathFor(14);
if (stringIsNullOrEmpty(b)) {
b = a.getMemberPathFor(11);
}
return b;
}
ah7(axisType_) {
if ((this.externalObject)) {
return (this.externalObject.createXAxis(axisType_).i);
}
else {
let a;
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;
}
}
ajl(axisType_) {
if ((this.externalObject)) {
return (this.externalObject.createYAxis(axisType_).i);
}
else {
let a;
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;
}
}
ajr() {
return this.df(1);
}
ajs() {
return this.df(0);
}
ajq() {
return this.df(2);
}
ajt() {
return this.df(20);
}
get aka() {
return (TypeRegistrar.isRegistered("HorizontalAnchoredCategorySeriesProxy"));
}
get ai8() {
if (TypeRegistrar.isRegistered("HorizontalAnchoredCategorySeriesProxy")) {
return TypeRegistrar.create("HorizontalAnchoredCategorySeriesProxy");
}
else {
throw new BaseError(1, "horizontal series module is not loaded, but is required.");
}
}
get akd() {
return (TypeRegistrar.isRegistered("FinancialPriceSeriesProxy"));
}
get ai6() {
if (TypeRegistrar.isRegistered("FinancialPriceSeriesProxy")) {
return TypeRegistrar.create("FinancialPriceSeriesProxy");
}
else {
throw new BaseError(1, "financial series module is not loaded, but is required.");
}
}
get akb() {
return (TypeRegistrar.isRegistered("IndicatorProxy"));
}
get aja() {
if (TypeRegistrar.isRegistered("IndicatorProxy")) {
return TypeRegistrar.create("IndicatorProxy");
}
else {
throw new BaseError(1, "financial series module is not loaded, but is required.");
}
}
get akc() {
return (TypeRegistrar.isRegistered("OverlayProxy"));
}
get ajf() {
if (TypeRegistrar.isRegistered("OverlayProxy")) {
return TypeRegistrar.create("OverlayProxy");
}
else {
throw new BaseError(1, "overlay series module is not loaded, but is required.");
}
}
dc(a, b) {
let c = this.anc(a);
switch (this.aio(a)) {
case 3:
let d = this.ajr();
this.ai8.setValueMemberPath(d, c);
this.ai8.setXAxis(d, this.xAxis);
this.ai8.setYAxis(d, this.yAxis);
this.ai8.setCategoryMode(d, 1);
return d;
case 4:
let e = this.ajs();
this.ai8.setValueMemberPath(e, c);
this.ai8.setXAxis(e, this.xAxis);
this.ai8.setYAxis(e, this.yAxis);
this.ai8.setCategoryMode(e, 1);
return e;
default:
case 1:
case 2:
let f = this.ajt();
this.ai6.setOpenMemberPath(f, a.getMemberPathFor(11));
this.ai6.setHighMemberPath(f, a.getMemberPathFor(12));
this.ai6.setLowMemberPath(f, a.getMemberPathFor(13));
this.ai6.setCloseMemberPath(f, a.getMemberPathFor(14));
this.ai6.setVolumeMemberPath(f, a.getMemberPathFor(15));
this.ai6.setXAxis(f, this.xAxis);
this.ai6.setYAxis(f, this.yAxis);
this.ai6.setDisplayType(f, this.aim == 1 ? 1 : 0);
this.ai6.setCategoryMode(f, 1);
return f;
}
}
xa() {
super.xa();
this.ap3(this.xAxis);
this.aqr(false);
if (this.air != 0 && this.volumeChart != null) {
this.aqa();
}
this.ap3(this.volumeXAxis);
this.ap3(this.indicatorXAxis);
this.aqo();
this.aqq();
if (this.aiy != 0) {
this.aqb();
this.ap3(this.zoomSliderXAxis);
}
}
af0(a, b) {
super.af0(a, b);
a(this.volumeXAxis);
if (this.ak0 != null) {
for (let c of fromEnum(this.ak0)) {
a(c);
}
}
let d = true;
switch (b) {
case "XAxisMajorStroke":
case "XAxisMajorStrokeThickness":
d = false;
break;
}
if (d) {
a(this.zoomSliderXAxis);
}
}
af5(a, b) {
super.af5(a, b);
if (b) {
a(this.volumeAxis);
if (this.aky != null) {
for (let c of fromEnum(this.aky)) {
a(c);
}
}
a(this.zoomSliderAxis);
}
}
ap7(a) {
let b = typeCast(IZoomableCategoryAxis_$type, this.xAxis);
if (b != null) {
a(b);
}
}
af3(a) {
super.af3(a);
this.afu(this.volumeXAxis, a);
this.afu(this.indicatorXAxis, a);
this.afu(this.zoomSliderXAxis, a);
}
af8(a) {
super.af8(a);
this.afu(this.volumeAxis, a);
this.afu(this.indicatorAxis, a);
this.afu(this.zoomSliderAxis, a);
}
af6(a) {
super.af6(a);
this.aft(this.volumeAxis, a);
this.aft(this.indicatorAxis, a);
this.aft(this.zoomSliderAxis, a);
}
af1(a) {
super.af1(a);
this.aft(this.volumeXAxis, a);
this.aft(this.indicatorXAxis, a);
this.aft(this.zoomSliderXAxis, a);
}
vi(a) {
super.vi(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, ((() => {
let $ret = new SyncSettings();
$ret.syncChannel = this.an7();
$ret.synchronizeHorizontally = true;
$ret.synchronizeVertically = false;
return $ret;
})()));
SyncManager.c(a);
}
a.cw = 2;
}
an7() {
if (this.am4 == null) {
FinancialChart.amo++;
this.am4 = FinancialChart.amo.toString();
}
return this.am4;
}
app(a, b) {
this.apb();
this.ap5();
}
apb() {
if (this.yAxis.b8()) {
return;
}
let a = this.yAxis.aw.bd;
if (this.air != 0) {
a = Math.max(a, this.volumeAxis.aw.bd);
}
for (let b of fromEnum(this.aky)) {
a = Math.max(a, b.aw.bd);
}
this.apc(a);
}
apc(a) {
if (this.yAxis.b8()) {
return;
}
this.yAxis.eu = this.volumeAxis.eu = a;
for (let b of fromEnum(this.aky)) {
b.eu = a;
}
this.zoomSliderAxis.eu = this.yAxis.eu;
}
aph(a) {
if (this.indicatorCharts == null) {
return;
}
for (let b = 0; b < this.indicatorCharts.count; b++) {
let c = this.indicatorCharts._inner[b];
for (let d = 0; d < c.series.count; d++) {
let e = c.series._inner[d];
if (!(this.akf(e))) {
continue;
}
a(c.series._inner[d], b);
}
}
}
apk(a) {
if (this.volumeChart == null) {
return;
}
for (let b = 0; b < this.volumeChart.series.count; b++) {
let c = this.volumeChart.series._inner[b];
if (c.eu) {
continue;
}
a(this.volumeChart.series._inner[b], b);
}
}
api(a) {
if (this.dataChart == null) {
return;
}
for (let b = 0; b < this.dataChart.series.count; b++) {
let c = this.dataChart.series._inner[b];
if (!this.akh(c)) {
continue;
}
a(c, b);
}
}
apj(a, b) {
if (this.dataChart == null) {
return;
}
for (let c = 0; c < this.dataChart.series.count; c++) {
let d = this.dataChart.series._inner[c];
if (this.akh(d)) {
continue;
}
let e = this.ami(d, c);
a(d, e);
}
if (b) {
this.apl(a);
}
}
apl(a) {
if (this.zoomSliderChart == null) {
return;
}
for (let b = 0; b < this.zoomSliderChart.series.count; b++) {
let c = this.zoomSliderChart.series._inner[b];
if (c.eu) {
continue;
}
a(this.zoomSliderChart.series._inner[b], b);
}
}
ami(a, b) {
if (a.da != this.dataChart) {
return b;
}
let c = this.bf == null || this.bf.dataSeries == null ? 0 : this.bf.dataSeries.count;
let d = this.ai2 == null ? 0 : this.ai2.count;
return b - (c * d);
}
u7(a) {
super.u7(a);
this.apk(a);
this.aph(a);
this.apl(a);
}
get volumeChart() {
return this.ajx;
}
set volumeChart(a) {
let b = this.volumeChart;
if (a != b) {
this.ajx = a;
this.wd("VolumeChart", b, this.volumeChart);
}
}
aqa() {
if (this.dataChart == null) {
return;
}
this.volumeChart.series.clear();
let a = new List$1(Series.$, 0);
let b = -1;
for (let c = 0; c < this.dataChart.series.count; c++) {
let d = this.dataChart.series._inner[c];
if (this.akh(d) || d.eu) {
continue;
}
b++;
let e;
let f = this.air;
f = this.aiq(f);
switch (f) {
case 2:
e = this.ajs();
break;
case 3:
e = this.ajq();
break;
default:
case 1:
e = this.ajr();
break;
}
this.ai8.setCategoryMode(e, 1);
e.name = "volumeSeries_" + b;
e.itemsSource = d.itemsSource;
this.ai8.setXAxis(e, this.volumeXAxis);
this.ai8.setYAxis(e, this.volumeAxis);
this.ai8.setValueMemberPath(e, this.bf != null && this.bf.dataSeries != null && this.bf.dataSeries.count > b ? this.bf.dataSeries._inner[b].getMemberPathFor(15) : null);
e.title = d.title + " Volume";
e.vk = ArrayExtension.getModulus$1(Brush.$, this.ahz, b);
e.v0 = ArrayExtension.getModulus$1(Brush.$, this.ah0, b);
e.jq = this.alt;
a.add(e);
}
let g = this.hy("volume", false);
if (g != null) {
a.o(g);
}
for (let h = 0; h < a.count; h++) {
let i = a._inner[h];
this.volumeChart.series.add(i);
this.vn(i, h);
}
}
ake(a) {
if (!this.aka) {
return false;
}
return this.ai8.matchesType(a);
}
aki(a) {
if (!this.akd) {
return false;
}
return this.ai6.matchesType(a);
}
akf(a) {
if (!this.akb) {
return false;
}
return this.aja.matchesType(a);
}
akh(a) {
if (!this.akc) {
return false;
}
return this.ajf.matchesType(a);
}
ap9() {
if (this.dataChart == null) {
return;
}
let a = 0;
let b = this.ai0 == null ? 0 : this.ai0.count;
let c = this.customIndicatorNames == null ? 0 : this.customIndicatorNames.count;
let d = b + c;
for (let e = 0; e < d; e++) {
let f = new List$1(Series.$, 0);
let g = this.indicatorCharts._inner[e];
let h = e >= b;
let i = h ? this.customIndicatorNames._inner[e - b] : EnumUtil.getName(FinancialIndicatorType_$type, this.ai0._inner[e]);
let j = -1;
for (let k = 0; k < this.dataChart.series.count; k++) {
let l = this.dataChart.series._inner[k];
if (this.akh(l) || l.eu) {
continue;
}
j++;
let m;
if (h) {
let n = this.aju("Custom");
this.aja.handleCustomIndicatorEvent(n, runOn(this, this.apn));
m = n;
}
else {
m = this.ajw(this.ai0._inner[e]);
}
if (m == null) {
continue;
}
m.name = "indicator_" + a++;
this.aja.setXAxis(m, this.ak0._inner[e]);
this.aja.setYAxis(m, this.aky._inner[e]);
m.itemsSource = l.itemsSource;
this.aja.setOpenMemberPath(m, this.bf.dataSeries._inner[j].getMemberPathFor(11));
this.aja.setHighMemberPath(m, this.bf.dataSeries._inner[j].getMemberPathFor(12));
this.aja.setLowMemberPath(m, this.bf.dataSeries._inner[j].getMemberPathFor(13));
this.aja.setCloseMemberPath(m, this.bf.dataSeries._inner[j].getMemberPathFor(14));
this.aja.setVolumeMemberPath(m, this.bf.dataSeries._inner[j].getMemberPathFor(15));
m.title = l.title + " " + i;
m.vk = ArrayExtension.getModulus$1(Brush.$, this.aht, e);
m.jq = this.alp;
if (this.akf(m)) {
this.aja.setNegativeBrush(m, ArrayExtension.getModulus$1(Brush.$, this.ahu, e));
this.aja.setDisplayType(m, ArrayExtension.getModulus$1(IndicatorDisplayType_$type, this.ajc, e));
}
if (this.amk != -2147483648 && this.akf(m)) {
this.aja.setPeriodOverride(m, this.amk);
}
if (this.akf(m)) {
this.aja.setSmoothingPeriod(m, this.amn);
}
if (this.akf(m)) {
this.aja.setSignalPeriod(m, this.amm);
}
if (this.akf(m)) {
this.aja.setShortPeriod(m, this.aml);