UNPKG

igniteui-react-charts

Version:

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

1,434 lines 135 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 { v8(a, b, c) { super.v8(a, b, c); switch (a) { case "ToolbarTemplate": case "RangeSelectorTemplate": this.aia = new FinancialChartToolbar(this, this.amr); break; case "Toolbar": let d = b; if (d != null) { d.chartTypeChanged = delegateRemove(d.chartTypeChanged, runOn(this, this.apl)); d.trendLineTypeChanged = delegateRemove(d.trendLineTypeChanged, runOn(this, this.apo)); d.volumeTypeChanged = delegateRemove(d.volumeTypeChanged, runOn(this, this.app)); d.l(null); } if (this.aia != null) { this.aia.ac = this.aih; this.aia.ai = this.ec; this.aia.y = this.aic; this.aia.al = this.aka; if (this.aly != null) { this.aia.l(this.aly); } let e = this.aia; e.chartTypeChanged = delegateCombine(e.chartTypeChanged, runOn(this, this.apl)); ; let f = this.aia; f.trendLineTypeChanged = delegateCombine(f.trendLineTypeChanged, runOn(this, this.apo)); let g = this.aia; g.volumeTypeChanged = delegateCombine(g.volumeTypeChanged, runOn(this, this.app)); } break; case "ChartType": if (this.aia != null) { this.aia.y = this.aic; } break; case "VolumeType": if (this.aia != null) { this.aia.ac = this.aih; } break; case "TrendLineType": if (this.aia != null) { this.aia.ai = this.ec; } break; case "IsToolbarVisible": if (this.aia == null) { break; } this.aia.al = this.aka; this.setGridRows(); break; } } app(a, b) { this.aih = this.aia.ac; } apo(a, b) { this.ec = this.aia.ai; } apl(a, b) { this.aic = this.aia.y; } apy() { this.ai3 = new IndicatorPane(); this.aiu = TypeRegistrar.create("FinancialLegend"); } provideGrid(a) { this.al1 = a; this.aqj(); this.setGridRows(); if (this.aia != null) { this.aia.bg(a); } } onDocumentClick(a) { if (this.aia != null) { this.aia.bl(a); } } getContext() { let a = this.aia.v(); let b = new FinancialChartContext(); b.vm = new FinancialChartViewModel(); b.vm.toolbar = a; b.container = this.ly; b.toolbarContainer = this.aly; b.legendContainer = this.alx; b.indicatorsContainer = this.alw; b.volumeContainer = this.alz; b.zoomContainer = this.al0; 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.aia == null) { this.aia = new FinancialChartToolbar(this, this.amr); } this.aia.w.isIndicatorMenuVisible = this.aj1 && this.aj2; this.aly = b.getSubRenderer(d); this.aia.l(this.aly); 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.alx = b.getSubRenderer(f); let g = b.createElement("div"); g.setStyleProperty("width", "100%"); g.setStyleProperty("height", "100%"); this.alw = b.getSubRenderer(g); let h = b.createElement("div"); h.setStyleProperty("width", "100%"); h.setStyleProperty("height", "100%"); this.alz = b.getSubRenderer(h); let i = b.createElement("div"); i.setStyleProperty("width", "100%"); i.setStyleProperty("height", "100%"); this.al0 = b.getSubRenderer(i); a = b.getSubRenderer(e); } else { this.aly = null; if (this.aia != null) { this.aia.l(null); } if (this.ajs != null) { this.ajs.provideContainer(null); this.ajs = null; } if (this.aiu != null) { this.aiu.provideContainer(null); } } super.provideContainer(a); if (b != null) { if (this.volumeChart != null) { this.volumeChart.c9.b4(this.alz); } if (this.ai3 != null) { this.ai3.h(this.alw); } if (this.zoomSliderChart != null) { this.zoomSliderChart.c9.b4(this.al0); if (a != null) { this.ao5(); } else { this.ajs = null; } } if (this.aiu != null) { this.aiu.provideContainer(this.alx); } this.setGridRows(); } } ap9(a, b, c) { if (a != null) { a.provideContainer(null); } if (b != null) { b.c9.b4(c); } this.setGridRows(); } aqn(a, b) { this.ap9(a, b, this.al0); if (b == null) { return; } this.ao5(); } ao5() { if (this.al0 == null) { return; } if (this.ajs != null) { this.ajs.provideContainer(null); } this.ajs = TypeRegistrar.create("ZoomSlider"); this.ajs.provideContainer(this.al0); let a = this.ajs; a.windowRectChanged = delegateCombine(a.windowRectChanged, (a, b) => { if (this.dataChart != null) { this.dataChart.wo = new Rect(0, this.ajs.windowRect.left, this.dataChart.v5.top, this.ajs.windowRect.width, this.dataChart.v5.height); } }); this.ao6(); } aql(a, b) { this.ap9(a, b, this.alz); } setGridRows() { if (this.al1 == null) { return; } let a = new Array(6); a[0] = (this.aka ? this.ali : 0) + "px"; a[1] = this.aj6 ? "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.ajs != null) { if (a[5] == "0px") { this.ajs.hide(); } else { this.ajs.show(); } } this.al1.setStyleProperty("-ms-grid-rows", stringReplace(stringJoin(" ", ...a), "auto", "1fr")); this.al1.setStyleProperty("grid-template-rows", stringJoin(" ", ...a)); if (this.ly == null) { return; } if (this.dataChart != null) { this.dataChart.notifyContainerResized(); } if (this.ai3 != null) { this.ai3.f(); } if (this.volumeChart != null) { this.volumeChart.notifyContainerResized(); } if (this.zoomSliderChart != null) { this.zoomSliderChart.notifyContainerResized(); } if (this.ajs != null) { this.ajs.notifySizeChanged(); } } vd() { super.vd(); this.aap = 1; this.af4 = 0; this.acm = 0; this.agy = null; this.agr = AxisDefaults.g; this.ab6 = AxisDefaults.e; this.ab5 = AxisDefaults.f; this.ags = AxisDefaults.j; this.ago = null; this.aqp = AxisDefaults.h; this.alv = AxisDefaults.b; this.finalValueAnnotationsVisible = true; this.crosshairsAnnotationEnabled = true; this.gq = false; this.crosshairsDisplayMode = 0; this.jq = Defaults.j; this.yo = Defaults.ae; this.yj = Defaults.af; this.yk = Defaults.ag; this.ka = NaN; this.j2 = 40; this.g6 = true; this.he = false; if (this.dataChart != null) { let a = this.dataChart.c9.j.e(); this.ahl = a.d; this.ahm = a.e; this.ahk = a.d; this.aqp = this.dataChart.aat; } 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.n(d, 0.3)); } this.ahn = c; this.aho = b; } ap5() { if (this.ai3 != null) { this.ai3.b = null; this.ai3.b = this.indicatorCharts; } this.setGridRows(); } ap6() { this.setGridRows(); } aqf() { this.ap5(); } ao4() { if (this.ajs == null || this.zoomSliderChart == null || this.dataChart == null || this.dataChart.series.count == 0) { return; } let a = this.ly.rootWrapper.width(); let b = this.dataChart.wn.left + this.dataChart.wn.width; let c = this.dataChart.wn.left; let d = a - b; this.ajs.startInset = c - this.ajs.trackStartInset; this.ajs.endInset = d - this.ajs.trackEndInset; if (this.ajs.endInset < 0) { let e = this.ajs.endInset; this.ajs.endInset = 0; this.dataChart.h8 += (e * -1); } if (this.ajs.startInset < 0) { let f = this.ajs.startInset; this.ajs.startInset = 0; this.dataChart.h3 += (f * -1); } this.zoomSliderChart.h3 = c; this.zoomSliderChart.h8 = d; this.zoomSliderChart.hq = this.ajs.barExtent; } apv() { this.ao4(); } va(a) { super.va(a); if (a != null) { a.hp = 0; } } aqq(a) { return a.vy(); } aqt() { return this.alx == null ? null : this.aqs(this.alx.rootWrapper); } aqr(a) { if (a == null || a.d == null) { return null; } return this.aqs(a.d.rootWrapper); } aqs(a) { if (a == null) { return null; } let b = a.getOffset(); return new Rect(0, b.left, b.top, a.width(), a.height()); } ald() { if (this.al1 == null) { return NaN; } let a = this.al1.getOffset(); return this.al1.width() + (a == null ? 0 : a.left); } vm(source_, a, b) { super.vm(source_, a, b); if (this.zoomSliderChart != null) { this.zoomSliderChart.of(source_, a, b); } } vn(source_, a, b) { super.vn(source_, a, b); if (this.zoomSliderChart != null) { this.zoomSliderChart.og(source_, a, b); } } vl(source_) { super.vl(source_); if (this.zoomSliderChart != null) { this.zoomSliderChart.n8(source_); } } vp(source_, a, b, c) { super.vp(source_, a, b, c); if (this.zoomSliderChart != null) { this.zoomSliderChart.oh(source_, a, b, c); } } vg(a, b) { super.vg(a, b); if (this.aj7(a)) { a.toolTip = null; } } get aia() { return this.ah9; } set aia(a) { let b = this.aia; if (a != b) { this.ah9 = a; this.v3("Toolbar", b, this.aia); } } get amq() { return this.amj; } set amq(a) { let b = this.amq; if (a != b) { this.amj = a; this.v3("RangeSelectorTemplate", b, this.amq); } } get amr() { return this.amk; } set amr(a) { let b = this.amr; if (a != b) { this.amk = a; this.v3("ToolbarTemplate", b, this.amr); } } get amn() { return this.amg; } set amn(a) { let b = this.amn; if (a != b) { this.amg = a; this.v3("ChartTypePickerTemplate", b, this.amn); } } get ams() { return this.aml; } set ams(a) { let b = this.ams; if (a != b) { this.aml = a; this.v3("TrendLineTypePickerTemplate", b, this.ams); } } get amt() { return this.amm; } set amt(a) { let b = this.amt; if (a != b) { this.amm = a; this.v3("VolumeTypePickerTemplate", b, this.amt); } } get amo() { return this.amh; } set amo(a) { let b = this.amo; if (a != b) { this.amh = a; this.v3("IndicatorMenuTemplate", b, this.amo); } } get amp() { return this.ami; } set amp(a) { let b = this.amp; if (a != b) { this.ami = a; this.v3("OverlayPickerTemplate", b, this.amp); } } get ajs() { return this.ajr; } set ajs(a) { let b = this.ajs; if (a != b) { this.ajr = a; this.v3("ZoomSlider", b, this.ajs); } } 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 ali() { return this.ak1; } set ali(a) { let b = this.ali; if (a != b) { this.ak1 = a; this.v3("ToolbarHeight", b, this.ali); } } constructor() { super(); this.ai3 = null; this.al1 = null; this.alz = null; this.alw = null; this.aly = null; this.al0 = null; this.alx = null; this.ah9 = null; this.amj = null; this.amk = null; this.amg = null; this.aml = null; this.amm = null; this.amh = null; this.ami = null; this.ajr = null; this.ak1 = 40; this.aix = null; this.aiv = null; this.aiz = null; this.ai4 = null; this.amu = null; this.ajn = null; this.akd = false; this.akc = false; this.akk = false; this.ajz = false; this.al7 = 10; this.ak8 = NaN; this.ala = NaN; this.ak9 = NaN; this.alb = 0; this.aif = 0; this.aii = 0; this.ak3 = 3; this.ak6 = NaN; this.ak4 = NaN; this.ak5 = NaN; this.ak7 = NaN; this.aik = 0; this.aju = true; this.aib = 0; this.ajv = false; this.aip = null; this.air = null; this.akm = null; this.ajx = true; this.ajw = false; this.ajy = false; this.ajo = null; this.aim = 1; this.ahd = null; this.ahe = null; this.ahf = null; this.ahg = null; this.ahi = null; this.ahh = null; this.ahc = null; this.ahb = null; this.ak2 = 1; this.ak0 = 1; this.akz = 2; this.aky = 1; this.ai1 = null; this.al3 = -2147483648; this.akx = 2; this.al6 = 3; this.al4 = 10; this.al2 = 30; this.al5 = 9; this.ah6 = null; this.ah7 = null; this.ah2 = null; this.applyCustomIndicators = null; this.aqo = null; this.alc = 1; this.ajt = false; this.ait = null; this.aku = dateMinValue(); this.akt = dateMaxValue(); this.akr = null; this.ut(); this.akr = new ObservableCollection$1(Base.$, 0); if (this.xAxisBreaks != null) { let a = this.xAxisBreaks; a.collectionChanged = delegateCombine(a.collectionChanged, (a, b) => this.aqd()); } this.apy(); } aae() { return this.xAxis; } aaf() { return this.yAxis; } onAttachedToUI() { super.onAttachedToUI(); if (this.ajs != null) { this.ajs.onAttachedToUI(); } } onDetachedFromUI() { super.onDetachedFromUI(); if (this.ajs != null) { this.ajs.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(); } ahw(a) { return this.ahx(a); } aja(a) { return this.ajb(a); } ahv(a) { let b = this.ahw(0); b.name = a; return b; } uo() { this.xAxis = this.ahv("xAxis"); this.yAxis = this.aja(0); this.yAxis.name = "yAxis"; this.volumeAxis = this.aja(0); this.volumeAxis.name = "volumeAxis"; this.volumeXAxis = this.ahv("volumeXAxis"); this.ako = new List$1(NumericYAxis.$, 0); this.akq = new List$1(CategoryAxisBase.$, 0); this.indicatorAxis = this.aja(0); this.indicatorAxis.name = "indicatorAxis"; this.indicatorXAxis = this.ahv("indicatorXAxis_0"); this.ako.add(this.indicatorAxis); this.akq.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.aja(0); this.zoomSliderAxis.name = "zoomSliderAxis"; this.zoomSliderXAxis = this.ahv("zoomSliderXAxis"); if (this.zoomSliderAxis.az == null) { this.zoomSliderAxis.az = new AxisLabelSettings(); } if (this.zoomSliderXAxis.az == null) { this.zoomSliderXAxis.az = new AxisLabelSettings(); } } ui(a, b) { let c = typeCast(MarkerSeries.$, a); if (c != null) { c.xc = this.c2(a, b); } } c1(a) { if (a != null) { return 1; } return super.c1(a); } wy(a) { if (a.suggestedSecondaryAxis == 2) { this.yAxis.lo = true; this.yAxis.mm = 10; } } w1() { this.yAxis.lo = this.akh; this.yAxis.mm = this.amf; } aie(a) { let b; if (this.aic == 0) { if (a == null || a.index > 0 || stringIsNullOrEmpty(a.getMemberPathFor(12))) { b = 4; } else { b = 2; } } else { b = this.aic; } b = this.aid(b); return b; } aid(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; } ain(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; } aig(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; } am2(a) { let b = a.getMemberPathFor(14); if (stringIsNullOrEmpty(b)) { b = a.getMemberPathFor(11); } return b; } ahx(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; } } ajb(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; } } ajh() { return this.df(1); } aji() { return this.df(0); } ajg() { return this.df(2); } ajj() { return this.df(20); } get aj0() { return (TypeRegistrar.isRegistered("HorizontalAnchoredCategorySeriesProxy")); } get aiy() { if (TypeRegistrar.isRegistered("HorizontalAnchoredCategorySeriesProxy")) { return TypeRegistrar.create("HorizontalAnchoredCategorySeriesProxy"); } else { throw new BaseError(1, "horizontal series module is not loaded, but is required."); } } get aj3() { return (TypeRegistrar.isRegistered("FinancialPriceSeriesProxy")); } get aiw() { if (TypeRegistrar.isRegistered("FinancialPriceSeriesProxy")) { return TypeRegistrar.create("FinancialPriceSeriesProxy"); } else { throw new BaseError(1, "financial series module is not loaded, but is required."); } } get aj1() { return (TypeRegistrar.isRegistered("IndicatorProxy")); } get ai0() { if (TypeRegistrar.isRegistered("IndicatorProxy")) { return TypeRegistrar.create("IndicatorProxy"); } else { throw new BaseError(1, "financial series module is not loaded, but is required."); } } get aj2() { return (TypeRegistrar.isRegistered("OverlayProxy")); } get ai5() { 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.am2(a); switch (this.aie(a)) { case 3: let d = this.ajh(); this.aiy.setValueMemberPath(d, c); this.aiy.setXAxis(d, this.xAxis); this.aiy.setYAxis(d, this.yAxis); this.aiy.setCategoryMode(d, 1); return d; case 4: let e = this.aji(); this.aiy.setValueMemberPath(e, c); this.aiy.setXAxis(e, this.xAxis); this.aiy.setYAxis(e, this.yAxis); this.aiy.setCategoryMode(e, 1); return e; default: case 1: case 2: let f = this.ajj(); this.aiw.setOpenMemberPath(f, a.getMemberPathFor(11)); this.aiw.setHighMemberPath(f, a.getMemberPathFor(12)); this.aiw.setLowMemberPath(f, a.getMemberPathFor(13)); this.aiw.setCloseMemberPath(f, a.getMemberPathFor(14)); this.aiw.setVolumeMemberPath(f, a.getMemberPathFor(15)); this.aiw.setXAxis(f, this.xAxis); this.aiw.setYAxis(f, this.yAxis); this.aiw.setDisplayType(f, this.aic == 1 ? 1 : 0); this.aiw.setCategoryMode(f, 1); return f; } } w0() { super.w0(); this.apt(this.xAxis); this.aqh(false); if (this.aih != 0 && this.volumeChart != null) { this.ap0(); } this.apt(this.volumeXAxis); this.apt(this.indicatorXAxis); this.aqe(); this.aqg(); if (this.aio != 0) { this.ap1(); this.apt(this.zoomSliderXAxis); } } afq(a, b) { super.afq(a, b); a(this.volumeXAxis); if (this.akq != null) { for (let c of fromEnum(this.akq)) { a(c); } } let d = true; switch (b) { case "XAxisMajorStroke": case "XAxisMajorStrokeThickness": d = false; break; } if (d) { a(this.zoomSliderXAxis); } } afv(a, b) { super.afv(a, b); if (b) { a(this.volumeAxis); if (this.ako != null) { for (let c of fromEnum(this.ako)) { a(c); } } a(this.zoomSliderAxis); } } apx(a) { let b = typeCast(IZoomableCategoryAxis_$type, this.xAxis); if (b != null) { a(b); } } aft(a) { super.aft(a); this.afk(this.volumeXAxis, a); this.afk(this.indicatorXAxis, a); this.afk(this.zoomSliderXAxis, a); } afy(a) { super.afy(a); this.afk(this.volumeAxis, a); this.afk(this.indicatorAxis, a); this.afk(this.zoomSliderAxis, a); } afw(a) { super.afw(a); this.afj(this.volumeAxis, a); this.afj(this.indicatorAxis, a); this.afj(this.zoomSliderAxis, a); } afr(a) { super.afr(a); this.afj(this.volumeXAxis, a); this.afj(this.indicatorXAxis, a); this.afj(this.zoomSliderXAxis, a); } u9(a) { super.u9(a); if (a == null) { return; } if (a == this.zoomSliderChart) { a.xj = a.xm = 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.anx(); $ret.synchronizeHorizontally = true; $ret.synchronizeVertically = false; return $ret; })())); SyncManager.c(a); } a.cw = 2; } anx() { if (this.amu == null) { FinancialChart.ame++; this.amu = FinancialChart.ame.toString(); } return this.amu; } apf(a, b) { this.ao1(); this.apv(); } ao1() { if (this.yAxis.b8()) { return; } let a = this.yAxis.aw.bd; if (this.aih != 0) { a = Math.max(a, this.volumeAxis.aw.bd); } for (let b of fromEnum(this.ako)) { a = Math.max(a, b.aw.bd); } this.ao2(a); } ao2(a) { if (this.yAxis.b8()) { return; } this.yAxis.eu = this.volumeAxis.eu = a; for (let b of fromEnum(this.ako)) { b.eu = a; } this.zoomSliderAxis.eu = this.yAxis.eu; } ao7(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.aj5(e))) { continue; } a(c.series._inner[d], b); } } } apa(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.et) { continue; } a(this.volumeChart.series._inner[b], b); } } ao8(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.aj7(c)) { continue; } a(c, b); } } ao9(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.aj7(d)) { continue; } let e = this.al8(d, c); a(d, e); } if (b) { this.apb(a); } } apb(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.et) { continue; } a(this.zoomSliderChart.series._inner[b], b); } } al8(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.ais == null ? 0 : this.ais.count; return b - (c * d); } uy(a) { super.uy(a); this.apa(a); this.ao7(a); this.apb(a); } get volumeChart() { return this.ajn; } set volumeChart(a) { let b = this.volumeChart; if (a != b) { this.ajn = a; this.v3("VolumeChart", b, this.volumeChart); } } ap0() { 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.aj7(d) || d.et) { continue; } b++; let e; let f = this.aih; f = this.aig(f); switch (f) { case 2: e = this.aji(); break; case 3: e = this.ajg(); break; default: case 1: e = this.ajh(); break; } this.aiy.setCategoryMode(e, 1); e.name = "volumeSeries_" + b; e.itemsSource = d.itemsSource; this.aiy.setXAxis(e, this.volumeXAxis); this.aiy.setYAxis(e, this.volumeAxis); this.aiy.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.vh = ArrayExtension.getModulus$1(Brush.$, this.ahp, b); e.vx = ArrayExtension.getModulus$1(Brush.$, this.ahq, b); e.jp = this.alj; 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.ve(i, h); } } aj4(a) { if (!this.aj0) { return false; } return this.aiy.matchesType(a); } aj8(a) { if (!this.aj3) { return false; } return this.aiw.matchesType(a); } aj5(a) { if (!this.aj1) { return false; } return this.ai0.matchesType(a); } aj7(a) { if (!this.aj2) { return false; } return this.ai5.matchesType(a); } apz() { if (this.dataChart == null) { return; } let a = 0; let b = this.aiq == null ? 0 : this.aiq.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.aiq._inner[e]); let j = -1; for (let k = 0; k < this.dataChart.series.count; k++) { let l = this.dataChart.series._inner[k]; if (this.aj7(l) || l.et) { continue; } j++; let m; if (h) { let n = this.ajk("Custom"); this.ai0.handleCustomIndicatorEvent(n, runOn(this, this.apd)); m = n; } else { m = this.ajm(this.aiq._inner[e]); } if (m == null) { continue; } m.name = "indicator_" + a++; this.ai0.setXAxis(m, this.akq._inner[e]); this.ai0.setYAxis(m, this.ako._inner[e]); m.itemsSource = l.itemsSource; this.ai0.setOpenMemberPath(m, this.bf.dataSeries._inner[j].getMemberPathFor(11)); this.ai0.setHighMemberPath(m, this.bf.dataSeries._inner[j].getMemberPathFor(12)); this.ai0.setLowMemberPath(m, this.bf.dataSeries._inner[j].getMemberPathFor(13)); this.ai0.setCloseMemberPath(m, this.bf.dataSeries._inner[j].getMemberPathFor(14)); this.ai0.setVolumeMemberPath(m, this.bf.dataSeries._inner[j].getMemberPathFor(15)); m.title = l.title + " " + i; m.vh = ArrayExtension.getModulus$1(Brush.$, this.ahj, e); m.jp = this.alf; if (this.aj5(m)) { this.ai0.setNegativeBrush(m, ArrayExtension.getModulus$1(Brush.$, this.ahk, e)); this.ai0.setDisplayType(m, ArrayExtension.getModulus$1(IndicatorDisplayType_$type, this.ai2, e)); } if (this.ama != -2147483648 && this.aj5(m)) { this.ai0.setPeriodOverride(m, this.ama); } if (this.aj5(m)) { this.ai0.setSmoothingPeriod(m, this.amd); } if (this.aj5(m)) { this.ai0.setSignalPeriod(m, this.amc); } if (this.aj5(m)) { this.ai0.setShortPeriod(m, this.amb); this.ai0.setLongPeriod(m, this.al9); } this.ve(m, e); f.add(m); } let o = this.hy(i, false); for (let p = 0; p < f.count; p++) { let q = f._inner[p]; g.series.add(q