UNPKG

igniteui-react-charts

Version:

Ignite UI React charting components for building rich data visualizations using TypeScript APIs.

1,429 lines 136 kB
/* 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-react-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-react-core"; import { List$1 } from "igniteui-react-core"; import { DataSeriesType_$type } from "igniteui-react-core"; import { IDataSeriesAdapterRule_$type } from "igniteui-react-core"; import { SimpleFinancialPriceSeriesRule } from "igniteui-react-core"; import { SubCollectionsRule } from "igniteui-react-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-react-core"; import { FinancialChartRangeSelectorOptionCollection } from "./FinancialChartRangeSelectorOptionCollection"; import { ObservableCollection$1 } from "igniteui-react-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-react-core"; import { Series } from "./Series"; import { Rect } from "igniteui-react-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-react-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-react-core"; import { timeSpanFromDays } from "igniteui-react-core"; import { dateMaxValue, dateMinValue } from "igniteui-react-core"; import { isNaN_, isInfinity } from "igniteui-react-core"; import { FinancialChartTypePicker } from "./FinancialChartTypePicker"; import { FinancialChartIndicatorMenu } from "./FinancialChartIndicatorMenu"; import { TrendLineType_$type } from "igniteui-react-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 { wo(a, b, c) { super.wo(a, b, c); switch (a) { case "ToolbarTemplate": case "RangeSelectorTemplate": this.ai2 = new FinancialChartToolbar(this, this.anj); break; case "Toolbar": let d = b; if (d != null) { d.chartTypeChanged = delegateRemove(d.chartTypeChanged, runOn(this, this.aqd)); d.trendLineTypeChanged = delegateRemove(d.trendLineTypeChanged, runOn(this, this.aqg)); d.volumeTypeChanged = delegateRemove(d.volumeTypeChanged, runOn(this, this.aqh)); d.l(null); } if (this.ai2 != null) { this.ai2.ac = this.ai9; this.ai2.ai = this.ec; this.ai2.y = this.ai4; this.ai2.al = this.ak2; if (this.amq != null) { this.ai2.l(this.amq); } let e = this.ai2; e.chartTypeChanged = delegateCombine(e.chartTypeChanged, runOn(this, this.aqd)); ; let f = this.ai2; f.trendLineTypeChanged = delegateCombine(f.trendLineTypeChanged, runOn(this, this.aqg)); let g = this.ai2; g.volumeTypeChanged = delegateCombine(g.volumeTypeChanged, runOn(this, this.aqh)); } break; case "ChartType": if (this.ai2 != null) { this.ai2.y = this.ai4; } break; case "VolumeType": if (this.ai2 != null) { this.ai2.ac = this.ai9; } break; case "TrendLineType": if (this.ai2 != null) { this.ai2.ai = this.ec; } break; case "IsToolbarVisible": if (this.ai2 == null) { break; } this.ai2.al = this.ak2; this.setGridRows(); break; } } aqh(a, b) { this.ai9 = this.ai2.ac; } aqg(a, b) { this.ec = this.ai2.ai; } aqd(a, b) { this.ai4 = this.ai2.y; } aqq() { this.ajv = new IndicatorPane(); this.ajm = TypeRegistrar.create("FinancialLegend"); } provideGrid(a) { this.amt = a; this.arb(); this.setGridRows(); if (this.ai2 != null) { this.ai2.bg(a); } } onDocumentClick(a) { if (this.ai2 != null) { this.ai2.bl(a); } } getContext() { let a = this.ai2.v(); let b = new FinancialChartContext(); b.vm = new FinancialChartViewModel(); b.vm.toolbar = a; b.container = this.l8; b.toolbarContainer = this.amq; b.legendContainer = this.amp; b.indicatorsContainer = this.amo; b.volumeContainer = this.amr; b.zoomContainer = this.ams; 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.ai2 == null) { this.ai2 = new FinancialChartToolbar(this, this.anj); } this.ai2.w.isIndicatorMenuVisible = this.akt && this.aku; this.amq = b.getSubRenderer(d); this.ai2.l(this.amq); 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.amp = b.getSubRenderer(f); let g = b.createElement("div"); g.setStyleProperty("width", "100%"); g.setStyleProperty("height", "100%"); this.amo = b.getSubRenderer(g); let h = b.createElement("div"); h.setStyleProperty("width", "100%"); h.setStyleProperty("height", "100%"); this.amr = b.getSubRenderer(h); let i = b.createElement("div"); i.setStyleProperty("width", "100%"); i.setStyleProperty("height", "100%"); this.ams = b.getSubRenderer(i); a = b.getSubRenderer(e); } else { this.amq = null; if (this.ai2 != null) { this.ai2.l(null); } if (this.akk != null) { this.akk.provideContainer(null); this.akk = null; } if (this.ajm != null) { this.ajm.provideContainer(null); } } super.provideContainer(a); if (b != null) { if (this.volumeChart != null) { this.volumeChart.dc.b4(this.amr); } if (this.ajv != null) { this.ajv.h(this.amo); } if (this.zoomSliderChart != null) { this.zoomSliderChart.dc.b4(this.ams); if (a != null) { this.apx(); } else { this.akk = null; } } if (this.ajm != null) { this.ajm.provideContainer(this.amp); } this.setGridRows(); } } aq1(a, b, c) { if (a != null) { a.provideContainer(null); } if (b != null) { b.dc.b4(c); } this.setGridRows(); } arf(a, b) { this.aq1(a, b, this.ams); if (b == null) { return; } this.apx(); } apx() { if (this.ams == null) { return; } if (this.akk != null) { this.akk.provideContainer(null); } this.akk = TypeRegistrar.create("ZoomSlider"); this.akk.provideContainer(this.ams); let a = this.akk; a.windowRectChanged = delegateCombine(a.windowRectChanged, (a, b) => { if (this.dataChart != null) { this.dataChart.xc = new Rect(0, this.akk.windowRect.left, this.dataChart.wt.top, this.akk.windowRect.width, this.dataChart.wt.height); } }); this.apy(); } ard(a, b) { this.aq1(a, b, this.amr); } setGridRows() { if (this.amt == null) { return; } let a = new Array(6); a[0] = (this.ak2 ? this.ama : 0) + "px"; a[1] = this.aky ? "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.akk != null) { if (a[5] == "0px") { this.akk.hide(); } else { this.akk.show(); } } this.amt.setStyleProperty("-ms-grid-rows", stringReplace(stringJoin(" ", ...a), "auto", "1fr")); this.amt.setStyleProperty("grid-template-rows", stringJoin(" ", ...a)); if (this.l8 == null) { return; } if (this.dataChart != null) { this.dataChart.notifyContainerResized(); } if (this.ajv != null) { this.ajv.f(); } if (this.volumeChart != null) { this.volumeChart.notifyContainerResized(); } if (this.zoomSliderChart != null) { this.zoomSliderChart.notifyContainerResized(); } if (this.akk != null) { this.akk.notifySizeChanged(); } } vs() { super.vs(); this.aa5 = 1; this.agw = 0; this.ada = 0; this.ahq = null; this.ahj = AxisDefaults.axis_LineBrush; this.acs = AxisDefaults.axis_TickStroke; this.acr = AxisDefaults.categoryAxis_TickLength; this.ahk = AxisDefaults.axis_TickBrush; this.ahg = null; this.arh = AxisDefaults.axis_MajorBrush; this.amn = AxisDefaults.axis_MajorStroke; this.finalValueAnnotationsVisible = true; this.crosshairsAnnotationEnabled = true; this.gu = false; this.crosshairsDisplayMode = 0; this.ju = Defaults.crosshairLineThickness; this.y4 = Defaults.crosshairLineBrush; this.yz = Defaults.crosshairXAxisAnnotationBackground; this.y0 = Defaults.crosshairXAxisAnnotationTextColor; this.ke = NaN; this.j6 = 40; this.ha = true; this.hi = false; if (this.dataChart != null) { let a = this.dataChart.dc.j.e(); this.aid = a.d; this.aie = a.e; this.aic = a.d; this.arh = this.dataChart.abh; } 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.aif = c; this.aig = b; } aqx() { if (this.ajv != null) { this.ajv.b = null; this.ajv.b = this.indicatorCharts; } this.setGridRows(); } aqy() { this.setGridRows(); } aq7() { this.aqx(); } apw() { if (this.akk == null || this.zoomSliderChart == null || this.dataChart == null || this.dataChart.series.count == 0) { return; } let a = this.l8.rootWrapper.width(); let b = this.dataChart.xb.left + this.dataChart.xb.width; let c = this.dataChart.xb.left; let d = a - b; this.akk.startInset = c - this.akk.trackStartInset; this.akk.endInset = d - this.akk.trackEndInset; if (this.akk.endInset < 0) { let e = this.akk.endInset; this.akk.endInset = 0; this.dataChart.ih += (e * -1); } if (this.akk.startInset < 0) { let f = this.akk.startInset; this.akk.startInset = 0; this.dataChart.ib += (f * -1); } this.zoomSliderChart.ib = c; this.zoomSliderChart.ih = d; this.zoomSliderChart.hw = this.akk.barExtent; } aqn() { this.apw(); } vp(a) { super.vp(a); if (a != null) { a.hv = 0; } } ari(a) { return a.wm(); } arl() { return this.amp == null ? null : this.ark(this.amp.rootWrapper); } arj(a) { if (a == null || a.d == null) { return null; } return this.ark(a.d.rootWrapper); } ark(a) { if (a == null) { return null; } let b = a.getOffset(); return new Rect(0, b.left, b.top, a.width(), a.height()); } al5() { if (this.amt == null) { return NaN; } let a = this.amt.getOffset(); return this.amt.width() + (a == null ? 0 : a.left); } v1(source_, a, b) { super.v1(source_, a, b); if (this.zoomSliderChart != null) { this.zoomSliderChart.ow(source_, a, b); } } v2(source_, a, b) { super.v2(source_, a, b); if (this.zoomSliderChart != null) { this.zoomSliderChart.ox(source_, a, b); } } v0(source_) { super.v0(source_); if (this.zoomSliderChart != null) { this.zoomSliderChart.op(source_); } } v4(source_, a, b, c) { super.v4(source_, a, b, c); if (this.zoomSliderChart != null) { this.zoomSliderChart.oy(source_, a, b, c); } } vv(a, b) { super.vv(a, b); if (this.akz(a)) { a.toolTip = null; } } get ai2() { return this.ai1; } set ai2(a) { let b = this.ai2; if (a != b) { this.ai1 = a; this.wj("Toolbar", b, this.ai2); } } get ani() { return this.anb; } set ani(a) { let b = this.ani; if (a != b) { this.anb = a; this.wj("RangeSelectorTemplate", b, this.ani); } } get anj() { return this.anc; } set anj(a) { let b = this.anj; if (a != b) { this.anc = a; this.wj("ToolbarTemplate", b, this.anj); } } get anf() { return this.am8; } set anf(a) { let b = this.anf; if (a != b) { this.am8 = a; this.wj("ChartTypePickerTemplate", b, this.anf); } } get ank() { return this.and; } set ank(a) { let b = this.ank; if (a != b) { this.and = a; this.wj("TrendLineTypePickerTemplate", b, this.ank); } } get anl() { return this.ane; } set anl(a) { let b = this.anl; if (a != b) { this.ane = a; this.wj("VolumeTypePickerTemplate", b, this.anl); } } get ang() { return this.am9; } set ang(a) { let b = this.ang; if (a != b) { this.am9 = a; this.wj("IndicatorMenuTemplate", b, this.ang); } } get anh() { return this.ana; } set anh(a) { let b = this.anh; if (a != b) { this.ana = a; this.wj("OverlayPickerTemplate", b, this.anh); } } get akk() { return this.akj; } set akk(a) { let b = this.akk; if (a != b) { this.akj = a; this.wj("ZoomSlider", b, this.akk); } } get_j6() { return super.get_j6(); } set_j6(a) { super.set_j6(a); } get_ha() { return super.get_ha(); } set_ha(a) { super.set_ha(a); } get ama() { return this.alt; } set ama(a) { let b = this.ama; if (a != b) { this.alt = a; this.wj("ToolbarHeight", b, this.ama); } } constructor() { super(); this.ajv = null; this.amt = null; this.amr = null; this.amo = null; this.amq = null; this.ams = null; this.amp = null; this.ai1 = null; this.anb = null; this.anc = null; this.am8 = null; this.and = null; this.ane = null; this.am9 = null; this.ana = null; this.akj = null; this.alt = 40; this.ajp = null; this.ajn = null; this.ajr = null; this.ajw = null; this.anm = null; this.akf = null; this.ak5 = false; this.ak4 = false; this.alc = false; this.akr = false; this.amz = 10; this.al0 = NaN; this.al2 = NaN; this.al1 = NaN; this.al3 = 0; this.ai7 = 0; this.aja = 0; this.alv = 3; this.aly = NaN; this.alw = NaN; this.alx = NaN; this.alz = NaN; this.ajc = 0; this.akm = true; this.ai3 = 0; this.akn = false; this.ajh = null; this.ajj = null; this.ale = null; this.akp = true; this.ako = false; this.akq = false; this.akg = null; this.aje = 1; this.ah5 = null; this.ah6 = null; this.ah7 = null; this.ah8 = null; this.aia = null; this.ah9 = null; this.ah4 = null; this.ah3 = null; this.alu = 1; this.als = 1; this.alr = 2; this.alq = 1; this.ajt = null; this.amv = -2147483648; this.alp = 2; this.amy = 3; this.amw = 10; this.amu = 30; this.amx = 9; this.aiy = null; this.aiz = null; this.aiu = null; this.applyCustomIndicators = null; this.arg = null; this.al4 = 1; this.akl = false; this.ajl = null; this.alm = dateMinValue(); this.all = dateMaxValue(); this.alj = null; this.u8(); this.alj = new ObservableCollection$1(Base.$, 0); if (this.xAxisBreaks != null) { let a = this.xAxisBreaks; a.collectionChanged = delegateCombine(a.collectionChanged, (a, b) => this.aq5()); } this.aqq(); } aau() { return this.xAxis; } aav() { return this.yAxis; } onAttachedToUI() { super.onAttachedToUI(); if (this.akk != null) { this.akk.onAttachedToUI(); } } onDetachedFromUI() { super.onDetachedFromUI(); if (this.akk != null) { this.akk.onDetachedFromUI(); } } be(a) { return 20; } get_h6() { return ((() => { let $ret = new List$1(DataSeriesType_$type, 0); $ret.add(20); return $ret; })()); } get h6() { return this.get_h6(); } get_h5() { return ((() => { let $ret = new List$1(IDataSeriesAdapterRule_$type, 0); $ret.add(new SimpleFinancialPriceSeriesRule()); $ret.add(new SubCollectionsRule()); return $ret; })()); } get h5() { return this.get_h5(); } aio(a) { return this.aip(a); } aj2(a) { return this.aj3(a); } ain(a) { let b = this.aio(0); b.name = a; return b; } u3() { this.xAxis = this.ain("xAxis"); this.yAxis = this.aj2(0); this.yAxis.name = "yAxis"; this.volumeAxis = this.aj2(0); this.volumeAxis.name = "volumeAxis"; this.volumeXAxis = this.ain("volumeXAxis"); this.alg = new List$1(NumericYAxis.$, 0); this.ali = new List$1(CategoryAxisBase.$, 0); this.indicatorAxis = this.aj2(0); this.indicatorAxis.name = "indicatorAxis"; this.indicatorXAxis = this.ain("indicatorXAxis_0"); this.alg.add(this.indicatorAxis); this.ali.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.aj2(0); this.zoomSliderAxis.name = "zoomSliderAxis"; this.zoomSliderXAxis = this.ain("zoomSliderXAxis"); if (this.zoomSliderAxis.az == null) { this.zoomSliderAxis.az = new AxisLabelSettings(); } if (this.zoomSliderXAxis.az == null) { this.zoomSliderXAxis.az = new AxisLabelSettings(); } } ux(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); } xe(a) { if (a.suggestedSecondaryAxis == 2) { this.yAxis.lo = true; this.yAxis.mm = 10; } } xh() { this.yAxis.lo = this.ak9; this.yAxis.mm = this.am7; } ai6(a) { let b; if (this.ai4 == 0) { if (a == null || a.index > 0 || stringIsNullOrEmpty(a.getMemberPathFor(12))) { b = 4; } else { b = 2; } } else { b = this.ai4; } b = this.ai5(b); return b; } ai5(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; } ajf(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; } ai8(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; } anu(a) { let b = a.getMemberPathFor(14); if (stringIsNullOrEmpty(b)) { b = a.getMemberPathFor(11); } return b; } aip(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; } } aj3(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; } } aj9() { return this.df(1); } aka() { return this.df(0); } aj8() { return this.df(2); } akb() { return this.df(20); } get aks() { return (TypeRegistrar.isRegistered("HorizontalAnchoredCategorySeriesProxy")); } get ajq() { if (TypeRegistrar.isRegistered("HorizontalAnchoredCategorySeriesProxy")) { return TypeRegistrar.create("HorizontalAnchoredCategorySeriesProxy"); } else { throw new BaseError(1, "horizontal series module is not loaded, but is required."); } } get akv() { return (TypeRegistrar.isRegistered("FinancialPriceSeriesProxy")); } get ajo() { if (TypeRegistrar.isRegistered("FinancialPriceSeriesProxy")) { return TypeRegistrar.create("FinancialPriceSeriesProxy"); } else { throw new BaseError(1, "financial series module is not loaded, but is required."); } } get akt() { return (TypeRegistrar.isRegistered("IndicatorProxy")); } get ajs() { if (TypeRegistrar.isRegistered("IndicatorProxy")) { return TypeRegistrar.create("IndicatorProxy"); } else { throw new BaseError(1, "financial series module is not loaded, but is required."); } } get aku() { return (TypeRegistrar.isRegistered("OverlayProxy")); } get ajx() { 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.anu(a); switch (this.ai6(a)) { case 3: let d = this.aj9(); this.ajq.setValueMemberPath(d, c); this.ajq.setXAxis(d, this.xAxis); this.ajq.setYAxis(d, this.yAxis); this.ajq.setCategoryMode(d, 1); return d; case 4: let e = this.aka(); this.ajq.setValueMemberPath(e, c); this.ajq.setXAxis(e, this.xAxis); this.ajq.setYAxis(e, this.yAxis); this.ajq.setCategoryMode(e, 1); return e; default: case 1: case 2: let f = this.akb(); this.ajo.setOpenMemberPath(f, a.getMemberPathFor(11)); this.ajo.setHighMemberPath(f, a.getMemberPathFor(12)); this.ajo.setLowMemberPath(f, a.getMemberPathFor(13)); this.ajo.setCloseMemberPath(f, a.getMemberPathFor(14)); this.ajo.setVolumeMemberPath(f, a.getMemberPathFor(15)); this.ajo.setXAxis(f, this.xAxis); this.ajo.setYAxis(f, this.yAxis); this.ajo.setDisplayType(f, this.ai4 == 1 ? 1 : 0); this.ajo.setCategoryMode(f, 1); return f; } } xg() { super.xg(); this.aql(this.xAxis); this.aq9(false); if (this.ai9 != 0 && this.volumeChart != null) { this.aqs(); } this.aql(this.volumeXAxis); this.aql(this.indicatorXAxis); this.aq6(); this.aq8(); if (this.ajg != 0) { this.aqt(); this.aql(this.zoomSliderXAxis); } } agi(a, b) { super.agi(a, b); a(this.volumeXAxis); if (this.ali != null) { for (let c of fromEnum(this.ali)) { a(c); } } let d = true; switch (b) { case "XAxisMajorStroke": case "XAxisMajorStrokeThickness": d = false; break; } if (d) { a(this.zoomSliderXAxis); } } agn(a, b) { super.agn(a, b); if (b) { a(this.volumeAxis); if (this.alg != null) { for (let c of fromEnum(this.alg)) { a(c); } } a(this.zoomSliderAxis); } } aqp(a) { let b = typeCast(IZoomableCategoryAxis_$type, this.xAxis); if (b != null) { a(b); } } agl(a) { super.agl(a); this.agc(this.volumeXAxis, a); this.agc(this.indicatorXAxis, a); this.agc(this.zoomSliderXAxis, a); } agq(a) { super.agq(a); this.agc(this.volumeAxis, a); this.agc(this.indicatorAxis, a); this.agc(this.zoomSliderAxis, a); } ago(a) { super.ago(a); this.agb(this.volumeAxis, a); this.agb(this.indicatorAxis, a); this.agb(this.zoomSliderAxis, a); } agj(a) { super.agj(a); this.agb(this.volumeXAxis, a); this.agb(this.indicatorXAxis, a); this.agb(this.zoomSliderXAxis, a); } vo(a) { super.vo(a); if (a == null) { return; } if (a == this.zoomSliderChart) { a.x7 = a.ya = 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.aop(); $ret.synchronizeHorizontally = true; $ret.synchronizeVertically = false; return $ret; })())); SyncManager.c(a); } a.cz = 2; } aop() { if (this.anm == null) { FinancialChart.am6++; this.anm = FinancialChart.am6.toString(); } return this.anm; } ap7(a, b) { this.apt(); this.aqn(); } apt() { if (this.yAxis.b8()) { return; } let a = this.yAxis.aw.bg; if (this.ai9 != 0) { a = Math.max(a, this.volumeAxis.aw.bg); } for (let b of fromEnum(this.alg)) { a = Math.max(a, b.aw.bg); } this.apu(a); } apu(a) { if (this.yAxis.b8()) { return; } this.yAxis.eu = this.volumeAxis.eu = a; for (let b of fromEnum(this.alg)) { b.eu = a; } this.zoomSliderAxis.eu = this.yAxis.eu; } apz(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.akx(e))) { continue; } a(c.series._inner[d], b); } } } ap2(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); } } ap0(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.akz(c)) { continue; } a(c, b); } } ap1(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.akz(d)) { continue; } let e = this.am0(d, c); a(d, e); } if (b) { this.ap3(a); } } ap3(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); } } am0(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.ajk == null ? 0 : this.ajk.count; return b - (c * d); } vd(a) { super.vd(a); this.ap2(a); this.apz(a); this.ap3(a); } get volumeChart() { return this.akf; } set volumeChart(a) { let b = this.volumeChart; if (a != b) { this.akf = a; this.wj("VolumeChart", b, this.volumeChart); } } aqs() { 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.akz(d) || d.eu) { continue; } b++; let e; let f = this.ai9; f = this.ai8(f); switch (f) { case 2: e = this.aka(); break; case 3: e = this.aj8(); break; default: case 1: e = this.aj9(); break; } this.ajq.setCategoryMode(e, 1); e.name = "volumeSeries_" + b; e.itemsSource = d.itemsSource; this.ajq.setXAxis(e, this.volumeXAxis); this.ajq.setYAxis(e, this.volumeAxis); this.ajq.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.aih, b); e.v0 = ArrayExtension.getModulus$1(Brush.$, this.aii, b); e.jq = this.amb; a.add(e); } let g = this.h2("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.vt(i, h); } } akw(a) { if (!this.aks) { return false; } return this.ajq.matchesType(a); } ak0(a) { if (!this.akv) { return false; } return this.ajo.matchesType(a); } akx(a) { if (!this.akt) { return false; } return this.ajs.matchesType(a); } akz(a) { if (!this.aku) { return false; } return this.ajx.matchesType(a); } aqr() { if (this.dataChart == null) { return; } let a = 0; let b = this.aji == null ? 0 : this.aji.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.aji._inner[e]); let j = -1; for (let k = 0; k < this.dataChart.series.count; k++) { let l = this.dataChart.series._inner[k]; if (this.akz(l) || l.eu) { continue; } j++; let m; if (h) { let n = this.akc("Custom"); this.ajs.handleCustomIndicatorEvent(n, runOn(this, this.ap5)); m = n; } else { m = this.ake(this.aji._inner[e]); } if (m == null) { continue; } m.name = "indicator_" + a++; this.ajs.setXAxis(m, this.ali._inner[e]); this.ajs.setYAxis(m, this.alg._inner[e]); m.itemsSource = l.itemsSource; this.ajs.setOpenMemberPath(m, this.bf.dataSeries._inner[j].getMemberPathFor(11)); this.ajs.setHighMemberPath(m, this.bf.dataSeries._inner[j].getMemberPathFor(12)); this.ajs.setLowMemberPath(m, this.bf.dataSeries._inner[j].getMemberPathFor(13)); this.ajs.setCloseMemberPath(m, this.bf.dataSeries._inner[j].getMemberPathFor(14)); this.ajs.setVolumeMemberPath(m, this.bf.dataSeries._inner[j].getMemberPathFor(15)); m.title = l.title + " " + i; m.vk = ArrayExtension.getModulus$1(Brush.$, this.aib, e); m.jq = this.al7; if (this.akx(m)) { this.ajs.setNegativeBrush(m, ArrayExtension.getModulus$1(Brush.$, this.aic, e)); this.ajs.setDisplayType(m, ArrayExtension.getModulus$1(IndicatorDisplayType_$type, this.aju, e)); } if (this.am2 != -2147483648 && this.akx(m)) { this.ajs.setPeriodOverride(m, this.am2); } if (this.akx(m)) { this.ajs.setSmoothingPeriod(m, this.am5); } if (this.akx(m)) { this.ajs.setSignalPeriod(m, this.am4); } if (this.akx(m)) { this.ajs.setShortPeriod(m, this.am3); this.ajs.setLongPeriod(m, this.am1); } this.vt(m, e); f.add(m