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AKpB,KAAKqwC,SAASv2B,OAAO3Y,EAAGC,GAAI,MAC/F,KAAK,EAAGpB,KAAK6wC,OAAS,EAAG7wC,KAAKmyC,IAAMhxC,EAAGnB,KAAKuyC,IAAMnxC,EAAG,MACrD,KAAK,EAAGpB,KAAK6wC,OAAS,EACtB,QAASnsC,EAAM1E,KAAMmB,EAAGC,GAE1BpB,KAAKsyC,IAAMtyC,KAAKmyC,IAAKnyC,KAAKmyC,IAAMnyC,KAAKqyC,IAAKryC,KAAKqyC,IAAMlxC,EACrDnB,KAAKyyC,IAAMzyC,KAAKuyC,IAAKvyC,KAAKuyC,IAAMvyC,KAAKwyC,IAAKxyC,KAAKwyC,IAAMpxC,CACvD,GAGF,KAAe,SAAUuxC,EAAO34B,GAE9B,SAAS44B,EAASrM,GAChB,OAAO,IAAImM,EAASnM,EAASvsB,EAC/B,CAMA,OAJA44B,EAAS54B,QAAU,SAASA,GAC1B,OAAO24B,GAAQ34B,EACjB,EAEO44B,CACR,CAXD,CAWG,E","sources":["webpack://@amcharts/amcharts5/./src/.internal/charts/xy/XYChart.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/XYChartDefaultTheme.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/XYCursor.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/axes/Axis.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/axes/AxisBullet.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/axes/AxisLabel.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/axes/AxisLabelRadial.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/axes/AxisRenderer.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/axes/AxisRendererX.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/axes/AxisRendererY.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/axes/AxisTick.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/axes/DateAxis.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/axes/GaplessDateAxis.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/axes/Grid.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/axes/ValueAxis.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/series/BaseColumnSeries.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/series/Candlestick.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/series/CandlestickSeries.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/series/ColumnSeries.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/series/LineSeries.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/series/XYSeries.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/XYChartScrollbar.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/axes/CategoryAxis.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/axes/CategoryDateAxis.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/axes/DurationAxis.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/series/OHLC.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/series/OHLCSeries.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/series/SmoothedYLineSeries.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/series/SmoothedXLineSeries.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/series/SmoothedXYLineSeries.ts","webpack://@amcharts/amcharts5/./node_modules/d3-shape/src/curve/step.js","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/series/StepLineSeries.ts","webpack://@amcharts/amcharts5/./tmp/webpack/xy.js","webpack://@amcharts/amcharts5/./node_modules/d3-shape/src/curve/cardinal.js"],"sourcesContent":["import type { Axis } from \"./axes/Axis\";\nimport type { XYCursor } from \"./XYCursor\";\nimport type { AxisRenderer } from \"./axes/AxisRenderer\";\nimport type { DataItem } from \"../../core/render/Component\";\nimport type { IDisposer } from \"../../core/util/Disposer\";\nimport type { XYSeries, IXYSeriesDataItem } from \"./series/XYSeries\";\nimport type { IPointerEvent } from \"../../core/render/backend/Renderer\";;\nimport type { Scrollbar } from \"../../core/render/Scrollbar\";\nimport type { Tooltip } from \"../../core/render/Tooltip\";\nimport type { IPoint } from \"../../core/util/IPoint\";\nimport type { ISpritePointerEvent } from \"../../core/render/Sprite\";\nimport type { Animation } from \"../../core/util/Entity\";\nimport type { CategoryAxis } from \"./axes/CategoryAxis\";\nimport type { DateAxis } from \"./axes/DateAxis\";\n\nimport { XYChartDefaultTheme } from \"./XYChartDefaultTheme\";\nimport { Container } from \"../../core/render/Container\";\nimport { Rectangle } from \"../../core/render/Rectangle\";\nimport { SerialChart, ISerialChartPrivate, ISerialChartSettings, ISerialChartEvents } from \"../../core/render/SerialChart\";\nimport { ListAutoDispose } from \"../../core/util/List\";\nimport { p100 } from \"../../core/util/Percent\";\nimport { Button } from \"../../core/render/Button\";\nimport { Graphics } from \"../../core/render/Graphics\";\nimport { Percent } from \"../../core/util/Percent\";\n\nimport * as $array from \"../../core/util/Array\";\nimport * as $type from \"../../core/util/Type\";\nimport * as $order from \"../../core/util/Order\";\nimport * as $object from \"../../core/util/Object\";\nimport * as $utils from \"../../core/util/Utils\";\nimport * as $math from \"../../core/util/Math\";\n\nexport interface IXYChartSettings extends ISerialChartSettings {\n\n\t/**\n\t * horizontal scrollbar.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/scrollbars/} for more info\n\t */\n\tscrollbarX?: Scrollbar;\n\n\t/**\n\t * Vertical scrollbar.\n\t *\n\t */\n\tscrollbarY?: Scrollbar;\n\n\t/**\n\t * If this is set to `true`, users will be able to pan the chart horizontally\n\t * by dragging plot area.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/zoom-and-pan/#Panning} for more info\n\t */\n\tpanX?: boolean;\n\n\t/**\n\t * If this is set to `true`, users will be able to pan the chart vertically\n\t * by dragging plot area.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/zoom-and-pan/#Panning} for more info\n\t */\n\tpanY?: boolean;\n\n\t/**\n\t * Indicates what happens when mouse wheel is spinned horizontally while over\n\t * plot area.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/zoom-and-pan/#Mouse_wheel_behavior} for more info\n\t */\n\twheelX?: \"zoomX\" | \"zoomY\" | \"zoomXY\" | \"panX\" | \"panY\" | \"panXY\" | \"none\";\n\n\t/**\n\t * Indicates what happens when mouse wheel is spinned vertically while over\n\t * plot area.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/zoom-and-pan/#Mouse_wheel_behavior} for more info\n\t */\n\twheelY?: \"zoomX\" | \"zoomY\" | \"zoomXY\" | \"panX\" | \"panY\" | \"panXY\" | \"none\";\n\n\t/**\n\t * Indicates the relative \"speed\" of the mouse wheel.\n\t *\n\t * @default 0.25\n\t */\n\twheelStep?: number;\n\n\t/**\n\t * Chart's cursor.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/cursor/} for more info\n\t */\n\tcursor?: XYCursor;\n\n\t/**\n\t * If not set (default), cursor will show tooltips for all data items in the\n\t * same category/date.\n\t *\n\t * If set, cursor will select closest data item to pointer (mouse or touch) and\n\t * show tooltip for it.\n\t *\n\t * It will also show tooltips for all data items that are within X pixels\n\t * range (as set in `maxTooltipDistance`).\n\t *\n\t * Tooltips for data items farther then X pixels, will not be shown.\n\t *\n\t * NOTE: set it to `-1` to ensure only one tooltip is displayed, even if there\n\t * are multiple data items in the same place.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/cursor/#tooltips} for more info\n\t */\n\tmaxTooltipDistance?: number;\n\n\t/**\n\t * Indicates how the distance should be measured when assessing distance\n\t * between tooltips as set in `maxTooltipDistance`.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/cursor/#tooltips} for more info\n\t * @since 5.2.6\n\t */\n\tmaxTooltipDistanceBy?: \"xy\" | \"x\" | \"y\";\n\n\t/**\n\t * If set to `false` the chart will not check for overlapping of multiple\n\t * tooltips, and will not arrange them to not overlap.\n\t *\n\t * Will work only if chart has an `XYCursor` enabled.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/cursor/#ooltips} for more info\n\t * @default true\n\t */\n\tarrangeTooltips?: boolean\n\n\t/**\n\t * If set to `true`, using pinch gesture on the chart's plot area will zoom\n\t * chart horizontally.\n\t *\n\t * NOTE: this setting is not supported in a [[RadarChart]].\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/zoom-and-pan/#Pinch_zoom} for more info\n\t * @since 5.1.8\n\t * @default false\n\t */\n\tpinchZoomX?: boolean;\n\n\t/**\n\t * If set to `true`, using pinch gesture on the chart's plot area will zoom\n\t * chart vertically.\n\t *\n\t * NOTE: this setting is not supported in a [[RadarChart]].\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/zoom-and-pan/#Pinch_zoom} for more info\n\t * @since 5.1.8\n\t * @default false\n\t */\n\tpinchZoomY?: boolean;\n\n\t/**\n\t * If set, will use this relative position as a \"center\" for mouse wheel\n\t * horizontal zooming instead of actual cursor position.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/zoom-and-pan/#Mouse_wheel_behavior} for more info\n\t * @since 5.2.11\n\t */\n\twheelZoomPositionX?: number;\n\n\t/**\n\t * If set, will use this relative position as a \"center\" for mouse wheel\n\t * vertical zooming instead of actual cursor position.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/zoom-and-pan/#Mouse_wheel_behavior} for more info\n\t * @since 5.2.11\n\t */\n\twheelZoomPositionY?: number;\n\n}\n\nexport interface IXYChartPrivate extends ISerialChartPrivate {\n\n\t/**\n\t * A list of [[Series]] that currently have their tooltip being displayed.\n\t */\n\ttooltipSeries?: Array\n\n\t/**\n\t * Array of other [[XYChart]] objects that cursors should be synced with.\n\t *\n\t * Note: cursors will be synced across the vertically stacked charts only.\n\t */\n\totherCharts?: Array\n\n}\n\n\nexport interface IXYChartEvents extends ISerialChartEvents {\n\n\t/**\n\t * Invoked when panning starts.\n\t *\n\t * @since 5.0.4\n\t */\n\tpanstarted: {\n\t\toriginalEvent: IPointerEvent\n\t};\n\n\t/**\n\t * Invoked when panning ends.\n\t *\n\t * @since 5.0.4\n\t */\n\tpanended: {\n\t\toriginalEvent: IPointerEvent\n\t};\n\n\t/**\n\t * Invoked if pointer is pressed down on a chart and released without moving.\n\t *\n\t * `panended` event will still kick in after that.\n\t *\n\t * @since 5.2.19\n\t */\n\tpancancelled: {\n\t\toriginalEvent: IPointerEvent\n\t};\n\n\t/**\n\t * Invoked when wheel caused zoom ends.\n\t *\n\t * @since 5.0.4\n\t */\n\twheelended: {};\n\n}\n\n/**\n * Creates an XY chart.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/} for more info\n * @important\n */\nexport class XYChart extends SerialChart {\n\n\tpublic static className: string = \"XYChart\";\n\tpublic static classNames: Array = SerialChart.classNames.concat([XYChart.className]);\n\n\tdeclare public _settings: IXYChartSettings;\n\tdeclare public _privateSettings: IXYChartPrivate;\n\tdeclare public _seriesType: XYSeries;\n\tdeclare public _events: IXYChartEvents;\n\n\t/**\n\t * A list of horizontal axes.\n\t */\n\tpublic readonly xAxes: ListAutoDispose> = new ListAutoDispose();\n\n\t/**\n\t * A list of vertical axes.\n\t */\n\tpublic readonly yAxes: ListAutoDispose> = new ListAutoDispose();\n\n\t/**\n\t * A [[Container]] located on top of the chart, used to store top horizontal\n\t * axes.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/xy-chart-containers/} for more info\n\t * @default Container.new()\n\t */\n\tpublic readonly topAxesContainer: Container = this.chartContainer.children.push(Container.new(this._root, { width: p100, layout: this._root.verticalLayout }));\n\n\t/**\n\t * A [[Container]] located in the middle the chart, used to store vertical axes\n\t * and plot area container.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/xy-chart-containers/} for more info\n\t * @default Container.new()\n\t */\n\tpublic readonly yAxesAndPlotContainer: Container = this.chartContainer.children.push(Container.new(this._root, { width: p100, height: p100, layout: this._root.horizontalLayout }));\n\n\t/**\n\t * A [[Container]] located on bottom of the chart, used to store bottom\n\t * horizontal axes.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/xy-chart-containers/} for more info\n\t * @default Container.new()\n\t */\n\tpublic readonly bottomAxesContainer: Container = this.chartContainer.children.push(Container.new(this._root, { width: p100, layout: this._root.verticalLayout }));\n\n\t/**\n\t * A [[Container]] located on left of the chart, used to store left-hand\n\t * vertical axes.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/xy-chart-containers/} for more info\n\t * @default Container.new()\n\t */\n\tpublic readonly leftAxesContainer: Container = this.yAxesAndPlotContainer.children.push(Container.new(this._root, { height: p100, layout: this._root.horizontalLayout }));\n\n\t/**\n\t * A [[Container]] located in the middle of the chart, used to store plotContainer and topPlotContainer\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/xy-chart-containers/} for more info\n\t * @default Container.new()\n\t */\n\tpublic readonly plotsContainer: Container = this.yAxesAndPlotContainer.children.push(Container.new(this._root, { width: p100, height: p100, maskContent: false }));\n\n\t/**\n\t * A [[Container]] located in the middle of the chart, used to store actual\n\t * plots (series).\n\t *\n\t * NOTE: `plotContainer` will automatically have its `background` preset. If\n\t * you need to modify background or outline for chart's plot area, you can\n\t * use `plotContainer.get(\"background\")` for that.*\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/xy-chart-containers/} for more info\n\t * @default Container.new()\n\t */\n\tpublic readonly plotContainer: Container = this.plotsContainer.children.push(Container.new(this._root, { width: p100, height: p100 }));\n\n\t/**\n\t * A [[Container]] used for any elements that need to be displayed over\n\t * regular `plotContainer`.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/xy-chart-containers/} for more info\n\t * @default Container.new()\n\t */\n\tpublic readonly topPlotContainer: Container = this.plotsContainer.children.push(Container.new(this._root, { width: p100, height: p100 }));\n\n\t/**\n\t * A [[Container]] axis grid elements are stored in.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/xy-chart-containers/} for more info\n\t * @default Container.new()\n\t */\n\tpublic readonly gridContainer: Container = this.plotContainer.children.push(Container.new(this._root, { width: p100, height: p100, isMeasured: false }));\n\n\t/**\n\t * A [[Container]] axis background grid elements are stored in.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/xy-chart-containers/} for more info\n\t * @default Container.new()\n\t */\n\tpublic readonly topGridContainer: Container = Container.new(this._root, { width: p100, height: p100, isMeasured: false });\n\n\t/**\n\t * A [[Container]] located on right of the chart, used to store right-hand\n\t * vertical axes.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/xy-chart-containers/} for more info\n\t * @default Container.new()\n\t */\n\tpublic readonly rightAxesContainer: Container = this.yAxesAndPlotContainer.children.push(Container.new(this._root, { height: p100, layout: this._root.horizontalLayout }));\n\n\t/**\n\t * A [[Container]] axis headers are stored in.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/axis-headers/} for more info\n\t * @default Container.new()\n\t */\n\tpublic readonly axisHeadersContainer: Container = this.plotContainer.children.push(Container.new(this._root, {}));\n\n\t/**\n\t * A button that is shown when chart is not fully zoomed out.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/zoom-and-pan/#Zoom_out_button} for more info\n\t * @default Button.new()\n\t */\n\tpublic readonly zoomOutButton: Button = this.topPlotContainer.children.push(Button.new(this._root, {\n\t\tthemeTags: [\"zoom\"],\n\t\ticon: Graphics.new(this._root, {\n\t\t\tthemeTags: [\"button\", \"icon\"]\n\t\t})\n\t}));\n\n\tpublic _movePoint: IPoint = { x: 0, y: 0 };\n\n\tprotected _wheelDp: IDisposer | undefined;\n\n\tpublic _otherCharts?: Array;\n\n\tprotected _movePoints: { [index: number]: IPoint } = {};\n\n\tprotected _downStartX?: number;\n\tprotected _downEndX?: number;\n\n\tprotected _downStartY?: number;\n\tprotected _downEndY?: number;\n\n\tprotected _afterNew() {\n\t\tthis._defaultThemes.push(XYChartDefaultTheme.new(this._root));\n\n\t\tsuper._afterNew();\n\n\t\tthis._disposers.push(this.xAxes);\n\t\tthis._disposers.push(this.yAxes);\n\n\t\tconst root = this._root;\n\n\t\tlet verticalLayout = this._root.verticalLayout;\n\n\t\tconst zoomOutButton = this.zoomOutButton;\n\t\tzoomOutButton.events.on(\"click\", () => {\n\t\t\tthis.zoomOut();\n\t\t})\n\t\tzoomOutButton.hide(0);\n\t\tzoomOutButton.states.lookup(\"default\")!.set(\"opacity\", 1);\n\n\t\tthis.chartContainer.set(\"layout\", verticalLayout);\n\n\t\tconst plotContainer = this.plotContainer;\n\t\tplotContainer.children.push(this.seriesContainer);\n\n\t\tthis._disposers.push(this._processAxis(this.xAxes, this.bottomAxesContainer));\n\t\tthis._disposers.push(this._processAxis(this.yAxes, this.leftAxesContainer));\n\n\n\t\tplotContainer.children.push(this.topGridContainer);\n\t\tplotContainer.children.push(this.bulletsContainer);\n\n\t\t// Setting trasnparent background so that full body of the plot container\n\t\t// is interactive\n\t\tplotContainer.set(\"interactive\", true);\n\t\tplotContainer.set(\"interactiveChildren\", false);\n\t\tplotContainer.set(\"background\", Rectangle.new(root, {\n\t\t\tthemeTags: [\"plotbackground\", \"xy\", \"background\"]\n\t\t}));\n\n\t\tthis._disposers.push(plotContainer.events.on(\"pointerdown\", (event) => {\n\t\t\tthis._handlePlotDown(event);\n\t\t}));\n\n\t\tthis._disposers.push(plotContainer.events.on(\"globalpointerup\", (event) => {\n\t\t\tthis._handlePlotUp(event);\n\t\t}));\n\n\t\tthis._disposers.push(plotContainer.events.on(\"globalpointermove\", (event) => {\n\t\t\tthis._handlePlotMove(event);\n\t\t}));\n\n\t\tthis._maskGrid();\n\t\tthis._setUpTouch();\n\t}\n\n\tpublic _beforeChanged() {\n\t\tsuper._beforeChanged();\n\n\t\tif (this.isDirty(\"pinchZoomX\") || this.isDirty(\"pinchZoomY\") || this.get(\"panX\") || this.get(\"panY\")) {\n\t\t\tthis._setUpTouch();\n\t\t}\n\n\t}\n\n\tprotected _setUpTouch(): void {\n\t\tif (!this.plotContainer._display.cancelTouch) {\n\t\t\tthis.plotContainer._display.cancelTouch = (this.get(\"pinchZoomX\") || this.get(\"pinchZoomY\") || this.get(\"panX\") || this.get(\"panY\")) ? true : false;\n\t\t}\n\t}\n\n\tprotected _maskGrid() {\n\t\tthis.gridContainer.set(\"maskContent\", true);\n\t\tthis.topGridContainer.set(\"maskContent\", true);\n\t}\n\n\tprotected _removeSeries(series: this[\"_seriesType\"]) {\n\t\tseries._unstack();\n\n\t\tif (series._posXDp) {\n\t\t\tseries._posXDp.dispose();\n\t\t}\n\n\t\tif (series._posYDp) {\n\t\t\tseries._posYDp.dispose();\n\t\t}\n\n\t\tseries.set(\"baseAxis\", undefined);\n\n\t\tconst xAxis = series.get(\"xAxis\");\n\t\tif (xAxis) {\n\t\t\t$array.remove(xAxis.series, series);\n\t\t\txAxis.markDirtyExtremes();\n\t\t}\n\t\tconst yAxis = series.get(\"yAxis\");\n\t\tif (yAxis) {\n\t\t\t$array.remove(yAxis.series, series);\n\t\t\tyAxis.markDirtyExtremes();\n\t\t}\n\n\t\tconst cursor = this.get(\"cursor\");\n\t\tif (cursor) {\n\t\t\tconst snapToSeries = cursor.get(\"snapToSeries\");\n\t\t\tif (snapToSeries) {\n\t\t\t\t$array.remove(snapToSeries, series);\n\t\t\t}\n\t\t}\n\n\t\tsuper._removeSeries(series);\n\t}\n\n\t/**\n\t * This method is invoked when mouse wheel is used over chart's plot\n\t * container, and handles zooming/pan.\n\t *\n\t * You can invoke this method manually, if you need to mimic chart's wheel\n\t * behavior over other elements of the chart.\n\t */\n\tpublic handleWheel(event: { originalEvent: WheelEvent, point: IPoint, target: Container }) {\n\t\tconst wheelX = this.get(\"wheelX\");\n\t\tconst wheelY = this.get(\"wheelY\");\n\t\tconst plotContainer = this.plotContainer;\n\n\t\tconst wheelEvent = event.originalEvent;\n\n\t\t// Ignore wheel event if it is happening on a non-chart element, e.g. if\n\t\t// some page element is over the chart.\n\t\tlet prevent = false;\n\t\tif ($utils.isLocalEvent(wheelEvent, this)) {\n\t\t\tprevent = true;\n\t\t}\n\t\telse {\n\t\t\treturn;\n\t\t}\n\n\t\tconst plotPoint = plotContainer.toLocal(event.point);\n\t\tconst wheelStep = this.get(\"wheelStep\", 0.2);\n\n\t\tconst shiftY = wheelEvent.deltaY / 100;\n\t\tconst shiftX = wheelEvent.deltaX / 100;\n\n\t\tconst wheelZoomPositionX = this.get(\"wheelZoomPositionX\");\n\t\tconst wheelZoomPositionY = this.get(\"wheelZoomPositionY\");\n\n\n\t\tif ((wheelX === \"zoomX\" || wheelX === \"zoomXY\") && shiftX != 0) {\n\t\t\tthis.xAxes.each((axis) => {\n\t\t\t\tif (axis.get(\"zoomX\")) {\n\t\t\t\t\tlet start = axis.get(\"start\")!;\n\t\t\t\t\tlet end = axis.get(\"end\")!;\n\n\t\t\t\t\tlet position = axis.fixPosition(plotPoint.x / plotContainer.width());\n\n\t\t\t\t\tif (wheelZoomPositionX != null) {\n\t\t\t\t\t\tposition = wheelZoomPositionX;\n\t\t\t\t\t}\n\n\t\t\t\t\tlet maxDeviation = axis.get(\"maxDeviation\", 0);\n\n\t\t\t\t\tlet newStart = Math.min(1 + maxDeviation, Math.max(-maxDeviation, start - wheelStep * (end - start) * shiftX * position));\n\t\t\t\t\tlet newEnd = Math.max(-maxDeviation, Math.min(1 + maxDeviation, end + wheelStep * (end - start) * shiftX * (1 - position)));\n\n\t\t\t\t\tif (newStart == start && newEnd == end) {\n\t\t\t\t\t\tprevent = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (1 / (newEnd - newStart) < axis.getPrivate(\"maxZoomFactor\", Infinity) / axis.get(\"minZoomCount\", 1)) {\n\t\t\t\t\t\tthis._handleWheelAnimation(axis.zoom(newStart, newEnd));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tprevent = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\tif ((wheelY === \"zoomX\" || wheelY === \"zoomXY\") && shiftY != 0) {\n\t\t\tthis.xAxes.each((axis) => {\n\t\t\t\tif (axis.get(\"zoomX\")) {\n\t\t\t\t\tlet start = axis.get(\"start\")!;\n\t\t\t\t\tlet end = axis.get(\"end\")!;\n\n\t\t\t\t\tlet position = axis.fixPosition(plotPoint.x / plotContainer.width());\n\n\t\t\t\t\tif (wheelZoomPositionX != null) {\n\t\t\t\t\t\tposition = wheelZoomPositionX;\n\t\t\t\t\t}\n\n\t\t\t\t\tlet maxDeviation = axis.get(\"maxDeviation\", 0);\n\n\t\t\t\t\tlet newStart = Math.min(1 + maxDeviation, Math.max(-maxDeviation, start - wheelStep * (end - start) * shiftY * position));\n\t\t\t\t\tlet newEnd = Math.max(-maxDeviation, Math.min(1 + maxDeviation, end + wheelStep * (end - start) * shiftY * (1 - position)));\n\n\t\t\t\t\tif (newStart == start && newEnd == end) {\n\t\t\t\t\t\tprevent = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (1 / (newEnd - newStart) < axis.getPrivate(\"maxZoomFactor\", Infinity) / axis.get(\"minZoomCount\", 1)) {\n\t\t\t\t\t\tthis._handleWheelAnimation(axis.zoom(newStart, newEnd));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tprevent = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\n\t\tif ((wheelX === \"zoomY\" || wheelX === \"zoomXY\") && shiftX != 0) {\n\t\t\tthis.yAxes.each((axis) => {\n\t\t\t\tif (axis.get(\"zoomY\")) {\n\t\t\t\t\tlet start = axis.get(\"start\")!;\n\t\t\t\t\tlet end = axis.get(\"end\")!;\n\n\t\t\t\t\tlet position = axis.fixPosition(plotPoint.y / plotContainer.height());\n\n\t\t\t\t\tif (wheelZoomPositionY != null) {\n\t\t\t\t\t\tposition = wheelZoomPositionY;\n\t\t\t\t\t}\n\n\t\t\t\t\tlet maxDeviation = axis.get(\"maxDeviation\", 0);\n\n\t\t\t\t\tlet newStart = Math.min(1 + maxDeviation, Math.max(-maxDeviation, start - wheelStep * (end - start) * shiftX * position));\n\t\t\t\t\tlet newEnd = Math.max(-maxDeviation, Math.min(1 + maxDeviation, end + wheelStep * (end - start) * shiftX * (1 - position)));\n\n\t\t\t\t\tif (newStart == start && newEnd == end) {\n\t\t\t\t\t\tprevent = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (1 / (newEnd - newStart) < axis.getPrivate(\"maxZoomFactor\", Infinity) / axis.get(\"minZoomCount\", 1)) {\n\t\t\t\t\t\tthis._handleWheelAnimation(axis.zoom(newStart, newEnd));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tprevent = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\tif ((wheelY === \"zoomY\" || wheelY === \"zoomXY\") && shiftY != 0) {\n\t\t\tthis.yAxes.each((axis) => {\n\t\t\t\tif (axis.get(\"zoomY\")) {\n\t\t\t\t\tlet start = axis.get(\"start\")!;\n\t\t\t\t\tlet end = axis.get(\"end\")!;\n\n\t\t\t\t\tlet position = axis.fixPosition(plotPoint.y / plotContainer.height());\n\n\t\t\t\t\tif (wheelZoomPositionY != null) {\n\t\t\t\t\t\tposition = wheelZoomPositionY;\n\t\t\t\t\t}\n\n\t\t\t\t\tlet maxDeviation = axis.get(\"maxDeviation\", 0);\n\n\t\t\t\t\tlet newStart = Math.min(1 + maxDeviation, Math.max(-maxDeviation, start - wheelStep * (end - start) * shiftY * position));\n\t\t\t\t\tlet newEnd = Math.max(-maxDeviation, Math.min(1 + maxDeviation, end + wheelStep * (end - start) * shiftY * (1 - position)));\n\n\t\t\t\t\tif (newStart == start && newEnd == end) {\n\t\t\t\t\t\tprevent = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (1 / (newEnd - newStart) < axis.getPrivate(\"maxZoomFactor\", Infinity) / axis.get(\"minZoomCount\", 1)) {\n\t\t\t\t\t\tthis._handleWheelAnimation(axis.zoom(newStart, newEnd));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tprevent = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\n\t\tif ((wheelX === \"panX\" || wheelX === \"panXY\") && shiftX != 0) {\n\t\t\tthis.xAxes.each((axis) => {\n\t\t\t\tif (axis.get(\"panX\")) {\n\t\t\t\t\tlet start = axis.get(\"start\")!;\n\t\t\t\t\tlet end = axis.get(\"end\")!;\n\n\t\t\t\t\tlet delta = this._getWheelSign(axis) * wheelStep * (end - start) * shiftX;\n\t\t\t\t\tlet newStart = start + delta;\n\t\t\t\t\tlet newEnd = end + delta;\n\n\t\t\t\t\tlet se = this._fixWheel(newStart, newEnd);\n\t\t\t\t\tnewStart = se[0];\n\t\t\t\t\tnewEnd = se[1];\n\n\t\t\t\t\tif (newStart == start && newEnd == end) {\n\t\t\t\t\t\tprevent = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._handleWheelAnimation(axis.zoom(newStart, newEnd));\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\tif ((wheelY === \"panX\" || wheelY === \"panXY\") && shiftY != 0) {\n\t\t\tthis.xAxes.each((axis) => {\n\t\t\t\tif (axis.get(\"panX\")) {\n\t\t\t\t\tlet start = axis.get(\"start\")!;\n\t\t\t\t\tlet end = axis.get(\"end\")!;\n\n\t\t\t\t\tlet delta = this._getWheelSign(axis) * wheelStep * (end - start) * shiftY;\n\t\t\t\t\tlet newStart = start + delta;\n\t\t\t\t\tlet newEnd = end + delta;\n\n\t\t\t\t\tlet se = this._fixWheel(newStart, newEnd);\n\t\t\t\t\tnewStart = se[0];\n\t\t\t\t\tnewEnd = se[1];\n\n\t\t\t\t\tif (newStart == start && newEnd == end) {\n\t\t\t\t\t\tprevent = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._handleWheelAnimation(axis.zoom(newStart, newEnd));\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\tif ((wheelX === \"panY\" || wheelX === \"panXY\") && shiftX != 0) {\n\t\t\tthis.yAxes.each((axis) => {\n\t\t\t\tif (axis.get(\"panY\")) {\n\t\t\t\t\tlet start = axis.get(\"start\")!;\n\t\t\t\t\tlet end = axis.get(\"end\")!;\n\n\t\t\t\t\tlet delta = this._getWheelSign(axis) * wheelStep * (end - start) * shiftX;\n\t\t\t\t\tlet newStart = start + delta;\n\t\t\t\t\tlet newEnd = end + delta;\n\n\t\t\t\t\tlet se = this._fixWheel(newStart, newEnd);\n\t\t\t\t\tnewStart = se[0];\n\t\t\t\t\tnewEnd = se[1];\n\n\t\t\t\t\tif (newStart == start && newEnd == end) {\n\t\t\t\t\t\tprevent = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._handleWheelAnimation(axis.zoom(newStart, newEnd));\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\tif ((wheelY === \"panY\" || wheelY === \"panXY\") && shiftY != 0) {\n\t\t\tthis.yAxes.each((axis) => {\n\t\t\t\tif (axis.get(\"panY\")) {\n\t\t\t\t\tlet start = axis.get(\"start\")!;\n\t\t\t\t\tlet end = axis.get(\"end\")!;\n\n\t\t\t\t\tlet delta = this._getWheelSign(axis) * wheelStep * (end - start) * shiftY;\n\t\t\t\t\tlet newStart = start - delta;\n\t\t\t\t\tlet newEnd = end - delta;\n\n\t\t\t\t\tlet se = this._fixWheel(newStart, newEnd);\n\t\t\t\t\tnewStart = se[0];\n\t\t\t\t\tnewEnd = se[1];\n\n\t\t\t\t\tif (newStart == start && newEnd == end) {\n\t\t\t\t\t\tprevent = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._handleWheelAnimation(axis.zoom(newStart, newEnd));\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\tif (prevent) {\n\t\t\twheelEvent.preventDefault();\n\t\t}\n\t}\n\n\tprotected _handleSetWheel() {\n\t\tconst wheelX = this.get(\"wheelX\");\n\t\tconst wheelY = this.get(\"wheelY\");\n\t\tconst plotContainer = this.plotContainer;\n\n\t\tif (wheelX !== \"none\" || wheelY !== \"none\") {\n\t\t\tthis._wheelDp = plotContainer.events.on(\"wheel\", (event) => {\n\t\t\t\tconst wheelEvent = event.originalEvent;\n\t\t\t\tif ((wheelX !== \"none\" && Math.abs(wheelEvent.deltaX) != 0) || (wheelY !== \"none\" && Math.abs(wheelEvent.deltaY) != 0)) {\n\t\t\t\t\tthis.handleWheel(event);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis._disposers.push(this._wheelDp);\n\t\t}\n\t\telse {\n\t\t\tif (this._wheelDp) {\n\t\t\t\tthis._wheelDp.dispose();\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _getWheelSign(axis: Axis) {\n\t\tlet sign = 1;\n\t\tif (axis.get(\"renderer\").get(\"inversed\")) {\n\t\t\tsign = -1;\n\t\t}\n\n\t\treturn sign\n\t}\n\n\tprotected _fixWheel(start: number, end: number): [number, number] {\n\t\tconst diff = end - start;\n\t\tif (start < 0) {\n\t\t\tstart = 0;\n\t\t\tend = start + diff;\n\t\t}\n\t\tif (end > 1) {\n\t\t\tend = 1;\n\t\t\tstart = end - diff;\n\t\t}\n\n\t\treturn [start, end];\n\t}\n\n\tprotected _handlePlotDown(event: ISpritePointerEvent) {\n\t\tconst originalEvent = event.originalEvent as any;\n\n\t\tif (originalEvent.button == 2) {\n\t\t\treturn;\n\t\t}\n\t\tconst plotContainer = this.plotContainer;\n\t\tlet local = plotContainer.toLocal(event.point);\n\n\t\tif (this.get(\"pinchZoomX\") || this.get(\"pinchZoomY\")) {\n\t\t\tconst pointerId = originalEvent.pointerId;\n\n\t\t\tif (pointerId) {\n\n\t\t\t\tif ($object.keys(plotContainer._downPoints).length > 0) {\n\t\t\t\t\tconst xAxis = this.xAxes.getIndex(0);\n\t\t\t\t\tconst yAxis = this.yAxes.getIndex(0);\n\n\n\t\t\t\t\tif (xAxis) {\n\t\t\t\t\t\tthis._downStartX = xAxis.get(\"start\", 0);\n\t\t\t\t\t\tthis._downEndX = xAxis.get(\"end\", 1);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (yAxis) {\n\t\t\t\t\t\tthis._downStartY = yAxis.get(\"start\", 0);\n\t\t\t\t\t\tthis._downEndY = yAxis.get(\"end\", 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.get(\"panX\") || this.get(\"panY\")) {\n\n\t\t\tif (local.x >= 0 && local.y >= 0 && local.x <= plotContainer.width() && local.y <= this.height()) {\n\t\t\t\t//this._downPoint = local;\n\t\t\t\tthis._downPoint = { x: originalEvent.clientX, y: originalEvent.clientY };\n\n\t\t\t\tconst panX = this.get(\"panX\");\n\t\t\t\tconst panY = this.get(\"panY\");\n\n\t\t\t\tif (panX) {\n\t\t\t\t\tthis.xAxes.each((axis) => {\n\t\t\t\t\t\taxis._panStart = axis.get(\"start\")!;\n\t\t\t\t\t\taxis._panEnd = axis.get(\"end\")!;\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\tif (panY) {\n\t\t\t\t\tthis.yAxes.each((axis) => {\n\t\t\t\t\t\taxis._panStart = axis.get(\"start\")!;\n\t\t\t\t\t\taxis._panEnd = axis.get(\"end\")!;\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\tconst eventType = \"panstarted\";\n\t\t\t\tif (this.events.isEnabled(eventType)) {\n\t\t\t\t\tthis.events.dispatch(eventType, { type: eventType, target: this, originalEvent: event.originalEvent });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _handleWheelAnimation(animation?: Animation) {\n\t\tif (animation) {\n\t\t\tanimation.events.on(\"stopped\", () => {\n\t\t\t\tthis._dispatchWheelAnimation();\n\t\t\t})\n\t\t}\n\t\telse {\n\t\t\tthis._dispatchWheelAnimation();\n\t\t}\n\t}\n\n\tprotected _dispatchWheelAnimation() {\n\t\tconst eventType = \"wheelended\";\n\t\tif (this.events.isEnabled(eventType)) {\n\t\t\tthis.events.dispatch(eventType, { type: eventType, target: this });\n\t\t}\n\t}\n\n\tprotected _handlePlotUp(event: ISpritePointerEvent) {\n\t\tconst downPoint = this._downPoint;\n\t\tif (downPoint) {\n\t\t\tif (this.get(\"panX\") || this.get(\"panY\")) {\n\t\t\t\tif (event.originalEvent.clientX == downPoint.x && event.originalEvent.clientY == downPoint.y) {\n\t\t\t\t\tconst eventType = \"pancancelled\";\n\t\t\t\t\tif (this.events.isEnabled(eventType)) {\n\t\t\t\t\t\tthis.events.dispatch(eventType, { type: eventType, target: this, originalEvent: event.originalEvent });\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst eventType = \"panended\";\n\t\t\t\tif (this.events.isEnabled(eventType)) {\n\t\t\t\t\tthis.events.dispatch(eventType, { type: eventType, target: this, originalEvent: event.originalEvent });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// TODO: handle multitouch\n\t\tthis._downPoint = undefined;\n\t\tthis.xAxes.each((xAxis) => {\n\t\t\txAxis._isPanning = false;\n\t\t})\n\t\tthis.yAxes.each((yAxis) => {\n\t\t\tyAxis._isPanning = false;\n\t\t})\n\t}\n\n\tprotected _handlePlotMove(event: ISpritePointerEvent) {\n\t\tconst plotContainer = this.plotContainer;\n\n\t\tif (this.get(\"pinchZoomX\") || this.get(\"pinchZoomY\")) {\n\t\t\tconst touchEvent = event.originalEvent as any;\n\t\t\tconst pointerId = touchEvent.pointerId;\n\n\t\t\tif (pointerId) {\n\t\t\t\tthis._movePoints[pointerId] = event.point;\n\n\t\t\t\tif ($object.keys(plotContainer._downPoints).length > 1) {\n\t\t\t\t\tthis._handlePinch();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet downPoint = this._downPoint!;\n\n\t\tif (downPoint) {\n\n\t\t\tdownPoint = plotContainer.toLocal(this._root.documentPointToRoot(downPoint));\n\t\t\tlet local = plotContainer.toLocal(event.point);\n\n\t\t\tconst panX = this.get(\"panX\");\n\t\t\tconst panY = this.get(\"panY\");\n\n\t\t\tif (panX) {\n\n\t\t\t\tlet scrollbarX = this.get(\"scrollbarX\");\n\t\t\t\tif (scrollbarX) {\n\t\t\t\t\tscrollbarX.events.disableType(\"rangechanged\");\n\t\t\t\t}\n\n\t\t\t\tthis.xAxes.each((axis) => {\n\t\t\t\t\tif (axis.get(\"panX\")) {\n\t\t\t\t\t\taxis._isPanning = true;\n\t\t\t\t\t\t//const maxDeviation = axis.get(\"maxDeviation\", 0);\n\t\t\t\t\t\tlet panStart = axis._panStart;\n\t\t\t\t\t\tlet panEnd = axis._panEnd;\n\t\t\t\t\t\tlet difference = (panEnd - panStart);\n\t\t\t\t\t\tlet deltaX = difference * (downPoint.x - local.x) / plotContainer.width();\n\n\t\t\t\t\t\tif (axis.get(\"renderer\").get(\"inversed\")) {\n\t\t\t\t\t\t\tdeltaX *= -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlet start = panStart + deltaX;\n\t\t\t\t\t\tlet end = panEnd + deltaX;\n\n\t\t\t\t\t\tif (end - start < 1 + axis.get(\"maxDeviation\", 1) * 2) {\n\t\t\t\t\t\t\taxis.set(\"start\", start);\n\t\t\t\t\t\t\taxis.set(\"end\", end);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\tif (scrollbarX) {\n\t\t\t\t\tscrollbarX.events.enableType(\"rangechanged\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (panY) {\n\n\t\t\t\tlet scrollbarY = this.get(\"scrollbarY\");\n\t\t\t\tif (scrollbarY) {\n\t\t\t\t\tscrollbarY.events.disableType(\"rangechanged\");\n\t\t\t\t}\n\n\t\t\t\tthis.yAxes.each((axis) => {\n\t\t\t\t\tif (axis.get(\"panY\")) {\n\t\t\t\t\t\taxis._isPanning = true;\n\t\t\t\t\t\t//const maxDeviation = axis.get(\"maxDeviation\", 0);\n\n\t\t\t\t\t\tlet panStart = axis._panStart;\n\t\t\t\t\t\tlet panEnd = axis._panEnd;\n\t\t\t\t\t\tlet difference = (panEnd - panStart);\n\t\t\t\t\t\tlet deltaY = difference * (downPoint.y - local.y) / plotContainer.height();\n\t\t\t\t\t\tif (axis.get(\"renderer\").get(\"inversed\")) {\n\t\t\t\t\t\t\tdeltaY *= -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlet start = panStart - deltaY;\n\t\t\t\t\t\tlet end = panEnd - deltaY;\n\n\t\t\t\t\t\tif (end - start < 1 + axis.get(\"maxDeviation\", 1) * 2) {\n\t\t\t\t\t\t\taxis.set(\"start\", start);\n\t\t\t\t\t\t\taxis.set(\"end\", end);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\n\t\t\t\tif (scrollbarY) {\n\t\t\t\t\tscrollbarY.events.enableType(\"rangechanged\");\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t}\n\t}\n\n\tprotected _handlePinch() {\n\t\tconst plotContainer = this.plotContainer;\n\t\tlet i = 0;\n\t\tlet downPoints: Array = [];\n\t\tlet movePoints: Array = [];\n\n\t\t$object.each(plotContainer._downPoints, (k, point) => {\n\t\t\tdownPoints[i] = point;\n\t\t\tlet movePoint = this._movePoints[k];\n\t\t\tif (movePoint) {\n\t\t\t\tmovePoints[i] = movePoint;\n\t\t\t}\n\t\t\ti++;\n\t\t});\n\n\t\tif (downPoints.length > 1 && movePoints.length > 1) {\n\t\t\tconst w = plotContainer.width();\n\t\t\tconst h = plotContainer.height();\n\n\t\t\tlet downPoint0 = downPoints[0];\n\t\t\tlet downPoint1 = downPoints[1];\n\n\t\t\tlet movePoint0 = movePoints[0];\n\t\t\tlet movePoint1 = movePoints[1];\n\n\t\t\tif (downPoint0 && downPoint1 && movePoint0 && movePoint1) {\n\n\t\t\t\tmovePoint0 = plotContainer.toLocal(movePoint0)\n\t\t\t\tmovePoint1 = plotContainer.toLocal(movePoint1)\n\n\t\t\t\tdownPoint0 = plotContainer.toLocal(downPoint0)\n\t\t\t\tdownPoint1 = plotContainer.toLocal(downPoint1)\n\n\t\t\t\tif (this.get(\"pinchZoomX\")) {\n\t\t\t\t\tconst downStartX = this._downStartX;\n\t\t\t\t\tconst downEndX = this._downEndX;\n\n\t\t\t\t\tif (downStartX != null && downEndX != null) {\n\n\t\t\t\t\t\tif (downPoint0.x > downPoint1.x) {\n\t\t\t\t\t\t\t[downPoint0, downPoint1] = [downPoint1, downPoint0];\n\t\t\t\t\t\t\t[movePoint0, movePoint1] = [movePoint1, movePoint0];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet downPos0 = downStartX + (downPoint0.x / w) * (downEndX - downStartX);\n\t\t\t\t\t\tlet downPos1 = downStartX + (downPoint1.x / w) * (downEndX - downStartX);\n\n\t\t\t\t\t\tlet movePos0 = downStartX + (movePoint0.x / w) * (downEndX - downStartX);\n\t\t\t\t\t\tlet movePos1 = downStartX + (movePoint1.x / w) * (downEndX - downStartX);\n\n\t\t\t\t\t\tlet initialDistance = Math.max(0.001, downPos1 - downPos0);\n\t\t\t\t\t\tlet currentDistance = Math.max(0.001, movePos1 - movePos0);\n\n\n\t\t\t\t\t\tlet d = initialDistance / currentDistance;\n\n\t\t\t\t\t\tlet s = downStartX * d + downPos0 - movePos0 * d;\n\t\t\t\t\t\tlet e = downEndX * d + downPos1 - movePos1 * d;\n\n\t\t\t\t\t\tthis.xAxes.each((xAxis) => {\n\t\t\t\t\t\t\tlet sa = xAxis.fixPosition(s);\n\t\t\t\t\t\t\tlet ea = xAxis.fixPosition(e);\n\n\t\t\t\t\t\t\txAxis.zoom(sa, ea, 0);\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this.get(\"pinchZoomY\")) {\n\t\t\t\t\tconst downStartY = this._downStartY;\n\t\t\t\t\tconst downEndY = this._downEndY;\n\n\t\t\t\t\tif (downStartY != null && downEndY != null) {\n\n\t\t\t\t\t\tif (downPoint0.y < downPoint1.y) {\n\t\t\t\t\t\t\t[downPoint0, downPoint1] = [downPoint1, downPoint0];\n\t\t\t\t\t\t\t[movePoint0, movePoint1] = [movePoint1, movePoint0];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet downPos0 = downStartY + (1 - downPoint0.y / h) * (downEndY - downStartY);\n\t\t\t\t\t\tlet downPos1 = downStartY + (1 - downPoint1.y / h) * (downEndY - downStartY);\n\n\t\t\t\t\t\tlet movePos0 = downStartY + (1 - movePoint0.y / h) * (downEndY - downStartY);\n\t\t\t\t\t\tlet movePos1 = downStartY + (1 - movePoint1.y / h) * (downEndY - downStartY);\n\n\t\t\t\t\t\tlet initialDistance = Math.max(0.001, downPos1 - downPos0);\n\t\t\t\t\t\tlet currentDistance = Math.max(0.001, movePos1 - movePos0);\n\n\t\t\t\t\t\tlet d = initialDistance / currentDistance;\n\n\t\t\t\t\t\tlet s = downStartY * d + downPos0 - movePos0 * d;\n\t\t\t\t\t\tlet e = downEndY * d + downPos1 - movePos1 * d;\n\n\t\t\t\t\t\tthis.yAxes.each((yAxis) => {\n\n\t\t\t\t\t\t\tlet sa = yAxis.fixPosition(s);\n\t\t\t\t\t\t\tlet ea = yAxis.fixPosition(e);\n\n\t\t\t\t\t\t\tyAxis.zoom(sa, ea, 0);\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic _handleCursorPosition() {\n\t\tconst cursor = this.get(\"cursor\");\n\t\tif (cursor) {\n\t\t\tconst cursorPoint = cursor.getPrivate(\"point\");\n\n\t\t\tlet snapToSeries = cursor.get(\"snapToSeries\");\n\n\t\t\tif (cursor._downPoint) {\n\t\t\t\tsnapToSeries = undefined;\n\t\t\t}\n\n\t\t\tif (snapToSeries && cursorPoint) {\n\t\t\t\tconst snapToSeriesBy = cursor.get(\"snapToSeriesBy\");\n\t\t\t\tconst dataItems: Array> = [];\n\t\t\t\t$array.each(snapToSeries, (series) => {\n\t\t\t\t\tif (!series.isHidden() && !series.isHiding()) {\n\t\t\t\t\t\tif (snapToSeriesBy != \"x!\" && snapToSeriesBy != \"y!\") {\n\t\t\t\t\t\t\tconst startIndex = series.startIndex();\n\t\t\t\t\t\t\tconst endIndex = series.endIndex();\n\t\t\t\t\t\t\tfor (let i = startIndex; i < endIndex; i++) {\n\t\t\t\t\t\t\t\tconst dataItem = series.dataItems[i];\n\t\t\t\t\t\t\t\tif (dataItem && !dataItem.isHidden()) {\n\t\t\t\t\t\t\t\t\tdataItems.push(dataItem);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tconst tooltipDataItem = series.get(\"tooltipDataItem\");\n\t\t\t\t\t\t\tif (tooltipDataItem) {\n\t\t\t\t\t\t\t\tdataItems.push(tooltipDataItem);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\n\t\t\t\tlet minDistance = Infinity;\n\t\t\t\tlet closestItem: DataItem | undefined;\n\n\t\t\t\t$array.each(dataItems, (dataItem) => {\n\t\t\t\t\tconst point = dataItem.get(\"point\");\n\n\t\t\t\t\tif (point) {\n\t\t\t\t\t\tlet distance = 0;\n\t\t\t\t\t\tif (snapToSeriesBy == \"x\" || snapToSeriesBy == \"x!\") {\n\t\t\t\t\t\t\tdistance = Math.abs(cursorPoint.x - point.x);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (snapToSeriesBy == \"y\" || snapToSeriesBy == \"y!\") {\n\t\t\t\t\t\t\tdistance = Math.abs(cursorPoint.y - point.y);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tdistance = Math.hypot(cursorPoint.x - point.x, cursorPoint.y - point.y);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (distance < minDistance) {\n\t\t\t\t\t\t\tminDistance = distance;\n\t\t\t\t\t\t\tclosestItem = dataItem;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\n\t\t\t\t$array.each(snapToSeries, (series) => {\n\t\t\t\t\tconst tooltip = series.get(\"tooltip\");\n\t\t\t\t\tif (tooltip) {\n\t\t\t\t\t\ttooltip._setDataItem(undefined);\n\t\t\t\t\t}\n\t\t\t\t})\n\n\t\t\t\tif (closestItem) {\n\t\t\t\t\tlet series = closestItem.component as XYSeries;\n\t\t\t\t\tseries.showDataItemTooltip(closestItem);\n\t\t\t\t\tseries.setRaw(\"tooltipDataItem\", closestItem);\n\n\t\t\t\t\tconst point = closestItem.get(\"point\");\n\t\t\t\t\tif (point) {\n\n\t\t\t\t\t\t// removing x and y to solve #72225\n\t\t\t\t\t\tcursor.handleMove(series.toGlobal({ x: point.x - series.x(), y: point.y - series.y() }), true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic _updateCursor() {\n\t\tlet cursor = this.get(\"cursor\");\n\t\tif (cursor) {\n\t\t\tcursor.updateCursor();\n\t\t}\n\t}\n\n\tprotected _addCursor(cursor: XYCursor) {\n\t\tthis.plotContainer.children.push(cursor);\n\t}\n\n\tpublic _prepareChildren() {\n\t\tsuper._prepareChildren();\n\n\t\tthis.series.each((series) => {\n\t\t\tthis._colorize(series);\n\t\t})\n\n\t\tif (this.isDirty(\"wheelX\") || this.isDirty(\"wheelY\")) {\n\t\t\tthis._handleSetWheel();\n\t\t}\n\n\t\tif (this.isDirty(\"cursor\")) {\n\t\t\tconst previous = this._prevSettings.cursor;\n\t\t\tconst cursor = this.get(\"cursor\")!;\n\t\t\tif (cursor !== previous) {\n\t\t\t\tthis._disposeProperty(\"cursor\");\n\t\t\t\tif (previous) {\n\t\t\t\t\tprevious.dispose();\n\t\t\t\t}\n\t\t\t\tif (cursor) {\n\t\t\t\t\tcursor._setChart(this);\n\t\t\t\t\tthis._addCursor(cursor);\n\n\t\t\t\t\tthis._pushPropertyDisposer(\"cursor\", cursor.events.on(\"selectended\", () => {\n\t\t\t\t\t\tthis._handleCursorSelectEnd();\n\t\t\t\t\t}))\n\t\t\t\t}\n\n\t\t\t\t//this.setRaw(\"cursor\", cursor) // to reset previous value\n\t\t\t\tthis._prevSettings.cursor = cursor;\n\t\t\t}\n\t\t}\n\n\t\tif (this.isDirty(\"scrollbarX\")) {\n\t\t\tconst previous = this._prevSettings.scrollbarX;\n\t\t\tconst scrollbarX = this.get(\"scrollbarX\")!;\n\t\t\tif (scrollbarX !== previous) {\n\t\t\t\tthis._disposeProperty(\"scrollbarX\");\n\t\t\t\tif (previous) {\n\t\t\t\t\tprevious.dispose();\n\t\t\t\t}\n\t\t\t\tif (scrollbarX) {\n\t\t\t\t\tif (!scrollbarX.parent) {\n\t\t\t\t\t\tthis.topAxesContainer.children.push(scrollbarX);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._pushPropertyDisposer(\"scrollbarX\", scrollbarX.events.on(\"rangechanged\", (e) => {\n\t\t\t\t\t\tthis._handleScrollbar(this.xAxes, e.start, e.end, e.grip);\n\t\t\t\t\t}))\n\n\t\t\t\t\tthis._pushPropertyDisposer(\"scrollbarX\", scrollbarX.events.on(\"released\", () => {\n\t\t\t\t\t\tthis.xAxes.each((axis) => {\n\t\t\t\t\t\t\tif (axis.get(\"zoomable\")) {\n\t\t\t\t\t\t\t\tthis._handleAxisSelection(axis);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t}))\n\n\t\t\t\t\t// Used to populate `ariaLabel` with meaningful values\n\t\t\t\t\tscrollbarX.setPrivate(\"positionTextFunction\", (position: number) => {\n\t\t\t\t\t\tconst axis = this.xAxes.getIndex(0);\n\t\t\t\t\t\treturn axis ? axis.getTooltipText(position, false) || \"\" : \"\";\n\t\t\t\t\t});\n\n\t\t\t\t}\n\n\t\t\t\tthis._prevSettings.scrollbarX = scrollbarX;\n\t\t\t}\n\t\t}\n\n\t\tif (this.isDirty(\"scrollbarY\")) {\n\t\t\tconst previous = this._prevSettings.scrollbarY;\n\t\t\tconst scrollbarY = this.get(\"scrollbarY\")!;\n\t\t\tif (scrollbarY !== previous) {\n\t\t\t\tthis._disposeProperty(\"scrollbarY\");\n\t\t\t\tif (previous) {\n\t\t\t\t\tprevious.dispose();\n\t\t\t\t}\n\t\t\t\tif (scrollbarY) {\n\t\t\t\t\tif (!scrollbarY.parent) {\n\t\t\t\t\t\tthis.rightAxesContainer.children.push(scrollbarY);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._pushPropertyDisposer(\"scrollbarY\", scrollbarY.events.on(\"rangechanged\", (e) => {\n\t\t\t\t\t\tthis._handleScrollbar(this.yAxes, e.start, e.end, e.grip);\n\t\t\t\t\t}))\n\n\t\t\t\t\tthis._pushPropertyDisposer(\"scrollbarY\", scrollbarY.events.on(\"released\", () => {\n\t\t\t\t\t\tthis.yAxes.each((axis) => {\n\t\t\t\t\t\t\tif (axis.get(\"zoomable\")) {\n\t\t\t\t\t\t\t\tthis._handleAxisSelection(axis);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t}))\n\n\t\t\t\t\t// Used to populate `ariaLabel` with meaningful values\n\t\t\t\t\tscrollbarY.setPrivate(\"positionTextFunction\", (position: number) => {\n\t\t\t\t\t\tconst axis = this.yAxes.getIndex(0);\n\t\t\t\t\t\treturn axis ? axis.getTooltipText(position, false) || \"\" : \"\";\n\t\t\t\t\t});\n\n\t\t\t\t}\n\t\t\t\tthis._prevSettings.scrollbarY = scrollbarY;\n\t\t\t}\n\t\t}\n\n\t\tthis._handleZoomOut();\n\t}\n\n\tprotected _processSeries(series: this[\"_seriesType\"]) {\n\t\tsuper._processSeries(series);\n\n\t\tconst xAxis = series.get(\"xAxis\");\n\t\tconst yAxis = series.get(\"yAxis\");\n\n\t\t$array.move(xAxis.series, series);\n\t\t$array.move(yAxis.series, series);\n\n\t\tseries._posXDp = series.addDisposer(xAxis.events.on(\"positionchanged\", () => {\n\t\t\tseries._fixPosition();\n\t\t}))\n\n\t\tseries._posXDp = series.addDisposer(yAxis.events.on(\"positionchanged\", () => {\n\t\t\tseries._fixPosition();\n\t\t}))\n\n\t\tif (!series.get(\"baseAxis\")) {\n\t\t\tif (yAxis.isType>(\"CategoryAxis\") || yAxis.isType>(\"DateAxis\")) {\n\t\t\t\tseries.set(\"baseAxis\", yAxis);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tseries.set(\"baseAxis\", xAxis);\n\t\t\t}\n\t\t}\n\n\t\tif (series.get(\"stacked\")) {\n\t\t\tseries._markDirtyKey(\"stacked\");\n\t\t\t$array.each(series.dataItems, (dataItem) => {\n\t\t\t\tdataItem.set(\"stackToItemY\", undefined);\n\t\t\t\tdataItem.set(\"stackToItemX\", undefined);\n\t\t\t})\n\t\t}\n\t\tseries._markDirtyAxes();\n\t\tyAxis.markDirtyExtremes();\n\t\txAxis.markDirtyExtremes();\n\t\txAxis._seriesAdded = true;\n\t\tyAxis._seriesAdded = true;\n\n\t\tthis._colorize(series);\n\t}\n\n\tprotected _colorize(series: this[\"_seriesType\"]) {\n\t\tconst colorSet = this.get(\"colors\")!;\n\t\tif (colorSet) {\n\t\t\tif (series.get(\"fill\") == null) {\n\t\t\t\tconst color = colorSet.next();\n\n\t\t\t\tseries._setSoft(\"stroke\", color);\n\t\t\t\tseries._setSoft(\"fill\", color);\n\t\t\t}\n\t\t}\n\t\tconst patternSet = this.get(\"patterns\")!;\n\t\tif (patternSet) {\n\t\t\tif (series.get(\"fillPattern\") == null) {\n\t\t\t\tconst pattern = patternSet.next();\n\n\t\t\t\tseries._setSoft(\"fillPattern\", pattern);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _handleCursorSelectEnd() {\n\t\tconst cursor = this.get(\"cursor\")!;\n\t\tconst behavior = cursor.get(\"behavior\");\n\n\t\tconst downPositionX = cursor.getPrivate(\"downPositionX\", 0);\n\t\tconst downPositionY = cursor.getPrivate(\"downPositionY\", 0);\n\n\t\tconst positionX = Math.min(1, Math.max(0, cursor.getPrivate(\"positionX\", 0.5)));\n\t\tconst positionY = Math.min(1, Math.max(0, cursor.getPrivate(\"positionY\", 0.5)));\n\n\t\tthis.xAxes.each((axis) => {\n\t\t\tif (behavior === \"zoomX\" || behavior === \"zoomXY\") {\n\t\t\t\tlet position0 = axis.toAxisPosition(downPositionX);\n\t\t\t\tlet position1 = axis.toAxisPosition(positionX);\n\t\t\t\taxis.zoom(position0, position1);\n\t\t\t}\n\t\t\taxis.setPrivate(\"updateScrollbar\", true);\n\t\t})\n\n\t\tthis.yAxes.each((axis) => {\n\t\t\tif (behavior === \"zoomY\" || behavior === \"zoomXY\") {\n\t\t\t\tlet position0 = axis.toAxisPosition(downPositionY);\n\t\t\t\tlet position1 = axis.toAxisPosition(positionY);\n\t\t\t\taxis.zoom(position0, position1);\n\t\t\t}\n\t\t\taxis.setPrivate(\"updateScrollbar\", true);\n\t\t})\n\t}\n\n\tprotected _handleScrollbar(axes: ListAutoDispose>, start: number, end: number, priority?: \"start\" | \"end\") {\n\n\t\taxes.each((axis) => {\n\n\t\t\tlet axisStart = axis.fixPosition(start);\n\t\t\tlet axisEnd = axis.fixPosition(end);\n\n\t\t\tlet zoomAnimation = axis.zoom(axisStart, axisEnd, undefined, priority);\n\n\t\t\tconst updateScrollbar = \"updateScrollbar\";\n\t\t\taxis.setPrivateRaw(updateScrollbar, false);\n\n\t\t\tif (zoomAnimation) {\n\t\t\t\tzoomAnimation.events.on(\"stopped\", () => {\n\t\t\t\t\taxis.setPrivateRaw(updateScrollbar, true);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\taxis.setPrivateRaw(updateScrollbar, true);\n\t\t\t}\n\t\t})\n\t}\n\n\n\tprotected _processAxis(axes: ListAutoDispose>, container: Container): IDisposer {\n\t\treturn axes.events.onAll((change) => {\n\t\t\tif (change.type === \"clear\") {\n\t\t\t\t$array.each(change.oldValues, (axis) => {\n\t\t\t\t\tthis._removeAxis(axis);\n\t\t\t\t})\n\t\t\t} else if (change.type === \"push\") {\n\t\t\t\tcontainer.children.push(change.newValue);\n\t\t\t\tchange.newValue.processChart(this);\n\t\t\t} else if (change.type === \"setIndex\") {\n\t\t\t\tcontainer.children.setIndex(change.index, change.newValue);\n\t\t\t\tchange.newValue.processChart(this);\n\t\t\t} else if (change.type === \"insertIndex\") {\n\t\t\t\tcontainer.children.insertIndex(change.index, change.newValue);\n\t\t\t\tchange.newValue.processChart(this);\n\t\t\t} else if (change.type === \"removeIndex\") {\n\t\t\t\tthis._removeAxis(change.oldValue);\n\t\t\t} else if (change.type === \"moveIndex\") {\n\t\t\t\tcontainer.children.moveValue(change.value, change.newIndex);\n\t\t\t\tchange.value.processChart(this);\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Unknown IListEvent type\");\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected _removeAxis(axis: Axis) {\n\t\tif (!axis.isDisposed()) {\n\t\t\tconst axisParent = axis.parent\n\t\t\tif (axisParent) {\n\t\t\t\taxisParent.children.removeValue(axis);\n\t\t\t}\n\n\t\t\tconst gridContainer = axis.gridContainer;\n\t\t\tconst gridParent = gridContainer.parent;\n\t\t\tif (gridParent) {\n\t\t\t\tgridParent.children.removeValue(gridContainer);\n\t\t\t}\n\n\t\t\tconst topGridContainer = axis.topGridContainer;\n\t\t\tconst topGridParent = topGridContainer.parent;\n\t\t\tif (topGridParent) {\n\t\t\t\ttopGridParent.children.removeValue(topGridContainer);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic _updateChartLayout() {\n\t\tconst left = this.leftAxesContainer.width();\n\t\tconst right = this.rightAxesContainer.width();\n\n\t\tconst bottomAxesContainer = this.bottomAxesContainer;\n\t\tbottomAxesContainer.set(\"paddingLeft\", left);\n\t\tbottomAxesContainer.set(\"paddingRight\", right);\n\n\t\tconst topAxesContainer = this.topAxesContainer;\n\t\ttopAxesContainer.set(\"paddingLeft\", left);\n\t\ttopAxesContainer.set(\"paddingRight\", right);\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic processAxis(axis: Axis) {\n\t\tvar cursor = this.get(\"cursor\");\n\t\tif (cursor) {\n\t\t\tthis.addDisposer(axis.on(\"start\", () => {\n\t\t\t\tthis._updateCursor();\n\t\t\t}))\n\n\t\t\tthis.addDisposer(axis.on(\"end\", () => {\n\t\t\t\tthis._updateCursor();\n\t\t\t}))\n\t\t}\n\t}\n\n\n\tpublic _handleAxisSelection(axis: Axis, force?: boolean) {\n\n\t\tlet start = axis.fixPosition(axis.get(\"start\", 0));\n\t\tlet end = axis.fixPosition(axis.get(\"end\", 1));\n\n\t\tif (start > end) {\n\t\t\t[start, end] = [end, start];\n\t\t}\n\n\t\tif (this.xAxes.indexOf(axis) != -1) {\n\t\t\tif (force || axis.getPrivate(\"updateScrollbar\")) {\n\t\t\t\tlet scrollbarX = this.get(\"scrollbarX\");\n\n\t\t\t\tif (scrollbarX && (!scrollbarX.getPrivate(\"isBusy\") || force)) {\n\t\t\t\t\tscrollbarX.setRaw(\"start\", start);\n\t\t\t\t\tscrollbarX.setRaw(\"end\", end);\n\t\t\t\t\tscrollbarX.updateGrips();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if (this.yAxes.indexOf(axis) != -1) {\n\t\t\tif (force || axis.getPrivate(\"updateScrollbar\")) {\n\t\t\t\tlet scrollbarY = this.get(\"scrollbarY\");\n\n\t\t\t\tif (scrollbarY && (!scrollbarY.getPrivate(\"isBusy\") || force)) {\n\t\t\t\t\tscrollbarY.setRaw(\"start\", start);\n\t\t\t\t\tscrollbarY.setRaw(\"end\", end);\n\t\t\t\t\tscrollbarY.updateGrips();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis._handleZoomOut();\n\t}\n\n\tprotected _handleZoomOut() {\n\t\tlet zoomOutButton = this.zoomOutButton;\n\t\tif (zoomOutButton && zoomOutButton.parent) {\n\t\t\tlet visible = false;\n\t\t\tthis.xAxes.each((axis) => {\n\t\t\t\tif ($math.round(axis.get(\"start\", 0), 6) != 0 || $math.round(axis.get(\"end\", 1), 6) != 1) {\n\t\t\t\t\tvisible = true;\n\t\t\t\t}\n\t\t\t})\n\t\t\tthis.yAxes.each((axis) => {\n\t\t\t\tif ($math.round(axis.get(\"start\", 0), 6) != 0 || $math.round(axis.get(\"end\", 1), 6) != 1) {\n\t\t\t\t\tvisible = true;\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tif (visible) {\n\t\t\t\tif (zoomOutButton.isHidden()) {\n\t\t\t\t\tzoomOutButton.show();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tzoomOutButton.hide();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if point is within plot area.\n\t *\n\t * @param point Reference point\n\t * @return Is within plot area?\n\t */\n\tpublic inPlot(point: IPoint): boolean {\n\t\tconst plotContainer = this.plotContainer;\n\t\tconst otherCharts = this.getPrivate(\"otherCharts\", this._otherCharts);\n\t\tconst global = plotContainer.toGlobal(point);\n\n\t\tif (point.x >= -0.5 && point.y >= -0.5 && point.x <= plotContainer.width() + 0.5 && point.y <= plotContainer.height() + 0.5) {\n\t\t\treturn true;\n\t\t}\n\t\tif (otherCharts) {\n\n\t\t\tfor (let i = otherCharts.length - 1; i >= 0; i--) {\n\t\t\t\tconst chart = otherCharts[i];\n\n\t\t\t\tif (chart != this) {\n\t\t\t\t\tconst chartPlotContainer = chart.plotContainer;\n\t\t\t\t\tconst documentPoint = this._root.rootPointToDocument(global);\n\t\t\t\t\tconst chartRoot = chart._root.documentPointToRoot(documentPoint);\n\t\t\t\t\tconst local = chartPlotContainer.toLocal(chartRoot);\n\t\t\t\t\tif (local.x >= -0.1 && local.y >= -0.1 && local.x <= chartPlotContainer.width() + 0.1 && local.y <= chartPlotContainer.height() + 0.1) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic arrangeTooltips() {\n\t\tconst plotContainer = this.plotContainer;\n\n\t\tconst w = plotContainer.width();\n\t\tconst h = plotContainer.height();\n\n\t\tlet hh = this.height();\n\n\t\tconst bounds = this._root.tooltipContainer.get(\"layerMargin\");\n\n\t\tif (bounds) {\n\t\t\tif (bounds.bottom > hh) {\n\t\t\t\thh = bounds.bottom;\n\t\t\t}\n\t\t}\n\n\t\tlet plotT = plotContainer._display.toGlobal({ x: 0, y: 0 });\n\t\tlet plotB = plotContainer._display.toGlobal({ x: w, y: h });\n\n\t\tconst tooltips: Array = [];\n\t\tlet sum = 0;\n\n\t\tlet minDistance = Infinity;\n\t\tlet movePoint = this._movePoint;\n\t\tlet maxTooltipDistance = this.get(\"maxTooltipDistance\");\n\t\tlet maxTooltipDistanceBy = this.get(\"maxTooltipDistanceBy\", \"xy\");\n\t\tlet closest: XYSeries;\n\t\tlet closestPoint: IPoint;\n\n\t\tif ($type.isNumber(maxTooltipDistance)) {\n\t\t\tthis.series.each((series) => {\n\t\t\t\tif (!series.isHidden()) {\n\t\t\t\t\tconst tooltip = series.get(\"tooltip\");\n\t\t\t\t\tif (tooltip) {\n\t\t\t\t\t\tlet point = tooltip.get(\"pointTo\")!;\n\t\t\t\t\t\tif (point) {\n\t\t\t\t\t\t\tlet distance = Math.hypot(movePoint.x - point.x, movePoint.y - point.y);\n\t\t\t\t\t\t\tif (maxTooltipDistanceBy == \"x\") {\n\t\t\t\t\t\t\t\tdistance = Math.abs(movePoint.x - point.x);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (maxTooltipDistanceBy == \"y\") {\n\t\t\t\t\t\t\t\tdistance = Math.abs(movePoint.y - point.y);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (distance < minDistance) {\n\t\t\t\t\t\t\t\tminDistance = distance;\n\t\t\t\t\t\t\t\tclosest = series;\n\t\t\t\t\t\t\t\tclosestPoint = point;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\tconst tooltipSeries: Array = [];\n\n\t\tthis.series.each((series) => {\n\t\t\tconst tooltip = series.get(\"tooltip\")!;\n\n\t\t\tif (tooltip && !tooltip.get(\"forceHidden\")) {\n\t\t\t\tlet hidden = false;\n\t\t\t\tlet point = tooltip.get(\"pointTo\")!;\n\t\t\t\tif (point) {\n\t\t\t\t\tif (maxTooltipDistance >= 0) {\n\t\t\t\t\t\tlet point = tooltip.get(\"pointTo\")!;\n\t\t\t\t\t\tif (point && closestPoint) {\n\t\t\t\t\t\t\tif (series != closest) {\n\t\t\t\t\t\t\t\tlet distance = Math.hypot(closestPoint.x - point.x, closestPoint.y - point.y);\n\t\t\t\t\t\t\t\tif (maxTooltipDistanceBy == \"x\") {\n\t\t\t\t\t\t\t\t\tdistance = Math.abs(closestPoint.x - point.x);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (maxTooltipDistanceBy == \"y\") {\n\t\t\t\t\t\t\t\t\tdistance = Math.abs(closestPoint.y - point.y);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (distance > maxTooltipDistance) {\n\t\t\t\t\t\t\t\t\thidden = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (maxTooltipDistance == -1) {\n\t\t\t\t\t\tif (series != closest) {\n\t\t\t\t\t\t\thidden = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!this.inPlot(this._tooltipToLocal(point)) || !tooltip.dataItem) {\n\t\t\t\t\t\thidden = true;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (!hidden) {\n\t\t\t\t\t\t\tsum += point.y;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (hidden || series.isHidden() || series.isHiding()) {\n\t\t\t\t\t\ttooltip.hide(0);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\ttooltip.show();\n\t\t\t\t\t\ttooltips.push(tooltip);\n\n\t\t\t\t\t\ttooltipSeries.push(series);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\tthis.setPrivate(\"tooltipSeries\", tooltipSeries);\n\n\t\tif (this.get(\"arrangeTooltips\")) {\n\n\t\t\tconst tooltipContainer = this._root.tooltipContainer;\n\n\t\t\tconst count = tooltips.length;\n\t\t\tconst average = sum / count;\n\n\t\t\tif (average > h / 2 + plotT.y) {\n\t\t\t\ttooltips.sort((a, b) => $order.compareNumber(b.get(\"pointTo\")!.y, a.get(\"pointTo\")!.y));\n\n\t\t\t\tlet prevY = plotB.y;\n\n\t\t\t\t$array.each(tooltips, (tooltip) => {\n\t\t\t\t\tlet height = tooltip.height();\n\t\t\t\t\tlet centerY = tooltip.get(\"centerY\");\n\t\t\t\t\tif (centerY instanceof Percent) {\n\t\t\t\t\t\theight *= centerY.value;\n\t\t\t\t\t}\n\t\t\t\t\theight += tooltip.get(\"marginBottom\", 0);\n\n\t\t\t\t\ttooltip.set(\"bounds\", { left: plotT.x, top: plotT.y, right: plotB.x, bottom: prevY })\n\t\t\t\t\ttooltip.setPrivate(\"customData\", { left: plotT.x, top: plotT.y, right: plotB.x, bottom: prevY })\n\t\t\t\t\tprevY = Math.min(prevY - height, tooltip._fy - height);\n\t\t\t\t\tif (tooltip.parent == tooltipContainer) {\n\t\t\t\t\t\ttooltipContainer.children.moveValue(tooltip, 0);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\tif (prevY < 0) {\n\t\t\t\t\ttooltips.reverse();\n\t\t\t\t\tlet prevBottom = prevY;\n\n\t\t\t\t\t$array.each(tooltips, (tooltip) => {\n\t\t\t\t\t\tlet bounds = tooltip.get(\"bounds\");\n\t\t\t\t\t\tif (bounds) {\n\t\t\t\t\t\t\tlet top = bounds.top - prevY;\n\t\t\t\t\t\t\tlet bottom = bounds.bottom - prevY;\n\t\t\t\t\t\t\tif (top < prevBottom) {\n\t\t\t\t\t\t\t\ttop = prevBottom;\n\t\t\t\t\t\t\t\tbottom = top + tooltip.height();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttooltip.set(\"bounds\", { left: bounds.left, top: top, right: bounds.right, bottom: bottom })\n\t\t\t\t\t\t\tprevBottom = bounds.bottom - prevY + tooltip.get(\"marginBottom\", 0);\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttooltips.reverse();\n\t\t\t\ttooltips.sort((a, b) => $order.compareNumber(a.get(\"pointTo\")!.y, b.get(\"pointTo\")!.y));\n\n\t\t\t\tlet prevY = 0;\n\t\t\t\t$array.each(tooltips, (tooltip) => {\n\t\t\t\t\tlet height = tooltip.height();\n\t\t\t\t\tlet centerY = tooltip.get(\"centerY\");\n\t\t\t\t\tif (centerY instanceof Percent) {\n\t\t\t\t\t\theight *= centerY.value;\n\t\t\t\t\t}\n\t\t\t\t\theight += tooltip.get(\"marginBottom\", 0);\n\n\t\t\t\t\ttooltip.set(\"bounds\", { left: plotT.x, top: prevY, right: plotB.x, bottom: Math.max(plotT.y + hh, prevY + height) })\n\t\t\t\t\tif (tooltip.parent == tooltipContainer) {\n\t\t\t\t\t\ttooltipContainer.children.moveValue(tooltip, 0);\n\t\t\t\t\t}\n\t\t\t\t\tprevY = Math.max(prevY + height, tooltip._fy + height);\n\t\t\t\t})\n\n\t\t\t\tif (prevY > hh) {\n\t\t\t\t\ttooltips.reverse();\n\t\t\t\t\tlet prevBottom = hh;\n\n\t\t\t\t\t$array.each(tooltips, (tooltip) => {\n\t\t\t\t\t\tlet bounds = tooltip.get(\"bounds\");\n\t\t\t\t\t\tif (bounds) {\n\t\t\t\t\t\t\tlet top = bounds.top - (hh - prevY);\n\t\t\t\t\t\t\tlet bottom = bounds.bottom - (hh - prevY);\n\t\t\t\t\t\t\tif (bottom > prevBottom) {\n\t\t\t\t\t\t\t\tbottom = prevBottom\n\t\t\t\t\t\t\t\ttop = bottom - tooltip.height();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttooltip.set(\"bounds\", { left: bounds.left, top: top, right: bounds.right, bottom: bottom })\n\t\t\t\t\t\t\tprevBottom = bottom - tooltip.height() - tooltip.get(\"marginBottom\", 0);\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _tooltipToLocal(point: IPoint): IPoint {\n\t\treturn this.plotContainer.toLocal(point);\n\t}\n\n\t/**\n\t * Fully zooms out the chart.\n\t */\n\tpublic zoomOut() {\n\t\tthis.xAxes.each((axis) => {\n\t\t\taxis.setPrivate(\"updateScrollbar\", true);\n\t\t\taxis.zoom(0, 1);\n\t\t})\n\n\t\tthis.yAxes.each((axis) => {\n\t\t\taxis.setPrivate(\"updateScrollbar\", true);\n\t\t\taxis.zoom(0, 1);\n\t\t})\n\t}\n\n\tprotected _dispose() {\n\t\tsuper._dispose();\n\n\t\t// Explicitly disposing cursor to avoid memory leak of cursor adding\n\t\t// keyboard events after parent chart has been disposed\n\t\tconst cursor = this.get(\"cursor\");\n\t\tif (cursor) {\n\t\t\tcursor.dispose();\n\t\t}\n\t}\n\n}\n","import type { ITimeInterval } from \"../../core/util/Time\";\r\nimport type { DataItem } from \"../../core/render/Component\";\r\nimport type { IValueAxisDataItem, ValueAxis } from \"./axes/ValueAxis\";\r\nimport type { AxisRenderer } from \"./axes/AxisRenderer\";\r\nimport type { DateAxis } from \"./axes/DateAxis\";\r\nimport type { ICategoryAxisDataItem } from \"./axes/CategoryAxis\";\r\nimport type { IGaplessDateAxisDataItem } from \"./axes/GaplessDateAxis\";\r\n\r\nimport { Theme } from \"../../core/Theme\";\r\nimport { percent, p50, p100 } from \"../../core/util/Percent\";\r\nimport { Color } from \"../../core/util/Color\";\r\nimport { ColorSet } from \"../../core/util/ColorSet\";\r\nimport { setColor } from \"../../themes/DefaultTheme\";\r\n\r\nimport * as $time from \"../../core/util/Time\";\r\nimport * as $type from \"../../core/util/Type\";\r\nimport * as $math from \"../../core/util/Math\";\r\nimport * as $object from \"../../core/util/Object\";\r\nimport * as $array from \"../../core/util/Array\";\r\n\r\n/**\r\n * @ignore\r\n */\r\nexport class XYChartDefaultTheme extends Theme {\r\n\tprotected setupDefaultRules() {\r\n\t\tsuper.setupDefaultRules();\r\n\r\n\t\tconst ic = this._root.interfaceColors;\r\n\t\tconst language = this._root.language;\r\n\t\tconst r = this.rule.bind(this);\r\n\r\n\t\t/**\r\n\t\t * ========================================================================\r\n\t\t * charts/xy\r\n\t\t * ========================================================================\r\n\t\t */\r\n\r\n\t\tr(\"XYChart\").setAll({\r\n\t\t\tcolors: ColorSet.new(this._root, {}),\r\n\t\t\tpaddingLeft: 20,\r\n\t\t\tpaddingRight: 20,\r\n\t\t\tpaddingTop: 16,\r\n\t\t\tpaddingBottom: 16,\r\n\t\t\tpanX: false,\r\n\t\t\tpanY: false,\r\n\t\t\twheelStep: 0.25,\r\n\t\t\tarrangeTooltips: true,\r\n\t\t\tpinchZoomX: false,\r\n\t\t\tpinchZoomY: false\r\n\t\t});\r\n\r\n\r\n\t\tr(\"XYSeries\").setAll({\r\n\t\t\tlegendLabelText: \"{name}\"\r\n\t\t})\r\n\r\n\t\tr(\"Rectangle\", [\"plotbackground\", \"xy\", \"background\"]).setAll({\r\n\t\t\tfill: Color.fromHex(0x000000),\r\n\t\t\tfillOpacity: 0\r\n\t\t});\r\n\r\n\t\t/**\r\n\t\t * ------------------------------------------------------------------------\r\n\t\t * charts/xy: XYChartScrollbar\r\n\t\t * ------------------------------------------------------------------------\r\n\t\t */\r\n\r\n\t\tr(\"XYChart\", [\"scrollbar\", \"chart\"]).setAll({\r\n\t\t\tpaddingBottom: 0,\r\n\t\t\tpaddingLeft: 0,\r\n\t\t\tpaddingTop: 0,\r\n\t\t\tpaddingRight: 0,\r\n\t\t\tcolors: ColorSet.new(this._root, {\r\n\t\t\t\tsaturation: 0\r\n\t\t\t})\r\n\t\t});\r\n\r\n\t\t{\r\n\t\t\tconst rule = r(\"Graphics\", [\"scrollbar\", \"overlay\"]);\r\n\r\n\t\t\trule.setAll({\r\n\t\t\t\tfillOpacity: 0.5\r\n\t\t\t});\r\n\r\n\t\t\tsetColor(rule, \"fill\", ic, \"background\");\r\n\t\t}\r\n\r\n\t\t// Class: RoundedRectangle\r\n\t\tr(\"RoundedRectangle\", [\"xy\", \"scrollbar\", \"thumb\"]).setAll({\r\n\t\t\tcornerRadiusTR: 0,\r\n\t\t\tcornerRadiusTL: 0,\r\n\t\t\tcornerRadiusBR: 0,\r\n\t\t\tcornerRadiusBL: 0,\r\n\t\t\tfillOpacity: 0,\r\n\t\t\tfocusable: true\r\n\t\t});\r\n\r\n\t\tr(\"RoundedRectangle\", [\"xy\", \"scrollbar\", \"thumb\"]).states.create(\"hover\", { fillOpacity: 0.4 });\r\n\r\n\t\tr(\"RoundedRectangle\", [\"xy\", \"scrollbar\", \"chart\", \"background\"]).setAll({\r\n\t\t\tcornerRadiusTL: 0,\r\n\t\t\tcornerRadiusBL: 0,\r\n\t\t\tcornerRadiusTR: 0,\r\n\t\t\tcornerRadiusBR: 0\r\n\t\t});\r\n\r\n\t\tr(\"RoundedRectangle\", [\"xy\", \"scrollbar\", \"chart\", \"background\", \"resize\", \"button\"]).setAll({\r\n\t\t\tcornerRadiusBL: 40,\r\n\t\t\tcornerRadiusBR: 40,\r\n\t\t\tcornerRadiusTL: 40,\r\n\t\t\tcornerRadiusTR: 40\r\n\t\t});\r\n\r\n\t\tr(\"AxisRendererX\", [\"xy\", \"chart\", \"scrollbar\"]).setAll({\r\n\t\t\tstrokeOpacity: 0,\r\n\t\t\tinside: true\r\n\t\t});\r\n\r\n\t\tr(\"AxisRendererY\", [\"xy\", \"chart\", \"scrollbar\"]).setAll({\r\n\t\t\tstrokeOpacity: 0,\r\n\t\t\tinside: true,\r\n\t\t\tminGridDistance: 5\r\n\t\t});\r\n\r\n\t\tr(\"AxisLabel\", [\"xy\", \"scrollbar\", \"x\"]).setAll({\r\n\t\t\topacity: 0.5,\r\n\t\t\tcenterY: p100,\r\n\t\t\tminPosition: 0.01,\r\n\t\t\tmaxPosition: 0.99,\r\n\t\t\tfontSize: \"0.8em\"\r\n\t\t});\r\n\r\n\t\tr(\"AxisLabel\", [\"category\"]).setAll({\r\n\t\t\ttext: \"{category}\",\r\n\t\t\tpopulateText: true\r\n\t\t});\r\n\r\n\t\tr(\"AxisLabel\", [\"x\"]).setAll({\r\n\t\t\tcenterY: 0\r\n\t\t});\r\n\r\n\t\tr(\"AxisLabel\", [\"x\", \"inside\"]).setAll({\r\n\t\t\tcenterY: p100\r\n\t\t});\r\n\r\n\t\tr(\"AxisLabel\", [\"x\", \"inside\", \"opposite\"]).setAll({\r\n\t\t\tcenterY: 0\r\n\t\t});\r\n\r\n\t\tr(\"AxisLabel\", [\"x\", \"opposite\"]).setAll({\r\n\t\t\tcenterY: p100\r\n\t\t});\r\n\r\n\r\n\t\tr(\"AxisLabel\", [\"y\"]).setAll({\r\n\t\t\tcenterX: p100\r\n\t\t});\r\n\r\n\t\tr(\"AxisLabel\", [\"y\", \"inside\"]).setAll({\r\n\t\t\tcenterX: 0\r\n\t\t});\r\n\r\n\t\tr(\"AxisLabel\", [\"y\", \"inside\", \"opposite\"]).setAll({\r\n\t\t\tcenterX: p100\r\n\t\t});\r\n\r\n\t\tr(\"AxisLabel\", [\"y\", \"opposite\"]).setAll({\r\n\t\t\tcenterX: 0\r\n\t\t});\r\n\r\n\t\tr(\"AxisLabel\", [\"minor\"]).setAll({\r\n\t\t\tfontSize: \"0.6em\"\r\n\t\t});\r\n\r\n\t\tr(\"AxisLabel\", [\"xy\", \"scrollbar\", \"y\"]).setAll({\r\n\t\t\tvisible: false\r\n\t\t});\r\n\r\n\t\t// Class: Grid\r\n\t\tr(\"Grid\", [\"xy\", \"scrollbar\", \"y\"]).setAll({\r\n\t\t\tvisible: false\r\n\t\t});\r\n\r\n\t\t// Class: Grid\r\n\t\tr(\"Grid\", [\"xy\", \"scrollbar\", \"x\"]).setAll({\r\n\t\t\topacity: 0.5\r\n\t\t});\r\n\r\n\r\n\r\n\r\n\t\t/**\r\n\t\t * ------------------------------------------------------------------------\r\n\t\t * charts/xy: Cursor\r\n\t\t * ------------------------------------------------------------------------\r\n\t\t */\r\n\r\n\t\tr(\"XYCursor\").setAll({\r\n\t\t\tbehavior: \"none\",\r\n\t\t\tlayer: 30,\r\n\t\t\texportable: false,\r\n\t\t\tsnapToSeriesBy: \"xy\",\r\n\t\t\tmoveThreshold: 1\r\n\t\t});\r\n\r\n\t\t{\r\n\t\t\tconst rule = r(\"Grid\", [\"cursor\", \"x\"]);\r\n\r\n\t\t\trule.setAll({\r\n\t\t\t\tforceInactive: true,\r\n\t\t\t\tstrokeOpacity: 0.8,\r\n\t\t\t\tstrokeDasharray: [2, 2],\r\n\t\t\t\trole: \"slider\",\r\n\t\t\t\tariaLabel: language.translate(\"Use left and right arrows to move selection\")\r\n\t\t\t});\r\n\r\n\t\t\tsetColor(rule, \"stroke\", ic, \"alternativeBackground\");\r\n\t\t}\r\n\r\n\t\t{\r\n\t\t\tconst rule = r(\"Grid\", [\"cursor\", \"y\"]);\r\n\r\n\t\t\trule.setAll({\r\n\t\t\t\tforceInactive: true,\r\n\t\t\t\tstrokeOpacity: 0.8,\r\n\t\t\t\tstrokeDasharray: [2, 2],\r\n\t\t\t\trole: \"slider\",\r\n\t\t\t\tariaLabel: language.translate(\"Use up and down arrows to move selection\")\r\n\t\t\t});\r\n\r\n\t\t\tsetColor(rule, \"stroke\", ic, \"alternativeBackground\");\r\n\t\t}\r\n\r\n\t\t{\r\n\t\t\tconst rule = r(\"Graphics\", [\"cursor\", \"selection\"]);\r\n\r\n\t\t\trule.setAll({\r\n\t\t\t\tfillOpacity: 0.15,\r\n\t\t\t});\r\n\r\n\t\t\tsetColor(rule, \"fill\", ic, \"alternativeBackground\");\r\n\t\t}\r\n\r\n\r\n\t\t/**\r\n\t\t * ------------------------------------------------------------------------\r\n\t\t * charts/xy: Axes\r\n\t\t * ------------------------------------------------------------------------\r\n\t\t */\r\n\r\n\t\tr(\"Axis\").setAll({\r\n\t\t\tstart: 0,\r\n\t\t\tend: 1,\r\n\t\t\tminZoomCount: 1,\r\n\t\t\tmaxZoomCount: Infinity,\r\n\t\t\tmaxZoomFactor: 1000,\r\n\t\t\tmaxDeviation: 0.1,\r\n\t\t\tsnapTooltip: true,\r\n\t\t\ttooltipLocation: 0.5,\r\n\t\t\tpanX: true,\r\n\t\t\tpanY: true,\r\n\t\t\tzoomX: true,\r\n\t\t\tzoomY: true,\r\n\t\t\tfixAxisSize: true\r\n\t\t});\r\n\r\n\t\tr(\"AxisLabel\").setAll({\r\n\t\t\tlocation: 0.5,\r\n\t\t\tmultiLocation: 0,\r\n\t\t\tcenterX: p50,\r\n\t\t\tcenterY: p50,\r\n\t\t\tpaddingTop: 3,\r\n\t\t\tpaddingBottom: 3,\r\n\t\t\tpaddingLeft: 5,\r\n\t\t\tpaddingRight: 5\r\n\t\t});\r\n\r\n\t\t// The following is deprecated following text measuring updates in 5.0.5\r\n\t\t// r(\"AxisLabel\", [\"y\"]).setAll({\r\n\t\t// \ttextAlign: \"right\"\r\n\t\t// });\r\n\r\n\t\t// r(\"AxisLabel\", [\"y\", \"opposite\"]).setAll({\r\n\t\t// \ttextAlign: \"left\"\r\n\t\t// });\r\n\r\n\t\tr(\"Container\", [\"axis\", \"header\"]).setAll({\r\n\t\t\tlayer: 30\r\n\t\t});\r\n\r\n\t\tr(\"Rectangle\", [\"axis\", \"header\", \"background\"]).setAll({\r\n\t\t\tcrisp: true\r\n\t\t});\r\n\r\n\t\t{\r\n\t\t\tconst rule = r(\"AxisRenderer\");\r\n\r\n\t\t\trule.setAll({\r\n\t\t\t\tcrisp: true,\r\n\t\t\t\tstrokeOpacity: 0\r\n\t\t\t});\r\n\r\n\t\t\tsetColor(rule, \"stroke\", ic, \"grid\");\r\n\t\t}\r\n\r\n\t\tr(\"AxisRendererX\").setAll({\r\n\t\t\tminGridDistance: 120,\r\n\t\t\topposite: false,\r\n\t\t\tinversed: false,\r\n\t\t\tcellStartLocation: 0,\r\n\t\t\tcellEndLocation: 1,\r\n\t\t\twidth: p100\r\n\t\t});\r\n\r\n\t\tr(\"AxisRendererY\").setAll({\r\n\t\t\tminGridDistance: 40,\r\n\t\t\topposite: false,\r\n\t\t\tinversed: false,\r\n\t\t\tcellStartLocation: 0,\r\n\t\t\tcellEndLocation: 1,\r\n\t\t\theight: p100\r\n\t\t});\r\n\r\n\t\t{\r\n\t\t\tconst rule = r(\"Rectangle\", [\"axis\", \"thumb\"]);\r\n\r\n\t\t\trule.setAll({\r\n\t\t\t\tfillOpacity: 0\r\n\t\t\t});\r\n\r\n\t\t\tsetColor(rule, \"fill\", ic, \"alternativeBackground\");\r\n\r\n\t\t\trule.states.create(\"hover\", { fillOpacity: 0.1 })\r\n\t\t}\r\n\r\n\t\tr(\"Rectangle\", [\"axis\", \"thumb\", \"x\"]).setAll({\r\n\t\t\tcursorOverStyle: \"ew-resize\"\r\n\t\t});\r\n\r\n\t\tr(\"Rectangle\", [\"axis\", \"thumb\", \"y\"]).setAll({\r\n\t\t\tcursorOverStyle: \"ns-resize\"\r\n\t\t});\r\n\r\n\r\n\t\t{\r\n\t\t\tconst rule = r(\"Grid\");\r\n\r\n\t\t\trule.setAll({\r\n\t\t\t\tlocation: 0,\r\n\t\t\t\tstrokeOpacity: 0.15,\r\n\t\t\t\tcrisp: true\r\n\t\t\t});\r\n\r\n\t\t\tsetColor(rule, \"stroke\", ic, \"grid\");\r\n\t\t}\r\n\r\n\t\t{\r\n\t\t\tconst rule = r(\"Grid\", [\"minor\"]);\r\n\r\n\t\t\trule.setAll({\r\n\t\t\t\tlocation: 0,\r\n\t\t\t\tstrokeOpacity: 0.07,\r\n\t\t\t\tcrisp: true\r\n\t\t\t});\r\n\r\n\t\t\tsetColor(rule, \"stroke\", ic, \"grid\");\r\n\t\t}\r\n\r\n\r\n\t\tr(\"Grid\", [\"base\"]).setAll({\r\n\t\t\tstrokeOpacity: 0.3\r\n\t\t});\r\n\r\n\t\t{\r\n\t\t\tconst rule = r(\"Graphics\", [\"axis\", \"fill\"]);\r\n\r\n\t\t\trule.setAll({\r\n\t\t\t\tvisible: false,\r\n\t\t\t\tisMeasured: false,\r\n\t\t\t\tposition: \"absolute\",\r\n\t\t\t\tfillOpacity: 0.05,\r\n\t\t\t});\r\n\r\n\t\t\tsetColor(rule, \"fill\", ic, \"alternativeBackground\");\r\n\t\t}\r\n\r\n\t\tr(\"Graphics\", [\"axis\", \"fill\", \"range\"]).setAll({\r\n\t\t\tisMeasured: true\r\n\t\t});\r\n\r\n\t\t// hides all elements of series axis range\r\n\t\tr(\"Graphics\", [\"series\", \"fill\", \"range\"]).setAll({\r\n\t\t\tvisible: false,\r\n\t\t\tisMeasured: true\r\n\t\t});\r\n\r\n\t\tr(\"Grid\", [\"series\", \"range\"]).setAll({\r\n\t\t\tvisible: false\r\n\t\t});\r\n\r\n\t\tr(\"AxisTick\", [\"series\", \"range\"]).setAll({\r\n\t\t\tvisible: false\r\n\t\t});\r\n\r\n\t\tr(\"AxisLabel\", [\"series\", \"range\"]).setAll({\r\n\t\t\tvisible: false\r\n\t\t});\r\n\r\n\t\t{\r\n\t\t\tconst rule = r(\"AxisTick\");\r\n\r\n\t\t\trule.setAll({\r\n\t\t\t\tlocation: 0.5,\r\n\t\t\t\tmultiLocation: 0,\r\n\t\t\t\tstrokeOpacity: 1,\r\n\t\t\t\tisMeasured: false,\r\n\t\t\t\tposition: \"absolute\",\r\n\t\t\t\tvisible: false\r\n\t\t\t});\r\n\r\n\t\t\tsetColor(rule, \"stroke\", ic, \"grid\");\r\n\t\t}\r\n\r\n\t\tr(\"CategoryAxis\").setAll({\r\n\t\t\tstartLocation: 0,\r\n\t\t\tendLocation: 1,\r\n\t\t\tfillRule: (dataItem: DataItem, index?: number) => {\r\n\t\t\t\tconst axisFill = dataItem.get(\"axisFill\");\r\n\t\t\t\tif (axisFill) {\r\n\t\t\t\t\tif (!$type.isNumber(index) || index % 2 == 0) {\r\n\t\t\t\t\t\taxisFill.setPrivate(\"visible\", true);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\taxisFill.setPrivate(\"visible\", false);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tconst gridIntervals: Array = [\r\n\t\t\t{ timeUnit: \"millisecond\", count: 1 },\r\n\t\t\t{ timeUnit: \"millisecond\", count: 5 },\r\n\t\t\t{ timeUnit: \"millisecond\", count: 10 },\r\n\t\t\t{ timeUnit: \"millisecond\", count: 50 },\r\n\t\t\t{ timeUnit: \"millisecond\", count: 100 },\r\n\t\t\t{ timeUnit: \"millisecond\", count: 500 },\r\n\t\t\t{ timeUnit: \"second\", count: 1 },\r\n\t\t\t{ timeUnit: \"second\", count: 5 },\r\n\t\t\t{ timeUnit: \"second\", count: 10 },\r\n\t\t\t{ timeUnit: \"second\", count: 30 },\r\n\t\t\t{ timeUnit: \"minute\", count: 1 },\r\n\t\t\t{ timeUnit: \"minute\", count: 5 },\r\n\t\t\t{ timeUnit: \"minute\", count: 10 },\r\n\t\t\t{ timeUnit: \"minute\", count: 15 },\r\n\t\t\t{ timeUnit: \"minute\", count: 30 },\r\n\t\t\t{ timeUnit: \"hour\", count: 1 },\r\n\t\t\t{ timeUnit: \"hour\", count: 3 },\r\n\t\t\t{ timeUnit: \"hour\", count: 6 },\r\n\t\t\t{ timeUnit: \"hour\", count: 12 },\r\n\t\t\t{ timeUnit: \"day\", count: 1 },\r\n\t\t\t{ timeUnit: \"day\", count: 2 },\r\n\t\t\t{ timeUnit: \"day\", count: 3 },\r\n\t\t\t{ timeUnit: \"day\", count: 4 },\r\n\t\t\t{ timeUnit: \"day\", count: 5 },\r\n\t\t\t{ timeUnit: \"week\", count: 1 },\r\n\t\t\t{ timeUnit: \"month\", count: 1 },\r\n\t\t\t{ timeUnit: \"month\", count: 2 },\r\n\t\t\t{ timeUnit: \"month\", count: 3 },\r\n\t\t\t{ timeUnit: \"month\", count: 6 },\r\n\t\t\t{ timeUnit: \"year\", count: 1 },\r\n\t\t\t{ timeUnit: \"year\", count: 2 },\r\n\t\t\t{ timeUnit: \"year\", count: 5 },\r\n\t\t\t{ timeUnit: \"year\", count: 10 },\r\n\t\t\t{ timeUnit: \"year\", count: 50 },\r\n\t\t\t{ timeUnit: \"year\", count: 100 },\r\n\t\t\t{ timeUnit: \"year\", count: 200 },\r\n\t\t\t{ timeUnit: \"year\", count: 500 },\r\n\t\t\t{ timeUnit: \"year\", count: 1000 },\r\n\t\t\t{ timeUnit: \"year\", count: 2000 },\r\n\t\t\t{ timeUnit: \"year\", count: 5000 },\r\n\t\t\t{ timeUnit: \"year\", count: 10000 },\r\n\t\t\t{ timeUnit: \"year\", count: 100000 }\r\n\t\t];\r\n\r\n\t\tconst dateFormats = {\r\n\t\t\t\"millisecond\": language.translate(\"_date_millisecond\"),\r\n\t\t\t\"second\": language.translate(\"_date_second\"),\r\n\t\t\t\"minute\": language.translate(\"_date_minute\"),\r\n\t\t\t\"hour\": language.translate(\"_date_hour\"),\r\n\t\t\t\"day\": language.translate(\"_date_day\"),\r\n\t\t\t\"week\": language.translate(\"_date_day\"),\r\n\t\t\t\"month\": language.translate(\"_date_month\"),\r\n\t\t\t\"year\": language.translate(\"_date_year\")\r\n\t\t};\r\n\r\n\t\tconst periodChangeDateFormats = {\r\n\t\t\t\"millisecond\": language.translate(\"_date_millisecond\"),\r\n\t\t\t\"second\": language.translate(\"_date_second\"),\r\n\t\t\t\"minute\": language.translate(\"_date_minute\"),\r\n\t\t\t\"hour\": language.translate(\"_date_day\"),\r\n\t\t\t\"day\": language.translate(\"_date_day\"),\r\n\t\t\t\"week\": language.translate(\"_date_day\"),\r\n\t\t\t\"month\": language.translate(\"_date_month\") + \" \" + language.translate(\"_date_year\"),\r\n\t\t\t\"year\": language.translate(\"_date_year\")\r\n\t\t};\r\n\r\n\t\tconst tooltipDateFormats = {\r\n\t\t\t\"millisecond\": language.translate(\"_date_millisecond_full\"),\r\n\t\t\t\"second\": language.translate(\"_date_second_full\"),\r\n\t\t\t\"minute\": language.translate(\"_date_minute_full\"),\r\n\t\t\t\"hour\": language.translate(\"_date_hour_full\"),\r\n\t\t\t\"day\": language.translate(\"_date_day_full\"),\r\n\t\t\t\"week\": language.translate(\"_date_week_full\"),\r\n\t\t\t\"month\": language.translate(\"_date_month_full\"),\r\n\t\t\t\"year\": language.translate(\"_date_year\")\r\n\t\t};\r\n\r\n\t\tr(\"CategoryDateAxis\").setAll({\r\n\t\t\tmarkUnitChange: true,\r\n\t\t\tgridIntervals: $array.copy(gridIntervals),\r\n\t\t\tdateFormats: $object.copy(dateFormats),\r\n\t\t\tperiodChangeDateFormats: $object.copy(periodChangeDateFormats)\r\n\t\t});\r\n\r\n\t\tr(\"DateAxis\").setAll({\r\n\t\t\tmaxZoomFactor: null,\r\n\t\t\tstrictMinMax: true,\r\n\t\t\tstartLocation: 0,\r\n\t\t\tendLocation: 1,\r\n\t\t\tmarkUnitChange: true,\r\n\t\t\tgroupData: false,\r\n\t\t\tgroupCount: 500,\r\n\t\t\tgridIntervals: $array.copy(gridIntervals),\r\n\t\t\tdateFormats: $object.copy(dateFormats),\r\n\t\t\tperiodChangeDateFormats: $object.copy(periodChangeDateFormats),\r\n\t\t\ttooltipDateFormats: tooltipDateFormats,\r\n\r\n\t\t\tgroupIntervals: [\r\n\t\t\t\t{ timeUnit: \"millisecond\", count: 1 },\r\n\t\t\t\t{ timeUnit: \"millisecond\", count: 10 },\r\n\t\t\t\t{ timeUnit: \"millisecond\", count: 100 },\r\n\t\t\t\t{ timeUnit: \"second\", count: 1 },\r\n\t\t\t\t{ timeUnit: \"second\", count: 10 },\r\n\t\t\t\t{ timeUnit: \"minute\", count: 1 },\r\n\t\t\t\t{ timeUnit: \"minute\", count: 10 },\r\n\t\t\t\t{ timeUnit: \"hour\", count: 1 },\r\n\t\t\t\t{ timeUnit: \"day\", count: 1 },\r\n\t\t\t\t{ timeUnit: \"week\", count: 1 },\r\n\t\t\t\t{ timeUnit: \"month\", count: 1 },\r\n\t\t\t\t{ timeUnit: \"year\", count: 1 }\r\n\t\t\t],\r\n\r\n\t\t\tfillRule: (dataItem: DataItem) => {\r\n\t\t\t\tconst axisFill = dataItem.get(\"axisFill\");\r\n\t\t\t\tif (axisFill) {\r\n\t\t\t\t\tconst axis = >dataItem.component;\r\n\t\t\t\t\tconst value = dataItem.get(\"value\");\r\n\t\t\t\t\tconst endValue = dataItem.get(\"endValue\");\r\n\t\t\t\t\tconst intervalDuration = axis.intervalDuration();\r\n\t\t\t\t\tconst baseInterval = axis.getPrivate(\"baseInterval\");\r\n\t\t\t\t\tconst gridInterval = axis.getPrivate(\"gridInterval\", baseInterval);\r\n\r\n\r\n\t\t\t\t\tlet min = axis.getPrivate(\"min\", 0);\r\n\t\t\t\t\tmin = $time.round(new Date(min), gridInterval.timeUnit, gridInterval.count, this._root.locale.firstDayOfWeek, this._root.utc, undefined, this._root.timezone).getTime();\r\n\r\n\t\t\t\t\tif (value != null && endValue != null) {\r\n\t\t\t\t\t\tconst val = Math.round(Math.round((value - min) / intervalDuration)) / 2;\r\n\r\n\t\t\t\t\t\tif (val == Math.round(val)) {\r\n\t\t\t\t\t\t\taxisFill.setPrivate(\"visible\", true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\taxisFill.setPrivate(\"visible\", false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tr(\"GaplessDateAxis\").setAll({\r\n\t\t\tfillRule: (dataItem: DataItem) => {\r\n\t\t\t\tconst axisFill = dataItem.get(\"axisFill\");\r\n\t\t\t\tif (axisFill) {\r\n\r\n\t\t\t\t\tconst index = dataItem.get(\"index\")\r\n\t\t\t\t\tlet visible = false;\r\n\t\t\t\t\tif (!$type.isNumber(index) || index % 2 == 0) {\r\n\t\t\t\t\t\tvisible = true\r\n\t\t\t\t\t}\r\n\t\t\t\t\taxisFill.setPrivate(\"visible\", visible);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\tr(\"ValueAxis\").setAll({\r\n\r\n\t\t\tbaseValue: 0,\r\n\t\t\tlogarithmic: false,\r\n\t\t\tstrictMinMax: false,\r\n\t\t\tautoZoom: true,\r\n\r\n\t\t\tfillRule: (dataItem: DataItem) => {\r\n\t\t\t\tconst axisFill = dataItem.get(\"axisFill\");\r\n\t\t\t\tif (axisFill) {\r\n\t\t\t\t\tconst axis = >dataItem.component;\r\n\t\t\t\t\tconst value = dataItem.get(\"value\");\r\n\t\t\t\t\tconst step = axis.getPrivate(\"step\");\r\n\r\n\t\t\t\t\tif ($type.isNumber(value) && $type.isNumber(step)) {\r\n\t\t\t\t\t\tif ($math.round(value / step / 2, 5) == Math.round(value / step / 2)) {\r\n\t\t\t\t\t\t\taxisFill.setPrivate(\"visible\", false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\taxisFill.setPrivate(\"visible\", true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tr(\"DurationAxis\").setAll({\r\n\t\t\tbaseUnit: \"second\"\r\n\t\t})\r\n\r\n\r\n\t\t/**\r\n\t\t * ------------------------------------------------------------------------\r\n\t\t * charts/xy: Series\r\n\t\t * ------------------------------------------------------------------------\r\n\t\t */\r\n\r\n\t\tr(\"XYSeries\").setAll({\r\n\t\t\tmaskBullets: true,\r\n\t\t\tstackToNegative: true,\r\n\r\n\t\t\tlocationX: 0.5,\r\n\t\t\tlocationY: 0.5,\r\n\r\n\t\t\tsnapTooltip: false,\r\n\r\n\t\t\topenValueXGrouped: \"open\",\r\n\t\t\topenValueYGrouped: \"open\",\r\n\t\t\tvalueXGrouped: \"close\",\r\n\t\t\tvalueYGrouped: \"close\",\r\n\r\n\t\t\tseriesTooltipTarget: \"series\"\r\n\t\t});\r\n\r\n\t\tr(\"BaseColumnSeries\").setAll({\r\n\t\t\tadjustBulletPosition: true\r\n\t\t});\r\n\r\n\t\tr(\"ColumnSeries\").setAll({\r\n\t\t\tclustered: true\r\n\t\t});\r\n\r\n\t\tr(\"RoundedRectangle\", [\"series\", \"column\"]).setAll({\r\n\t\t\tposition: \"absolute\",\r\n\t\t\tisMeasured: false,\r\n\t\t\twidth: percent(70),\r\n\t\t\theight: percent(70),\r\n\t\t\tstrokeWidth: 1,\r\n\t\t\tstrokeOpacity: 1,\r\n\t\t\tcornerRadiusBL: 0,\r\n\t\t\tcornerRadiusTL: 0,\r\n\t\t\tcornerRadiusBR: 0,\r\n\t\t\tcornerRadiusTR: 0,\r\n\t\t\tfillOpacity: 1,\r\n\t\t\trole: \"figure\"\r\n\t\t});\r\n\r\n\t\tr(\"LineSeries\").setAll({\r\n\t\t\tconnect: true,\r\n\t\t\tautoGapCount: 1.1,\r\n\t\t\tstackToNegative: false\r\n\t\t});\r\n\r\n\t\tr(\"Graphics\", [\"series\", \"stroke\"]).setAll({\r\n\t\t\tposition: \"absolute\",\r\n\t\t\tstrokeWidth: 1,\r\n\t\t\tstrokeOpacity: 1,\r\n\t\t\tisMeasured: false\r\n\t\t});\r\n\r\n\t\tr(\"Graphics\", [\"series\", \"fill\"]).setAll({\r\n\t\t\tvisible: false,\r\n\t\t\tfillOpacity: 0,\r\n\t\t\tposition: \"absolute\",\r\n\t\t\tstrokeWidth: 0,\r\n\t\t\tstrokeOpacity: 0,\r\n\t\t\tisMeasured: false\r\n\t\t});\r\n\r\n\t\tr(\"Graphics\", [\"line\", \"series\", \"legend\", \"marker\", \"stroke\"]).setAll({\r\n\t\t\tdraw: (display: any, sprite: any) => {\r\n\t\t\t\tconst parent = sprite.parent;\r\n\t\t\t\tif (parent) {\r\n\t\t\t\t\tconst h = parent.height();\r\n\t\t\t\t\tconst w = parent.width();\r\n\t\t\t\t\tdisplay.moveTo(0, h / 2);\r\n\t\t\t\t\tdisplay.lineTo(w, h / 2);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t{\r\n\t\t\tconst rule = r(\"Graphics\", [\"line\", \"series\", \"legend\", \"marker\", \"stroke\"]).states.create(\"disabled\", {});\r\n\t\t\tsetColor(rule, \"stroke\", ic, \"disabled\");\r\n\t\t}\r\n\r\n\t\tr(\"Graphics\", [\"line\", \"series\", \"legend\", \"marker\", \"fill\"]).setAll({\r\n\t\t\tdraw: (display: any, sprite: any) => {\r\n\t\t\t\tconst parent = sprite.parent;\r\n\t\t\t\tif (parent) {\r\n\t\t\t\t\tconst h = parent.height();\r\n\t\t\t\t\tconst w = parent.width();\r\n\t\t\t\t\tdisplay.moveTo(0, 0);\r\n\t\t\t\t\tdisplay.lineTo(w, 0);\r\n\t\t\t\t\tdisplay.lineTo(w, h);\r\n\t\t\t\t\tdisplay.lineTo(0, h);\r\n\t\t\t\t\tdisplay.lineTo(0, 0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t{\r\n\t\t\tconst rule = r(\"Graphics\", [\"line\", \"series\", \"legend\", \"marker\", \"fill\"]).states.create(\"disabled\", {});\r\n\t\t\tsetColor(rule, \"stroke\", ic, \"disabled\");\r\n\t\t}\r\n\r\n\t\tr(\"SmoothedXYLineSeries\").setAll({\r\n\t\t\ttension: 0.5\r\n\t\t});\r\n\r\n\t\tr(\"SmoothedXLineSeries\").setAll({\r\n\t\t\ttension: 0.5\r\n\t\t});\r\n\r\n\t\tr(\"SmoothedYLineSeries\").setAll({\r\n\t\t\ttension: 0.5\r\n\t\t});\r\n\r\n\t\tr(\"Candlestick\").setAll({\r\n\t\t\tposition: \"absolute\",\r\n\t\t\tisMeasured: false,\r\n\t\t\twidth: percent(50),\r\n\t\t\theight: percent(50),\r\n\t\t\tstrokeWidth: 1,\r\n\t\t\tstrokeOpacity: 1,\r\n\t\t\tcornerRadiusBL: 0,\r\n\t\t\tcornerRadiusTL: 0,\r\n\t\t\tcornerRadiusBR: 0,\r\n\t\t\tcornerRadiusTR: 0,\r\n\t\t\tfillOpacity: 1,\r\n\t\t\trole: \"figure\"\r\n\t\t});\r\n\r\n\t\tr(\"OHLC\").setAll({\r\n\t\t\twidth: percent(80),\r\n\t\t\theight: percent(80)\r\n\t\t});\r\n\r\n\t\tr(\"CandlestickSeries\").setAll({\r\n\t\t\tlowValueXGrouped: \"low\",\r\n\t\t\tlowValueYGrouped: \"low\",\r\n\t\t\thighValueXGrouped: \"high\",\r\n\t\t\thighValueYGrouped: \"high\",\r\n\t\t\topenValueXGrouped: \"open\",\r\n\t\t\topenValueYGrouped: \"open\",\r\n\t\t\tvalueXGrouped: \"close\",\r\n\t\t\tvalueYGrouped: \"close\"\r\n\t\t})\r\n\r\n\t\t// These rules can be used for regular columns, too\r\n\t\t{\r\n\t\t\tconst rule = r(\"Rectangle\", [\"column\", \"autocolor\"]).states.create(\"riseFromOpen\", {});\r\n\t\t\tsetColor(rule, \"fill\", ic, \"positive\");\r\n\t\t\tsetColor(rule, \"stroke\", ic, \"positive\");\r\n\t\t}\r\n\r\n\t\t{\r\n\t\t\tconst rule = r(\"Rectangle\", [\"column\", \"autocolor\"]).states.create(\"dropFromOpen\", {});\r\n\t\t\tsetColor(rule, \"fill\", ic, \"negative\");\r\n\t\t\tsetColor(rule, \"stroke\", ic, \"negative\");\r\n\t\t}\r\n\r\n\t\t// Hollow\r\n\t\tr(\"Rectangle\", [\"column\", \"autocolor\", \"pro\"]).states.create(\"riseFromOpen\", { fillOpacity: 0 });\r\n\t\tr(\"Rectangle\", [\"column\", \"autocolor\", \"pro\"]).states.create(\"dropFromOpen\", { fillOpacity: 1 });\r\n\r\n\t\t{\r\n\t\t\tconst rule = r(\"Rectangle\", [\"column\", \"autocolor\", \"pro\"]).states.create(\"riseFromPrevious\", {});\r\n\t\t\tsetColor(rule, \"fill\", ic, \"positive\");\r\n\t\t\tsetColor(rule, \"stroke\", ic, \"positive\");\r\n\t\t}\r\n\r\n\t\t{\r\n\t\t\tconst rule = r(\"Rectangle\", [\"column\", \"autocolor\", \"pro\"]).states.create(\"dropFromPrevious\", {});\r\n\t\t\tsetColor(rule, \"fill\", ic, \"negative\");\r\n\t\t\tsetColor(rule, \"stroke\", ic, \"negative\");\r\n\t\t}\r\n\r\n\r\n\t\t// AXIS RANGE GRIP\r\n\t\t{\r\n\t\t\tconst rule = r(\"RoundedRectangle\", [\"rangegrip\"]);\r\n\r\n\t\t\trule.setAll({\r\n\t\t\t\tstrokeOpacity: 0,\r\n\t\t\t\tfillOpacity: 0,\r\n\t\t\t\tstrokeWidth: 1,\r\n\t\t\t\twidth: 12,\r\n\t\t\t\theight: 12\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t{\r\n\t\t\tconst rule = r(\"Graphics\", [\"rangegrip\", \"button\", \"icon\"]);\r\n\r\n\t\t\trule.setAll({\r\n\t\t\t\tinteractive: false,\r\n\t\t\t\tcrisp: true,\r\n\t\t\t\tstrokeOpacity: 0.5,\r\n\t\t\t\tdraw: (display: any) => {\r\n\t\t\t\t\tdisplay.moveTo(0, 0.5);\r\n\t\t\t\t\tdisplay.lineTo(0, 12.5);\r\n\r\n\t\t\t\t\tdisplay.moveTo(2, 0.5);\r\n\t\t\t\t\tdisplay.lineTo(2, 12.5);\r\n\r\n\t\t\t\t\tdisplay.moveTo(4, 0.5);\r\n\t\t\t\t\tdisplay.lineTo(4, 12.5);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tsetColor(rule, \"stroke\", ic, \"secondaryButtonText\");\r\n\t\t}\r\n\r\n\t\tr(\"Button\", [\"rangegrip\"]).setAll({\r\n\t\t\tdraggable: true,\r\n\t\t\tpaddingTop: 0,\r\n\t\t\tpaddingBottom: 0\r\n\t\t})\r\n\r\n\t\tr(\"Button\", [\"rangegrip\", \"vertical\"]).setAll({\r\n\t\t\trotation: 90,\r\n\t\t\tcursorOverStyle: \"ns-resize\",\r\n\t\t\tcenterX: p50\r\n\t\t});\r\n\r\n\t\tr(\"Button\", [\"rangegrip\", \"horizontal\"]).setAll({\r\n\t\t\tcursorOverStyle: \"ew-resize\",\r\n\t\t\tcenterX: p50\r\n\t\t});\r\n\r\n\t\tr(\"Button\", [\"rangegrip\", \"vertical\", \"left\"]).setAll({\r\n\t\t\tcenterY: p100\r\n\t\t});\r\n\r\n\t\tr(\"Button\", [\"rangegrip\", \"vertical\", \"right\"]).setAll({\r\n\t\t\tcenterY: 0\r\n\t\t});\r\n\r\n\t\tr(\"Button\", [\"rangegrip\", \"horizontal\", \"top\"]).setAll({\r\n\t\t\tcenterY: 0\r\n\t\t});\r\n\r\n\t\tr(\"Button\", [\"rangegrip\", \"horizontal\", \"bottom\"]).setAll({\r\n\t\t\tcenterY: p100\r\n\t\t});\r\n\r\n\t}\r\n}\r\n","import type { IPoint } from \"../../core/util/IPoint\";\nimport type { XYChart } from \"./XYChart\"\nimport type { XYSeries } from \"./series/XYSeries\";\nimport type { ISpritePointerEvent } from \"../../core/render/Sprite\";\nimport type { Axis } from \"./axes/Axis\";\nimport type { AxisRenderer } from \"./axes/AxisRenderer\";\nimport type { Tooltip } from \"../../core/render/Tooltip\";\n\nimport { Container, IContainerSettings, IContainerPrivate, IContainerEvents } from \"../../core/render/Container\";\nimport { p100 } from \"../../core/util/Percent\";\nimport { Graphics } from \"../../core/render/Graphics\";\nimport { Grid } from \"./axes/Grid\";\n//import { Animations } from \"../core/util/Animation\";\n\nimport * as $type from \"../../core/util/Type\";\nimport * as $utils from \"../../core/util/Utils\";\nimport * as $math from \"../../core/util/Math\";\nimport * as $array from \"../../core/util/Array\";\nimport * as $object from \"../../core/util/Object\";\nimport type { IPointerEvent } from \"../../core/render/backend/Renderer\";\n\nexport interface IXYCursorSettings extends IContainerSettings {\n\n\t/**\n\t * Cursor's X axis.\n\t *\n\t * If set, cursor will snap to that axis' cells.\n\t */\n\txAxis?: Axis;\n\n\t/**\n\t * Cursor's Y axis.\n\t *\n\t * If set, cursor will snap to that axis' cells.\n\t */\n\tyAxis?: Axis;\n\n\t/**\n\t * What should cursor do when dragged across plot area.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/cursor/#Behavior} for more info\n\t * @default \"none\"\n\t */\n\tbehavior?: \"zoomX\" | \"zoomY\" | \"zoomXY\" | \"selectX\" | \"selectY\" | \"selectXY\" | \"none\";\n\n\t/**\n\t * Cursor's horizontal position relative to plot area.\n\t *\n\t * If this setting is set, cursor will not react to mouse/touch and will just\n\t * sit at specified position until `positionX` is reset to `undefined`.\n\t *\n\t * `0` - left, `1` - right.\n\t */\n\tpositionX?: number;\n\n\t/**\n\t * Cursor's vertical position relative to plot area.\n\t *\n\t * If this setting is set, cursor will not react to mouse/touch and will just\n\t * sit at specified position until `positionY` is reset to `undefined`.\n\t *\n\t * `0` - left, `1` - right.\n\t */\n\tpositionY?: number;\n\n\t/**\n\t * If set to `true`, cursor will not be hidden when mouse cursor moves out\n\t * of the plot area.\n\t *\n\t * @default false\n\t */\n\talwaysShow?: boolean;\n\n\t/**\n\t * A list of series to snap cursor to.\n\t *\n\t * If set, the cursor will always snap to the closest data item of listed\n\t * series.\n\t */\n\tsnapToSeries?: Array;\n\n\t/**\n\t * Defines in which direction to look when searching for the nearest data\n\t * item to snap to.\n\t *\n\t * Possible values: `\"xy\"` (default), `\"x\"`, `\"y\"`, `\"x!\"`, `\"y!\"`.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/cursor/#snapping-to-series} for more info\n\t * @since 5.0.6\n\t * @default \"xy\"\n\t */\n\tsnapToSeriesBy?: \"xy\" | \"x\" | \"y\" | \"x!\" | \"y!\";\n\n\t/**\n\t * An array of other [[XYCursor]] objects to sync this cursor with.\n\t *\n\t * If set will automatically move synced cursors to the same position within\n\t * their respective axes as the this cursor assumin same XY coordinates of\n\t * the pointer.\n\t *\n\t * NOTE: Syncing is performed using actual X/Y coordinates of the point of\n\t * mouse cursor's position or touch. It means that they will not sync by axis\n\t * positions, but rather by screen coordinates. For example vertical lines\n\t * will not sync across horizontally laid out charts, and vice versa.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/cursor/#syncing-cursors} for more info\n\t * @since 5.1.4\n\t */\n\tsyncWith?: Array;\n\n\t/**\n\t * Minimum distance in pixels between down and up points.\n\t *\n\t * If a distance is less than the value of `moveThreshold`, the zoom or\n\t * selection won't happen.\n\t *\n\t * @since 5.2.20\n\t * @default 1\n\t */\n\tmoveThreshold?: number\n\n}\n\n\nexport interface IXYCursorPrivate extends IContainerPrivate {\n\n\t/**\n\t * Current X/Y coordinates of the cursor.\n\t */\n\tpoint?: IPoint;\n\n\t/**\n\t * Current horizontal position relative to the plot area (0-1).\n\t */\n\tpositionX?: number;\n\n\t/**\n\t * Current vertical position relative to the plot area (0-1).\n\t */\n\tpositionY?: number;\n\n\t/**\n\t * Horizontal cursor position on the moment when selection started.\n\t */\n\tdownPositionX?: number;\n\n\t/**\n\t * Vertical cursor position on the moment when selection started.\n\t */\n\tdownPositionY?: number;\n\n\t/**\n\t * Last global point to which cursor moved\n\t */\n\tlastPoint?: IPoint;\n}\n\nexport interface IXYCursorEvents extends IContainerEvents {\n\n\t/**\n\t * Kicks in when cursor selection ends.\n\t *\n\t * Only when `behavior` is set.\n\t */\n\tselectended: {\n\t\toriginalEvent: IPointerEvent,\n\t\ttarget: XYCursor\n\t};\n\n\t/**\n\t * Kicks in when cursor selection starts.\n\t *\n\t * Only when `behavior` is set.\n\t */\n\tselectstarted: {\n\t\toriginalEvent: IPointerEvent,\n\t\ttarget: XYCursor\n\t};\n\n\t/**\n\t * Kicks in when cursor's position over plot area changes.\n\t */\n\tcursormoved: {\n\t\tpoint: IPoint,\n\t\ttarget: XYCursor,\n\t\toriginalEvent?: IPointerEvent\n\t};\n\n\t/**\n\t * Kicks in when cursor's is hidden when user rolls-out of the plot area\n\t */\n\tcursorhidden: {\n\t\ttarget: XYCursor\n\t};\n\n\t/**\n\t * Invoked if pointer is pressed down on a plot area and released without\n\t * moving (only when behavior is `\"selectX\"`).\n\t *\n\t * @since 5.4.7\n\t */\n\tselectcancelled: {\n\t\toriginalEvent: IPointerEvent,\n\t\ttarget: XYCursor\n\t};\n\n}\n\n/**\n * Creates a chart cursor for an [[XYChart]].\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/cursor/} for more info\n * @important\n */\nexport class XYCursor extends Container {\n\tpublic static className: string = \"XYCursor\";\n\tpublic static classNames: Array = Container.classNames.concat([XYCursor.className]);\n\n\tdeclare public _settings: IXYCursorSettings;\n\tdeclare public _privateSettings: IXYCursorPrivate;\n\tdeclare public _events: IXYCursorEvents;\n\n\tprotected _alwaysShow: boolean = false;\n\n\t/**\n\t * A [[Grid]] elment that used for horizontal line of the cursor crosshair.\n\t *\n\t * @default Grid.new()\n\t */\n\tpublic readonly lineX: Grid = this.children.push(Grid.new(this._root, {\n\t\tthemeTags: [\"x\"]\n\t}));\n\n\t/**\n\t * A [[Grid]] elment that used for horizontal line of the cursor crosshair.\n\t *\n\t * @default Grid.new()\n\t */\n\tpublic readonly lineY: Grid = this.children.push(Grid.new(this._root, {\n\t\tthemeTags: [\"y\"]\n\t}));\n\n\t/**\n\t * An element that represents current selection.\n\t *\n\t * @default Graphics.new()\n\t */\n\tpublic readonly selection: Graphics = this.children.push(Graphics.new(this._root, {\n\t\tthemeTags: [\"selection\", \"cursor\"], layer: 30\n\t}));\n\n\tprotected _movePoint: IPoint | undefined;\n\tprotected _lastPoint: IPoint = { x: 0, y: 0 };\n\tprotected _lastPoint2: IPoint = { x: 0, y: 0 };\n\n\tprotected _tooltipX: boolean = false;\n\tprotected _tooltipY: boolean = false;\n\n\t/**\n\t * A chart cursor is attached to.\n\t */\n\tpublic chart: XYChart | undefined;\n\n\tprotected _toX?: number;\n\tprotected _toY?: number;\n\n\tprotected _afterNew() {\n\t\tthis._settings.themeTags = $utils.mergeTags(this._settings.themeTags, [\"xy\", \"cursor\"]);\n\t\tsuper._afterNew();\n\t\tthis.setAll({ \"width\": p100, height: p100, isMeasured: true, position: \"absolute\" });\n\t\tthis.states.create(\"hidden\", { visible: true, opacity: 0 });\n\t\tthis._drawLines();\n\t\tthis.setPrivateRaw(\"visible\", false);\n\n\t\tthis._disposers.push(this.setTimeout(() => {\n\t\t\tthis.setPrivate(\"visible\", true)\n\t\t}, 500));\n\n\t\tthis._disposers.push(this.lineX.events.on(\"positionchanged\", () => {\n\t\t\tthis._handleXLine();\n\t\t}));\n\n\t\tthis._disposers.push(this.lineY.events.on(\"positionchanged\", () => {\n\t\t\tthis._handleYLine();\n\t\t}));\n\n\t\tthis._disposers.push(this.lineX.events.on(\"focus\", () => this._handleLineFocus()));\n\t\tthis._disposers.push(this.lineX.events.on(\"blur\", () => this._handleLineBlur()));\n\n\t\tthis._disposers.push(this.lineY.events.on(\"focus\", () => this._handleLineFocus()));\n\t\tthis._disposers.push(this.lineY.events.on(\"blur\", () => this._handleLineBlur()));\n\n\t\tif ($utils.supports(\"keyboardevents\")) {\n\t\t\tthis._disposers.push($utils.addEventListener(document, \"keydown\", (ev: KeyboardEvent) => {\n\t\t\t\tthis._handleLineMove($utils.getEventKey(ev), ev.ctrlKey);\n\t\t\t}));\n\t\t}\n\t}\n\n\tprotected _setUpTouch(): void {\n\t\tconst chart = this.chart;\n\t\tif (chart) {\n\t\t\tchart.plotContainer._display.cancelTouch = this.get(\"behavior\") != \"none\" ? true : false;\n\t\t}\n\t}\n\n\tprotected _handleXLine() {\n\t\tlet x = this.lineX.x();\n\t\tlet visible = true;\n\t\tif (x < 0 || x > this.width()) {\n\t\t\tvisible = false;\n\t\t}\n\t\tthis.lineX.setPrivate(\"visible\", visible);\n\t}\n\n\tprotected _handleYLine() {\n\t\tlet y = this.lineY.y();\n\t\tlet visible = true;\n\t\tif (y < 0 || y > this.height()) {\n\t\t\tvisible = false;\n\t\t}\n\t\tthis.lineY.setPrivate(\"visible\", visible);\n\t}\n\n\tprotected _handleLineMove(key: string, ctrlKey?: boolean) {\n\t\tlet dir: any = \"\";\n\n\t\tconst chart = this.chart;\n\n\t\tlet axis: Axis | undefined;\n\t\tif (chart && chart.xAxes.length) {\n\t\t\tif (this._root.focused(this.lineX)) {\n\t\t\t\tdir = \"positionX\";\n\t\t\t\taxis = chart.xAxes.getIndex(0);\n\t\t\t}\n\t\t\telse if (this._root.focused(this.lineY)) {\n\t\t\t\taxis = chart.yAxes.getIndex(0);\n\t\t\t\tdir = \"positionY\";\n\t\t\t}\n\n\t\t\tlet m = 1;\n\t\t\tif (ctrlKey) {\n\t\t\t\tm = 5;\n\t\t\t}\n\n\t\t\tif (axis) {\n\t\t\t\tlet inversed = axis.get(\"renderer\").get(\"inversed\", false);\n\t\t\t\tlet step;\n\t\t\t\tif (key == \"ArrowRight\" || key == \"ArrowDown\") {\n\t\t\t\t\tstep = 1;\n\t\t\t\t}\n\t\t\t\telse if (key == \"ArrowLeft\" || key == \"ArrowUp\") {\n\t\t\t\t\tstep = -1;\n\t\t\t\t}\n\t\t\t\telse if (key == \"Tab\") {\n\t\t\t\t\tstep = 0;\n\t\t\t\t}\n\n\t\t\t\tif (step != null) {\n\t\t\t\t\tif (inversed) {\n\t\t\t\t\t\tstep *= -1;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.set(dir, axis.nextPosition(step * m));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _handleLineFocus() {\n\t\tthis._alwaysShow = this.get(\"alwaysShow\", false);\n\t\tthis.setAll({\n\t\t\tpositionX: this.getPrivate(\"positionX\", 0),\n\t\t\tpositionY: this.getPrivate(\"positionY\", 0),\n\t\t\talwaysShow: true\n\t\t});\n\n\t\tthis._handleLineMove(\"Tab\");\n\t}\n\n\tprotected _handleLineBlur() {\n\t\tif (this.lineX.isFocus() || this.lineY.isFocus()) {\n\t\t\tthis.setAll({\n\t\t\t\tpositionX: undefined,\n\t\t\t\tpositionY: undefined,\n\t\t\t\talwaysShow: this._alwaysShow\n\t\t\t});\n\t\t}\n\t}\n\n\tpublic _prepareChildren() {\n\t\tsuper._prepareChildren();\n\n\t\tif (this.isDirty(\"xAxis\")) {\n\t\t\tthis._tooltipX = false;\n\t\t\tconst xAxis = this.get(\"xAxis\");\n\n\t\t\tif (xAxis) {\n\t\t\t\tconst tooltip = xAxis.get(\"tooltip\");\n\t\t\t\tif (tooltip) {\n\t\t\t\t\tthis._tooltipX = true;\n\t\t\t\t\tthis._disposers.push(\n\t\t\t\t\t\ttooltip.on(\"pointTo\", () => {\n\t\t\t\t\t\t\tthis._updateXLine(tooltip);\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.isDirty(\"yAxis\")) {\n\t\t\tthis._tooltipY = false;\n\t\t\tconst yAxis = this.get(\"yAxis\");\n\n\t\t\tif (yAxis) {\n\t\t\t\tconst tooltip = yAxis.get(\"tooltip\");\n\t\t\t\tif (tooltip) {\n\t\t\t\t\tthis._tooltipY = true;\n\t\t\t\t\tthis._disposers.push(\n\t\t\t\t\t\ttooltip.on(\"pointTo\", () => {\n\t\t\t\t\t\t\tthis._updateYLine(tooltip);\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _handleSyncWith() {\n\t\tconst chart = this.chart;\n\t\tif (chart) {\n\t\t\tconst syncWith = this.get(\"syncWith\");\n\t\t\tconst otherCharts: Array = [];\n\t\t\tif (syncWith) {\n\t\t\t\t$array.each(syncWith, (cursor) => {\n\t\t\t\t\tconst chart = cursor.chart;\n\t\t\t\t\tif (chart) {\n\t\t\t\t\t\totherCharts.push(chart)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t\tchart._otherCharts = otherCharts;\n\t\t}\n\t}\n\n\tpublic _updateChildren() {\n\t\tsuper._updateChildren();\n\t\tthis._handleSyncWith();\n\n\t\tif (this.isDirty(\"positionX\") || this.isDirty(\"positionY\")) {\n\t\t\tconst positionX = this.get(\"positionX\");\n\t\t\tconst positionY = this.get(\"positionY\");\n\n\t\t\tif (positionX == null && positionY == null) {\n\t\t\t\tthis.hide(0);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis._movePoint = this.toGlobal(this._getPoint(this.get(\"positionX\", 0), this.get(\"positionY\", 0)));\n\t\t\t\tthis.handleMove();\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _updateXLine(tooltip: Tooltip) {\n\t\tlet x = $math.round(this._display.toLocal(tooltip.get(\"pointTo\", { x: 0, y: 0 })).x, 3);\n\t\tif (this._toX != x) {\n\t\t\tthis.lineX.animate({ key: \"x\", to: x, duration: tooltip.get(\"animationDuration\", 0), easing: tooltip.get(\"animationEasing\") });\n\t\t\tthis._toX = x;\n\t\t}\n\t}\n\n\tprotected _updateYLine(tooltip: Tooltip) {\n\t\tlet y = $math.round(this._display.toLocal(tooltip.get(\"pointTo\", { x: 0, y: 0 })).y, 3);\n\t\tif (this._toY != y) {\n\t\t\tthis.lineY.animate({ key: \"y\", to: y, duration: tooltip.get(\"animationDuration\", 0), easing: tooltip.get(\"animationEasing\") });\n\t\t\tthis._toY = y;\n\t\t}\n\t}\n\n\tprotected _drawLines() {\n\t\tthis.lineX.set(\"draw\", (display) => {\n\t\t\tdisplay.moveTo(0, 0);\n\t\t\tdisplay.lineTo(0, this.height());\n\t\t})\n\t\tthis.lineY.set(\"draw\", (display) => {\n\t\t\tdisplay.moveTo(0, 0);\n\t\t\tdisplay.lineTo(this.width(), 0);\n\t\t})\n\t}\n\n\tpublic updateCursor() {\n\t\tif (this.get(\"alwaysShow\")) {\n\t\t\tthis._movePoint = this.toGlobal(this._getPoint(this.get(\"positionX\", 0), this.get(\"positionY\", 0)));\n\t\t}\n\t\tthis.handleMove();\n\t}\n\n\tpublic _setChart(chart: XYChart): void {\n\t\tthis.chart = chart;\n\n\t\tthis._handleSyncWith();\n\n\t\tconst plotContainer = chart.plotContainer;\n\n\t\tthis.events.on(\"boundschanged\", () => {\n\t\t\tthis._disposers.push(this.setTimeout(() => {\n\t\t\t\tthis.updateCursor();\n\t\t\t}, 50))\n\t\t})\n\n\t\t//this._display.interactive = true;\n\t\tif ($utils.supports(\"touchevents\")) {\n\t\t\tthis._disposers.push(plotContainer.events.on(\"click\", (event) => {\n\t\t\t\tif ($utils.isTouchEvent(event.originalEvent)) {\n\t\t\t\t\tthis._handleMove(event);\n\t\t\t\t}\n\t\t\t}));\n\t\t\tthis._setUpTouch();\n\t\t}\n\n\t\tthis._disposers.push(plotContainer.events.on(\"pointerdown\", (event) => {\n\t\t\tthis._handleCursorDown(event);\n\t\t}));\n\n\t\tthis._disposers.push(plotContainer.events.on(\"globalpointerup\", (event) => {\n\t\t\tthis._handleCursorUp(event);\n\t\t\tif (!event.native && !this.isHidden()) {\n\t\t\t\tthis._handleMove(event);\n\t\t\t}\n\t\t}));\n\n\t\tthis._disposers.push(plotContainer.events.on(\"globalpointermove\", (event) => {\n\t\t\tif (!this.get(\"syncWith\")) {\n\t\t\t\tif ($object.keys(plotContainer._downPoints).length == 0 && !event.native && this.isHidden()) {\n\t\t\t\t\t// Ignore mouse movement if it originates on outside element and\n\t\t\t\t\t// we're not dragging.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._handleMove(event);\n\n\t\t\tif (Math.hypot(this._lastPoint2.x - event.point.x, this._lastPoint2.y - event.point.y) > 1) {\n\t\t\t\tthis._handleLineBlur();\n\t\t\t\tthis._lastPoint2 = event.point;\n\t\t\t}\n\t\t}));\n\n\t\tconst parent = this.parent;\n\t\tif (parent) {\n\t\t\tparent.children.moveValue(this.selection);\n\t\t}\n\t}\n\n\tprotected _inPlot(point: IPoint): boolean {\n\t\tconst chart = this.chart;\n\t\tif (chart) {\n\t\t\treturn chart.inPlot(point);\n\t\t}\n\t\treturn false;\n\t}\n\n\tprotected _handleCursorDown(event: ISpritePointerEvent) {\n\t\tif ((event.originalEvent as any).button == 2) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst rootPoint = event.point;\n\t\tlet local = this._display.toLocal(rootPoint);\n\t\tconst chart = this.chart;\n\n\t\tthis.selection.set(\"draw\", () => { });\n\n\t\tif (chart && this._inPlot(local)) {\n\t\t\tthis._downPoint = local;\n\n\t\t\tif (this.get(\"behavior\") != \"none\") {\n\t\t\t\tthis.selection.show();\n\n\t\t\t\tconst type = \"selectstarted\";\n\t\t\t\tif (this.events.isEnabled(type)) {\n\t\t\t\t\tthis.events.dispatch(type, { type: type, target: this, originalEvent: event.originalEvent });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet positionX = this._getPosition(local).x;\n\t\t\tlet positionY = this._getPosition(local).y;\n\n\t\t\tthis.setPrivate(\"downPositionX\", positionX);\n\t\t\tthis.setPrivate(\"downPositionY\", positionY);\n\t\t}\n\t}\n\n\tprotected _handleCursorUp(event: ISpritePointerEvent) {\n\t\t// TODO: handle multitouch\n\t\tif (this._downPoint) {\n\t\t\tconst behavior = this.get(\"behavior\", \"none\");\n\t\t\tif (behavior != \"none\") {\n\t\t\t\tif (behavior.charAt(0) === \"z\") {\n\t\t\t\t\tthis.selection.hide();\n\t\t\t\t}\n\n\t\t\t\tconst rootPoint = event.point;\n\t\t\t\tlet local = this._display.toLocal(rootPoint);\n\n\t\t\t\tconst downPoint = this._downPoint;\n\t\t\t\tconst moveThreshold = this.get(\"moveThreshold\", 1);\n\t\t\t\tif (local && downPoint) {\n\t\t\t\t\tlet dispatch = false;\n\t\t\t\t\tif (behavior === \"zoomX\" || behavior === \"zoomXY\" || behavior === \"selectX\" || behavior === \"selectXY\") {\n\t\t\t\t\t\tif (Math.abs(local.x - downPoint.x) > moveThreshold) {\n\t\t\t\t\t\t\tdispatch = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (behavior === \"zoomY\" || behavior === \"zoomXY\" || behavior === \"selectY\" || behavior === \"selectXY\") {\n\t\t\t\t\t\tif (Math.abs(local.y - downPoint.y) > moveThreshold) {\n\t\t\t\t\t\t\tdispatch = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (dispatch) {\n\t\t\t\t\t\tconst type = \"selectended\";\n\t\t\t\t\t\tif (this.events.isEnabled(type)) {\n\t\t\t\t\t\t\tthis.events.dispatch(type, { type: type, target: this, originalEvent: event.originalEvent });\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tconst type = \"selectcancelled\";\n\t\t\t\t\t\tif (this.events.isEnabled(type)) {\n\t\t\t\t\t\t\tthis.events.dispatch(type, { type: type, target: this, originalEvent: event.originalEvent });\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis._downPoint = undefined;\n\t}\n\n\tprotected _handleMove(event: ISpritePointerEvent) {\n\t\tif (this.getPrivate(\"visible\")) {\n\t\t\tconst chart = this.chart;\n\t\t\tif (chart && $object.keys(chart.plotContainer._downPoints).length > 1) {\n\t\t\t\tthis.set(\"forceHidden\", true)\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.set(\"forceHidden\", false)\n\t\t\t}\n\n\t\t\t// TODO: handle multitouch\n\t\t\tconst rootPoint = event.point;\n\t\t\tconst lastPoint = this._lastPoint;\n\n\t\t\tif (Math.round(lastPoint.x) === Math.round(rootPoint.x) && Math.round(lastPoint.y) === Math.round(rootPoint.y)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._lastPoint = rootPoint;\n\t\t\tthis.setPrivate(\"lastPoint\", rootPoint);\n\n\t\t\tthis.handleMove({ x: rootPoint.x, y: rootPoint.y }, false, event.originalEvent);\n\t\t}\n\t}\n\n\tprotected _getPosition(point: IPoint): IPoint {\n\t\treturn { x: point.x / this.width(), y: point.y / this.height() };\n\t}\n\n\t/**\n\t * Moves the cursor to X/Y coordinates within chart container (`point`).\n\t *\n\t * If `skipEvent` parameter is set to `true`, the move will not invoke\n\t * the `\"cursormoved\"` event.\n\t *\n\t * @param point X/Y to move cursor to\n\t * @param skipEvent Do not fire \"cursormoved\" event\n\t */\n\tpublic handleMove(point?: IPoint, skipEvent?: boolean, originalEvent?: IPointerEvent) {\n\t\tif (!point) {\n\t\t\tpoint = this._movePoint;\n\t\t}\n\n\t\tconst alwaysShow = this.get(\"alwaysShow\");\n\n\t\tif (!point) {\n\t\t\tthis.hide(0);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._movePoint = point;\n\t\tlet local = this._display.toLocal(point);\n\t\tlet chart = this.chart;\n\n\t\tif (chart && (this._inPlot(local) || this._downPoint)) {\n\t\t\tchart._movePoint = point;\n\n\t\t\tif (this.isHidden()) {\n\t\t\t\tthis.show();\n\n\t\t\t\tconst behavior = this.get(\"behavior\", \"\");\n\t\t\t\tif (behavior.charAt(0) == \"z\") {\n\t\t\t\t\tthis.selection.set(\"draw\", () => { });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet x = local.x;\n\t\t\tlet y = local.y;\n\n\t\t\tlet xyPos = this._getPosition(local);\n\n\t\t\tthis.setPrivate(\"point\", local);\n\n\t\t\tlet snapToSeries = this.get(\"snapToSeries\");\n\n\t\t\tif (this._downPoint) {\n\t\t\t\tsnapToSeries = undefined;\n\t\t\t}\n\n\t\t\tlet userPositionX = this.get(\"positionX\");\n\t\t\tlet positionX = xyPos.x;\n\n\t\t\tif ($type.isNumber(userPositionX)) {\n\t\t\t\tpositionX = userPositionX;\n\t\t\t}\n\n\t\t\tlet userPositionY = this.get(\"positionY\");\n\t\t\tlet positionY = xyPos.y;\n\n\t\t\tif ($type.isNumber(userPositionY)) {\n\t\t\t\tpositionY = userPositionY;\n\t\t\t}\n\n\t\t\tthis.setPrivate(\"positionX\", positionX);\n\t\t\tthis.setPrivate(\"positionY\", positionY);\n\n\t\t\tconst xy = this._getPoint(positionX, positionY);\n\t\t\tx = xy.x;\n\t\t\ty = xy.y;\n\n\t\t\tchart.xAxes.each((axis) => {\n\t\t\t\taxis._handleCursorPosition(positionX, snapToSeries);\n\t\t\t\tif (alwaysShow) {\n\t\t\t\t\taxis.handleCursorShow();\n\t\t\t\t}\n\t\t\t})\n\t\t\tchart.yAxes.each((axis) => {\n\t\t\t\taxis._handleCursorPosition(positionY, snapToSeries);\n\t\t\t\tif (alwaysShow) {\n\t\t\t\t\taxis.handleCursorShow();\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tif (!skipEvent) {\n\t\t\t\tchart._handleCursorPosition();\n\n\t\t\t\tconst type = \"cursormoved\";\n\t\t\t\tif (this.events.isEnabled(type)) {\n\t\t\t\t\tthis.events.dispatch(type, { type: type, target: this, point: point, originalEvent: originalEvent });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._updateLines(x, y);\n\n\t\t\tchart.arrangeTooltips();\n\t\t}\n\t\telse if (!this._downPoint) {\n\t\t\tif (!alwaysShow) {\n\t\t\t\tthis.hide(0);\n\n\t\t\t\tconst type = \"cursorhidden\";\n\t\t\t\tif (this.events.isEnabled(type)) {\n\t\t\t\t\tthis.events.dispatch(type, { type: type, target: this });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this._downPoint && this.get(\"behavior\") != \"none\") {\n\t\t\tthis._updateSelection(local)\n\t\t}\n\t}\n\n\tprotected _getPoint(positionX: number, positionY: number): IPoint {\n\t\treturn { x: this.width() * positionX, y: this.height() * positionY };\n\t}\n\n\n\tprotected _updateLines(x: number, y: number) {\n\t\tif (!this._tooltipX) {\n\t\t\tthis.lineX.set(\"x\", x);\n\t\t}\n\t\tif (!this._tooltipY) {\n\t\t\tthis.lineY.set(\"y\", y);\n\t\t}\n\n\t\tthis._drawLines();\n\t}\n\n\tprotected _updateSelection(point: IPoint) {\n\t\tconst selection = this.selection;\n\t\tconst behavior = this.get(\"behavior\");\n\t\tconst w = this.width();\n\t\tconst h = this.height();\n\n\t\tif (point.x < 0) {\n\t\t\tpoint.x = 0;\n\t\t}\n\n\t\tif (point.x > w) {\n\t\t\tpoint.x = w;\n\t\t}\n\n\t\tif (point.y < 0) {\n\t\t\tpoint.y = 0;\n\t\t}\n\n\t\tif (point.y > h) {\n\t\t\tpoint.y = h;\n\t\t}\n\n\t\tselection.set(\"draw\", (display) => {\n\t\t\tconst downPoint = this._downPoint;\n\t\t\tif (downPoint) {\n\t\t\t\tif (behavior === \"zoomXY\" || behavior === \"selectXY\") {\n\t\t\t\t\tdisplay.moveTo(downPoint.x, downPoint.y);\n\t\t\t\t\tdisplay.lineTo(downPoint.x, point.y);\n\t\t\t\t\tdisplay.lineTo(point.x, point.y);\n\t\t\t\t\tdisplay.lineTo(point.x, downPoint.y);\n\t\t\t\t\tdisplay.lineTo(downPoint.x, downPoint.y);\n\t\t\t\t}\n\t\t\t\telse if (behavior === \"zoomX\" || behavior === \"selectX\") {\n\t\t\t\t\tdisplay.moveTo(downPoint.x, 0);\n\t\t\t\t\tdisplay.lineTo(downPoint.x, h);\n\t\t\t\t\tdisplay.lineTo(point.x, h);\n\t\t\t\t\tdisplay.lineTo(point.x, 0);\n\t\t\t\t\tdisplay.lineTo(downPoint.x, 0);\n\t\t\t\t}\n\t\t\t\telse if (behavior === \"zoomY\" || behavior === \"selectY\") {\n\t\t\t\t\tdisplay.moveTo(0, downPoint.y);\n\t\t\t\t\tdisplay.lineTo(w, downPoint.y);\n\t\t\t\t\tdisplay.lineTo(w, point.y);\n\t\t\t\t\tdisplay.lineTo(0, point.y);\n\t\t\t\t\tdisplay.lineTo(0, downPoint.y);\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\tprotected _onHide() {\n\t\tif (this.isHidden()) {\n\t\t\tlet chart = this.chart;\n\t\t\tif (chart) {\n\n\t\t\t\tchart.xAxes.each((axis) => {\n\t\t\t\t\taxis.handleCursorHide();\n\t\t\t\t})\n\t\t\t\tchart.yAxes.each((axis) => {\n\t\t\t\t\taxis.handleCursorHide();\n\t\t\t\t})\n\t\t\t\tchart.series.each((series) => {\n\t\t\t\t\tseries.handleCursorHide();\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tsuper._onHide();\n\t}\n\n\tprotected _onShow() {\n\t\tif (!this.isHidden()) {\n\t\t\tlet chart = this.chart;\n\t\t\tif (chart) {\n\t\t\t\tchart.xAxes.each((axis) => {\n\t\t\t\t\taxis.handleCursorShow();\n\t\t\t\t})\n\t\t\t\tchart.yAxes.each((axis) => {\n\t\t\t\t\taxis.handleCursorShow();\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tsuper._onShow();\n\t}\n\n\tprotected _dispose() {\n\t\tsuper._dispose();\n\t\tthis.selection.dispose();\n\t}\n}\n","import type { AxisRenderer } from \"./AxisRenderer\";\nimport type { AxisLabel } from \"./AxisLabel\";\nimport type { AxisTick } from \"./AxisTick\";\nimport type { Graphics } from \"../../../core/render/Graphics\";\nimport type { Grid } from \"./Grid\";\nimport type { AxisBullet } from \"./AxisBullet\";\nimport type { XYChart } from \"../XYChart\";\nimport type { XYSeries, IXYSeriesDataItem } from \"../series/XYSeries\";\nimport type { Animation } from \"../../../core/util/Entity\";\nimport type { Tooltip } from \"../../../core/render/Tooltip\";\nimport type { Root } from \"../../../core/Root\";\n\nimport { DataItem } from \"../../../core/render/Component\";\nimport { Component, IComponentSettings, IComponentPrivate, IComponentEvents, IComponentDataItem } from \"../../../core/render/Component\";\nimport { Container } from \"../../../core/render/Container\";\nimport { p100 } from \"../../../core/util/Percent\";\nimport { List } from \"../../../core/util/List\";\nimport { Rectangle } from \"../../../core/render/Rectangle\";\n\nimport * as $array from \"../../../core/util/Array\";\nimport * as $type from \"../../../core/util/Type\";\nimport * as $utils from \"../../../core/util/Utils\";\n\n\n\nexport interface IAxisSettings extends IComponentSettings {\n\t/**\n\t * A renderer object which is responsible of rendering visible axis elements.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/#Axis_renderer} for more info\n\t */\n\trenderer: R;\n\n\t/**\n\t * The initial relative zoom start position of the axis.\n\t *\n\t * E.g. stting it to `0.1` will pre-zoom axis to 10% from the start.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/zoom-and-pan/#Pre_zooming_axes} for more info\n\t */\n\tstart?: number;\n\n\t/**\n\t * The initial relative zoom end position of the axis.\n\t *\n\t * E.g. stting it to `0.9` will pre-zoom axis to 10% from the end.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/zoom-and-pan/#Pre_zooming_axes} for more info\n\t */\n\tend?: number;\n\n\t/**\n\t * Maximum number of times the scope of the axis could auto-zoom-in.\n\t *\n\t * This is to prevent axis jumping too drastically when scrolling/zooming.\n\t *\n\t * @default 1000\n\t */\n\tmaxZoomFactor?: number | null;\n\n\t/**\n\t * Maximum number of axis elements to show at a time.\n\t *\n\t * E.g. for a [[CategoryAxis]] that would be number of categories.\n\t * For a [[DateAxis]] it would be number of `baseInterval`.\n\t *\n\t * The axis will not allow to be zoomed out beyond this number.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/zoom-and-pan/#Limiting_zoom_scope} for more info\n\t */\n\tmaxZoomCount?: number;\n\n\t/**\n\t * Minimum number of axis elements to show at a time.\n\t *\n\t * E.g. for a [[CategoryAxis]] that would be number of categories.\n\t * For a [[DateAxis]] it would be number of `baseInterval`.\n\t *\n\t * The axis will not allow to be zoomed in beyond this number.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/zoom-and-pan/#Limiting_zoom_scope} for more info\n\t */\n\tminZoomCount?: number;\n\n\t/**\n\t * Base value of the axis.\n\t */\n\tbaseValue?: number;\n\n\t/**\n\t * If set to `false` the axis will be exempt when chart is panned\n\t * horizontally, and will keep its current position.`\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/zoom-and-pan/#Excluding_axes_from_pan_or_zoom} for more info\n\t */\n\tpanX?: boolean;\n\n\t/**\n\t * If set to `false` the axis will be exempt when chart is panned\n\t * vertically, and will keep its current position.`\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/zoom-and-pan/#Excluding_axes_from_pan_or_zoom} for more info\n\t */\n\tpanY?: boolean;\n\n\t/**\n\t * If set to `false` the axis will be exempt when chart is zoomed\n\t * horizontally, and will keep its current zoom/position.`\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/zoom-and-pan/#Excluding_axes_from_pan_or_zoom} for more info\n\t */\n\tzoomX?: boolean;\n\n\t/**\n\t * If set to `false` the axis will be exempt when chart is zoomed\n\t * vertically, and will keep its current zoom/position.`\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/zoom-and-pan/#Excluding_axes_from_pan_or_zoom} for more info\n\t */\n\tzoomY?: boolean;\n\n\t/**\n\t * Set this to `false` to prevent axis from being zoomed.\n\t */\n\tzoomable?:boolean;\n\n\t/**\n\t * A relative distance the axis is allowed to be zoomed/panned beyond its\n\t * actual scope.\n\t *\n\t * @default 0.1\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/zoom-and-pan/#Over_zooming} for more info\n\t */\n\tmaxDeviation?: number;\n\n\t/**\n\t * [[Tooltip]] element to use for axis.\n\t */\n\ttooltip?: Tooltip;\n\n\t/**\n\t * `tooltipLocation` indicates\n\t * which relative place to snap to: `0` beginning, `0.5` - middle, `1` - end.\n\t *\n\t * @default 0.5\n\t */\n\ttooltipLocation?: number;\n\n\t/**\n\t * Should tooltip snap to the `tooltipLocation` (`true`) or follow cursor.\n\t *\n\t * @default true\n\t */\n\tsnapTooltip?: boolean;\n\n\t/**\n\t * If set to `true` (default) the axis width will stay constant across all\n\t * zooms, even if actual length of all visible labels changes.\n\t *\n\t * @default true\n\t */\n\tfixAxisSize?: boolean;\n\n\t/**\n\t * A function that will be used to create bullets on each cell.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Axis_bullets} for more info\n\t */\n\tbullet?: (root: Root, axis: Axis, dataItem: DataItem) => AxisBullet;\n}\n\nexport interface IAxisEvents extends IComponentEvents {\n}\n\nexport interface IAxisPrivate extends IComponentPrivate {\n\n\t/**\n\t * @ignore\n\t */\n\tname?: \"value\" | \"date\" | \"category\";\n\n\t/**\n\t * @ignore\n\t */\n\tupdateScrollbar?: boolean;\n\n\t/**\n\t * @ignore\n\t */\n\tmaxZoomFactor?: number | null;\n\n\t/**\n\t * Saves position to which tooltip points.\n\t */\n\ttooltipPosition?: number;\n\n\t/**\n\t * Width in pixels between grid lines (read-only).\n\t * \n\t * It might not be exact, as [[DateAxis]] can have grids at irregular\n\t * intervals.\n\t * \n\t * Could be used to detect when size changes and to adjust labels for them\n\t * not to overlap.\n\t */\n\tcellWidth?: number;\n\n}\n\nexport interface IAxisDataItem extends IComponentDataItem {\n\n\t/**\n\t * Axis label element.\n\t */\n\tlabel?: AxisLabel;\n\n\t/**\n\t * Tick element.\n\t */\n\ttick?: AxisTick;\n\n\t/**\n\t * Grid line element.\n\t */\n\tgrid?: Grid;\n\n\t/**\n\t * Axis fill element.\n\t */\n\taxisFill?: Graphics;\n\n\t/**\n\t * Bullet element.\n\t */\n\tbullet?: AxisBullet;\n\n\t/**\n\t * Indicates if this data item represents an axis range.\n\t */\n\tisRange?: boolean;\n\n\t/**\n\t * If set to `true`, the grid and axis fill of this data item will be drawn\n\t * above series.\n\t *\n\t * NOTE: this needs to be set **before** crating an axis range. Updating this\n\t * dynamically won't have any effect.\n\t *\n\t * NOTE: if you need all grid to be drawn above series, you can brig it to\n\t * front with `chart.gridContainer.toFront();`.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/axis-ranges/#Grid_fill_above_series} for more info\n\t * @default false\n\t */\n\tabove?: boolean\n\n}\n\n/**\n * A base class for all axes.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/#Adding_axes} for more info\n */\nexport abstract class Axis extends Component {\n\tpublic static className: string = \"Axis\";\n\tpublic static classNames: Array = Component.classNames.concat([Axis.className]);\n\n\tdeclare public _settings: IAxisSettings;\n\tdeclare public _privateSettings: IAxisPrivate;\n\tdeclare public _dataItemSettings: IAxisDataItem;\n\tdeclare public _events: IAxisEvents;\n\n\tdeclare public _seriesType: XYSeries;\n\n\tprotected _series: Array = [];\n\n\tpublic _isPanning: boolean = false;\n\n\t/**\n\t * Array of minor data items.\n\t */\n\tpublic minorDataItems: Array> = [];\n\n\t/**\n\t * A [[Container]] that holds all the axis label elements.\n\t *\n\t * @default Container.new()\n\t */\n\tpublic readonly labelsContainer: Container = this.children.push(Container.new(this._root, {}));\n\n\t/**\n\t * A [[Container]] that holds all the axis grid and fill elements.\n\t *\n\t * @default Container.new()\n\t */\n\tpublic readonly gridContainer: Container = Container.new(this._root, { width: p100, height: p100 });\n\n\t/**\n\t * A [[Container]] that holds axis grid elements which goes above the series.\n\t *\n\t * @default Container.new()\n\t */\n\tpublic readonly topGridContainer: Container = Container.new(this._root, { width: p100, height: p100 });\n\n\t/**\n\t * A [[Container]] that holds all the axis bullet elements.\n\t *\n\t * @default new Container\n\t */\n\tpublic readonly bulletsContainer: Container = this.children.push(Container.new(this._root, { isMeasured: false, width: p100, height: p100, position: \"absolute\" }));\n\n\t/**\n\t * A referenece to the the chart the axis belongs to.\n\t */\n\tpublic chart: XYChart | undefined;\n\n\tprotected _rangesDirty: Boolean = false;\n\n\tpublic _panStart: number = 0;\n\tpublic _panEnd: number = 1;\n\n\tprotected _sAnimation?: Animation;\n\tprotected _eAnimation?: Animation;\n\n\tpublic _skipSync: boolean = false;\n\n\t/**\n\t * A list of axis ranges.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/axis-ranges/} for more info\n\t * @default new List()\n\t */\n\tpublic readonly axisRanges: List> = new List();\n\n\tpublic _seriesAxisRanges: Array> = [];\n\n\t/**\n\t * A control label that is invisible but is used to keep width the width of\n\t * the axis constant.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/value-axis/#Ghost_label} for more info\n\t */\n\tpublic ghostLabel!: AxisLabel;\n\n\tprotected _cursorPosition: number = -1;\n\n\tprotected _snapToSeries?: Array;\n\n\tpublic _seriesValuesDirty = false;\n\n\tpublic _seriesAdded = false;\n\n\t/**\n\t * A container above the axis that can be used to add additional stuff into\n\t * it. For example a legend, label, or an icon.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/axis-headers/} for more info\n\t * @default new Container\n\t */\n\tpublic axisHeader: Container = this.children.push(Container.new(this._root, {\n\t\tthemeTags: [\"axis\", \"header\"],\n\t\tposition: \"absolute\",\n\t\tbackground: Rectangle.new(this._root, {\n\t\t\tthemeTags: [\"header\", \"background\"],\n\t\t\tfill: this._root.interfaceColors.get(\"background\")\n\t\t})\n\t}));\n\n\tpublic _bullets: { [index: string]: AxisBullet } = {};\n\n\tprotected _dispose() {\n\t\t// these could be in other parents, so disposing just in case\n\t\tthis.gridContainer.dispose();\n\t\tthis.topGridContainer.dispose();\n\t\tthis.bulletsContainer.dispose();\n\t\tthis.labelsContainer.dispose();\n\t\tthis.axisHeader.dispose();\n\t\tsuper._dispose();\n\t}\n\n\tprotected _afterNew() {\n\t\tsuper._afterNew();\n\n\t\tthis.setPrivate(\"updateScrollbar\", true);\n\n\t\tthis._disposers.push(this.axisRanges.events.onAll((change) => {\n\t\t\tif (change.type === \"clear\") {\n\t\t\t\t$array.each(change.oldValues, (dataItem) => {\n\t\t\t\t\tthis.disposeDataItem(dataItem);\n\t\t\t\t});\n\t\t\t} else if (change.type === \"push\") {\n\t\t\t\tthis._processAxisRange(change.newValue, [\"range\"]);\n\t\t\t} else if (change.type === \"setIndex\") {\n\t\t\t\tthis._processAxisRange(change.newValue, [\"range\"]);\n\t\t\t} else if (change.type === \"insertIndex\") {\n\t\t\t\tthis._processAxisRange(change.newValue, [\"range\"]);\n\t\t\t} else if (change.type === \"removeIndex\") {\n\t\t\t\tthis.disposeDataItem(change.oldValue);\n\t\t\t} else if (change.type === \"moveIndex\") {\n\t\t\t\tthis._processAxisRange(change.value, [\"range\"]);\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Unknown IStreamEvent type\");\n\t\t\t}\n\t\t}))\n\n\t\tconst renderer = this.get(\"renderer\");\n\t\tif (renderer) {\n\t\t\trenderer.axis = this;\n\t\t\trenderer.processAxis();\n\t\t}\n\t\tthis.children.push(renderer);\n\t\tthis.ghostLabel = renderer.makeLabel(new DataItem(this, undefined, {}), []);\n\t\tthis.ghostLabel.adapters.disable(\"text\");\n\t\tthis.ghostLabel.setAll({ opacity: 0, tooltipText: undefined, tooltipHTML: undefined, interactive: false });\n\t\tthis.ghostLabel.events.disable();\n\t}\n\n\tprotected _updateFinals(_start: number, _end: number) {\n\n\t}\n\n\t/**\n\t * Zooms the axis to relative locations.\n\t *\n\t * Both `start` and `end` are relative: 0 means start of the axis, 1 - end.\n\t *\n\t * @param start Relative start\n\t * @param end Relative end\n\t * @param duration Duration of the zoom animation in milliseconds\n\t * @return Zoom animation\n\t */\n\tpublic zoom(start: number, end: number, duration?: number, priority?: \"start\" | \"end\"): Animation | Animation | undefined {\n\t\tif(this.get(\"zoomable\", true)){\n\t\t\tthis._updateFinals(start, end);\n\n\t\t\tif (this.get(\"start\") !== start || this.get(\"end\") != end) {\n\t\t\t\tlet sAnimation = this._sAnimation;\n\t\t\t\tlet eAnimation = this._eAnimation;\n\n\t\t\t\tlet maxDeviation = this.get(\"maxDeviation\", 0.5) * Math.min(1, (end - start));\n\n\t\t\t\tif (start < - maxDeviation) {\n\t\t\t\t\tstart = -maxDeviation;\n\t\t\t\t}\n\n\t\t\t\tif (end > 1 + maxDeviation) {\n\t\t\t\t\tend = 1 + maxDeviation;\n\t\t\t\t}\n\n\t\t\t\tif (start > end) {\n\t\t\t\t\t[start, end] = [end, start];\n\t\t\t\t}\n\n\t\t\t\tif (!$type.isNumber(duration)) {\n\t\t\t\t\tduration = this.get(\"interpolationDuration\", 0);\n\t\t\t\t}\n\n\t\t\t\tif (!priority) {\n\t\t\t\t\tpriority = \"end\";\n\t\t\t\t}\n\n\t\t\t\tlet maxZoomFactor = this.getPrivate(\"maxZoomFactor\", this.get(\"maxZoomFactor\", 100));\n\t\t\t\tlet maxZoomFactorReal = maxZoomFactor;\n\n\t\t\t\tif (end === 1 && start !== 0) {\n\t\t\t\t\tif (start < this.get(\"start\", 0)) {\n\t\t\t\t\t\tpriority = \"start\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tpriority = \"end\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (start === 0 && end !== 1) {\n\t\t\t\t\tif (end > this.get(\"end\", 1)) {\n\t\t\t\t\t\tpriority = \"end\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tpriority = \"start\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet minZoomCount = this.get(\"minZoomCount\", 0);\n\t\t\t\tlet maxZoomCount = this.get(\"maxZoomCount\", Infinity);\n\n\t\t\t\tif ($type.isNumber(minZoomCount)) {\n\t\t\t\t\tmaxZoomFactor = maxZoomFactorReal / minZoomCount;\n\t\t\t\t}\n\n\t\t\t\tlet minZoomFactor: number = 1;\n\n\t\t\t\tif ($type.isNumber(maxZoomCount)) {\n\t\t\t\t\tminZoomFactor = maxZoomFactorReal / maxZoomCount;\n\t\t\t\t}\n\n\t\t\t\t// most likely we are dragging left scrollbar grip here, so we tend to modify end\n\t\t\t\tif (priority === \"start\") {\n\t\t\t\t\tif (maxZoomCount > 0) {\n\t\t\t\t\t\t// add to the end\n\t\t\t\t\t\tif (1 / (end - start) < minZoomFactor) {\n\t\t\t\t\t\t\tend = start + 1 / minZoomFactor;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// add to the end\n\t\t\t\t\tif (1 / (end - start) > maxZoomFactor) {\n\t\t\t\t\t\tend = start + 1 / maxZoomFactor;\n\t\t\t\t\t}\n\t\t\t\t\t//unless end is > 0\n\t\t\t\t\tif (end > 1 && end - start < 1 / maxZoomFactor) {\n\t\t\t\t\t\t//end = 1;\n\t\t\t\t\t\tstart = end - 1 / maxZoomFactor;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// most likely we are dragging right, so we modify left\n\t\t\t\telse {\n\t\t\t\t\tif (maxZoomCount > 0) {\n\t\t\t\t\t\t// add to the end\n\t\t\t\t\t\tif (1 / (end - start) < minZoomFactor) {\n\t\t\t\t\t\t\tstart = end - 1 / minZoomFactor;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// remove from start\n\t\t\t\t\tif (1 / (end - start) > maxZoomFactor) {\n\t\t\t\t\t\tstart = end - 1 / maxZoomFactor;\n\t\t\t\t\t}\n\t\t\t\t\tif (start < 0 && end - start < 1 / maxZoomFactor) {\n\t\t\t\t\t\t//start = 0;\n\t\t\t\t\t\tend = start + 1 / maxZoomFactor;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (1 / (end - start) > maxZoomFactor) {\n\t\t\t\t\tend = start + 1 / maxZoomFactor;\n\t\t\t\t}\n\n\t\t\t\tif (1 / (end - start) > maxZoomFactor) {\n\t\t\t\t\tstart = end - 1 / maxZoomFactor;\n\t\t\t\t}\n\n\t\t\t\tif (maxZoomCount != null && minZoomCount != null && (start == this.get(\"start\") && end == this.get(\"end\"))) {\n\t\t\t\t\tconst chart = this.chart;\n\t\t\t\t\tif (chart) {\n\t\t\t\t\t\tchart._handleAxisSelection(this, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (((sAnimation && sAnimation.playing && sAnimation.to == start) || this.get(\"start\") == start) && ((eAnimation && eAnimation.playing && eAnimation.to == end) || this.get(\"end\") == end)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\n\t\t\t\tif (duration > 0) {\n\t\t\t\t\tlet easing = this.get(\"interpolationEasing\");\n\t\t\t\t\tlet sAnimation, eAnimation;\n\t\t\t\t\tif (this.get(\"start\") != start) {\n\t\t\t\t\t\tsAnimation = this.animate({ key: \"start\", to: start, duration: duration, easing: easing });\n\t\t\t\t\t}\n\t\t\t\t\tif (this.get(\"end\") != end) {\n\t\t\t\t\t\teAnimation = this.animate({ key: \"end\", to: end, duration: duration, easing: easing });\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._sAnimation = sAnimation;\n\t\t\t\t\tthis._eAnimation = eAnimation;\n\n\t\t\t\t\tif (sAnimation) {\n\t\t\t\t\t\treturn sAnimation;\n\t\t\t\t\t}\n\t\t\t\t\telse if (eAnimation) {\n\t\t\t\t\t\treturn eAnimation;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.set(\"start\", start);\n\t\t\t\t\tthis.set(\"end\", end);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (this._sAnimation) {\n\t\t\t\t\tthis._sAnimation.stop();\n\t\t\t\t}\n\t\t\t\tif (this._eAnimation) {\n\t\t\t\t\tthis._eAnimation.stop();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * A list of series using this axis.\n\t *\n\t * @return Series\n\t */\n\tpublic get series(): Array {\n\t\treturn this._series;\n\t}\n\n\n\tpublic _processAxisRange(dataItem: DataItem, themeTags: Array) {\n\t\tdataItem.setRaw(\"isRange\", true);\n\t\tthis._createAssets(dataItem, themeTags);\n\t\tthis._rangesDirty = true;\n\t\tthis._prepareDataItem(dataItem);\n\n\t\tconst above = dataItem.get(\"above\");\n\t\tconst container = this.topGridContainer;\n\n\t\tconst grid = dataItem.get(\"grid\");\n\t\tif (above && grid) {\n\t\t\tcontainer.children.moveValue(grid);\n\t\t}\n\n\t\tconst fill = dataItem.get(\"axisFill\");\n\t\tif (above && fill) {\n\t\t\tcontainer.children.moveValue(fill);\n\t\t}\n\t}\n\n\tpublic _prepareDataItem(_dataItem: DataItem, _index?: number) { }\n\n\t/**\n\t * @ignore\n\t */\n\tpublic abstract getX(_value: any, _location: number, baseValue?: any): number;\n\n\t/**\n\t * @ignore\n\t */\n\tpublic abstract getY(_value: any, _location: number, baseValue?: any): number;\n\n\t/**\n\t * @ignore\n\t */\n\tpublic abstract getDataItemCoordinateX(_dataItem: DataItem, _field: string, _cellLocation?: number, _axisLocation?: number): number;\n\n\t/**\n\t * @ignore\n\t */\n\tpublic abstract getDataItemCoordinateY(_dataItem: DataItem, _field: string, _cellLocation?: number, _axisLocation?: number): number;\n\n\t/**\n\t * @ignore\n\t */\n\tpublic abstract getDataItemPositionX(_dataItem: DataItem, _field: string, _cellLocation?: number, _axisLocation?: number): number;\n\n\t/**\n\t * @ignore\n\t */\n\tpublic abstract getDataItemPositionY(_dataItem: DataItem, _field: string, _cellLocation?: number, _axisLocation?: number): number;\n\n\t/**\n\t * @ignore\n\t */\n\tpublic markDirtyExtremes() {\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic markDirtySelectionExtremes() {\n\t}\n\n\tpublic _calculateTotals() {\n\t}\n\n\tprotected _updateAxisRanges() {\n\t\tthis._bullets = {};\n\t\tthis.axisRanges.each((axisRange) => {\n\t\t\tthis._prepareDataItem(axisRange);\n\t\t})\n\n\t\t$array.each(this._seriesAxisRanges, (axisRange) => {\n\t\t\tthis._prepareDataItem(axisRange);\n\t\t})\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic abstract baseValue(): any;\n\n\tpublic _prepareChildren() {\n\t\tsuper._prepareChildren();\n\n\t\tif (this.get(\"fixAxisSize\")) {\n\t\t\tthis.ghostLabel.set(\"visible\", true);\n\t\t}\n\t\telse {\n\t\t\tthis.ghostLabel.set(\"visible\", false);\n\t\t}\n\n\t\tif (this.isDirty(\"start\") || this.isDirty(\"end\")) {\n\t\t\tconst chart = this.chart;\n\t\t\tif (chart) {\n\t\t\t\tchart._updateCursor();\n\t\t\t}\n\n\t\t\tlet start = this.get(\"start\", 0);\n\t\t\tlet end = this.get(\"end\", 1);\n\n\t\t\tlet maxDeviation = this.get(\"maxDeviation\", 0.5) * Math.min(1, (end - start));\n\n\t\t\tif (start < -maxDeviation) {\n\t\t\t\tlet delta = start + maxDeviation;\n\t\t\t\tstart = -maxDeviation;\n\t\t\t\tthis.setRaw(\"start\", start);\n\t\t\t\tif (this.isDirty(\"end\")) {\n\t\t\t\t\tthis.setRaw(\"end\", end - delta);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (end > 1 + maxDeviation) {\n\t\t\t\tlet delta = end - 1 - maxDeviation;\n\t\t\t\tend = 1 + maxDeviation;\n\t\t\t\tthis.setRaw(\"end\", end);\n\n\t\t\t\tif (this.isDirty(\"start\")) {\n\t\t\t\t\tthis.setRaw(\"start\", start - delta);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\tconst renderer = this.get(\"renderer\");\n\t\trenderer._start = this.get(\"start\")!;\n\t\trenderer._end = this.get(\"end\")!;\n\t\trenderer._inversed = renderer.get(\"inversed\", false);\n\t\trenderer._axisLength = renderer.axisLength() / (renderer._end - renderer._start);\n\t\trenderer._updateLC();\n\n\t\tif (this.isDirty(\"tooltip\")) {\n\t\t\tconst tooltip = this.get(\"tooltip\");\n\t\t\tif (tooltip) {\n\t\t\t\tconst rendererTags = renderer.get(\"themeTags\");\n\t\t\t\ttooltip.addTag(\"axis\");\n\t\t\t\ttooltip.addTag(this.className.toLowerCase());\n\t\t\t\ttooltip._applyThemes();\n\n\t\t\t\tif (rendererTags) {\n\t\t\t\t\ttooltip.set(\"themeTags\", $utils.mergeTags(tooltip.get(\"themeTags\"), rendererTags));\n\t\t\t\t\ttooltip.label._applyThemes();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic _updateTooltipBounds() {\n\t\tconst tooltip = this.get(\"tooltip\")!;\n\t\tif (tooltip) {\n\t\t\tthis.get(\"renderer\").updateTooltipBounds(tooltip);\n\t\t}\n\t}\n\n\tpublic _updateBounds() {\n\t\tsuper._updateBounds();\n\t\tthis._updateTooltipBounds();\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic processChart(chart: XYChart) {\n\t\tthis.chart = chart;\n\t\tconst renderer = this.get(\"renderer\");\n\n\t\trenderer.chart = chart;\n\t\tchart.gridContainer.children.push(this.gridContainer);\n\t\tchart.topGridContainer.children.push(this.topGridContainer);\n\n\t\tchart.axisHeadersContainer.children.push(this.axisHeader);\n\n\t\tthis.on(\"start\", () => {\n\t\t\tchart._handleAxisSelection(this);\n\t\t});\n\t\tthis.on(\"end\", () => {\n\t\t\tchart._handleAxisSelection(this);\n\t\t});\n\n\t\tchart.plotContainer.onPrivate(\"width\", () => {\n\t\t\tthis.markDirtySize();\n\t\t});\n\t\tchart.plotContainer.onPrivate(\"height\", () => {\n\t\t\tthis.markDirtySize();\n\t\t});\n\n\t\tchart.processAxis(this);\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic hideDataItem(dataItem: DataItem): Promise {\n\t\tthis._toggleFHDataItem(dataItem, true);\n\t\treturn super.hideDataItem(dataItem);\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic showDataItem(dataItem: DataItem): Promise {\n\t\tthis._toggleFHDataItem(dataItem, false);\n\t\treturn super.showDataItem(dataItem);\n\t}\n\n\tpublic _toggleFHDataItem(dataItem: DataItem, forceHidden: boolean) {\n\t\tconst fh = \"forceHidden\";\n\t\tconst label = dataItem.get(\"label\");\n\t\tif (label) {\n\t\t\tlabel.set(fh, forceHidden);\n\t\t}\n\t\tconst grid = dataItem.get(\"grid\");\n\t\tif (grid) {\n\t\t\tgrid.set(fh, forceHidden);\n\t\t}\n\t\tconst tick = dataItem.get(\"tick\");\n\t\tif (tick) {\n\t\t\ttick.set(fh, forceHidden);\n\t\t}\n\t\tconst axisFill = dataItem.get(\"axisFill\");\n\t\tif (axisFill) {\n\t\t\taxisFill.set(fh, forceHidden);\n\t\t}\n\n\t\tconst bullet = dataItem.get(\"bullet\");\n\t\tif (bullet) {\n\t\t\tconst sprite = bullet.get(\"sprite\");\n\t\t\tif (sprite) {\n\t\t\t\tsprite.set(fh, forceHidden);\n\t\t\t}\n\t\t}\n\t}\n\n\n\tpublic _toggleDataItem(dataItem: DataItem, visible: boolean) {\n\t\tconst label = dataItem.get(\"label\");\n\t\tconst v = \"visible\";\n\t\tif (label) {\n\t\t\tlabel.setPrivate(v, visible);\n\t\t}\n\t\tconst grid = dataItem.get(\"grid\");\n\t\tif (grid) {\n\t\t\tgrid.setPrivate(v, visible);\n\t\t}\n\t\tconst tick = dataItem.get(\"tick\");\n\t\tif (tick) {\n\t\t\ttick.setPrivate(v, visible);\n\t\t}\n\t\tconst axisFill = dataItem.get(\"axisFill\");\n\t\tif (axisFill) {\n\t\t\taxisFill.setPrivate(v, visible);\n\t\t}\n\n\t\tconst bullet = dataItem.get(\"bullet\");\n\t\tif (bullet) {\n\t\t\tconst sprite = bullet.get(\"sprite\");\n\t\t\tif (sprite) {\n\t\t\t\tsprite.setPrivate(v, visible);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic abstract basePosition(): number;\n\n\tpublic _createAssets(dataItem: DataItem, tags: Array, minor?: boolean) {\n\t\tconst renderer = this.get(\"renderer\");\n\t\tlet m = \"minor\";\n\n\t\tconst label = dataItem.get(\"label\");\n\t\tif (!label) {\n\t\t\trenderer.makeLabel(dataItem, tags);\n\t\t}\n\t\telse {\n\t\t\tlet themeTags = label.get(\"themeTags\");\n\t\t\tlet remove = false;\n\t\t\tif (minor) {\n\t\t\t\tif (themeTags?.indexOf(m) == -1) {\n\t\t\t\t\tremove = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (themeTags?.indexOf(m) != -1) {\n\t\t\t\t\tremove = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (remove) {\n\t\t\t\tlabel.parent?.children.removeValue(label);\n\t\t\t\trenderer.makeLabel(dataItem, tags);\n\t\t\t\tlabel.dispose();\n\t\t\t\trenderer.labels.removeValue(label);\n\t\t\t}\n\t\t}\n\n\t\tconst grid = dataItem.get(\"grid\");\n\n\t\tif (!grid) {\n\t\t\trenderer.makeGrid(dataItem, tags);\n\t\t}\n\t\telse {\n\t\t\tlet themeTags = grid.get(\"themeTags\");\n\t\t\tlet remove = false;\n\t\t\tif (minor) {\n\t\t\t\tif (themeTags?.indexOf(m) == -1) {\n\t\t\t\t\tremove = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (themeTags?.indexOf(m) != -1) {\n\t\t\t\t\tremove = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (remove) {\n\t\t\t\tgrid.parent?.children.removeValue(grid);\n\t\t\t\trenderer.makeGrid(dataItem, tags);\n\t\t\t\tgrid.dispose();\n\t\t\t\trenderer.grid.removeValue(grid);\n\t\t\t}\n\t\t}\n\n\t\tconst tick = dataItem.get(\"tick\");\n\t\tif (!tick) {\n\t\t\trenderer.makeTick(dataItem, tags);\n\t\t}\n\t\telse {\n\t\t\tlet remove = false;\n\t\t\tlet themeTags = tick.get(\"themeTags\");\n\t\t\tif (minor) {\n\t\t\t\tif (themeTags?.indexOf(m) == -1) {\n\t\t\t\t\tremove = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (themeTags?.indexOf(m) != -1) {\n\t\t\t\t\tremove = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (remove) {\n\t\t\t\ttick.parent?.children.removeValue(tick);\n\t\t\t\trenderer.makeTick(dataItem, tags);\n\t\t\t\ttick.dispose();\n\t\t\t\trenderer.ticks.removeValue(tick);\n\t\t\t}\n\t\t}\n\n\t\tif (!minor && !dataItem.get(\"axisFill\")) {\n\t\t\trenderer.makeAxisFill(dataItem, tags);\n\t\t}\n\n\t\tthis._processBullet(dataItem);\n\t}\n\n\tprotected _processBullet(dataItem: DataItem) {\n\t\tlet bullet = dataItem.get(\"bullet\");\n\t\tlet axisBullet = this.get(\"bullet\");\n\n\t\tif (!bullet && axisBullet && !dataItem.get(\"isRange\")) {\n\t\t\tbullet = axisBullet(this._root, this, dataItem);\n\t\t}\n\n\t\tif (bullet) {\n\t\t\tbullet.axis = this;\n\t\t\tconst sprite = bullet.get(\"sprite\");\n\n\t\t\tif (sprite) {\n\t\t\t\tsprite._setDataItem(dataItem);\n\t\t\t\tdataItem.setRaw(\"bullet\", bullet);\n\t\t\t\tif (!sprite.parent) {\n\t\t\t\t\tthis.bulletsContainer.children.push(sprite);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic _afterChanged() {\n\t\tsuper._afterChanged();\n\n\t\tconst chart = this.chart;\n\t\tif (chart) {\n\t\t\tchart._updateChartLayout();\n\t\t\tchart.axisHeadersContainer.markDirtySize();\n\t\t}\n\n\t\tthis.get(\"renderer\")._updatePositions();\n\n\t\tthis._seriesAdded = false;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic disposeDataItem(dataItem: DataItem) {\n\t\tsuper.disposeDataItem(dataItem);\n\t\tconst renderer = this.get(\"renderer\");\n\t\tconst label = dataItem.get(\"label\");\n\t\tif (label) {\n\t\t\trenderer.labels.removeValue(label);\n\t\t\tlabel.dispose();\n\t\t}\n\t\tconst tick = dataItem.get(\"tick\");\n\t\tif (tick) {\n\t\t\trenderer.ticks.removeValue(tick);\n\t\t\ttick.dispose();\n\t\t}\n\t\tconst grid = dataItem.get(\"grid\");\n\t\tif (grid) {\n\t\t\trenderer.grid.removeValue(grid);\n\t\t\tgrid.dispose();\n\t\t}\n\t\tconst axisFill = dataItem.get(\"axisFill\");\n\t\tif (axisFill) {\n\t\t\trenderer.axisFills.removeValue(axisFill);\n\t\t\taxisFill.dispose();\n\t\t}\n\t\tconst bullet = dataItem.get(\"bullet\");\n\n\t\tif (bullet) {\n\t\t\tbullet.dispose();\n\t\t}\n\t}\n\n\tprotected _updateGhost() {\n\t\tthis.setPrivate(\"cellWidth\", this.getCellWidthPosition() * this.get(\"renderer\").axisLength());\n\t\tconst ghostLabel = this.ghostLabel;\n\t\tif (!ghostLabel.isHidden()) {\n\t\t\tconst bounds = ghostLabel.localBounds();\n\t\t\tconst gWidth = Math.ceil(bounds.right - bounds.left);\n\t\t\tlet text = ghostLabel.get(\"text\");\n\t\t\t$array.each(this.dataItems, (dataItem) => {\n\t\t\t\tconst label = dataItem.get(\"label\");\n\t\t\t\tif (label && !label.isHidden()) {\n\t\t\t\t\tconst bounds = label.localBounds();\n\t\t\t\t\tconst w = Math.ceil(bounds.right - bounds.left);\n\n\t\t\t\t\tif (w > gWidth) {\n\t\t\t\t\t\ttext = label.text._getText();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t\tghostLabel.set(\"text\", text);\n\t\t}\n\t\tlet start = this.get(\"start\", 0);\n\t\tlet end = this.get(\"end\", 1);\n\t\tthis.get(\"renderer\").updateLabel(ghostLabel, start + (end - start) * 0.5);\n\t}\n\n\tpublic _handleCursorPosition(position: number, snapToSeries?: Array) {\n\t\tconst renderer = this.get(\"renderer\");\n\t\tposition = renderer.toAxisPosition(position);\n\n\t\tthis._cursorPosition = position;\n\t\tthis._snapToSeries = snapToSeries;\n\n\t\tthis.updateTooltip();\n\t}\n\n\t/**\n\t * Can be called when axis zoom changes and you need to update tooltip\n\t * position.\n\t */\n\tpublic updateTooltip() {\n\t\tconst snapToSeries = this._snapToSeries;\n\t\tlet position = this._cursorPosition;\n\t\tconst tooltip = this.get(\"tooltip\")!;\n\t\tconst renderer = this.get(\"renderer\");\n\n\t\tif ($type.isNumber(position)) {\n\n\t\t\t$array.each(this.series, (series) => {\n\t\t\t\tif (series.get(\"baseAxis\") === this) {\n\t\t\t\t\tconst dataItem = this.getSeriesItem(series, position!, this.get(\"tooltipLocation\"));\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif (snapToSeries && snapToSeries.indexOf(series) != -1) {\n\t\t\t\t\t\tseries.updateLegendMarker(dataItem);\n\t\t\t\t\t\tseries.updateLegendValue(dataItem);\n\t\t\t\t\t\tseries._settings.tooltipDataItem = dataItem;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tseries.showDataItemTooltip(dataItem);\n\t\t\t\t\t\tseries.setRaw(\"tooltipDataItem\", dataItem);\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tif (this.get(\"snapTooltip\")) {\n\t\t\t\tposition = this.roundAxisPosition(position, this.get(\"tooltipLocation\", 0.5));\n\t\t\t}\n\t\t\t\n\t\t\tthis.setPrivateRaw(\"tooltipPosition\", position);\n\n\t\t\tif (tooltip) {\n\t\t\t\trenderer.updateTooltipBounds(tooltip);\n\n\t\t\t\tif (!$type.isNaN(position)) {\t\t\t\t\t\n\t\t\t\t\tthis._updateTooltipText(tooltip, position);\n\t\t\t\t\trenderer.positionTooltip(tooltip, position);\n\n\t\t\t\t\tif (position < this.get(\"start\", 0) || position > this.get(\"end\", 1)) {\n\t\t\t\t\t\ttooltip.hide(0);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\ttooltip.show(0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ttooltip.hide(0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _updateTooltipText(tooltip: Tooltip, position: number) {\n\t\ttooltip.label.set(\"text\", this.getTooltipText(position));\n\t}\n\n\t/**\n\t * Returns text to be used in an axis tooltip for specific relative position.\n\t *\n\t * @param position Position\n\t * @param adjustPosition Adjust position\n\t * @return Tooltip text\n\t */\n\tpublic abstract getTooltipText(position: number, adjustPosition?: boolean): string | undefined;\n\n\t/**\n\t * @ignore\n\t */\n\tpublic roundAxisPosition(position: number, _location: number): number {\n\t\treturn position;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic handleCursorShow() {\n\t\tlet tooltip = this.get(\"tooltip\");\n\t\tif (tooltip) {\n\t\t\ttooltip.show();\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic handleCursorHide() {\n\t\tlet tooltip = this.get(\"tooltip\");\n\t\tif (tooltip) {\n\t\t\ttooltip.hide();\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic processSeriesDataItem(_dataItem: DataItem, _fields: Array) {\n\n\t}\n\n\tpublic _clearDirty() {\n\t\tsuper._clearDirty();\n\t\tthis._sizeDirty = false;\n\t\tthis._rangesDirty = false;\n\t}\n\n\t/**\n\t * Converts pixel coordinate to a relative position on axis.\n\t *\n\t * @param coordinate Coordinate\n\t * @return Relative position\n\t */\n\tpublic coordinateToPosition(coordinate: number): number {\n\t\tconst renderer = this.get(\"renderer\");\n\t\treturn renderer.toAxisPosition(coordinate / renderer.axisLength());\n\t}\n\n\t/**\n\t * Converts relative position of the plot area to relative position of the\n\t * axis with zoom taken into account.\n\t *\n\t * @param position Position\n\t * @return Relative position\n\t */\n\tpublic toAxisPosition(position: number): number {\n\t\treturn this.get(\"renderer\").toAxisPosition(position);\n\t}\n\n\t/**\n\t * Converts relative position of the axis to a global position taking current\n\t * zoom into account (opposite to what `toAxisPosition` does).\n\t *\n\t * @since 5.4.2\n\t * @param position Position\n\t * @return Global position\n\t */\n\tpublic toGlobalPosition(position: number): number {\n\t\treturn this.get(\"renderer\").toGlobalPosition(position);\n\t}\n\n\t/**\n\t * Adjusts position with inversed taken into account.\n\t *\n\t * @ignore\n\t */\n\tpublic fixPosition(position: number): number {\n\t\treturn this.get(\"renderer\").fixPosition(position);\n\t}\n\n\t/**\n\t * Returns a data item from series that is closest to the `position`.\n\t *\n\t * @param series Series\n\t * @param position Relative position\n\t * @return Data item\n\t */\n\tpublic abstract getSeriesItem(series: XYSeries, position: number, location?: number): DataItem | undefined\n\n\t/**\n\t * @ignore\n\t */\n\tpublic shouldGap(_dataItem: DataItem, _nextItem: DataItem, _autoGapCount: number, _fieldName: string): boolean {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Creates and returns an axis range object.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/axis-ranges/} for more info\n\t * @param axisDataItem Axis data item\n\t * @return Axis range\n\t */\n\tpublic createAxisRange(axisDataItem: DataItem): DataItem {\n\t\treturn this.axisRanges.push(axisDataItem);\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic _groupSeriesData(_series: XYSeries) { }\n\n\t/**\n\t * Returns relative position between two grid lines of the axis.\n\t *\n\t * @return Position\n\t */\n\tpublic getCellWidthPosition(): number {\n\t\treturn 0.05;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic abstract nextPosition(_count?:number):number\n}\n","import { Entity, IEntitySettings, IEntityPrivate } from \"../../../core/util/Entity\";\nimport type { Sprite } from \"../../../core/render/Sprite\";\nimport type { Axis } from \"./Axis\";\nimport type { AxisRenderer } from \"./AxisRenderer\";\nimport * as $object from \"../../../core/util/Object\";\n\nexport interface IAxisBulletSettings extends IEntitySettings {\n\n\t/**\n\t * Relative location of the bullet within the cell.\n\t *\n\t * `0` - beginning, `0.5` - middle, `1` - end.\n\t */\n\tlocation?: number;\n\n\t/**\n\t * A visual element of the bullet.\n\t */\n\tsprite: Sprite;\n\n\t/**\n\t * Indicates if the bullet should be stacked on top of another bullet if it's\n\t * on the same position.\n\t *\n\t * Will work on horizontal or vertical axes only.\n\t *\n\t * @since 5.2.28\n\t * @default false\n\t */\n\tstacked?: boolean;\n\n}\n\nexport interface IAxisBulletPrivate extends IEntityPrivate {\n}\n\n/**\n * Draws a bullet on an axis.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Axis_bullets} for more info\n */\nexport class AxisBullet extends Entity {\n\n\t/**\n\t * Target axis object.\n\t */\n\tpublic axis: Axis | undefined;\n\n\tdeclare public _settings: IAxisBulletSettings;\n\tdeclare public _privateSettings: IAxisBulletPrivate;\n\n\tpublic static className: string = \"AxisBullet\";\n\tpublic static classNames: Array = Entity.classNames.concat([AxisBullet.className]);\n\n\tpublic _beforeChanged() {\n\t\tsuper._beforeChanged();\n\n\t\tconst sprite = this.get(\"sprite\");\n\n\t\tif (this.isDirty(\"sprite\")) {\n\t\t\tif (sprite) {\n\t\t\t\tsprite.setAll({ position: \"absolute\", role: \"figure\" });\n\t\t\t\tthis._disposers.push(sprite);\n\t\t\t}\n\t\t}\n\n\t\tif (this.isDirty(\"location\")) {\n\t\t\tconst dataItem = sprite.dataItem;\n\t\t\tif (this.axis && sprite && dataItem) {\n\t\t\t\tthis.axis._prepareDataItem(dataItem as any)\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _dispose() {\n\t\tconst axis = this.axis;\n\t\tif (axis) {\n\t\t\t$object.each(axis._bullets, (key, bullet) => {\n\t\t\t\tif (bullet.uid == this.uid) {\n\t\t\t\t\tdelete axis._bullets[key];\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\tsuper._dispose();\n\t}\n}\n","import { Label, ILabelSettings, ILabelPrivate } from \"../../../core/render/Label\";\nimport type { IPoint } from \"../../../core/util/IPoint\";\n\nexport interface IAxisLabel extends Label {\n\n\t/**\n\t * Relative location of the label within the cell.\n\t *\n\t * `0` - beginning, `0.5` - middle, `1` - end.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Location_of_axis_elements} for more info\n\t */\n\tlocation?: number;\n\n\t/**\n\t * Relative location of the label within the cell when it spans multiple\n\t * intervals.\n\t *\n\t * `0` - beginning, `0.5` - middle, `1` - end.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Multi_location} for more info\n\t */\n\tmultiLocation?: number;\n\n\t/**\n\t * If set to `true` the label will be shown inside plot area.\n\t *\n\t * @default false\n\t */\n\tinside?: boolean | undefined;\n\n\t/**\n\t * The minimum relative position within visible axis scope the label can\n\t * appear on.\n\t *\n\t * E.g. `0.1` will mean that label will not be shown if it's closer to the\n\t * beginning of the axis than 10%.\n\t *\n\t * @default 0\n\t */\n\tminPosition?: number;\n\n\t/**\n\t * The maximum relative position within visible axis scope the label can\n\t * appear on.\n\t *\n\t * E.g. `0.9` will mean that label will not be shown if it's closer to the\n\t * end of the axis than 10%.\n\t *\n\t * @default 0\n\t */\n\tmaxPosition?: number;\n\n\t_tickPoints: Array;\n}\n\n\nexport interface IAxisLabelSettings extends ILabelSettings {\n\n\t/**\n\t * Relative location of the label within the cell.\n\t *\n\t * `0` - beginning, `0.5` - middle, `1` - end.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Location_of_axis_elements} for more info\n\t */\n\tlocation?: number;\n\n\t/**\n\t * Relative location of the label within the cell when it spans multiple\n\t * intervals.\n\t *\n\t * `0` - beginning, `0.5` - middle, `1` - end.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Multi_location} for more info\n\t */\n\tmultiLocation?: number;\n\n\t/**\n\t * If set to `true` the label will be shown inside plot area.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Labels_ticks_inside_plot_area} for more info\n\t * @default false\n\t */\n\tinside?: boolean | undefined;\n\n\t/**\n\t * The minimum relative position within visible axis scope the label can\n\t * appear on.\n\t *\n\t * E.g. `0.1` will mean that label will not be shown if it's closer to the\n\t * beginning of the axis than 10%.\n\t *\n\t * @default 0\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Start_end_labels_and_ticks} for more info\n\t */\n\tminPosition?: number;\n\n\t/**\n\t * The maximum relative position within visible axis scope the label can\n\t * appear on.\n\t *\n\t * E.g. `0.9` will mean that label will not be shown if it's closer to the\n\t * end of the axis than 10%.\n\t *\n\t * @default 1\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Start_end_labels_and_ticks} for more info\n\t */\n\tmaxPosition?: number;\n\n}\n\nexport interface IAxisLabelPrivate extends ILabelPrivate {\n}\n\n/**\n * Draws an axis label.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Labels} for more info\n * @important\n */\nexport class AxisLabel extends Label implements IAxisLabel {\n\n\tdeclare public _settings: IAxisLabelSettings;\n\tdeclare public _privateSettings: IAxisLabelPrivate;\n\n\tpublic _tickPoints: Array = [];\n\n\tpublic static className: string = \"AxisLabel\";\n\tpublic static classNames: Array = Label.classNames.concat([AxisLabel.className]);\n}\n","import { RadialLabel, IRadialLabelSettings, IRadialLabelPrivate } from \"../../../core/render/RadialLabel\";\nimport type { IPoint } from \"../../../core/util/IPoint\";\n\nexport interface IAxisLabelRadialSettings extends IRadialLabelSettings {\n\n\t/**\n\t * Relative location of the label within the cell.\n\t *\n\t * `0` - beginning, `0.5` - middle, `1` - end.\n\t */\n\tlocation?: number;\n\n\t/**\n\t * Relative location of the label within the cell when it spans multiple\n\t * intervals.\n\t *\n\t * `0` - beginning, `0.5` - middle, `1` - end.\n\t */\n\tmultiLocation?: number;\n\n\t/**\n\t * The minimum relative position within visible axis scope the label can\n\t * appear on.\n\t *\n\t * E.g. `0.1` will mean that label will not be shown if it's closer to the\n\t * beginning of the axis than 10%.\n\t *\n\t * @default 0\n\t */\n\tminPosition?: number;\n\n\t/**\n\t * The maximum relative position within visible axis scope the label can\n\t * appear on.\n\t *\n\t * E.g. `0.9` will mean that label will not be shown if it's closer to the\n\t * end of the axis than 10%.\n\t *\n\t * @default 0\n\t */\n\tmaxPosition?: number;\n\n}\n\nexport interface IAxisLabelRadialPrivate extends IRadialLabelPrivate {\n}\n\n/**\n * Draws a label on a circular axis.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Labels} for more info\n */\nexport class AxisLabelRadial extends RadialLabel {\n\n\tdeclare public _settings: IAxisLabelRadialSettings;\n\tdeclare public _privateSettings: IAxisLabelRadialPrivate;\n\n\tpublic static className: string = \"AxisLabelRadial\";\n\tpublic static classNames: Array = RadialLabel.classNames.concat([AxisLabelRadial.className]);\n\n\tpublic _tickPoints: Array = [];\n\n}\n","import type { Sprite, ISpritePointerEvent } from \"../../../core/render/Sprite\";\nimport { Graphics, IGraphicsSettings, IGraphicsPrivate } from \"../../../core/render/Graphics\";\nimport type { Axis, IAxisDataItem } from \"./Axis\";\nimport { Template } from \"../../../core/util/Template\";\nimport { ListTemplate } from \"../../../core/util/List\";\nimport { AxisTick } from \"./AxisTick\";\nimport { Grid } from \"./Grid\";\nimport { AxisLabel } from \"./AxisLabel\";\nimport type { IPoint } from \"../../../core/util/IPoint\";\nimport type { Tooltip } from \"../../../core/render/Tooltip\";\nimport type { AxisBullet } from \"./AxisBullet\";\nimport type { XYChart } from \"../XYChart\";\nimport type { DataItem } from \"../../../core/render/Component\";\nimport * as $utils from \"../../../core/util/Utils\";\n\nexport interface IAxisRendererSettings extends IGraphicsSettings {\n\n\t/**\n\t * The minimum distance between grid lines in pixels.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Grid_density} for more info\n\t */\n\tminGridDistance?: number;\n\n\t/**\n\t * Re-enable display of skipped grid lines due to lack of space and as per\n\t * the `minGridDistance` setting. Not recommended for CategoryAxis with a lot of data items.\n\t *\n\t * @default false\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Minor_grid} for more info\n\t * @since 5.6.0\n\t */\n\tminorGridEnabled?: boolean;\n\n\t/**\n\t * Enable labels on minor grid. If you enable labels, grid will be enabled automatically.\n\t *\n\t * @default false\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Enabling_minor_grid_labels} for more info\n\t * @since 5.6.0\n\t */\n\tminorLabelsEnabled?: boolean;\n\n\t/**\n\t * Set to `true` to invert direction of the axis.\n\t *\n\t * @default false\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Inversed_axes} for more info\n\t */\n\tinversed?: boolean;\n\n\t/**\n\t * Indicates relative position where \"usable\" space of the cell starts.\n\t *\n\t * `0` - beginning, `1` - end, or anything in-between.\n\t *\n\t * @default 0\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Cell_start_end_locations} for more info\n\t */\n\tcellStartLocation?: number;\n\n\t/**\n\t * Indicates relative position where \"usable\" space of the cell ends.\n\t *\n\t * `0` - beginning, `1` - end, or anything in-between.\n\t *\n\t * @default 1\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Cell_start_end_locations} for more info\n\t */\n\tcellEndLocation?: number;\n\n\t/**\n\t * If set to `\"zoom\"` will enable axis zoom by panning it in the axis label\n\t * area.\n\t *\n\t * Works on [[AxisRendererX]] and [[AxisRendererY]] only.\n\t *\n\t * For a better result, set `maxDeviation` to `1` or so on the Axis.\n\t *\n\t * Will not work if `inside` is set to `true`.\n\t *\n\t * @since 5.0.7\n\t * @default \"none\"\n\t */\n\tpan?: \"none\" | \"zoom\"\n\n\n\t/**\n\t * Sensitivity of panning. The higher the number, the more sensitive it is.\n\t *\n\t * @default 1\n\t */\n\tpanSensitivity?: number;\n\n}\n\nexport interface IAxisRendererPrivate extends IGraphicsPrivate {\n\t/**\n\t * @ignore\n\t */\n\tletter?: \"X\" | \"Y\";\n}\n\n/**\n * Base class for an axis renderer.\n *\n * Should not be used on its own.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/#Axis_renderer} for more info\n */\nexport abstract class AxisRenderer extends Graphics {\n\tpublic static className: string = \"AxisRenderer\";\n\tpublic static classNames: Array = Graphics.classNames.concat([AxisRenderer.className]);\n\n\t// save for quick access\n\tpublic _axisLength: number = 100;\n\tpublic _start: number = 0;\n\tpublic _end: number = 1;\n\tpublic _inversed: boolean = false;\n\n\tprotected _minSize: number = 0;\n\n\t/**\n\t * Chart the renderer is used in.\n\t */\n\tpublic chart: XYChart | undefined;\n\n\tprotected _lc = 1;\n\n\tprotected _ls = 0;\n\n\tprotected _thumbDownPoint?: IPoint;\n\n\tprotected _downStart?: number;\n\tprotected _downEnd?: number;\n\n\t/**\n\t * @ignore\n\t */\n\tpublic makeTick(dataItem: DataItem, themeTags: Array): AxisTick {\n\t\tconst tick = this.ticks.make();\n\t\ttick._setDataItem(dataItem);\n\t\tdataItem.setRaw(\"tick\", tick);\n\t\ttick.set(\"themeTags\", $utils.mergeTags(tick.get(\"themeTags\"), themeTags));\n\t\tthis.axis.labelsContainer.children.push(tick);\n\t\tthis.ticks.push(tick);\n\t\treturn tick;\n\t}\n\n\t/**\n\t * A list of ticks in the axis.\n\t *\n\t * `ticks.template` can be used to configure ticks.\n\t *\n\t * @default new ListTemplate\n\t */\n\tpublic readonly ticks: ListTemplate = this.addDisposer(new ListTemplate(\n\t\tTemplate.new({}),\n\t\t() => AxisTick._new(this._root, {\n\t\t\tthemeTags: $utils.mergeTags(this.ticks.template.get(\"themeTags\", []), this.get(\"themeTags\", []))\n\t\t}, [this.ticks.template])\n\t));\n\n\t/**\n\t * @ignore\n\t */\n\tpublic makeGrid(dataItem: DataItem, themeTags: Array): Grid {\n\t\tconst grid = this.grid.make();\n\t\tgrid._setDataItem(dataItem);\n\t\tdataItem.setRaw(\"grid\", grid);\n\t\tgrid.set(\"themeTags\", $utils.mergeTags(grid.get(\"themeTags\"), themeTags));\n\n\t\tthis.axis.gridContainer.children.push(grid);\n\t\tthis.grid.push(grid);\n\t\treturn grid;\n\t}\n\n\t/**\n\t * A list of grid elements in the axis.\n\t *\n\t * `grid.template` can be used to configure grid.\n\t *\n\t * @default new ListTemplate\n\t */\n\tpublic readonly grid: ListTemplate = this.addDisposer(new ListTemplate(\n\t\tTemplate.new({}),\n\t\t() => Grid._new(this._root, {\n\t\t\tthemeTags: $utils.mergeTags(this.grid.template.get(\"themeTags\", []), this.get(\"themeTags\", []))\n\t\t}, [this.grid.template])\n\t));\n\n\t/**\n\t * @ignore\n\t */\n\tpublic makeAxisFill(dataItem: DataItem, themeTags: Array): Grid {\n\t\tconst axisFill = this.axisFills.make();\n\t\taxisFill._setDataItem(dataItem);\n\t\taxisFill.set(\"themeTags\", $utils.mergeTags(axisFill.get(\"themeTags\"), themeTags));\n\n\t\tthis.axis.gridContainer.children.push(axisFill);\n\t\tdataItem.setRaw(\"axisFill\", axisFill);\n\t\tthis.axisFills.push(axisFill);\n\t\treturn axisFill;\n\t}\n\n\t/**\n\t * A list of fills in the axis.\n\t *\n\t * `axisFills.template` can be used to configure axis fills.\n\t *\n\t * @default new ListTemplate\n\t */\n\tpublic readonly axisFills: ListTemplate = this.addDisposer(new ListTemplate(\n\t\tTemplate.new({}),\n\t\t() => Graphics._new(this._root, {\n\t\t\tthemeTags: $utils.mergeTags(this.axisFills.template.get(\"themeTags\", [\"axis\", \"fill\"]), this.get(\"themeTags\", []))\n\t\t}, [this.axisFills.template])\n\t));\n\n\t/**\n\t * @ignore\n\t */\n\tpublic makeLabel(dataItem: DataItem, themeTags: Array): AxisLabel {\n\n\t\tconst label = this.labels.make();\n\n\t\tlabel.set(\"themeTags\", $utils.mergeTags(label.get(\"themeTags\"), themeTags));\n\t\tthis.axis.labelsContainer.children.moveValue(label, 0);\n\n\t\tlabel._setDataItem(dataItem);\n\t\tdataItem.setRaw(\"label\", label);\n\t\tthis.labels.push(label);\n\t\treturn label;\n\t}\n\n\t/**\n\t * A list of labels in the axis.\n\t *\n\t * `labels.template` can be used to configure axis labels.\n\t *\n\t * @default new ListTemplate\n\t */\n\tpublic readonly labels: ListTemplate = this.addDisposer(new ListTemplate(\n\t\tTemplate.new({}),\n\t\t() => AxisLabel._new(this._root, {\n\t\t\tthemeTags: $utils.mergeTags(this.labels.template.get(\"themeTags\", []), this.get(\"themeTags\", []))\n\t\t}, [this.labels.template])\n\t));\n\n\n\tdeclare public _settings: IAxisRendererSettings;\n\tdeclare public _privateSettings: IAxisRendererPrivate;\n\n\t/**\n\t * An [[Axis]] renderer is for.\n\t */\n\tpublic axis!: Axis;\n\n\tpublic axisLength(): number {\n\t\treturn 0;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic gridCount(): number {\n\t\treturn this.axisLength() / this.get(\"minGridDistance\", 50);\n\t}\n\n\tpublic _updatePositions() {\n\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic abstract updateLabel(_label?: AxisLabel, _position?: number, _endPosition?: number, _count?: number): void;\n\n\t/**\n\t * @ignore\n\t */\n\tpublic abstract updateGrid(_grid?: Grid, _position?: number, _endPosition?: number): void;\n\n\t/**\n\t * @ignore\n\t */\n\tpublic abstract updateTick(_grid?: AxisTick, _position?: number, _endPosition?: number, _count?: number): void;\n\n\t/**\n\t * @ignore\n\t */\n\tpublic abstract updateFill(_fill?: Graphics, _position?: number, _endPosition?: number): void;\n\n\t/**\n\t * @ignore\n\t */\n\tpublic abstract updateBullet(_bullet?: AxisBullet, _position?: number, _endPosition?: number): void;\n\n\t/**\n\t * @ignore\n\t */\n\tpublic abstract positionToPoint(_position: number): IPoint;\n\n\n\t/**\n\t * A thumb Graphics to be used for panning the axis (the one which shows under the labels when hovered)\n\t */\n\tpublic readonly thumb?: Graphics;\n\n\tprotected _afterNew() {\n\t\tsuper._afterNew();\n\t\tthis.set(\"isMeasured\", false);\n\n\t\tconst thumb = this.thumb;\n\t\tif (thumb) {\n\t\t\tthis._disposers.push(thumb.events.on(\"pointerdown\", (event) => {\n\t\t\t\tthis._handleThumbDown(event);\n\t\t\t}));\n\n\t\t\tthis._disposers.push(thumb.events.on(\"globalpointerup\", (event) => {\n\t\t\t\tthis._handleThumbUp(event);\n\t\t\t}));\n\n\t\t\tthis._disposers.push(thumb.events.on(\"globalpointermove\", (event) => {\n\t\t\t\tthis._handleThumbMove(event);\n\t\t\t}));\n\t\t}\n\t}\n\n\tpublic _beforeChanged() {\n\t\tsuper._beforeChanged();\n\t\tif (this.isDirty(\"minGridDistance\")) {\n\t\t\tthis.root.events.once(\"frameended\", () => {\n\t\t\t\tthis.axis.markDirtySize();\n\t\t\t})\n\t\t}\n\t}\n\n\n\tpublic _changed() {\n\t\tsuper._changed();\n\n\t\tif (this.isDirty(\"pan\")) {\n\t\t\tconst thumb = this.thumb;\n\t\t\tif (thumb) {\n\t\t\t\tconst labelsContainer = this.axis.labelsContainer;\n\t\t\t\tconst pan = this.get(\"pan\");\n\t\t\t\tif (pan == \"zoom\") {\n\t\t\t\t\tlabelsContainer.children.push(thumb);\n\t\t\t\t}\n\t\t\t\telse if (pan == \"none\") {\n\t\t\t\t\tlabelsContainer.children.removeValue(thumb);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _handleThumbDown(event: ISpritePointerEvent) {\n\t\tthis._thumbDownPoint = this.toLocal(event.point);\n\t\tconst axis = this.axis;\n\t\tthis._downStart = axis.get(\"start\");\n\t\tthis._downEnd = axis.get(\"end\");\n\t}\n\n\tprotected _handleThumbUp(_event: ISpritePointerEvent) {\n\t\tthis._thumbDownPoint = undefined;\n\t}\n\n\tprotected _handleThumbMove(event: ISpritePointerEvent) {\n\t\tconst downPoint = this._thumbDownPoint;\n\t\tif (downPoint) {\n\t\t\tconst point = this.toLocal(event.point);\n\n\t\t\tconst downStart = this._downStart!;\n\t\t\tconst downEnd = this._downEnd!;\n\t\t\tconst extra = this._getPan(point, downPoint) * Math.min(1, (downEnd - downStart)) / 2 * this.get(\"panSensitivity\", 1);\n\t\t\tthis.axis.zoom(downStart - extra, downEnd + extra, 0);\n\t\t}\n\t}\n\n\tprotected _getPan(_point1: IPoint, _point2: IPoint): number {\n\t\treturn 0;\n\t}\n\n\t/**\n\t * Converts relative position (0-1) on axis to a pixel coordinate.\n\t *\n\t * @param position Position (0-1)\n\t * @return Coordinate (px)\n\t */\n\tpublic positionToCoordinate(position: number): number {\n\t\tif (this._inversed) {\n\t\t\treturn (this._end - position) * this._axisLength;\n\t\t}\n\t\telse {\n\t\t\treturn (position - this._start) * this._axisLength;\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic abstract positionTooltip(_tooltip: Tooltip, _position: number): void;\n\n\t/**\n\t * @ignore\n\t */\n\tpublic updateTooltipBounds(_tooltip: Tooltip) { }\n\n\tpublic _updateSize() {\n\t\tthis.markDirty()\n\t\tthis._clear = true;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic toAxisPosition(position: number): number {\n\t\tconst start = this._start || 0;\n\t\tconst end = this._end || 1;\n\n\t\tposition = position * (end - start);\n\t\tif (!this.get(\"inversed\")) {\n\t\t\tposition = start + position;\n\t\t}\n\t\telse {\n\t\t\tposition = end - position;\n\t\t}\n\n\t\treturn position;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic toGlobalPosition(position: number): number {\n\t\tconst start = this._start || 0;\n\t\tconst end = this._end || 1;\n\n\t\tif (!this.get(\"inversed\")) {\n\t\t\tposition = position - start;\n\t\t}\n\t\telse {\n\t\t\tposition = end - position;\n\t\t}\n\n\t\tposition = position / (end - start);\n\n\t\treturn position;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic fixPosition(position: number) {\n\t\tif (this.get(\"inversed\")) {\n\t\t\treturn 1 - position;\n\t\t}\n\t\treturn position;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic _updateLC() {\n\n\t}\n\n\tprotected toggleVisibility(sprite: Sprite, position: number, minPosition: number, maxPosition: number): void {\n\t\tlet axis = this.axis;\n\n\t\tconst start = axis.get(\"start\", 0);\n\t\tconst end = axis.get(\"end\", 1);\n\n\t\tlet updatedStart = start + (end - start) * (minPosition - 0.0001);\n\t\tlet updatedEnd = start + (end - start) * (maxPosition + 0.0001);\n\n\t\tif (position < updatedStart || position > updatedEnd) {\n\t\t\tsprite.setPrivate(\"visible\", false);\n\t\t}\n\t\telse {\n\t\t\tsprite.setPrivate(\"visible\", true);\n\t\t}\n\t}\n\n\tprotected _positionTooltip(tooltip: Tooltip, point: IPoint) {\n\t\tconst chart = this.chart;\n\t\tif (chart) {\n\t\t\ttooltip.set(\"pointTo\", this._display.toGlobal(point));\n\t\t\tif (!chart.inPlot(point)) {\n\t\t\t\ttooltip.hide();\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic processAxis() { }\n}\n","import { AxisRenderer, IAxisRendererSettings, IAxisRendererPrivate } from \"./AxisRenderer\";\nimport { p100 } from \"../../../core/util/Percent\";\nimport type { IPoint } from \"../../../core/util/IPoint\";\nimport * as $type from \"../../../core/util/Type\";\nimport * as $utils from \"../../../core/util/Utils\";\nimport type { AxisLabel } from \"./AxisLabel\";\nimport type { Grid } from \"./Grid\";\nimport type { AxisTick } from \"./AxisTick\";\nimport type { Graphics } from \"../../../core/render/Graphics\";\nimport type { Tooltip } from \"../../../core/render/Tooltip\";\nimport type { Template } from \"../../../core/util/Template\";\nimport type { AxisBullet } from \"./AxisBullet\";\nimport { Rectangle } from \"../../../core/render/Rectangle\";\n\n\nexport interface IAxisRendererXSettings extends IAxisRendererSettings {\n\n\t/**\n\t * If set to `true` the axis will be drawn on the opposite side of the plot\n\t * area.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Axis_position} for more info\n\t * @default false\n\t */\n\topposite?: boolean;\n\n\t/**\n\t * If set to `true`, all axis elements (ticks, labels) will be drawn inside\n\t * plot area.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Labels_ticks_inside_plot_area} for more info\n\t * @default false\n\t */\n\tinside?: boolean;\n}\n\nexport interface IAxisRendererXPrivate extends IAxisRendererPrivate {\n}\n\n/**\n * Used to render horizontal axis.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/#Axis_renderer} for more info\n * @important\n */\nexport class AxisRendererX extends AxisRenderer {\n\n\tpublic static className: string = \"AxisRendererX\";\n\tpublic static classNames: Array = AxisRenderer.classNames.concat([AxisRendererX.className]);\n\n\tdeclare public _settings: IAxisRendererXSettings;\n\tdeclare public _privateSettings: IAxisRendererXPrivate;\n\n\tdeclare public readonly labelTemplate: Template;\n\n\tpublic thumb: Rectangle = Rectangle.new(this._root, { width: p100, isMeasured: false, themeTags: [\"axis\", \"x\", \"thumb\"] });\n\n\tpublic _afterNew() {\n\t\tthis._settings.themeTags = $utils.mergeTags(this._settings.themeTags, [\"renderer\", \"x\"]);\n\n\t\tsuper._afterNew();\n\t\tthis.setPrivateRaw(\"letter\", \"X\");\n\n\t\tconst gridTemplate = this.grid.template;\n\t\tgridTemplate.set(\"height\", p100);\n\t\tgridTemplate.set(\"width\", 0);\n\t\tgridTemplate.set(\"draw\", (display, graphics) => {\n\t\t\tdisplay.moveTo(0, 0);\n\t\t\tdisplay.lineTo(0, graphics.height());\n\t\t});\n\n\t\tthis.set(\"draw\", (display, graphics) => {\n\t\t\tdisplay.moveTo(0, 0);\n\t\t\tdisplay.lineTo(graphics.width(), 0);\n\t\t});\n\t}\n\n\tpublic _changed() {\n\t\tsuper._changed();\n\n\t\tconst axis = this.axis;\n\t\taxis.ghostLabel.setPrivate(\"visible\", !this.get(\"inside\"));\n\t\taxis.ghostLabel.set(\"x\", -1000);\n\n\t\tconst opposite = \"opposite\"\n\t\tconst inside = \"inside\";\n\n\t\tif (this.isDirty(opposite) || this.isDirty(inside)) {\n\t\t\tconst chart = this.chart;\n\t\t\tconst axisChildren = axis.children;\n\n\t\t\tif (this.get(inside)) {\n\t\t\t\taxis.addTag(inside);\n\t\t\t}\n\t\t\telse {\n\t\t\t\taxis.removeTag(inside);\n\t\t\t}\n\n\t\t\tif (chart) {\n\t\t\t\tif (this.get(opposite)) {\n\t\t\t\t\tconst children = chart.topAxesContainer.children;\n\t\t\t\t\tif (children.indexOf(axis) == -1) {\n\t\t\t\t\t\tchildren.insertIndex(0, axis);\n\t\t\t\t\t}\n\t\t\t\t\taxis.addTag(opposite);\n\t\t\t\t\taxisChildren.moveValue(this);\n\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconst children = chart.bottomAxesContainer.children;\n\t\t\t\t\tif (children.indexOf(axis) == -1) {\n\t\t\t\t\t\tchildren.moveValue(axis);\n\t\t\t\t\t}\n\t\t\t\t\taxis.removeTag(opposite);\n\n\t\t\t\t\taxisChildren.moveValue(this, 0);\n\n\t\t\t\t}\n\n\t\t\t\taxis.ghostLabel._applyThemes();\n\t\t\t\tthis.labels.each((label) => {\n\t\t\t\t\tlabel._applyThemes();\n\t\t\t\t})\n\t\t\t\tthis.root._markDirtyRedraw();\n\t\t\t}\n\t\t\taxis.markDirtySize();\n\t\t}\n\n\t\tthis.thumb.setPrivate(\"height\", axis.labelsContainer.height());\n\t}\n\n\n\tprotected _getPan(point1: IPoint, point2: IPoint): number {\n\t\treturn (point2.x - point1.x) / this.width();\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic toAxisPosition(position: number): number {\n\t\tconst start = this._start || 0;\n\t\tconst end = this._end || 1;\n\n\t\tposition -= this._ls;\n\n\t\tposition = position * (end - start) / this._lc;\n\t\tif (!this.get(\"inversed\")) {\n\t\t\tposition = start + position;\n\t\t}\n\t\telse {\n\t\t\tposition = end - position;\n\t\t}\n\n\t\treturn position;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic toGlobalPosition(position: number): number {\n\t\tconst start = this._start || 0;\n\t\tconst end = this._end || 1;\n\n\t\tif (!this.get(\"inversed\")) {\n\t\t\tposition = position - start;\n\t\t}\n\t\telse {\n\t\t\tposition = end - position;\n\t\t}\n\n\t\tposition = position / (end - start) * this._lc\n\n\t\tposition += this._ls;\n\n\t\treturn position;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic _updateLC() {\n\t\tconst axis = this.axis;\n\t\tconst parent = axis.parent;\n\t\tif (parent) {\n\t\t\tconst w = parent.innerWidth();\n\t\t\tthis._lc = this.axisLength() / w;\n\t\t\tthis._ls = (axis.x() - parent.get(\"paddingLeft\", 0)) / w;\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic _updatePositions() {\n\t\tconst axis = this.axis;\n\t\tconst x = axis.x() - $utils.relativeToValue(axis.get(\"centerX\", 0), axis.width()) - axis.parent!.get(\"paddingLeft\", 0);\n\t\taxis.gridContainer.set(\"x\", x);\n\t\taxis.topGridContainer.set(\"x\", x);\n\t\taxis.bulletsContainer.set(\"y\", this.y());\n\n\t\tconst chart = axis.chart;\n\t\tif (chart) {\n\t\t\tconst plotContainer = chart.plotContainer;\n\t\t\tconst axisHeader = axis.axisHeader;\n\t\t\tlet width = axis.get(\"marginLeft\", 0);\n\n\t\t\tlet x = axis.x() - width;\n\n\t\t\tconst parent = axis.parent;\n\t\t\tif (parent) {\n\t\t\t\tx -= parent.get(\"paddingLeft\", 0);\n\t\t\t}\n\n\t\t\tif (axisHeader.children.length > 0) {\n\t\t\t\twidth = axis.axisHeader.width();\n\t\t\t\taxis.set(\"marginLeft\", width + 1);\n\t\t\t}\n\t\t\telse {\n\t\t\t\taxisHeader.set(\"width\", width);\n\t\t\t}\n\t\t\taxisHeader.setAll({ x: x, y: -1, height: plotContainer.height() + 2 });\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic processAxis() {\n\t\tsuper.processAxis();\n\t\tconst axis = this.axis;\n\t\tif (axis.get(\"width\") == null) {\n\t\t\taxis.set(\"width\", p100);\n\t\t};\n\t\tconst verticalLayout = this._root.verticalLayout;\n\t\taxis.set(\"layout\", verticalLayout);\n\t\taxis.labelsContainer.set(\"width\", p100);\n\t\taxis.axisHeader.setAll({ layout: verticalLayout });\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic axisLength(): number {\n\t\treturn this.axis.width();\n\t}\n\n\t/**\n\t * Converts axis relative position to actual coordinate in pixels.\n\t *\n\t * @param position Position\n\t * @return Point\n\t */\n\tpublic positionToPoint(position: number): IPoint {\n\t\treturn { x: this.positionToCoordinate(position), y: 0 };\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic updateTick(tick?: AxisTick, position?: number, endPosition?: number, count?: number) {\n\t\tif (tick) {\n\t\t\tif (!$type.isNumber(position)) {\n\t\t\t\tposition = 0;\n\t\t\t}\n\n\t\t\tlet location = 0.5;\n\t\t\tif ($type.isNumber(count) && count > 1) {\n\t\t\t\tlocation = tick.get(\"multiLocation\", location)\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlocation = tick.get(\"location\", location)\n\t\t\t}\n\n\t\t\tif ($type.isNumber(endPosition) && endPosition != position) {\n\t\t\t\tposition = position + (endPosition - position) * location;\n\t\t\t}\n\n\t\t\ttick.set(\"x\", this.positionToCoordinate(position));\n\n\t\t\tlet length = tick.get(\"length\", 0);\n\t\t\tconst inside = tick.get(\"inside\", this.get(\"inside\", false));\n\n\t\t\tif (this.get(\"opposite\")) {\n\t\t\t\ttick.set(\"y\", p100);\n\t\t\t\tif (!inside) {\n\t\t\t\t\tlength *= -1\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttick.set(\"y\", 0);\n\t\t\t\tif (inside) {\n\t\t\t\t\tlength *= -1\n\t\t\t\t}\n\t\t\t}\n\t\t\ttick.set(\"draw\", (display) => {\n\t\t\t\tdisplay.moveTo(0, 0);\n\t\t\t\tdisplay.lineTo(0, length);\n\t\t\t})\n\n\t\t\tthis.toggleVisibility(tick, position, tick.get(\"minPosition\", 0), tick.get(\"maxPosition\", 1));\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic updateLabel(label?: AxisLabel, position?: number, endPosition?: number, count?: number) {\n\t\tif (label) {\n\t\t\tlet location = 0.5;\n\t\t\tif ($type.isNumber(count) && count > 1) {\n\t\t\t\tlocation = label.get(\"multiLocation\", location)\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlocation = label.get(\"location\", location)\n\t\t\t}\n\n\t\t\tif (!$type.isNumber(position)) {\n\t\t\t\tposition = 0;\n\t\t\t}\n\n\t\t\tconst inside = label.get(\"inside\", this.get(\"inside\", false));\n\n\t\t\tconst opposite = this.get(\"opposite\");\n\t\t\tif (opposite) {\n\t\t\t\tif (!inside) {\n\t\t\t\t\tlabel.set(\"position\", \"relative\");\n\t\t\t\t\tlabel.set(\"y\", p100);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tlabel.set(\"position\", \"absolute\");\n\t\t\t\t\tlabel.set(\"y\", 0)\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (!inside) {\n\t\t\t\t\tlabel.set(\"y\", undefined);\n\t\t\t\t\tlabel.set(\"position\", \"relative\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tlabel.set(\"y\", 0)\n\t\t\t\t\tlabel.set(\"position\", \"absolute\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($type.isNumber(endPosition) && endPosition != position) {\n\t\t\t\tposition = position + (endPosition - position) * location;\n\t\t\t}\n\n\t\t\tlabel.set(\"x\", this.positionToCoordinate(position));\n\t\t\tthis.toggleVisibility(label, position, label.get(\"minPosition\", 0), label.get(\"maxPosition\", 1));\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic updateGrid(grid?: Grid, position?: number, endPosition?: number) {\n\t\tif (grid) {\n\t\t\tif (!$type.isNumber(position)) {\n\t\t\t\tposition = 0;\n\t\t\t}\n\n\t\t\tlet location = grid.get(\"location\", 0.5);\n\t\t\tif ($type.isNumber(endPosition) && endPosition != position) {\n\t\t\t\tposition = position + (endPosition - position) * location;\n\t\t\t}\n\n\t\t\tgrid.set(\"x\", this.positionToCoordinate(position));\n\n\t\t\tthis.toggleVisibility(grid, position, 0, 1);\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic updateBullet(bullet?: AxisBullet, position?: number, endPosition?: number) {\n\t\tif (bullet) {\n\n\t\t\tconst sprite = bullet.get(\"sprite\");\n\t\t\tif (sprite) {\n\t\t\t\tif (!$type.isNumber(position)) {\n\t\t\t\t\tposition = 0;\n\t\t\t\t}\n\n\t\t\t\tlet location = bullet.get(\"location\", 0.5);\n\n\t\t\t\tif ($type.isNumber(endPosition) && endPosition != position) {\n\t\t\t\t\tposition = position + (endPosition - position) * location;\n\t\t\t\t}\n\n\t\t\t\tlet bulletPosition = this.axis.roundAxisPosition(position, location);\n\t\t\t\tlet previousBullet = this.axis._bullets[bulletPosition];\n\t\t\t\tlet d = -1;\n\t\t\t\tif (this.get(\"opposite\")) {\n\t\t\t\t\td = 1;\n\t\t\t\t}\n\n\t\t\t\tif (bullet.get(\"stacked\")) {\n\t\t\t\t\tif (previousBullet) {\n\t\t\t\t\t\tlet previousSprite = previousBullet.get(\"sprite\");\n\t\t\t\t\t\tif (previousSprite) {\n\t\t\t\t\t\t\tsprite.set(\"y\", previousSprite.y() + previousSprite.height() * d);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tsprite.set(\"y\", 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.axis._bullets[bulletPosition] = bullet;\n\t\t\t\tsprite.set(\"x\", this.positionToCoordinate(position));\n\t\t\t\tthis.toggleVisibility(sprite, position, 0, 1);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic updateFill(fill?: Graphics, position?: number, endPosition?: number) {\n\t\tif (fill) {\n\t\t\tif (!$type.isNumber(position)) {\n\t\t\t\tposition = 0;\n\t\t\t}\n\t\t\tif (!$type.isNumber(endPosition)) {\n\t\t\t\tendPosition = 1;\n\t\t\t}\n\n\t\t\tlet x0 = this.positionToCoordinate(position);\n\t\t\tlet x1 = this.positionToCoordinate(endPosition);\n\n\t\t\tthis.fillDrawMethod(fill, x0, x1);\n\t\t}\n\t}\n\n\tprotected fillDrawMethod(fill: Graphics, x0: number, x1: number) {\n\t\tfill.set(\"draw\", (display) => {\n\t\t\t//display.drawRect(x0, 0, x1 - x0, this.axis!.gridContainer.height());\n\t\t\t// using for holes, so can not be rectangle\n\t\t\tconst h = this.axis!.gridContainer.height();\n\t\t\tconst w = this.width();\n\n\t\t\tif (x1 < x0) {\n\t\t\t\t[x1, x0] = [x0, x1];\n\t\t\t}\n\t\t\tif (x0 > w || x1 < 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t/*\n\t\t\tconst limit = 10000;\n\n\t\t\tx0 = Math.max(-limit, x0);\n\t\t\tx1 = Math.min(limit, x1);\n\t\t\t*/\n\n\t\t\tdisplay.moveTo(x0, 0);\n\t\t\tdisplay.lineTo(x1, 0);\n\t\t\tdisplay.lineTo(x1, h);\n\t\t\tdisplay.lineTo(x0, h);\n\t\t\tdisplay.lineTo(x0, 0);\n\t\t})\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic positionTooltip(tooltip: Tooltip, position: number) {\n\t\tthis._positionTooltip(tooltip, { x: this.positionToCoordinate(position), y: 0 })\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic updateTooltipBounds(tooltip: Tooltip) {\n\t\tconst inside = this.get(\"inside\");\n\t\tconst num = 100000;\n\n\t\tlet global = this._display.toGlobal({ x: 0, y: 0 });\n\t\tlet x = global.x;\n\t\tlet y = 0;\n\t\tlet w = this.axisLength();\n\t\tlet h = num;\n\n\t\tlet pointerOrientation: \"up\" | \"down\" = \"up\";\n\n\t\tif (this.get(\"opposite\")) {\n\t\t\tif (inside) {\n\t\t\t\tpointerOrientation = \"up\";\n\t\t\t\ty = global.y;\n\t\t\t\th = num;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tpointerOrientation = \"down\";\n\t\t\t\ty = global.y - num;\n\t\t\t\th = num;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (inside) {\n\t\t\t\tpointerOrientation = \"down\";\n\t\t\t\ty = global.y - num;\n\t\t\t\th = num;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tpointerOrientation = \"up\";\n\t\t\t\ty = global.y;\n\t\t\t\th = num;\n\t\t\t}\n\t\t}\n\n\t\tconst bounds = { left: x, right: x + w, top: y, bottom: y + h };\n\t\tconst oldBounds = tooltip.get(\"bounds\");\n\n\t\tif (!$utils.sameBounds(bounds, oldBounds)) {\n\t\t\ttooltip.set(\"bounds\", bounds);\n\t\t\ttooltip.set(\"pointerOrientation\", pointerOrientation);\n\t\t}\n\t}\n}\n","import { AxisRenderer, IAxisRendererSettings, IAxisRendererPrivate } from \"./AxisRenderer\";\nimport { p100 } from \"../../../core/util/Percent\";\nimport type { IPoint } from \"../../../core/util/IPoint\";\nimport * as $type from \"../../../core/util/Type\";\nimport * as $utils from \"../../../core/util/Utils\";\nimport type { Graphics } from \"../../../core/render/Graphics\";\nimport type { AxisLabel } from \"./AxisLabel\";\nimport type { AxisBullet } from \"./AxisBullet\";\nimport type { Grid } from \"./Grid\";\nimport type { AxisTick } from \"./AxisTick\";\nimport type { Tooltip } from \"../../../core/render/Tooltip\";\nimport type { Template } from \"../../../core/util/Template\";\nimport { Rectangle } from \"../../../core/render/Rectangle\";\n\nexport interface IAxisRendererYSettings extends IAxisRendererSettings {\n\n\t/**\n\t * If set to `true` the axis will be drawn on the opposite side of the plot\n\t * area.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Axis_position} for more info\n\t * @default false\n\t */\n\topposite?: boolean;\n\n\t/**\n\t * If set to `true`, all axis elements (ticks, labels) will be drawn inside\n\t * plot area.\n\t *\n\t * @default false\n\t */\n\tinside?: boolean;\n}\n\nexport interface IAxisRendererYPrivate extends IAxisRendererPrivate {\n}\n\n/**\n * Used to render vertical axis.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/#Axis_renderer} for more info\n * @important\n */\nexport class AxisRendererY extends AxisRenderer {\n\n\tpublic static className: string = \"AxisRendererY\";\n\tpublic static classNames: Array = AxisRenderer.classNames.concat([AxisRendererY.className]);\n\n\tdeclare public _settings: IAxisRendererYSettings;\n\tdeclare public _privateSettings: IAxisRendererYPrivate;\n\n\tdeclare public readonly labelTemplate: Template;\n\n\tprotected _downY?: number;\n\n\tpublic thumb: Rectangle = Rectangle.new(this._root, { height: p100, isMeasured: false, themeTags: [\"axis\", \"y\", \"thumb\"] });\n\n\tpublic _afterNew() {\n\t\tthis._settings.themeTags = $utils.mergeTags(this._settings.themeTags, [\"renderer\", \"y\"]);\n\t\tif (this._settings.opposite) {\n\t\t\tthis._settings.themeTags.push(\"opposite\");\n\t\t}\n\n\t\tsuper._afterNew();\n\t\tthis.setPrivateRaw(\"letter\", \"Y\");\n\n\t\tconst gridTemplate = this.grid.template;\n\t\tgridTemplate.set(\"width\", p100);\n\t\tgridTemplate.set(\"height\", 0);\n\t\tgridTemplate.set(\"draw\", (display, graphics) => {\n\t\t\tdisplay.moveTo(0, 0);\n\t\t\tdisplay.lineTo(graphics.width(), 0);\n\t\t});\n\n\t\tthis.set(\"draw\", (display, renderer) => {\n\t\t\tdisplay.moveTo(0, 0);\n\t\t\tdisplay.lineTo(0, renderer.height());\n\t\t});\n\t}\n\n\tprotected _getPan(point1: IPoint, point2: IPoint): number {\n\t\treturn (point1.y - point2.y) / this.height();\n\t}\n\n\tpublic _changed() {\n\t\tsuper._changed();\n\n\t\tconst axis = this.axis;\n\t\taxis.ghostLabel.setPrivate(\"visible\", !this.get(\"inside\"));\n\t\taxis.ghostLabel.set(\"y\", -1000);\n\n\t\tconst thumb = this.thumb;\n\t\tconst opposite = \"opposite\";\n\t\tconst inside = \"inside\";\n\t\tconst chart = this.chart;\n\n\t\tif (this.isDirty(opposite) || this.isDirty(inside)) {\n\n\t\t\tconst axisChildren = axis.children;\n\n\t\t\tif (this.get(inside)) {\n\t\t\t\taxis.addTag(inside);\n\t\t\t}\n\t\t\telse {\n\t\t\t\taxis.removeTag(inside);\n\t\t\t}\n\n\t\t\tif (chart) {\n\t\t\t\tif (this.get(opposite)) {\n\t\t\t\t\tconst children = chart.rightAxesContainer.children;\n\t\t\t\t\tif (children.indexOf(axis) == -1) {\n\t\t\t\t\t\tchildren.moveValue(axis, 0);\n\t\t\t\t\t}\n\t\t\t\t\taxis.addTag(opposite);\n\t\t\t\t\taxisChildren.moveValue(this, 0);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconst children = chart.leftAxesContainer.children;\n\t\t\t\t\tif (children.indexOf(axis) == -1) {\n\t\t\t\t\t\tchildren.moveValue(axis);\n\t\t\t\t\t}\n\t\t\t\t\taxis.removeTag(opposite);\n\n\t\t\t\t\taxisChildren.moveValue(this);\n\t\t\t\t}\n\n\t\t\t\taxis.ghostLabel._applyThemes();\n\t\t\t\tthis.labels.each((label) => {\n\t\t\t\t\tlabel._applyThemes();\n\t\t\t\t})\n\t\t\t\tthis.root._markDirtyRedraw();\n\t\t\t}\n\t\t\taxis.markDirtySize();\n\t\t}\n\n\t\tconst w = axis.labelsContainer.width();\n\n\t\tif (chart) {\n\t\t\tif (this.get(opposite)) {\n\t\t\t\tthumb.set(\"centerX\", 0);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthumb.set(\"centerX\", w);\n\t\t\t}\n\t\t}\n\n\t\tthumb.setPrivate(\"width\", w);\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic processAxis() {\n\t\tsuper.processAxis();\n\t\tconst axis = this.axis;\n\t\tif (axis.get(\"height\") == null) {\n\t\t\taxis.set(\"height\", p100);\n\t\t}\n\t\tconst horizontalLayout = this._root.horizontalLayout;\n\t\taxis.set(\"layout\", horizontalLayout);\n\t\taxis.labelsContainer.set(\"height\", p100);\n\t\taxis.axisHeader.set(\"layout\", horizontalLayout);\n\t}\n\n\tpublic _updatePositions() {\n\t\tconst axis = this.axis;\n\t\tconst y = axis.y() - $utils.relativeToValue(axis.get(\"centerY\", 0), axis.height());\n\t\taxis.gridContainer.set(\"y\", y);\n\t\taxis.topGridContainer.set(\"y\", y);\n\t\taxis.bulletsContainer.set(\"x\", this.x());\n\n\t\tconst chart = axis.chart;\n\t\tif (chart) {\n\t\t\tconst plotContainer = chart.plotContainer;\n\t\t\tconst axisHeader = axis.axisHeader;\n\t\t\tlet height = axis.get(\"marginTop\", 0);\n\n\t\t\tif (axisHeader.children.length > 0) {\n\t\t\t\theight = axis.axisHeader.height();\n\t\t\t\taxis.set(\"marginTop\", height + 1);\n\t\t\t}\n\t\t\telse {\n\t\t\t\taxisHeader.set(\"height\", height);\n\t\t\t}\n\t\t\taxisHeader.setAll({ y: axis.y() - height, x: -1, width: plotContainer.width() + 2 });\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic axisLength(): number {\n\t\treturn this.axis.innerHeight();\n\t}\n\n\t/**\n\t * Converts axis relative position to actual coordinate in pixels.\n\t *\n\t * @param position Position\n\t * @return Point\n\t */\n\tpublic positionToPoint(position: number): IPoint {\n\t\treturn { x: 0, y: this.positionToCoordinate(position) };\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic updateLabel(label?: AxisLabel, position?: number, endPosition?: number, count?: number) {\n\t\tif (label) {\n\t\t\tif (!$type.isNumber(position)) {\n\t\t\t\tposition = 0;\n\t\t\t}\n\n\t\t\tlet location = 0.5;\n\t\t\tif ($type.isNumber(count) && count > 1) {\n\t\t\t\tlocation = label.get(\"multiLocation\", location)\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlocation = label.get(\"location\", location)\n\t\t\t}\n\n\t\t\tconst opposite = this.get(\"opposite\");\n\t\t\tconst inside = label.get(\"inside\", this.get(\"inside\", false));\n\n\t\t\tif (opposite) {\n\t\t\t\tlabel.set(\"x\", 0);\n\n\t\t\t\tif (inside) {\n\t\t\t\t\tlabel.set(\"position\", \"absolute\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tlabel.set(\"position\", \"relative\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (inside) {\n\t\t\t\t\tlabel.set(\"x\", 0);\n\t\t\t\t\tlabel.set(\"position\", \"absolute\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tlabel.set(\"x\", undefined);\n\t\t\t\t\tlabel.set(\"position\", \"relative\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($type.isNumber(endPosition) && endPosition != position) {\n\t\t\t\tposition = position + (endPosition - position) * location;\n\t\t\t}\n\n\t\t\tlabel.set(\"y\", this.positionToCoordinate(position));\n\t\t\tthis.toggleVisibility(label, position, label.get(\"minPosition\", 0), label.get(\"maxPosition\", 1));\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic updateGrid(grid?: Grid, position?: number, endPosition?: number) {\n\t\tif (grid) {\n\t\t\tif (!$type.isNumber(position)) {\n\t\t\t\tposition = 0;\n\t\t\t}\n\n\t\t\tlet location = grid.get(\"location\", 0.5);\n\t\t\tif ($type.isNumber(endPosition) && endPosition != position) {\n\t\t\t\tposition = position + (endPosition - position) * location;\n\t\t\t}\n\n\t\t\tgrid.set(\"y\", this.positionToCoordinate(position));\n\t\t\tthis.toggleVisibility(grid, position, 0, 1);\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic updateTick(tick?: AxisTick, position?: number, endPosition?: number, count?: number) {\n\t\tif (tick) {\n\t\t\tif (!$type.isNumber(position)) {\n\t\t\t\tposition = 0;\n\t\t\t}\n\n\t\t\tlet location = 0.5;\n\t\t\tif ($type.isNumber(count) && count > 1) {\n\t\t\t\tlocation = tick.get(\"multiLocation\", location);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlocation = tick.get(\"location\", location);\n\t\t\t}\n\n\t\t\tif ($type.isNumber(endPosition) && endPosition != position) {\n\t\t\t\tposition = position + (endPosition - position) * location;\n\t\t\t}\n\n\t\t\ttick.set(\"y\", this.positionToCoordinate(position));\n\n\t\t\tlet length = tick.get(\"length\", 0);\n\t\t\tconst inside = tick.get(\"inside\", this.get(\"inside\", false));\n\n\t\t\tif (this.get(\"opposite\")) {\n\t\t\t\ttick.set(\"x\", 0);\n\t\t\t\tif (inside) {\n\t\t\t\t\tlength *= -1\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (!inside) {\n\t\t\t\t\tlength *= -1\n\t\t\t\t}\n\t\t\t}\n\t\t\ttick.set(\"draw\", (display) => {\n\t\t\t\tdisplay.moveTo(0, 0);\n\t\t\t\tdisplay.lineTo(length, 0);\n\t\t\t})\n\n\t\t\tthis.toggleVisibility(tick, position, tick.get(\"minPosition\", 0), tick.get(\"maxPosition\", 1));\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic updateBullet(bullet?: AxisBullet, position?: number, endPosition?: number) {\n\t\tif (bullet) {\n\n\t\t\tconst sprite = bullet.get(\"sprite\");\n\t\t\tif (sprite) {\n\n\t\t\t\tif (!$type.isNumber(position)) {\n\t\t\t\t\tposition = 0;\n\t\t\t\t}\n\n\t\t\t\tlet location = bullet.get(\"location\", 0.5);\n\t\t\t\tif ($type.isNumber(endPosition) && endPosition != position) {\n\t\t\t\t\tposition = position + (endPosition - position) * location;\n\t\t\t\t}\n\n\n\t\t\t\tlet bulletPosition = this.axis.roundAxisPosition(position, location);\n\t\t\t\tlet previousBullet = this.axis._bullets[bulletPosition];\n\t\t\t\tlet d = 1;\n\t\t\t\tif (this.get(\"opposite\")) {\n\t\t\t\t\td = -1;\n\t\t\t\t}\n\n\t\t\t\tif (bullet.get(\"stacked\")) {\n\t\t\t\t\tif (previousBullet) {\n\t\t\t\t\t\tlet previousSprite = previousBullet.get(\"sprite\");\n\t\t\t\t\t\tif (previousSprite) {\n\t\t\t\t\t\t\tsprite.set(\"x\", previousSprite.x() + previousSprite.width() * d);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tsprite.set(\"x\", 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.axis._bullets[bulletPosition] = bullet;\n\n\n\t\t\t\tsprite.set(\"y\", this.positionToCoordinate(position));\n\n\t\t\t\tthis.toggleVisibility(sprite, position, 0, 1);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic updateFill(fill?: Graphics, position?: number, endPosition?: number) {\n\t\tif (fill) {\n\t\t\tif (!$type.isNumber(position)) {\n\t\t\t\tposition = 0;\n\t\t\t}\n\t\t\tif (!$type.isNumber(endPosition)) {\n\t\t\t\tendPosition = 1;\n\t\t\t}\n\n\t\t\tlet y0 = this.positionToCoordinate(position);\n\t\t\tlet y1 = this.positionToCoordinate(endPosition);\n\n\t\t\tthis.fillDrawMethod(fill, y0, y1);\n\t\t}\n\t}\n\n\tprotected fillDrawMethod(fill: Graphics, y0: number, y1: number) {\n\t\tfill.set(\"draw\", (display) => {\n\t\t\t// using for holes, so can not be rectangle\n\t\t\tconst w = this.axis!.gridContainer.width();\n\t\t\tconst h = this.height();\n\n\t\t\tif (y1 < y0) {\n\t\t\t\t[y1, y0] = [y0, y1];\n\t\t\t}\n\n\t\t\tif (y0 > h || y1 < 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//y0 = Math.max(0, y0);\n\t\t\t//y1 = Math.min(h, y1);\n\n\t\t\tdisplay.moveTo(0, y0);\n\t\t\tdisplay.lineTo(w, y0);\n\t\t\tdisplay.lineTo(w, y1);\n\t\t\tdisplay.lineTo(0, y1);\n\t\t\tdisplay.lineTo(0, y0);\n\t\t})\n\t}\n\n\t/**\n\t * Converts relative position (0-1) on axis to a pixel coordinate.\n\t *\n\t * @param position Position (0-1)\n\t * @return Coordinate (px)\n\t */\n\tpublic positionToCoordinate(position: number): number {\n\t\tif (!this._inversed) {\n\t\t\treturn (this._end - position) * this._axisLength;\n\t\t}\n\t\telse {\n\t\t\treturn (position - this._start) * this._axisLength;\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic positionTooltip(tooltip: Tooltip, position: number) {\n\t\tthis._positionTooltip(tooltip, { x: 0, y: this.positionToCoordinate(position) });\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic updateTooltipBounds(tooltip: Tooltip) {\n\t\tconst inside = this.get(\"inside\");\n\t\tconst num = 100000;\n\n\t\tlet global = this._display.toGlobal({ x: 0, y: 0 });\n\t\tlet y = global.y;\n\t\tlet x = 0;\n\t\tlet h = this.axisLength();\n\t\tlet w = num;\n\n\t\tlet pointerOrientation: \"left\" | \"right\" = \"right\";\n\n\t\tif (this.get(\"opposite\")) {\n\t\t\tif (inside) {\n\t\t\t\tpointerOrientation = \"right\";\n\t\t\t\tx = global.x - num;\n\t\t\t\tw = num;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tpointerOrientation = \"left\";\n\t\t\t\tx = global.x;\n\t\t\t\tw = num;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (inside) {\n\t\t\t\tpointerOrientation = \"left\";\n\t\t\t\tx = global.x;\n\t\t\t\tw = num;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tpointerOrientation = \"right\";\n\t\t\t\tx = global.x - num;\n\t\t\t\tw = num;\n\t\t\t}\n\t\t}\n\n\t\tconst bounds = { left: x, right: x + w, top: y, bottom: y + h };\n\t\tconst oldBounds = tooltip.get(\"bounds\");\n\n\t\tif (!$utils.sameBounds(bounds, oldBounds)) {\n\t\t\ttooltip.set(\"bounds\", bounds);\n\t\t\ttooltip.set(\"pointerOrientation\", pointerOrientation);\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic _updateLC() {\n\t\tconst axis = this.axis;\n\t\tconst parent = axis.parent;\n\t\tif (parent) {\n\t\t\tconst h = parent.innerHeight();\n\t\t\tthis._lc = this.axisLength() / h;\n\t\t\tthis._ls = axis.y() / h;\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic toAxisPosition(position: number): number {\n\t\tconst start = this._start || 0;\n\t\tconst end = this._end || 1;\n\n\t\tposition -= this._ls;\n\n\t\tposition = position * (end - start) / this._lc;\n\n\t\tif (this.get(\"inversed\")) {\n\t\t\tposition = start + position;\n\t\t}\n\t\telse {\n\t\t\tposition = end - position;\n\t\t}\n\n\t\treturn position;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic toGlobalPosition(position: number): number {\n\t\tconst start = this._start || 0;\n\t\tconst end = this._end || 1;\n\n\t\tif (this.get(\"inversed\")) {\n\t\t\tposition = position - start;\n\t\t}\n\t\telse {\n\t\t\tposition = end - position;\n\t\t}\n\n\t\tposition = position / (end - start) * this._lc\n\n\t\tposition += this._ls;\n\n\t\treturn position;\n\t}\n\n\n\t/**\n\t * @ignore\n\t */\n\tpublic fixPosition(position: number) {\n\t\tif (!this.get(\"inversed\")) {\n\t\t\treturn 1 - position;\n\t\t}\n\t\treturn position;\n\t}\n\n}\n","import type { IPoint } from \"../../../core/util/IPoint\";\n\nimport { Tick, ITickSettings, ITickPrivate } from \"../../../core/render/Tick\";\n\n\nexport interface IAxisTickSettings extends ITickSettings {\n\n\t/**\n\t * Relative location of the tick within the cell.\n\t *\n\t * `0` - beginning, `0.5` - middle, `1` - end.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Location_of_axis_elements} for more info\n\t */\n\tlocation?: number;\n\n\t/**\n\t * Relative location of the tick within the cell when it spans multiple\n\t * intervals.\n\t *\n\t * `0` - beginning, `0.5` - middle, `1` - end.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Multi_location} for more info\n\t */\n\tmultiLocation?: number;\n\n\t/**\n\t * If set to `true` the tick will be shown inside plot area.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Labels_ticks_inside_plot_area} for more info\n\t * @default false\n\t */\n\tinside?: boolean | undefined;\n\n\t/**\n\t * The minimum relative position within visible axis scope the tick can\n\t * appear on.\n\t *\n\t * E.g. `0.1` will mean that tick will not be shown if it's closer to the\n\t * beginning of the axis than 10%.\n\t *\n\t * @default 0\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Start_end_labels_and_ticks} for more info\n\t */\n\tminPosition?: number;\n\n\t/**\n\t * The maximum relative position within visible axis scope the tick can\n\t * appear on.\n\t *\n\t * E.g. `0.9` will mean that tick will not be shown if it's closer to the\n\t * end of the axis than 10%.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Start_end_labels_and_ticks} for more info\n\t * @default 1\n\t */\n\tmaxPosition?: number;\n\n}\n\nexport interface IAxisTickPrivate extends ITickPrivate {\n}\n\n/**\n * Draws an axis tick.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Ticks} for more info\n * @important\n */\nexport class AxisTick extends Tick {\n\n\tdeclare public _settings: IAxisTickSettings;\n\tdeclare public _privateSettings: IAxisTickPrivate;\n\n\tprotected _tickPoints: Array = [];\n\n\tpublic static className: string = \"AxisTick\";\n\tpublic static classNames: Array = Tick.classNames.concat([AxisTick.className]);\n}\n","import { DataItem } from \"../../../core/render/Component\";\nimport type { AxisRenderer } from \"./AxisRenderer\";\nimport type { XYSeries, IXYSeriesDataItem } from \"../series/XYSeries\";\nimport { ValueAxis, IValueAxisSettings, IValueAxisPrivate, IValueAxisDataItem, IMinMaxStep, IValueAxisEvents } from \"./ValueAxis\";\nimport * as $type from \"../../../core/util/Type\";\nimport * as $math from \"../../../core/util/Math\";\nimport * as $order from \"../../../core/util/Order\";\nimport * as $array from \"../../../core/util/Array\";\nimport * as $object from \"../../../core/util/Object\";\nimport * as $utils from \"../../../core/util/Utils\";\nimport * as $time from \"../../../core/util/Time\";\nimport type { ITimeInterval } from \"../../../core/util/Time\";\nimport type { TimeUnit } from \"../../../core/util/Time\";\n\nexport interface IDateAxisSettings extends IValueAxisSettings {\n\n\t/**\n\t * Indicates granularity of data.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/date-axis/#Data_granularity} for more info\n\t */\n\tbaseInterval: ITimeInterval;\n\n\t/**\n\t * Relative location of where axis cell starts: 0 - beginning, 1 - end.\n\t *\n\t * IMPORTANT: `startLocation` is not supported by [[GaplessDateAxis]].\n\t *\n\t * @default 0\n\t */\n\tstartLocation?: number;\n\n\t/**\n\t * Relative location of where axis cell ends: 0 - beginning, 1 - end.\n\t *\n\t * IMPORTANT: `endLocation` is not supported by [[GaplessDateAxis]].\n\t * \n\t * @default 1\n\t */\n\tendLocation?: number;\n\n\t/**\n\t * Should axis group data items togeter dynamically?\n\t *\n\t * @default false\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/date-axis/#Dynamic_data_item_grouping} for more info\n\t */\n\tgroupData?: boolean;\n\n\t/**\n\t * Maximum number of data items in the view before data grouping kicks in.\n\t *\n\t * @default 500\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/date-axis/#Dynamic_data_item_grouping} for more info\n\t */\n\tgroupCount?: number;\n\n\t/**\n\t * Force data item grouping to specific interval. This interval must be within groupIntervals array for this to work.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/date-axis/#Dynamic_data_item_grouping} for more info\n\t */\n\tgroupInterval?: ITimeInterval;\n\n\t/**\n\t * A list of intervals the axis is allowed to group data items into.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/date-axis/#Dynamic_data_item_grouping} for more info\n\t */\n\tgroupIntervals?: Array;\n\n\t/**\n\t * A list of intervals the axis is allowed to show grid/labels on.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/date-axis/#Grid_granularity} for more info\n\t */\n\tgridIntervals?: Array;\n\n\t/**\n\t * Display \"period change\" labels using different format.\n\t *\n\t * If set to `true`, will use `periodChangeDateFormats` instead\n\t * of `dateFormats` for such labels, e.g. for month start.\n\t *\n\t * @default true\n\t */\n\tmarkUnitChange?: boolean;\n\n\t/**\n\t * Date formats used for intermediate labels.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/date-axis/#Date_formats} for more info\n\t */\n\tdateFormats?: { [index: string]: string | Intl.DateTimeFormatOptions };\n\n\t/**\n\t * Date formats used for minor grid labels.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/date-axis/#Minor_grid_formats} for more info\n\t * @since 5.6.0\n\t */\n\tminorDateFormats?: { [index: string]: string | Intl.DateTimeFormatOptions };\n\n\t/**\n\t * Date formats used for \"period change\" labels.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/date-axis/#Date_formats} for more info\n\t */\n\tperiodChangeDateFormats?: { [index: string]: string | Intl.DateTimeFormatOptions };\n\n\t/**\n\t * A date format to use for axis tooltip.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/date-axis/#Axis_tooltip} for more info\n\t */\n\ttooltipDateFormat?: string | Intl.DateTimeFormatOptions;\n\n\t/**\n\t * Time unit-specific formats to use for axis tooltip.\n\t * \n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/date-axis/#Axis_tooltip} for more info\n\t * @since 5.1.4\n\t */\n\ttooltipDateFormats?: { [index: string]: string | Intl.DateTimeFormatOptions };\n\n\t/**\n\t * A value which indicates relative position within axis cell to get timestamp\n\t * for the tooltip from.\n\t *\n\t * Values are from `-1` to `1`.\n\t *\n\t * If not set, it will use `tooltipLocation` value, if `tooltipLocation`` is\n\t * not set, it will use -0.5.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/date-axis/#Axis_tooltip} for more info\n\t * @since 5.1.4\n\t */\n\ttooltipIntervalOffset?: number;\n}\n\nexport interface IDateAxisDataItem extends IValueAxisDataItem {\n}\n\nexport interface IDateAxisPrivate extends IValueAxisPrivate {\n\n\t/**\n\t * Current group interval.\n\t */\n\tgroupInterval?: ITimeInterval;\n\n\t/**\n\t * Current base interval.\n\t */\n\tbaseInterval: ITimeInterval;\n\n\t/**\n\t * Current grid interval.\n\t */\n\tgridInterval: ITimeInterval;\n}\n\nexport interface IDateAxisEvents extends IValueAxisEvents {\n\n\t/**\n\t * Kicks in when data grouping is on, and current group interval changes, e.g. via zooming the chart.\n\t *\n\t * @since 5.2.43\n\t */\n\tgroupintervalchanged: {}\n\n}\n\n/**\n * Creates a date axis.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/date-axis/} for more info\n * @important\n */\nexport class DateAxis extends ValueAxis {\n\tpublic static className: string = \"DateAxis\";\n\tpublic static classNames: Array = ValueAxis.classNames.concat([DateAxis.className]);\n\n\tdeclare public _settings: IDateAxisSettings;\n\tdeclare public _privateSettings: IDateAxisPrivate;\n\tdeclare public _dataItemSettings: IDateAxisDataItem;\n\tdeclare public _events: IDateAxisEvents;\n\n\tprotected _dataGrouped: boolean = false;\n\tprotected _seriesDataGrouped: boolean = false;\n\tprotected _groupingCalculated: boolean = false;\n\tprotected _intervalDuration: number = 1;\n\tprotected _baseDuration: number = 1;\n\n\tprotected _intervalMax: { [index: string]: number } = {};\n\tprotected _intervalMin: { [index: string]: number } = {};\n\n\tpublic _afterNew() {\n\t\tthis._settings.themeTags = $utils.mergeTags(this._settings.themeTags, [\"axis\"]);\n\t\tsuper._afterNew();\n\t\tthis._setBaseInterval(this.get(\"baseInterval\"));\n\t\tthis.on(\"baseInterval\", () => {\n\t\t\tthis._setBaseInterval(this.get(\"baseInterval\"));\n\t\t})\n\t}\n\n\tprotected _setBaseInterval(interval: ITimeInterval) {\n\t\tthis.setPrivateRaw(\"baseInterval\", interval);\n\t\tthis._baseDuration = $time.getIntervalDuration(interval);\n\t}\n\n\tprotected _fixZoomFactor() {\n\t\tconst maxZoomFactor = this.get(\"maxZoomFactor\");\n\t\tif (maxZoomFactor != null && maxZoomFactor != Infinity) {\n\t\t\tthis.setPrivateRaw(\"maxZoomFactor\", maxZoomFactor);\n\t\t}\n\t\telse {\n\t\t\tthis.setPrivateRaw(\"maxZoomFactor\", Math.round((this.getPrivate(\"max\", 0) - this.getPrivate(\"min\", 0)) / this.baseMainDuration()));\n\t\t}\n\t}\n\n\tprotected _groupData() {\n\t\tconst min = this.getPrivate(\"min\");\n\t\tconst max = this.getPrivate(\"max\");\n\n\t\tif (($type.isNumber(min) && $type.isNumber(max))) {\n\n\t\t\tthis._fixZoomFactor();\n\n\t\t\tconst groupInterval = this.getPrivate(\"groupInterval\")!;\n\t\t\tif (groupInterval) {\n\t\t\t\tthis._setBaseInterval(groupInterval);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis._setBaseInterval(this.get(\"baseInterval\"));\n\t\t\t}\n\n\n\t\t\tif (this.isDirty(\"groupInterval\")) {\n\t\t\t\tlet groupInterval = this.get(\"groupInterval\")!;\n\t\t\t\tif (groupInterval) {\n\t\t\t\t\tthis.setRaw(\"groupIntervals\", [groupInterval]);\n\t\t\t\t\tthis._handleRangeChange();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.isDirty(\"groupData\")) {\n\t\t\t\tif (!this._dataGrouped) {\n\t\t\t\t\tif (this.get(\"groupData\")) {\n\t\t\t\t\t\t$array.each(this.series, (series) => {\n\t\t\t\t\t\t\tthis._groupSeriesData(series);\n\t\t\t\t\t\t})\n\n\t\t\t\t\t\tthis._handleRangeChange();\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tlet baseInterval = this.get(\"baseInterval\");\n\t\t\t\t\t\tlet mainDataSetId: string = baseInterval.timeUnit + baseInterval.count;\n\t\t\t\t\t\t$array.each(this.series, (series) => {\n\t\t\t\t\t\t\tseries.setDataSet(mainDataSetId);\n\t\t\t\t\t\t\tseries.resetGrouping();\n\t\t\t\t\t\t})\n\n\t\t\t\t\t\tthis._setBaseInterval(baseInterval);\n\t\t\t\t\t\tthis.setPrivateRaw(\"groupInterval\", undefined);\n\t\t\t\t\t\tthis.markDirtyExtremes();\n\t\t\t\t\t}\n\t\t\t\t\tthis._dataGrouped = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\n\tpublic _groupSeriesData(series: XYSeries) {\n\t\tif (this.get(\"groupData\") && !series.get(\"groupDataDisabled\")) {\n\n\t\t\tthis._dataGrouped = true; // helps to avoid double grouping\n\n\t\t\tthis._seriesDataGrouped = true;\n\n\t\t\t// make array of intervals which will be used;\n\t\t\tlet intervals: ITimeInterval[] = [];\n\t\t\tlet baseDuration = this.baseMainDuration();\n\n\t\t\tlet groupIntervals = this.get(\"groupIntervals\")!;\n\t\t\tif (groupIntervals) { }\n\t\t\t$array.each(groupIntervals, (interval) => {\n\t\t\t\tlet intervalDuration = $time.getIntervalDuration(interval);\n\t\t\t\tif (intervalDuration > baseDuration) {\n\t\t\t\t\tintervals.push(interval);\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tseries._dataSets = {};\n\n\t\t\tconst key = this.getPrivate(\"name\")! + this.get(\"renderer\").getPrivate(\"letter\")!;\n\t\t\tlet fields: Array;\n\n\t\t\tconst baseAxis = series.get(\"baseAxis\");\n\n\t\t\tif (series.get(\"xAxis\") === baseAxis) {\n\t\t\t\tfields = series._valueYFields;\n\t\t\t}\n\t\t\telse if (series.get(\"yAxis\") === baseAxis) {\n\t\t\t\tfields = series._valueXFields;\n\t\t\t}\n\n\t\t\tlet dataItems = series._mainDataItems;\n\t\t\tlet baseInterval = this.get(\"baseInterval\");\n\t\t\tlet mainDataSetId: string = baseInterval.timeUnit + baseInterval.count;\n\n\t\t\tseries._dataSets[mainDataSetId] = dataItems;\n\n\t\t\tconst groupCallback = series.get(\"groupDataCallback\");\n\t\t\tlet groupOriginals = series.get(\"groupDataWithOriginals\", false);\n\t\t\tif (groupCallback) {\n\t\t\t\tgroupOriginals = true;\n\t\t\t}\n\n\t\t\t$array.each(intervals, (interval) => {\n\n\t\t\t\tlet previousTime = -Infinity;\n\t\t\t\tlet dataSetId = interval.timeUnit + interval.count;\n\t\t\t\tseries._dataSets[dataSetId] = [];\n\n\t\t\t\tlet newDataItem: DataItem;\n\n\t\t\t\tlet sum: { [index: string]: number } = {};\n\t\t\t\tlet count: { [index: string]: number } = {};\n\n\t\t\t\tlet groupFieldValues: { [index: string]: string } = {};\n\t\t\t\tlet workingFields: { [index: string]: string } = {};\n\n\t\t\t\t$array.each(fields, (field) => {\n\t\t\t\t\tsum[field] = 0;\n\t\t\t\t\tcount[field] = 0;\n\t\t\t\t\tgroupFieldValues[field] = series.get((field + \"Grouped\") as any);\n\t\t\t\t\tworkingFields[field] = field + \"Working\";\n\t\t\t\t})\n\n\t\t\t\tlet intervalDuration = $time.getDuration(interval.timeUnit);\n\n\t\t\t\tlet firstItem = dataItems[0];\n\t\t\t\tlet firstTime: any;\n\t\t\t\tif (firstItem) {\n\t\t\t\t\tfirstTime = dataItems[0].get(key as any);\n\t\t\t\t}\n\n\t\t\t\tlet prevNewDataItem: DataItem | undefined;\n\t\t\t\t$array.each(dataItems, (dataItem) => {\n\t\t\t\t\tlet time = dataItem.get(key as any);\n\t\t\t\t\t//let roundedTime = $time.round(new Date(time), interval.timeUnit, interval.count, firstDay, utc, firstDate, timezone).getTime();\n\t\t\t\t\tlet roundedTime = $time.roun(time, interval.timeUnit, interval.count, this._root, firstTime);\n\t\t\t\t\tlet dataContext: any;\n\n\t\t\t\t\tif (previousTime < roundedTime - intervalDuration / 24) {\n\t\t\t\t\t\tdataContext = $object.copy(dataItem.dataContext);\n\n\t\t\t\t\t\tnewDataItem = new DataItem(series, dataContext, series._makeDataItem(dataContext));\n\t\t\t\t\t\tnewDataItem.setRaw(key as any, roundedTime);\n\n\t\t\t\t\t\tseries._dataSets[dataSetId].push(newDataItem);\n\n\t\t\t\t\t\t$array.each(fields, (field) => {\n\t\t\t\t\t\t\tlet value = dataItem.get(field as any);\n\t\t\t\t\t\t\tif ($type.isNumber(value)) {\n\t\t\t\t\t\t\t\tnewDataItem.setRaw(field as any, value);\n\t\t\t\t\t\t\t\tnewDataItem.setRaw(workingFields[field] as any, value);\n\t\t\t\t\t\t\t\tcount[field] = 1;\n\t\t\t\t\t\t\t\tsum[field] = value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tsum[field] = 0;\n\t\t\t\t\t\t\t\tcount[field] = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\n\t\t\t\t\t\tif (groupOriginals) {\n\t\t\t\t\t\t\tnewDataItem.set(\"originals\", [dataItem]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (groupCallback && prevNewDataItem) {\n\t\t\t\t\t\t\tgroupCallback(prevNewDataItem, interval);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tprevNewDataItem = newDataItem;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$array.each(fields, (field) => {\n\t\t\t\t\t\t\tlet groupKey = groupFieldValues[field];\n\t\t\t\t\t\t\tlet value = dataItem.get(field as any);\n\n\t\t\t\t\t\t\tif (value != null) {\n\n\t\t\t\t\t\t\t\tlet currentValue = newDataItem.get(field as any);\n\n\t\t\t\t\t\t\t\tswitch (groupKey) {\n\t\t\t\t\t\t\t\t\tcase \"close\":\n\t\t\t\t\t\t\t\t\t\tnewDataItem.setRaw(field as any, value);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase \"sum\":\n\t\t\t\t\t\t\t\t\t\tnewDataItem.setRaw(field as any, currentValue + value);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase \"open\":\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase \"low\":\n\t\t\t\t\t\t\t\t\t\tif (value < currentValue) {\n\t\t\t\t\t\t\t\t\t\t\tnewDataItem.setRaw(field as any, value);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase \"high\":\n\t\t\t\t\t\t\t\t\t\tif (value > currentValue) {\n\t\t\t\t\t\t\t\t\t\t\tnewDataItem.setRaw(field as any, value);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase \"average\":\n\t\t\t\t\t\t\t\t\t\tcount[field]++;\n\t\t\t\t\t\t\t\t\t\tsum[field] += value;\n\t\t\t\t\t\t\t\t\t\tlet average = sum[field] / count[field];\n\t\t\t\t\t\t\t\t\t\tnewDataItem.setRaw(field as any, average);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase \"extreme\":\n\t\t\t\t\t\t\t\t\t\tif (Math.abs(value) > Math.abs(currentValue)) {\n\t\t\t\t\t\t\t\t\t\t\tnewDataItem.setRaw(field as any, value);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tnewDataItem.setRaw(workingFields[field] as any, newDataItem.get(field as any));\n\t\t\t\t\t\t\t\tlet dataContext: any = $object.copy(dataItem.dataContext);\n\t\t\t\t\t\t\t\tdataContext[key as any] = roundedTime;\n\t\t\t\t\t\t\t\tnewDataItem.dataContext = dataContext;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\n\t\t\t\t\t\tif (groupOriginals) {\n\t\t\t\t\t\t\tnewDataItem.get(\"originals\")!.push(dataItem);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpreviousTime = roundedTime;\n\t\t\t\t})\n\n\t\t\t\tif (groupCallback && prevNewDataItem) {\n\t\t\t\t\tgroupCallback(prevNewDataItem, interval);\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tif (series._dataSetId) {\n\t\t\t\tseries.setDataSet(series._dataSetId);\n\t\t\t}\n\t\t\tthis.markDirtySize();\n\t\t\t// solves problem if new series was added\n\t\t\tif (this._seriesAdded) {\n\t\t\t\tthis._root.events.once(\"frameended\", () => {\n\t\t\t\t\tthis.markDirtySize();\n\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic _clearDirty() {\n\t\tsuper._clearDirty();\n\t\tthis._groupingCalculated = false;\n\t\tthis._dataGrouped = false;\n\t}\n\n\t/**\n\t * Returns a time interval axis would group data to for a specified duration.\n\t *\n\t * @since 5.2.1\n\t */\n\tpublic getGroupInterval(duration: number): ITimeInterval {\n\t\tlet baseInterval = this.get(\"baseInterval\");\n\t\tlet groupInterval = $time.chooseInterval(0, duration, this.get(\"groupCount\", Infinity), this.get(\"groupIntervals\")!);\n\t\tif ($time.getIntervalDuration(groupInterval) < $time.getIntervalDuration(baseInterval)) {\n\t\t\tgroupInterval = { ...baseInterval };\n\t\t}\n\t\treturn groupInterval;\n\t}\n\n\t/**\n\t * Return `max` of a specified time interval.\n\t * \n\t * Will work only if the axis was grouped to this interval at least once.\n\t * \n\t * @since 5.2.1\n\t * @param interval Interval\n\t * @return Max\n\t */\n\tpublic getIntervalMax(interval: ITimeInterval): number {\n\t\treturn this._intervalMax[interval.timeUnit + interval.count];\n\t}\n\n\t/**\n\t * Return `min` of a specified time interval.\n\t * \n\t * Will work only if the axis was grouped to this interval at least once.\n\t * \n\t * @since 5.2.1\n\t * @param interval Interval\n\t * @return Min\n\t */\n\tpublic getIntervalMin(interval: ITimeInterval): number {\n\t\treturn this._intervalMin[interval.timeUnit + interval.count];\n\t}\n\n\tprotected _handleRangeChange() {\n\t\tsuper._handleRangeChange();\n\n\t\tlet selectionMin = Math.round(this.getPrivate(\"selectionMin\")! as number);\n\t\tlet selectionMax = Math.round(this.getPrivate(\"selectionMax\")! as number);\n\n\t\tif ($type.isNumber(selectionMin) && $type.isNumber(selectionMax)) {\n\n\t\t\tif (this.get(\"endLocation\") == 0) {\n\t\t\t\tselectionMax += 1;\n\t\t\t}\n\n\t\t\tif (this.get(\"groupData\") && !this._groupingCalculated) {\n\t\t\t\tthis._groupingCalculated = true;\n\n\t\t\t\tlet groupInterval = this.get(\"groupInterval\");\n\t\t\t\tlet current = this.getPrivate(\"groupInterval\");\n\n\t\t\t\tlet modifiedDifference = (selectionMax - selectionMin) + (this.get(\"startLocation\", 0) + (1 - this.get(\"endLocation\", 1)) * this.baseDuration());\n\n\t\t\t\tif (current) {\n\t\t\t\t\tlet duration = $time.getIntervalDuration(current);\n\t\t\t\t\tmodifiedDifference = Math.ceil(modifiedDifference / duration) * duration;\n\t\t\t\t}\n\n\t\t\t\tif (!groupInterval) {\n\t\t\t\t\tgroupInterval = this.getGroupInterval(modifiedDifference);\n\t\t\t\t}\n\n\t\t\t\tif (groupInterval && (!current || (current.timeUnit !== groupInterval.timeUnit || current.count !== groupInterval.count) || this._seriesDataGrouped)) {\n\t\t\t\t\tthis._seriesDataGrouped = false;\n\t\t\t\t\tthis.setPrivateRaw(\"groupInterval\", groupInterval);\n\t\t\t\t\tthis._setBaseInterval(groupInterval)\n\n\n\t\t\t\t\tlet newId = groupInterval.timeUnit + groupInterval.count;\n\t\t\t\t\t$array.each(this.series, (series) => {\n\t\t\t\t\t\tif (series.get(\"baseAxis\") === this) {\n\t\t\t\t\t\t\tseries.setDataSet(newId);\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\n\t\t\t\t\tthis.markDirtyExtremes();\n\n\t\t\t\t\tthis._root.events.once(\"frameended\", () => {\n\t\t\t\t\t\tthis._root.events.once(\"frameended\", () => {\n\t\t\t\t\t\t\tconst type = \"groupintervalchanged\";\n\t\t\t\t\t\t\tif (this.events.isEnabled(type)) {\n\t\t\t\t\t\t\t\tthis.events.dispatch(type, { type: type, target: this });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$array.each(this.series, (series) => {\n\t\t\t\tif (series.get(\"baseAxis\") === this) {\n\t\t\t\t\tlet fieldName = (this.getPrivate(\"name\")! + this.get(\"renderer\").getPrivate(\"letter\")!);\n\n\t\t\t\t\tconst start = $array.getFirstSortedIndex(series.dataItems, (dataItem) => {\n\t\t\t\t\t\treturn $order.compare(dataItem.get(fieldName), selectionMin);\n\t\t\t\t\t});\n\n\t\t\t\t\tlet startIndex = start.index;\n\n\t\t\t\t\tif (startIndex > 0) {\n\t\t\t\t\t\tstartIndex -= 1;\n\t\t\t\t\t}\n\n\t\t\t\t\tselectionMax += this.baseDuration() * (1 - this.get(\"endLocation\", 1));\n\n\t\t\t\t\tconst end = $array.getSortedIndex(series.dataItems, (dataItem) => {\n\t\t\t\t\t\treturn $order.compare(dataItem.get(fieldName), selectionMax);\n\t\t\t\t\t});\n\n\t\t\t\t\tlet endIndex = end.index;\n\t\t\t\t\tlet endIndex2 = endIndex;\n\n\t\t\t\t\tif (endIndex2 > 1) {\n\t\t\t\t\t\tendIndex2--;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst firstDataItem = series.dataItems[startIndex];\n\t\t\t\t\tconst lastDataItem = series.dataItems[endIndex2];\n\n\t\t\t\t\tlet lastDate: number | undefined;\n\t\t\t\t\tlet firstDate: number | undefined;\n\t\t\t\t\tif (firstDataItem) {\n\t\t\t\t\t\tfirstDate = firstDataItem.get(fieldName);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (lastDataItem) {\n\t\t\t\t\t\tlastDate = lastDataItem.get(fieldName);\n\t\t\t\t\t}\n\n\t\t\t\t\tlet outOfSelection = false;\n\t\t\t\t\tif (lastDate != null && firstDate != null) {\n\t\t\t\t\t\tif (lastDate < selectionMin || firstDate > selectionMax) {\n\t\t\t\t\t\t\toutOfSelection = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tseries.setPrivate(\"outOfSelection\", outOfSelection);\n\t\t\t\t\tseries.setPrivate(\"startIndex\", startIndex);\n\t\t\t\t\tseries.setPrivate(\"adjustedStartIndex\", series._adjustStartIndex(startIndex));\n\t\t\t\t\tseries.setPrivate(\"endIndex\", endIndex);\n\t\t\t\t\tthis.root.events.once(\"frameended\", () => {\n\t\t\t\t\t\tseries._markDirtyPrivateKey(\"adjustedStartIndex\");\n\t\t\t\t\t})\n\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}\n\n\tprotected _adjustMinMax(min: number, max: number, gridCount: number, _strictMode?: boolean): IMinMaxStep {\n\t\treturn { min: min, max: max, step: (max - min) / gridCount };\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic intervalDuration(): number {\n\t\treturn this._intervalDuration;\n\t}\n\n\tprotected _saveMinMax(min: number, max: number) {\n\t\tlet groupInterval = this.getPrivate(\"groupInterval\");\n\n\t\tif (!groupInterval) {\n\t\t\tgroupInterval = this.get(\"baseInterval\");\n\t\t}\n\n\t\tlet id = groupInterval.timeUnit + groupInterval.count;\n\t\tthis._intervalMin[id] = min;\n\t\tthis._intervalMax[id] = max;\n\t}\n\n\tprotected _getM(timeUnit: TimeUnit) {\n\t\tif (timeUnit == \"month\" || timeUnit == \"year\" || timeUnit == \"day\") {\n\t\t\treturn 1.05;\n\t\t}\n\t\treturn 1.01;\n\t}\n\n\tprotected _getMinorInterval(interval: ITimeInterval): ITimeInterval | undefined {\n\t\tlet minorGridInterval: ITimeInterval | undefined;\n\t\tlet count = interval.count;\n\t\tlet timeUnit = interval.timeUnit;\n\t\tif (count > 1) {\n\t\t\tif (count == 10) {\n\t\t\t\tcount = 5;\n\t\t\t}\n\t\t\telse if (count == 15) {\n\t\t\t\tcount = 5;\n\t\t\t}\n\t\t\telse if (count == 12) {\n\t\t\t\tcount = 2;\n\t\t\t}\n\t\t\telse if (count == 6) {\n\t\t\t\tcount = 1;\n\t\t\t}\n\t\t\telse if (count == 30) {\n\t\t\t\tcount = 10;\n\t\t\t}\n\t\t\telse if (count < 10) {\n\t\t\t\tcount = 1;\n\t\t\t}\n\t\t\tminorGridInterval = { timeUnit: timeUnit, count: count };\n\t\t}\n\t\tif (timeUnit == \"week\") {\n\t\t\tif (this.getPrivate(\"baseInterval\")?.timeUnit != \"week\") {\n\t\t\t\tminorGridInterval = { timeUnit: \"day\", count: 1 };\n\t\t\t}\n\t\t\telse {\n\t\t\t\tminorGridInterval = { timeUnit: \"week\", count: 1 };\n\t\t\t}\n\t\t}\n\t\treturn minorGridInterval;\n\t}\n\n\tprotected _prepareAxisItems() {\n\t\tconst min = this.getPrivate(\"min\");\n\t\tconst max = this.getPrivate(\"max\");\n\n\t\tif ($type.isNumber(min) && $type.isNumber(max)) {\n\t\t\tconst root = this._root;\n\t\t\tconst selectionMin = Math.round(this.getPrivate(\"selectionMin\")! as number);\n\t\t\tconst selectionMax = Math.round(this.getPrivate(\"selectionMax\")! as number);\n\t\t\tconst renderer = this.get(\"renderer\");\n\t\t\tconst baseInterval = this.getPrivate(\"baseInterval\");\n\n\t\t\tlet value = selectionMin;\n\t\t\tlet i = 0;\n\n\t\t\tconst intervals = this.get(\"gridIntervals\")!;\n\t\t\tlet gridInterval = $time.chooseInterval(0, selectionMax - selectionMin, renderer.gridCount(), intervals);\n\n\t\t\tif ($time.getIntervalDuration(gridInterval) < this.baseDuration()) {\n\t\t\t\tgridInterval = { ...baseInterval };\n\t\t\t}\n\n\t\t\tconst intervalDuration = $time.getIntervalDuration(gridInterval);\n\t\t\tthis._intervalDuration = intervalDuration;\n\n\t\t\tconst nextGridUnit = $time.getNextUnit(gridInterval.timeUnit);\n\t\t\tconst utc = root.utc;\n\t\t\tconst timezone = root.timezone;\n\n\t\t\t//value = $time.round(new Date(selectionMin - intervalDuration), gridInterval.timeUnit, gridInterval.count, firstDay, utc, new Date(min), timezone).getTime();\n\t\t\tvalue = $time.roun(selectionMin - intervalDuration, gridInterval.timeUnit, gridInterval.count, root, min);\n\t\t\tlet previousValue = value - intervalDuration;\n\t\t\tlet format: string | Intl.DateTimeFormatOptions;\n\t\t\tconst formats = this.get(\"dateFormats\")!;\n\n\t\t\tthis.setPrivateRaw(\"gridInterval\", gridInterval);\n\n\t\t\tconst minorLabelsEnabled = renderer.get(\"minorLabelsEnabled\");\n\t\t\tconst minorGridEnabled = renderer.get(\"minorGridEnabled\", minorLabelsEnabled);\n\n\t\t\tlet minorGridInterval: ITimeInterval | undefined;\n\t\t\tlet minorDuration = 0;\n\n\t\t\tif (minorGridEnabled) {\n\t\t\t\tminorGridInterval = this._getMinorInterval(gridInterval);\n\t\t\t\tminorDuration = $time.getIntervalDuration(minorGridInterval);\n\t\t\t}\n\n\t\t\tlet m = 0;\n\t\t\twhile (value < selectionMax + intervalDuration) {\n\t\t\t\tlet dataItem: DataItem;\n\t\t\t\tif (this.dataItems.length < i + 1) {\n\t\t\t\t\tdataItem = new DataItem(this, undefined, {});\n\t\t\t\t\tthis._dataItems.push(dataItem);\n\t\t\t\t\tthis.processDataItem(dataItem);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tdataItem = this.dataItems[i];\n\t\t\t\t}\n\n\t\t\t\tthis._createAssets(dataItem, []);\n\n\t\t\t\tthis._toggleDataItem(dataItem, true);\n\n\t\t\t\tdataItem.setRaw(\"value\", value);\n\t\t\t\tdataItem.setRaw(\"labelEndValue\", undefined);\n\n\t\t\t\tlet endValue = value + $time.getDuration(gridInterval.timeUnit, gridInterval.count * this._getM(gridInterval.timeUnit));\n\t\t\t\t//endValue = $time.round(new Date(endValue), gridInterval.timeUnit, 1, firstDay, utc, undefined, timezone).getTime();\n\t\t\t\tendValue = $time.roun(endValue, gridInterval.timeUnit, 1, root);\n\n\t\t\t\tdataItem.setRaw(\"endValue\", endValue);\n\n\t\t\t\tlet date = new Date(value);\n\n\t\t\t\tformat = formats[gridInterval.timeUnit];\n\t\t\t\tif (nextGridUnit && this.get(\"markUnitChange\") && $type.isNumber(previousValue)) {\n\t\t\t\t\tif (gridInterval.timeUnit != \"year\") {\n\t\t\t\t\t\tif ($time.checkChange(value, previousValue, nextGridUnit, utc, timezone)) {\n\t\t\t\t\t\t\tformat = this.get(\"periodChangeDateFormats\")![gridInterval.timeUnit];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst label = dataItem.get(\"label\");\n\t\t\t\tif (label) {\n\t\t\t\t\tlabel.set(\"text\", root.dateFormatter.format(date, format!));\n\t\t\t\t}\n\n\t\t\t\tlet count = gridInterval.count;\n\t\t\t\t// so that labels of week would always be at the beginning of the grid\n\t\t\t\tif (gridInterval.timeUnit == \"week\") {\n\t\t\t\t\tdataItem.setRaw(\"labelEndValue\", value);\n\t\t\t\t}\n\n\t\t\t\tif (minorGridEnabled) {\n\t\t\t\t\tcount = 1;\n\t\t\t\t\tlet timeUnit = gridInterval.timeUnit;\n\t\t\t\t\tif (timeUnit == \"week\") {\n\t\t\t\t\t\ttimeUnit = \"day\";\n\t\t\t\t\t}\n\n\t\t\t\t\tlet labelEndValue = value + $time.getDuration(timeUnit, this._getM(timeUnit));\n\t\t\t\t\t//labelEndValue = $time.round(new Date(labelEndValue), timeUnit, 1, firstDay, utc, undefined, timezone).getTime();\n\t\t\t\t\tlabelEndValue = $time.roun(labelEndValue, timeUnit, 1, root);\n\t\t\t\t\tdataItem.setRaw(\"labelEndValue\", labelEndValue);\n\t\t\t\t}\n\n\t\t\t\tthis._prepareDataItem(dataItem, count);\n\n\t\t\t\tpreviousValue = value;\n\t\t\t\tvalue = endValue;\n\n\t\t\t\t// min grid\n\t\t\t\tif (minorGridInterval) {\n\t\t\t\t\tconst minorTimeUnit = minorGridInterval.timeUnit;\n\t\t\t\t\tconst minorCount = minorGridInterval.count;\n\t\t\t\t\tconst mmm = this._getM(minorTimeUnit);\n\n\t\t\t\t\t//let minorValue = $time.round(new Date(previousValue + minorDuration * this._getM(minorGridInterval.timeUnit)), minorGridInterval.timeUnit, minorGridInterval.count, firstDay, utc, new Date(previousValue), timezone).getTime();\n\t\t\t\t\tlet minorValue = $time.roun(previousValue + minorDuration * mmm, minorTimeUnit, minorCount, root, previousValue);\n\n\t\t\t\t\tlet previousMinorValue: number | undefined;\n\t\t\t\t\tlet minorFormats = this.get(\"minorDateFormats\", this.get(\"dateFormats\"))!;\n\n\t\t\t\t\twhile (minorValue < value - 0.01 * minorDuration) {\n\t\t\t\t\t\tlet minorDataItem: DataItem;\n\t\t\t\t\t\tif (this.minorDataItems.length < m + 1) {\n\t\t\t\t\t\t\tminorDataItem = new DataItem(this, undefined, {});\n\t\t\t\t\t\t\tthis.minorDataItems.push(minorDataItem);\n\t\t\t\t\t\t\tthis.processDataItem(minorDataItem);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tminorDataItem = this.minorDataItems[m];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis._createAssets(minorDataItem, [\"minor\"], true);\n\n\t\t\t\t\t\tthis._toggleDataItem(minorDataItem, true);\n\n\t\t\t\t\t\tminorDataItem.setRaw(\"value\", minorValue);\n\n\t\t\t\t\t\tlet minorEndValue = minorValue + $time.getDuration(minorTimeUnit, minorCount * mmm);\n\t\t\t\t\t\t//minorEndValue = $time.round(new Date(minorEndValue), minorGridInterval.timeUnit, 1, firstDay, utc, undefined, timezone).getTime();\n\t\t\t\t\t\tminorEndValue = $time.roun(minorEndValue, minorTimeUnit, 1, root);\n\n\t\t\t\t\t\tminorDataItem.setRaw(\"endValue\", minorEndValue);\n\n\t\t\t\t\t\tlet date = new Date(minorValue);\n\n\t\t\t\t\t\tformat = minorFormats[minorTimeUnit];\n\n\t\t\t\t\t\tconst minorLabel = minorDataItem.get(\"label\");\n\n\t\t\t\t\t\tif (minorLabel) {\n\t\t\t\t\t\t\tif (minorLabelsEnabled) {\n\t\t\t\t\t\t\t\tminorLabel.set(\"text\", root.dateFormatter.format(date, format!));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tminorLabel.setPrivate(\"visible\", false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis._prepareDataItem(minorDataItem, 1);\n\n\t\t\t\t\t\tif (minorValue == previousMinorValue) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpreviousMinorValue = minorValue;\n\t\t\t\t\t\tminorValue = minorEndValue;\n\t\t\t\t\t\tm++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (value == previousValue) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\ti++;\n\t\t\t}\n\n\t\t\tfor (let j = i; j < this.dataItems.length; j++) {\n\t\t\t\tthis._toggleDataItem(this.dataItems[j], false);\n\t\t\t}\n\n\t\t\tfor (let j = m; j < this.minorDataItems.length; j++) {\n\t\t\t\tthis._toggleDataItem(this.minorDataItems[j], false);\n\t\t\t}\n\n\t\t\t$array.each(this.series, (series) => {\n\t\t\t\tif (series.inited) {\n\t\t\t\t\tseries._markDirtyAxes();\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\tthis._updateGhost();\n\t}\n\n\tprotected _updateFinals(start: number, end: number) {\n\t\tthis.setPrivateRaw(\"selectionMinFinal\", this.positionToValue(start));\n\t\tthis.setPrivateRaw(\"selectionMaxFinal\", this.positionToValue(end));\n\t}\n\n\tprotected _getDelta() {\n\t\tthis._deltaMinMax = this.baseDuration() / 2;\n\t}\n\n\tprotected _fixMin(min: number) {\n\t\tconst baseInterval = this.getPrivate(\"baseInterval\");\n\t\tconst timeUnit = baseInterval.timeUnit;\n\t\t//let startTime = $time.round(new Date(min), timeUnit, baseInterval.count, firstDay, utc, undefined, timezone).getTime();\n\t\tlet startTime = $time.roun(min, timeUnit, baseInterval.count, this._root);\n\n\t\tlet endTime = startTime + $time.getDuration(timeUnit, baseInterval.count * this._getM(timeUnit))\n\t\t//endTime = $time.round(new Date(endTime), timeUnit, 1, firstDay, utc, undefined, timezone).getTime();\n\t\tendTime = $time.roun(endTime, timeUnit, 1, this._root);\n\t\treturn startTime + (endTime - startTime) * this.get(\"startLocation\", 0);\n\t}\n\n\tprotected _fixMax(max: number) {\n\t\tconst baseInterval = this.getPrivate(\"baseInterval\");\n\t\tconst timeUnit = baseInterval.timeUnit;\n\t\t//let startTime = $time.round(new Date(max), timeUnit, baseInterval.count, firstDay, utc, undefined, timezone).getTime();\n\t\tlet startTime = $time.roun(max, timeUnit, baseInterval.count, this._root);\n\t\tlet endTime = startTime + $time.getDuration(timeUnit, baseInterval.count * this._getM(timeUnit))\n\t\t//endTime = $time.round(new Date(endTime), timeUnit, 1, firstDay, utc, undefined, timezone).getTime();\n\t\tendTime = $time.roun(endTime, timeUnit, 1, this._root);\n\n\t\treturn startTime + (endTime - startTime) * this.get(\"endLocation\", 1);\n\t}\n\n\tprotected _updateDates(_date: number, _series: XYSeries) {\n\n\t}\n\n\t/**\n\t * Returns a duration of currently active `baseInterval` in milliseconds.\n\t * \n\t * @return Duration\n\t */\n\tpublic baseDuration(): number {\n\t\treturn this._baseDuration;\n\t\t//return $time.getIntervalDuration(this.getPrivate(\"baseInterval\"));\n\t}\n\n\t/**\n\t * Returns a duration of user-defined `baseInterval` in milliseconds.\n\t *\n\t * @return Duration\n\t */\n\tpublic baseMainDuration(): number {\n\t\treturn $time.getIntervalDuration(this.get(\"baseInterval\"));\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic processSeriesDataItem(dataItem: DataItem, fields: Array) {\n\t\tconst baseInterval = this.getPrivate(\"baseInterval\");\n\n\t\tif (!dataItem.open) {\n\t\t\tdataItem.open = {};\n\t\t}\n\t\tif (!dataItem.close) {\n\t\t\tdataItem.close = {};\n\t\t}\n\n\t\t$array.each(fields, (field) => {\n\t\t\tlet value = dataItem.get(field as any);\n\t\t\tif ($type.isNumber(value)) {\n\t\t\t\tlet startTime = dataItem.open![field];\n\t\t\t\tlet endTime = dataItem.close![field];\n\t\t\t\t// this is done to save cpu, as rounding is quite expensive, especially with timezone set. \n\t\t\t\t// if value is between prev start and end, it means it didn't change, all is fine.\n\t\t\t\tif (value >= startTime && value <= endTime) {\n\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconst timeUnit = baseInterval.timeUnit;\n\t\t\t\t\tconst count = baseInterval.count;\n\t\t\t\t\t//startTime = $time.round(new Date(value), timeUnit, count, firstDay, utc, undefined, timezone).getTime();\n\t\t\t\t\tstartTime = $time.roun(value, timeUnit, count, this._root);\n\t\t\t\t\tendTime = startTime + $time.getDuration(timeUnit, count * this._getM(timeUnit));\n\t\t\t\t\t//endTime = $time.round(new Date(endTime), timeUnit, 1, firstDay, utc, undefined, timezone).getTime();\n\t\t\t\t\tendTime = $time.roun(endTime, timeUnit, 1, this._root);\n\n\t\t\t\t\tdataItem.open![field] = startTime;\n\t\t\t\t\tdataItem.close![field] = endTime;\n\t\t\t\t}\n\n\t\t\t\tthis._updateDates(startTime, dataItem.component as XYSeries);\n\t\t\t}\n\t\t})\n\t}\n\n\tprotected _handleSizeDirty() {\n\t\t// void \n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic getDataItemPositionX(dataItem: DataItem, field: string, cellLocation: number, axisLocation: number): number {\n\n\t\tlet openValue;\n\t\tlet closeValue;\n\n\t\tif (dataItem.open && dataItem.close) {\n\t\t\topenValue = dataItem.open[field];\n\t\t\tcloseValue = dataItem.close[field];\n\t\t}\n\t\telse {\n\t\t\topenValue = dataItem.get(field as any)\n\t\t\tcloseValue = openValue;\n\t\t}\n\n\t\tlet value = openValue + (closeValue - openValue) * cellLocation;\n\n\t\tvalue = this._baseValue + (value - this._baseValue) * axisLocation;\n\n\t\treturn this.valueToPosition(value);\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic getDataItemCoordinateX(dataItem: DataItem, field: string, cellLocation: number, axisLocation: number): number {\n\t\treturn this._settings.renderer.positionToCoordinate(this.getDataItemPositionX(dataItem, field, cellLocation, axisLocation));\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic getDataItemPositionY(dataItem: DataItem, field: string, cellLocation: number, axisLocation: number): number {\n\t\tlet openValue;\n\t\tlet closeValue;\n\n\t\tif (dataItem.open && dataItem.close) {\n\t\t\topenValue = dataItem.open[field];\n\t\t\tcloseValue = dataItem.close[field];\n\t\t}\n\t\telse {\n\t\t\topenValue = dataItem.get(field as any)\n\t\t\tcloseValue = openValue;\n\t\t}\n\n\t\tlet value = openValue + (closeValue - openValue) * cellLocation;\n\n\t\tvalue = this._baseValue + (value - this._baseValue) * axisLocation;\n\t\treturn this.valueToPosition(value);\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic getDataItemCoordinateY(dataItem: DataItem, field: string, cellLocation: number, axisLocation: number): number {\n\t\treturn this._settings.renderer.positionToCoordinate(this.getDataItemPositionY(dataItem, field, cellLocation, axisLocation));\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic roundAxisPosition(position: number, location: number): number {\n\t\tlet value = this.positionToValue(position);\n\t\tvalue = value - (location - 0.5) * this.baseDuration();\n\n\t\tlet baseInterval = this.getPrivate(\"baseInterval\");\n\t\tif (!$type.isNaN(value)) {\n\t\t\tconst firstDay = this._root.locale.firstDayOfWeek;\n\t\t\tconst timeUnit = baseInterval.timeUnit;\n\t\t\tconst utc = this._root.utc;\n\t\t\tconst timezone = this._root.timezone;\n\t\t\tconst count = baseInterval.count;\n\n\t\t\t//value = $time.round(new Date(value), timeUnit, count, firstDay, utc, new Date(this.getPrivate(\"min\", 0)), timezone).getTime();\n\t\t\tvalue = $time.roun(value, timeUnit, count, this._root, this.getPrivate(\"min\", 0));\n\n\t\t\tlet duration = $time.getDateIntervalDuration(baseInterval, new Date(value), firstDay, utc, timezone);\n\t\t\tif (timezone) {\n\t\t\t\t//value = $time.round(new Date(value + this.baseDuration() * 0.05), timeUnit, count, firstDay, utc, new Date(this.getPrivate(\"min\", 0)), timezone).getTime();\n\t\t\t\tvalue = $time.roun(value + this.baseDuration() * 0.05, timeUnit, count, this._root, this.getPrivate(\"min\", 0));\n\t\t\t\tduration = $time.getDateIntervalDuration(baseInterval, new Date(value + duration * location), firstDay, utc, timezone);\n\t\t\t}\n\n\t\t\treturn this.valueToPosition(value + duration * location);\n\t\t}\n\t\treturn NaN;\n\t}\n\n\t/**\n\t * Returns text to be used in an axis tooltip for specific relative position.\n\t *\n\t * NOTE: Unless `adjustPosition` (2nd parameter) is set to `false`, the method\n\t * will adjust position by `tooltipIntervalOffset`.\n\t *\n\t * @param position Position\n\t * @param adjustPosition Adjust position\n\t * @return Tooltip text\n\t */\n\tpublic getTooltipText(position: number, adjustPosition?: boolean): string | undefined {\n\t\t//@todo number formatter + tag\n\t\tif (this.getPrivate(\"min\") != null) {\n\t\t\tlet format = this.get(\"tooltipDateFormats\")![this.getPrivate(\"baseInterval\").timeUnit];\n\t\t\tlet value = this.positionToValue(position);\n\t\t\tif ($type.isNumber(value)) {\n\t\t\t\tlet date = new Date(value);\n\n\t\t\t\tlet baseInterval = this.getPrivate(\"baseInterval\");\n\t\t\t\tlet duration = $time.getDateIntervalDuration(baseInterval, date, this._root.locale.firstDayOfWeek, this._root.utc, this._root.timezone);\n\n\t\t\t\tif (adjustPosition !== false) {\n\t\t\t\t\tdate = new Date(value + this.get(\"tooltipIntervalOffset\", -this.get(\"tooltipLocation\", 0.5)) * duration)\n\t\t\t\t}\n\n\t\t\t\treturn this._root.dateFormatter.format(date, this.get(\"tooltipDateFormat\", format));\n\t\t\t}\n\n\t\t}\n\t\treturn \"\";\n\t}\n\n\t/**\n\t * Returns a data item from series that is closest to the `position`.\n\t *\n\t * @param series Series\n\t * @param position Relative position\n\t * @return Data item\n\t */\n\tpublic getSeriesItem(series: XYSeries, position: number, location?: number, snap?: boolean): DataItem | undefined {\n\t\tlet fieldName = (this.getPrivate(\"name\")! + this.get(\"renderer\").getPrivate(\"letter\")!);\n\t\tlet value = this.positionToValue(position);\n\n\t\tif (location == null) {\n\t\t\tlocation = 0.5;\n\t\t}\n\n\t\tvalue = value - (location - 0.5) * this.baseDuration();\n\n\t\tconst result = $array.getSortedIndex(series.dataItems, (dataItem) => {\n\t\t\tlet diValue = 0;\n\t\t\tif (dataItem.open) {\n\t\t\t\tdiValue = dataItem.open[fieldName];\n\t\t\t}\n\n\t\t\treturn $order.compare(diValue, value);\n\t\t});\n\n\t\tif (snap || series.get(\"snapTooltip\")) {\n\t\t\tlet first = series.dataItems[result.index - 1];\n\t\t\tlet second = series.dataItems[result.index];\n\n\t\t\tif (first && second) {\n\t\t\t\tif (first.open && second.close) {\n\t\t\t\t\tlet open = first.open[fieldName];\n\t\t\t\t\tlet close = second.close[fieldName];\n\n\t\t\t\t\tif (Math.abs(value - open) > Math.abs(value - close)) {\n\t\t\t\t\t\treturn second;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (first) {\n\t\t\t\treturn first;\n\t\t\t}\n\n\t\t\tif (second) {\n\t\t\t\treturn second;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tconst dataItem = series.dataItems[result.index - 1];\n\n\t\t\tif (dataItem) {\n\t\t\t\tif (dataItem.open && dataItem.close) {\n\t\t\t\t\tlet open = dataItem.open[fieldName];\n\t\t\t\t\tlet close = dataItem.close[fieldName];\n\n\t\t\t\t\tif (value >= open && value <= close) {\n\t\t\t\t\t\treturn dataItem;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic shouldGap(dataItem: DataItem, nextItem: DataItem, autoGapCount: number, fieldName: string): boolean {\n\t\tconst value1 = dataItem.get(fieldName as any);\n\t\tconst value2 = nextItem.get(fieldName as any);\n\n\t\tif (value2 - value1 > this.baseDuration() * autoGapCount) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Zooms the axis to specific `start` and `end` dates.\n\t *\n\t * Optional `duration` specifies duration of zoom animation in milliseconds.\n\t *\n\t * @param start Start Date\n\t * @param end End Date\n\t * @param duration Duration in milliseconds\n\t */\n\tpublic zoomToDates(start: Date, end: Date, duration?: number) {\n\t\tthis.zoomToValues(start.getTime(), end.getTime(), duration);\n\t}\n\n\t/**\n\t * Zooms the axis to specific `start` and `end` values.\n\t *\n\t * Optional `duration` specifies duration of zoom animation in milliseconds.\n\t *\n\t * @param start Start value\n\t * @param end End value\n\t * @param duration Duration in milliseconds\n\t */\n\tpublic zoomToValues(start: number, end: number, duration?: number) {\n\t\tconst min = this.getPrivate(\"minFinal\", 0);\n\t\tconst max = this.getPrivate(\"maxFinal\", 0);\n\t\tif (this.getPrivate(\"min\") != null && this.getPrivate(\"max\") != null) {\n\t\t\tif (this.get(\"groupData\")) {\n\t\t\t\tconst futureGroupInterval = this.getGroupInterval(end - start);\n\t\t\t\tconst baseInterval = this.get(\"baseInterval\");\n\n\t\t\t\tlet baseMin = this.getIntervalMin(baseInterval);\n\t\t\t\tlet baseMax = this.getIntervalMax(baseInterval) - 1;\n\t\t\t\tbaseMax = $time.roun(baseMax, futureGroupInterval.timeUnit, futureGroupInterval.count, this.root);\n\t\t\t\tbaseMax += this._getM(futureGroupInterval.timeUnit) * $time.getIntervalDuration(futureGroupInterval);\n\t\t\t\tbaseMax = $time.roun(baseMax, futureGroupInterval.timeUnit, futureGroupInterval.count, this.root);\n\n\t\t\t\tlet futureMin = $time.roun(baseMin, futureGroupInterval.timeUnit, futureGroupInterval.count, this.root);\n\t\t\t\tlet futureMax = $time.roun(baseMax, futureGroupInterval.timeUnit, futureGroupInterval.count, this.root);\n\n\t\t\t\tlet s = (start - futureMin) / (futureMax - futureMin);\n\t\t\t\tlet e = (end - futureMin) / (futureMax - futureMin);\n\n\t\t\t\tthis.zoom(s, e, duration);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.zoom((start - min) / (max - min), (end - min) / (max - min), duration);\n\t\t\t}\n\t\t}\n\t}\n\n\n\t/**\n\t * Returns a `Date` object corresponding to specific position within plot\n\t * area.\n\t *\n\t * @param position Pposition\n\t * @return Date\n\t */\n\tpublic positionToDate(position: number): Date {\n\t\treturn new Date(this.positionToValue(position));\n\t}\n\n\t/**\n\t * Returns a relative position within plot area that corresponds to specific\n\t * date.\n\t *\n\t * @param date Date\n\t * @return Position\n\t */\n\tpublic dateToPosition(date: Date): number {\n\t\treturn this.valueToPosition(date.getTime());\n\t}\n\n\t/**\n\t * Returns relative position between two grid lines of the axis.\n\t *\n\t * @since 5.2.30\n\t * @return Position\n\t */\n\tpublic getCellWidthPosition(): number {\n\t\tlet max = this.getPrivate(\"selectionMax\", this.getPrivate(\"max\"));\n\t\tlet min = this.getPrivate(\"selectionMin\", this.getPrivate(\"min\"));\n\n\t\tif ($type.isNumber(max) && $type.isNumber(min)) {\n\t\t\treturn this._intervalDuration / (max - min);\n\t\t}\n\t\treturn 0.05;\n\t}\n\n\tpublic nextPosition(count?: number) {\n\t\tif (count == null) {\n\t\t\tcount = 1;\n\t\t}\n\n\t\tlet dtime = this.get(\"tooltipLocation\", 0.5) * this.baseDuration();\n\t\tif (this.get(\"renderer\").getPrivate(\"letter\") == \"Y\") {\n\t\t\tcount *= -1;\n\t\t}\n\n\t\tlet tooltipValue = this.positionToValue(this.getPrivate(\"tooltipPosition\", 0));\n\n\t\tconst baseInterval = this.getPrivate(\"baseInterval\");\n\t\tlet time = this._nextTime(tooltipValue, count, baseInterval);\n\n\t\tlet selectionMin = this.getPrivate(\"selectionMin\", 0);\n\t\tlet selectionMax = this.getPrivate(\"selectionMax\", 0);\n\n\t\tlet min = $time.roun(selectionMin, baseInterval.timeUnit, baseInterval.count, this._root);\n\t\tlet max = $time.roun(selectionMax, baseInterval.timeUnit, baseInterval.count, this._root);\n\n\t\ttime += dtime;\n\t\ttime = $math.fitToRange(time, min + dtime, max - dtime);\n\n\t\treturn this.toGlobalPosition(this.valueToPosition(time));\n\t}\n\n\tprotected _nextTime(time: number, count: number, baseInterval: ITimeInterval) {\n\t\treturn $time.roun(time + count * this.baseDuration(), baseInterval.timeUnit, baseInterval.count, this._root);\n\t}\n}\n","import type { AxisRenderer } from \"./AxisRenderer\";\r\n\r\nimport { DateAxis, IDateAxisSettings, IDateAxisPrivate, IDateAxisDataItem, IDateAxisEvents } from \"./DateAxis\";\r\nimport { DataItem } from \"../../../core/render/Component\";\r\nimport type { XYSeries } from \"../../xy/series/XYSeries\";\r\n\r\nimport * as $array from \"../../../core/util/Array\"\r\nimport * as $order from \"../../../core/util/Order\";\r\nimport * as $time from \"../../../core/util/Time\";\r\nimport * as $type from \"../../../core/util/Type\";\r\nimport * as $math from \"../../../core/util/Math\";\r\nimport type { ITimeInterval } from \"../../../core/util/Time\";\r\n\r\nexport interface IGaplessDateAxisSettings extends IDateAxisSettings {\r\n\r\n}\r\n\r\nexport interface IGaplessDateAxisDataItem extends IDateAxisDataItem {\r\n\r\n\t/**\r\n\t * An index of a data item.\r\n\t */\r\n\tindex?: number\r\n\r\n}\r\n\r\nexport interface IGaplessDateAxisPrivate extends IDateAxisPrivate {\r\n\r\n}\r\n\r\nexport interface IGaplessDateAxisEvents extends IDateAxisEvents {\r\n}\r\n\r\n/**\r\n * A version of a [[DateAxis]] which removes intervals that don't have any data\r\n * items in them.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/gapless-date-axis/} for more info\r\n * @important\r\n */\r\nexport class GaplessDateAxis extends DateAxis {\r\n\tpublic static className: string = \"GaplessDateAxis\";\r\n\tpublic static classNames: Array = DateAxis.classNames.concat([GaplessDateAxis.className]);\r\n\r\n\tdeclare public _settings: IGaplessDateAxisSettings;\r\n\tdeclare public _privateSettings: IGaplessDateAxisPrivate;\r\n\tdeclare public _dataItemSettings: IGaplessDateAxisDataItem;\r\n\tdeclare public _events: IGaplessDateAxisEvents;\r\n\r\n\tprotected _frequency: number = 1;\r\n\tprotected _m: number = 0;\r\n\r\n\tpublic _afterNew() {\r\n\t\tthis.valueFields.push(\"date\");\r\n\t\tsuper._afterNew();\r\n\t}\r\n\r\n\tpublic _dates: Array = [];\r\n\tpublic _customDates?: Array;\r\n\r\n\r\n\tpublic _getDates(): Array {\r\n\t\tif (this._customDates) {\r\n\t\t\treturn this._customDates;\r\n\t\t}\r\n\t\treturn this._dates;\r\n\t}\r\n\r\n\tprotected _updateDates(date: number, series: XYSeries) {\r\n\t\tif (!series.get(\"ignoreMinMax\")) {\r\n\t\t\tconst dates = this._getDates();\r\n\t\t\tconst result = $array.getSortedIndex(dates, (x) => $order.compare(x, date));\r\n\t\t\tif (!result.found) {\r\n\t\t\t\t$array.insertIndex(dates, result.index, date);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tpublic _updateAllDates() {\r\n\t\tif (!this._customDates) {\r\n\t\t\tconst dates = this._dates;\r\n\t\t\tdates.length = 0;\r\n\r\n\t\t\t$array.each(this.series, (series) => {\r\n\t\t\t\tlet field = \"valueX\";\r\n\t\t\t\tif (series.get(\"yAxis\") == this) {\r\n\t\t\t\t\tfield = \"valueY\"\r\n\t\t\t\t}\r\n\t\t\t\t$array.each(series.dataItems, (dataItem) => {\r\n\t\t\t\t\tlet value = dataItem.get(field as any);\r\n\t\t\t\t\tif ($type.isNumber(value)) {\r\n\t\t\t\t\t\tif (dataItem.open) {\r\n\t\t\t\t\t\t\tthis._updateDates(dataItem.open![field], series);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t})\r\n\r\n\t\t\tconst extraMax = this.get(\"extraMax\", 0);\r\n\t\t\tconst extraMin = this.get(\"extraMin\", 0);\r\n\r\n\t\t\tlet len = dates.length;\r\n\r\n\t\t\tconst baseInterval = this.getPrivate(\"baseInterval\");\r\n\t\t\tconst baseCount = baseInterval.count;\r\n\t\t\tconst timeUnit = baseInterval.timeUnit;\r\n\r\n\t\t\tif (extraMax > 0) {\r\n\t\t\t\tconst extra = len * extraMax;\r\n\t\t\t\tlet time = dates[len - 1];\r\n\t\t\t\tif ($type.isNumber(time)) {\r\n\t\t\t\t\tfor (let i = len - 1; i < len + extra; i++) {\r\n\t\t\t\t\t\ttime += $time.getDuration(timeUnit, baseCount * this._getM(timeUnit));\r\n\t\t\t\t\t\t//time = $time.round(new Date(time), timeUnit, baseInterval.count, firstDay, utc, undefined, timezone).getTime();\r\n\t\t\t\t\t\ttime = $time.roun(time, timeUnit, baseCount, this._root);\r\n\t\t\t\t\t\tdates.push(time);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (extraMin > 0) {\r\n\t\t\t\tconst extra = len * extraMin;\r\n\t\t\t\tlet time = dates[0];\r\n\t\t\t\tif ($type.isNumber(time)) {\r\n\t\t\t\t\tfor (let i = 0; i < extra; i++) {\r\n\t\t\t\t\t\ttime -= $time.getDuration(timeUnit, baseCount);\r\n\t\t\t\t\t\t//time = $time.round(new Date(time), timeUnit, baseCount, firstDay, utc, undefined, timezone).getTime();\r\n\t\t\t\t\t\ttime = $time.roun(time, timeUnit, baseCount, this._root);\r\n\t\t\t\t\t\tdates.unshift(time);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Convers value to a relative position on axis.\r\n\t *\r\n\t * @param value Value\r\n\t * @return Relative position\r\n\t */\r\n\tpublic valueToPosition(value: number): number {\r\n\t\tconst dates = this._getDates();\r\n\t\tconst startLocation = this.get(\"startLocation\", 0);\r\n\t\tconst endLocation = this.get(\"endLocation\", 1);\r\n\t\tconst len = dates.length - startLocation - (1 - endLocation);\r\n\t\tconst result = $array.getSortedIndex(dates, (x) => $order.compare(x, value));\r\n\t\tlet index = result.index;\r\n\r\n\t\tif (result.found) {\r\n\t\t\treturn (index - startLocation) / len;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (index > 0) {\r\n\t\t\t\tindex -= 1;\r\n\t\t\t}\r\n\r\n\t\t\tlet itemValue = dates[index];\r\n\t\t\tconst nextDate = dates[index + 1];\r\n\t\t\tif(nextDate){\r\n\t\t\t\tlet nextItemValue = nextDate;\r\n\t\t\t\t// use next item value if it's closer\r\n\t\t\t\tif (Math.abs(nextItemValue - value) < Math.abs(itemValue - value)) {\r\n\t\t\t\t\titemValue = nextItemValue;\r\n\t\t\t\t\tindex++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/*\r\n\t\t\tlet d = 0;\r\n\t\t\tif (itemValue > value && value > this.getPrivate(\"min\", 0)) {\r\n\t\t\t\td = itemValue - value;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\td = value - itemValue;\r\n\t\t\t}\r\n\t\t\t*/\r\n\r\n\t\t\tlet d = value - itemValue;\r\n\r\n\t\t\treturn (index - startLocation) / len + d / this.baseDuration() / len;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Converts numeric value from axis scale to index.\r\n\t * \r\n\t * @param value Value\r\n\t * @return Index\r\n\t */\r\n\tpublic valueToIndex(value: number): number {\r\n\t\tconst dates = this._getDates();\r\n\r\n\t\tconst result = $array.getSortedIndex(dates, (x) => $order.compare(x, value));\r\n\t\tlet index = result.index;\r\n\r\n\t\tif (result.found) {\r\n\t\t\treturn index;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (index > 0) {\r\n\t\t\t\tindex -= 1;\r\n\t\t\t}\r\n\t\t\treturn index;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Converts a relative position to a corresponding numeric value from axis\r\n\t * scale.\r\n\t *\r\n\t * @param position Relative position\r\n\t * @return Value\r\n\t */\r\n\tpublic positionToValue(position: number): number {\r\n\t\tconst startLocation = this.get(\"startLocation\", 0);\r\n\t\tconst endLocation = this.get(\"endLocation\", 1);\r\n\t\tconst dates = this._getDates();\r\n\t\tlet len = Math.round(dates.length - startLocation - (1 - endLocation));\r\n\t\tlet index = position * len;\r\n\t\tlet findex = Math.floor(index);\r\n\t\tif (findex < 0) {\r\n\t\t\tfindex = 0;\r\n\t\t}\r\n\r\n\t\tif (findex > len - 1) {\r\n\t\t\tfindex = len - 1\r\n\t\t}\r\n\r\n\t\treturn dates[findex] + (index - findex + startLocation) * this.baseDuration();\r\n\t}\r\n\r\n\tprotected _fixZoomFactor() {\r\n\t\tthis.setPrivateRaw(\"maxZoomFactor\", this._getDates().length - this.get(\"startLocation\", 0) - (1 - this.get(\"endLocation\", 1)));\r\n\t}\r\n\r\n\t/**\r\n\t * Zooms the axis to specific `start` and `end` dates.\r\n\t *\r\n\t * Optional `duration` specifies duration of zoom animation in milliseconds.\r\n\t *\r\n\t * @param start Start Date\r\n\t * @param end End Date\r\n\t * @param duration Duration in milliseconds\r\n\t */\r\n\r\n\tpublic zoomToDates(start: Date, end: Date, duration?: number) {\r\n\t\tconst dates = this._getDates();\r\n\t\tconst len = dates.length;\r\n\t\tlet result = $array.getSortedIndex(dates, (x) => $order.compare(x, start.getTime()));\r\n\r\n\t\tlet startValue = dates[Math.min(result.index, len - 1)];\r\n\r\n\t\tresult = $array.getSortedIndex(dates, (x) => $order.compare(x, end.getTime()));\r\n\t\tlet endValue = dates[result.index];\r\n\r\n\t\tif (result.index >= len) {\r\n\t\t\tendValue = dates[len - 1] + this.baseDuration();\r\n\t\t}\r\n\r\n\t\tthis.zoomToValues(startValue, endValue, duration);\r\n\t}\r\n\r\n\t/**\r\n\t * Zooms the axis to specific `start` and `end` values.\r\n\t *\r\n\t * Optional `duration` specifies duration of zoom animation in milliseconds.\r\n\t *\r\n\t * @param start Start value\r\n\t * @param end End value\r\n\t * @param duration Duration in milliseconds\r\n\t */\r\n\tpublic zoomToValues(start: number, end: number, duration?: number) {\r\n\t\tconst min = this.getPrivate(\"min\", 0);\r\n\t\tconst max = this.getPrivate(\"max\", 0);\r\n\t\tstart = $math.fitToRange(start, min, max);\r\n\t\tend = $math.fitToRange(end, min, max);\r\n\t\tthis.zoom(this.valueToPosition(start), this.valueToPosition(end), duration);\r\n\t}\r\n\r\n\r\n\tprotected _prepareAxisItems() {\r\n\t\tlet startTime = this.getPrivate(\"selectionMin\", 0);\r\n\t\tlet endTime = this.getPrivate(\"selectionMax\", 0);\r\n\r\n\t\tif ($type.isNumber(startTime) && $type.isNumber(endTime)) {\r\n\r\n\t\t\tif (this._seriesValuesDirty) {\r\n\t\t\t\tthis._seriesValuesDirty = false;\r\n\t\t\t\tthis._updateAllDates();\r\n\t\t\t}\r\n\r\n\t\t\tconst root = this._root;\r\n\t\t\tconst utc = root.utc;\r\n\t\t\tconst timezone = root.timezone;\r\n\t\t\tconst dates = this._getDates();\r\n\t\t\tconst renderer = this.get(\"renderer\");\r\n\t\t\tconst len = dates.length;\r\n\t\t\tconst baseDuration = this.baseDuration();\r\n\r\n\t\t\tlet startIndex = this.valueToIndex(startTime);\r\n\t\t\tif (startIndex > 0) {\r\n\t\t\t\tstartIndex--;\r\n\t\t\t}\r\n\r\n\t\t\tlet endIndex = this.valueToIndex(endTime);\r\n\t\t\tif (endIndex < len - 1) {\r\n\t\t\t\tendIndex++;\r\n\t\t\t}\r\n\t\t\tlet maxCount = renderer.axisLength() / Math.max(renderer.get(\"minGridDistance\")!, 1 / Number.MAX_SAFE_INTEGER);\r\n\t\t\tlet frequency = Math.min(len, Math.ceil((endIndex - startIndex) / maxCount));\r\n\t\t\tfrequency = Math.max(1, frequency);\r\n\r\n\t\t\tstartIndex = Math.floor(startIndex / frequency) * frequency;\r\n\r\n\t\t\tthis._frequency = frequency;\r\n\r\n\t\t\t$array.each(this.dataItems, (dataItem) => {\r\n\t\t\t\tthis._toggleDataItem(dataItem, false);\r\n\t\t\t})\r\n\r\n\t\t\t$array.each(this.minorDataItems, (dataItem) => {\r\n\t\t\t\tthis._toggleDataItem(dataItem, false);\r\n\t\t\t})\r\n\r\n\t\t\tlet realDuration = (endTime - startTime) - ((endTime - startTime) / baseDuration - (endIndex - startIndex)) * baseDuration;\r\n\r\n\t\t\t// if all items are on axis\r\n\t\t\tlet gridInterval = $time.chooseInterval(0, realDuration, maxCount, this.get(\"gridIntervals\")!);\r\n\r\n\t\t\tconst baseInterval = this.getPrivate(\"baseInterval\");\r\n\t\t\tlet intervalDuration = $time.getIntervalDuration(gridInterval);\r\n\r\n\t\t\tif (intervalDuration < baseDuration) {\r\n\t\t\t\tgridInterval = { ...baseInterval };\r\n\t\t\t\tintervalDuration = $time.getIntervalDuration(gridInterval);\r\n\t\t\t}\r\n\r\n\t\t\tthis._intervalDuration = intervalDuration;\r\n\r\n\t\t\tconst timeUnit = gridInterval.timeUnit;\r\n\t\t\tconst formats = this.get(\"dateFormats\")!;\r\n\r\n\t\t\tlet firstTime = Date.now();\r\n\r\n\t\t\tif (dates[0]) {\r\n\t\t\t\tfirstTime = dates[0];\r\n\t\t\t}\r\n\r\n\t\t\t//let value = $time.round(new Date(this.getPrivate(\"selectionMin\", 0)), timeUnit, gridInterval.count, firstDay, utc, firstDate, timezone).getTime();\r\n\t\t\tlet value = $time.roun(this.getPrivate(\"selectionMin\", 0), timeUnit, gridInterval.count, root, firstTime);\r\n\r\n\t\t\tconst minorLabelsEnabled = renderer.get(\"minorLabelsEnabled\");\r\n\t\t\tconst minorGridEnabled = renderer.get(\"minorGridEnabled\", minorLabelsEnabled);\r\n\r\n\t\t\tlet minorGridInterval: ITimeInterval | undefined;\r\n\t\t\tlet minorDuration = 0;\r\n\t\t\tlet previousDataItem: DataItem | undefined;\r\n\r\n\t\t\tif (minorGridEnabled) {\r\n\t\t\t\tminorGridInterval = this._getMinorInterval(gridInterval);\r\n\t\t\t\tminorDuration = $time.getIntervalDuration(minorGridInterval);\r\n\t\t\t}\r\n\r\n\r\n\t\t\tlet selectedItems: Array = this._getIndexes(value, this.getPrivate(\"selectionMax\", value) + intervalDuration, gridInterval, this.getPrivate(\"min\", value));\r\n\t\t\tif (selectedItems.length > 0) {\r\n\t\t\t\tlet i = 0;\r\n\t\t\t\tthis._m = 0;\r\n\t\t\t\tlet previousValue = value - intervalDuration * 10;\r\n\t\t\t\tconst nextGridUnit = $time.getNextUnit(timeUnit);\r\n\r\n\t\t\t\t// MINOR GRID\r\n\t\t\t\tif (minorGridInterval) {\r\n\t\t\t\t\tlet first = dates[selectedItems[0]];\r\n\t\t\t\t\tthis._addMinorGrid(first - intervalDuration, first, minorDuration, minorGridInterval);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet minDistance = renderer.axisLength() / renderer.gridCount() * 0.5;\r\n\r\n\t\t\t\t$array.each(selectedItems, (index) => {\r\n\t\t\t\t\tlet dataItem: DataItem;\r\n\t\t\t\t\tif (this.dataItems.length < i + 1) {\r\n\t\t\t\t\t\tdataItem = new DataItem(this, undefined, {});\r\n\t\t\t\t\t\tthis._dataItems.push(dataItem);\r\n\t\t\t\t\t\tthis.processDataItem(dataItem);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tdataItem = this.dataItems[i];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tlet value = dates[index];\r\n\t\t\t\t\tlet date = new Date(value);\r\n\r\n\t\t\t\t\tlet endValue = value;\r\n\t\t\t\t\tif (i < selectedItems.length - 1) {\r\n\t\t\t\t\t\tendValue = dates[selectedItems[i + 1]];\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tendValue += intervalDuration;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdataItem.setRaw(\"value\", value);\r\n\t\t\t\t\tdataItem.setRaw(\"endValue\", endValue);\r\n\t\t\t\t\tdataItem.setRaw(\"index\", i);\r\n\t\t\t\t\tdataItem.setRaw(\"labelEndValue\", undefined);\r\n\r\n\t\t\t\t\tlet format = formats[timeUnit];\r\n\t\t\t\t\tif (nextGridUnit && this.get(\"markUnitChange\") && $type.isNumber(previousValue)) {\r\n\t\t\t\t\t\tif (timeUnit != \"year\") {\r\n\t\t\t\t\t\t\tif ($time.checkChange(value, previousValue, nextGridUnit, utc, timezone)) {\r\n\t\t\t\t\t\t\t\tformat = this.get(\"periodChangeDateFormats\")![timeUnit];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis._createAssets(dataItem, []);\r\n\r\n\t\t\t\t\tconst label = dataItem.get(\"label\");\r\n\t\t\t\t\tif (label) {\r\n\t\t\t\t\t\tlabel.set(\"text\", root.dateFormatter.format(date, format!));\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis._toggleDataItem(dataItem, true);\r\n\r\n\t\t\t\t\tlet count = gridInterval.count;\r\n\r\n\t\t\t\t\t// so that labels of week would always be at the beginning of the grid\r\n\t\t\t\t\tif (timeUnit == \"week\") {\r\n\t\t\t\t\t\tdataItem.setRaw(\"labelEndValue\", value);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (minorGridEnabled) {\r\n\t\t\t\t\t\tlet timeUnit2 = gridInterval.timeUnit;\r\n\t\t\t\t\t\tif (timeUnit2 == \"week\") {\r\n\t\t\t\t\t\t\ttimeUnit2 = \"day\";\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (count > 1 || gridInterval.timeUnit == \"week\") {\r\n\t\t\t\t\t\t\t//let labelEndValue = $time.round(new Date(value), timeUnit2, 1, firstDay, utc, undefined, timezone).getTime() + $time.getDuration(timeUnit2, this._getM(timeUnit2));\r\n\t\t\t\t\t\t\tlet labelEndValue = $time.roun(value, timeUnit2, 1, root) + $time.getDuration(timeUnit2, this._getM(timeUnit2));\r\n\t\t\t\t\t\t\tlet index = this.valueToIndex(labelEndValue)\r\n\t\t\t\t\t\t\tlabelEndValue = dates[index];\r\n\t\t\t\t\t\t\tif (labelEndValue == value) {\r\n\t\t\t\t\t\t\t\tlet next = dates[index + 1];\r\n\t\t\t\t\t\t\t\tif (next) {\r\n\t\t\t\t\t\t\t\t\tlabelEndValue = next;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tlabelEndValue += minorDuration;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tdataItem.setRaw(\"labelEndValue\", labelEndValue);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcount = 1;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis._prepareDataItem(dataItem, count);\r\n\r\n\t\t\t\t\tif (label && previousDataItem) {\r\n\t\t\t\t\t\tif (renderer.getPrivate(\"letter\") == \"X\") {\r\n\t\t\t\t\t\t\tlet previousLabel = previousDataItem.get(\"label\");\r\n\t\t\t\t\t\t\tif (previousLabel) {\r\n\t\t\t\t\t\t\t\tlet x = label.x();\r\n\t\t\t\t\t\t\t\tlet previousX = previousLabel.x();\r\n\r\n\t\t\t\t\t\t\t\tif (x - previousX < minDistance) {\r\n\t\t\t\t\t\t\t\t\tlet worse = this._pickWorse(previousDataItem, dataItem, gridInterval)\r\n\t\t\t\t\t\t\t\t\tif (worse) {\r\n\t\t\t\t\t\t\t\t\t\tworse.get(\"label\")?.setPrivate(\"visible\", false);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// todo y?\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// MINOR GRID\r\n\t\t\t\t\tif (minorGridInterval) {\r\n\t\t\t\t\t\tthis._addMinorGrid(value, endValue, minorDuration, minorGridInterval);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ti++;\r\n\r\n\t\t\t\t\tif (label && label.getPrivate(\"visible\")) {\r\n\t\t\t\t\t\tpreviousDataItem = dataItem;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpreviousValue = value;\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\t$array.each(this.series, (series) => {\r\n\t\t\t\tif (series.inited) {\r\n\t\t\t\t\tseries._markDirtyAxes();\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\tthis._updateGhost();\r\n\t}\r\n\r\n\tprotected _pickWorse(dataItemA: DataItem, dataItemB: DataItem, interval: ITimeInterval): DataItem {\r\n\t\tconst timeUnit = interval.timeUnit;\r\n\r\n\t\tconst valueA = dataItemA.get(\"value\", 0);\r\n\t\tconst valueB = dataItemB.get(\"value\", 0);\r\n\r\n\t\tif (timeUnit == \"hour\") {\r\n\t\t\tif (new Date(valueA).getDate() != new Date(valueB).getDate()) {\r\n\t\t\t\treturn dataItemA;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn dataItemB;\r\n\t}\r\n\r\n\tprotected _addMinorGrid(startValue: number, endValue: number, minorDuration: number, gridInterval: ITimeInterval) {\r\n\t\tconst minorFormats = this.get(\"minorDateFormats\", this.get(\"dateFormats\"))!;\r\n\t\tconst mTimeUnit = gridInterval.timeUnit;\r\n\t\tlet value = startValue + $time.getDuration(mTimeUnit, this._getM(mTimeUnit));\r\n\t\t//value = $time.round(new Date(value), mTimeUnit, 1, firstDay, utc, undefined, timezone).getTime();\r\n\t\tvalue = $time.roun(value, mTimeUnit, 1, this._root);\r\n\r\n\t\tlet maxValue = endValue - minorDuration * 0.5;\r\n\r\n\t\tlet minorSelectedItems: Array = this._getIndexes(value, maxValue, gridInterval, value);\r\n\t\tconst dates = this._getDates();\r\n\r\n\t\t$array.each(minorSelectedItems, (index) => {\r\n\t\t\tlet minorDataItem: DataItem;\r\n\t\t\tif (this.minorDataItems.length < this._m + 1) {\r\n\t\t\t\tminorDataItem = new DataItem(this, undefined, {});\r\n\t\t\t\tthis.minorDataItems.push(minorDataItem);\r\n\t\t\t\tthis.processDataItem(minorDataItem);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tminorDataItem = this.minorDataItems[this._m];\r\n\t\t\t}\r\n\r\n\t\t\tvalue = dates[index];\r\n\t\t\tminorDataItem.setRaw(\"value\", value);\r\n\t\t\tminorDataItem.setRaw(\"endValue\", value + minorDuration);\r\n\t\t\tminorDataItem.setRaw(\"index\", index);\r\n\r\n\t\t\tthis._createAssets(minorDataItem, [\"minor\"], true);\r\n\r\n\t\t\tconst label = minorDataItem.get(\"label\");\r\n\t\t\tif (label) {\r\n\t\t\t\tif (this.get(\"renderer\").get(\"minorLabelsEnabled\")) {\r\n\t\t\t\t\tlet date = new Date(value);\r\n\t\t\t\t\tlet format = minorFormats[mTimeUnit];\r\n\t\t\t\t\tlabel.set(\"text\", this._root.dateFormatter.format(date, format!));\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tlabel.setPrivate(\"visible\", false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis._toggleDataItem(minorDataItem, true);\r\n\t\t\tthis._prepareDataItem(minorDataItem, 1);\r\n\t\t\tthis._m++;\r\n\t\t})\r\n\t}\r\n\r\n\r\n\tprotected _getIndexes(value: number, maxValue: number, interval: ITimeInterval, firstValue: number): Array {\r\n\t\tconst items: Array = [];\r\n\t\tconst timeUnit = interval.timeUnit;\r\n\t\tconst count = interval.count;\r\n\t\tconst mmm = this._getM(timeUnit);\r\n\r\n\t\tconst baseInterval = this.getPrivate(\"baseInterval\");\r\n\r\n\t\tconst root = this._root;\r\n\t\tconst dates = this._getDates();\r\n\r\n\t\tlet c = count - 1;\r\n\t\tlet previousValue = -Infinity;\r\n\r\n\t\tlet duration = $time.getDuration(timeUnit, mmm);\r\n\t\tlet fullDuration = $time.getDuration(timeUnit, count * mmm);\r\n\t\tlet originalValue = value;\r\n\r\n\t\tif (timeUnit == \"day\") {\r\n\t\t\tvalue = firstValue;\r\n\t\t}\r\n\r\n\t\twhile (value <= maxValue) {\r\n\t\t\t//value = $time.round(new Date(value), timeUnit, count, firstDay, utc, undefined, timezone).getTime();\r\n\t\t\tvalue = $time.roun(value, timeUnit, count, root);\r\n\r\n\t\t\tlet index = this.valueToIndex(value);\r\n\t\t\tlet realValue = dates[index];\r\n\r\n\t\t\tif (timeUnit == \"day\" && baseInterval.timeUnit == \"day\") {\r\n\t\t\t\tif (this._hasDate(value)) {\r\n\t\t\t\t\tc++;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (c == count) {\r\n\t\t\t\t\tif (value >= originalValue - fullDuration * 2) {\r\n\t\t\t\t\t\t$array.move(items, index);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tc = 0;\r\n\t\t\t\t}\r\n\t\t\t\tvalue += duration;\r\n\t\t\t\t//value = $time.round(new Date(value), timeUnit, 1, firstDay, utc, undefined, timezone).getTime();\r\n\t\t\t\tvalue = $time.roun(value, timeUnit, 1, root);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (realValue < value) {\r\n\t\t\t\t\tfor (let i = index, len = dates.length; i < len; i++) {\r\n\t\t\t\t\t\trealValue = dates[i];\r\n\t\t\t\t\t\tif (realValue >= value) {\r\n\t\t\t\t\t\t\tindex = i;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$array.move(items, index);\r\n\r\n\t\t\t\tvalue += fullDuration;\r\n\t\t\t\t//value = $time.round(new Date(value), timeUnit, count, firstDay, utc, undefined, timezone).getTime();\r\n\t\t\t\tvalue = $time.roun(value, timeUnit, count, root);\r\n\t\t\t}\r\n\r\n\t\t\tif (value == previousValue) {\r\n\t\t\t\tvalue += fullDuration + duration;\r\n\t\t\t\t//value = $time.round(new Date(value), timeUnit, count, firstDay, utc, undefined, timezone).getTime();\r\n\t\t\t\tvalue = $time.roun(value, timeUnit, count, root);\r\n\t\t\t}\r\n\t\t\tif (value == previousValue) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tpreviousValue = value;\r\n\t\t}\r\n\r\n\t\treturn items;\r\n\t}\r\n\r\n\tprotected _hasDate(time: number) {\r\n\t\tconst result = $array.getSortedIndex(this._getDates(), (date) => {\r\n\t\t\treturn $order.compareNumber(date, time);\r\n\t\t});\r\n\r\n\t\treturn result.found;\r\n\t}\r\n\tprotected _nextTime(time: number, count: number, _baseInterval: ITimeInterval) {\r\n\t\tlet index = $math.fitToRange(this.valueToIndex(time) + count, 0, this._dates.length - 1);\r\n\t\treturn this._dates[index];\r\n\t}\r\n}","import { Graphics, IGraphicsPrivate, IGraphicsSettings } from \"../../../core/render/Graphics\";\n\nexport interface IGridSettings extends IGraphicsSettings {\n\n\t/**\n\t * Relative location of the grid line within the cell.\n\t *\n\t * `0` - beginning, `0.5` - middle, `1` - end.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Location_of_axis_elements} for more info\n\t */\n\tlocation?: number;\n\n}\n\nexport interface IGridPrivate extends IGraphicsPrivate {\n}\n\n/**\n * Creates an axis grid line.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Grid} for more info\n * @important\n */\nexport class Grid extends Graphics {\n\n\tdeclare public _settings: IGridSettings;\n\tdeclare public _privateSettings: IGridPrivate;\n\n\tpublic static className: string = \"Grid\";\n\tpublic static classNames: Array = Graphics.classNames.concat([Grid.className]);\n\n\tpublic _beforeChanged() {\n\t\tsuper._beforeChanged();\n\n\t\tif (this.isPrivateDirty(\"width\") || this.isPrivateDirty(\"height\")) {\n\t\t\tthis._clear = true;\n\t\t}\n\t}\n}\n","import type { AxisRenderer } from \"./AxisRenderer\";\nimport type { IXYSeriesDataItem, XYSeries } from \"../series/XYSeries\";\n\nimport { DataItem } from \"../../../core/render/Component\";\nimport { Axis, IAxisSettings, IAxisPrivate, IAxisDataItem, IAxisEvents } from \"./Axis\";\nimport { MultiDisposer } from \"../../../core/util/Disposer\";\n\nimport * as $type from \"../../../core/util/Type\";\nimport * as $array from \"../../../core/util/Array\";\nimport * as $math from \"../../../core/util/Math\";\nimport * as $utils from \"../../../core/util/Utils\";\n\nexport interface IValueAxisSettings extends IAxisSettings {\n\n\t/**\n\t * Override minimum value for the axis scale.\n\t *\n\t * NOTE: the axis might modify the minimum value to fit into its scale better,\n\t * unless `strictMinMax` is set to `true`.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/value-axis/#Custom_scope} for more info\n\t */\n\tmin?: number;\n\n\t/**\n\t * Override maximum value for the axis scale.\n\t *\n\t * NOTE: the axis might modify the maximum value to fit into its scale better,\n\t * unless `strictMinMax` is set to `true`.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/value-axis/#Custom_scope} for more info\n\t */\n\tmax?: number;\n\n\t/**\n\t * Force axis scale to be precisely at values as set in `min` and/or `max`.\n\t *\n\t * In case `min` and/or `max` is not set, the axis will fix its scale to\n\t * precise lowest and highest values available through all of the series\n\t * attached to it.\n\t *\n\t * This effectively locks the axis from auto-zooming itself when chart\n\t * is zoomed in.\n\t *\n\t * If you need to zoom to actual low/high values within currently visible\n\t * scope, use `strictMinMaxSelection` instead.\n\t *\n\t * Use `extraMin` and `extraMax` to add extra \"padding\".\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/value-axis/#Custom_scope} for more info\n\t */\n\tstrictMinMax?: boolean;\n\n\t/**\n\t * Force axis to auto-zoom to exact lowest and highest values from attached\n\t * series' data items within currently visible range.\n\t * \n\t * This is a good feature when your series is plotted from derivative values,\n\t * like `valueYChangeSelection` as it helps to avoid frequent jumping of\n\t * series to adjusted min and max of the axis.\n\t * \n\t * This will not work if strictMinMax is set to true (the axis will not zoom at all in this case).\n\t * \n\t * Use `extraMin` and `extraMax` to add extra \"padding\".\n\t *\n\t * @since 5.1.11\n\t */\n\tstrictMinMaxSelection?: boolean;\n\n\t/**\n\t * If set to `true` axis will use logarithmic scale.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/value-axis/#Logarithmic_scale} for more info\n\t */\n\tlogarithmic?: boolean;\n\n\t/**\n\t * Treat zero values as some other value.\n\t *\n\t * Useful in situations where zero would result in error, i.e. logarithmic\n\t * scale.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/value-axis/#Logarithmic_scale} for more info\n\t */\n\ttreatZeroAs?: number;\n\n\t/**\n\t * Relative extension to the automatically-calculated minimum value of the\n\t * axis scale.\n\t *\n\t * E..g. `0.1` will extend the scale by 10%, so if max value is `1000` and\n\t * minimum value is `0`, the new minimum value will be `-100`.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/value-axis/#Relative_scope_extension} for more info\n\t */\n\textraMin?: number;\n\n\t/**\n\t * Relative extension to the automatically-calculated maximum value of the\n\t * axis scale.\n\t *\n\t * E..g. `0.1` will extend the scale by 10%, so if max value is `1000`, the\n\t * axis will now show maximum value of `1100`.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/value-axis/#Relative_scope_extension} for more info\n\t */\n\textraMax?: number;\n\n\t/**\n\t * Base value, which indicates the threshold between \"positive\" and \"negative\"\n\t * values.\n\t *\n\t * @default 0\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/value-axis/#Base_value} for more info\n\t */\n\tbaseValue?: number;\n\n\t/**\n\t * Maximum number of decimals to allow in axis labels.\n\t *\n\t * This setting not only affects formatting of the labels, but also where and\n\t * how many grid/labels are placed on the axis.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/value-axis/#Label_format} for more info\n\t */\n\tmaxPrecision?: number;\n\n\t/**\n\t * A function that can be used to specify how to configure axis fills.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Axis_fills} for more info\n\t */\n\tfillRule?: (dataItem: DataItem) => void;\n\n\t/**\n\t * Number format to use for axis labels.\n\t *\n\t * If not set, will use format set in global number formatter.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/value-axis/#Label_format} for more info\n\t */\n\tnumberFormat?: string;\n\n\t/**\n\t * A numeric format used for numbers displayed in axis tooltip.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/value-axis/#Tooltip_number_format} for more info\n\t */\n\ttooltipNumberFormat?: string | Intl.NumberFormatOptions;\n\n\t/**\n\t * If set, will use greater precision for the axis tooltip than the one for\n\t * axis' actual labels.\n\t *\n\t * E.g. if axis displays labels with one decimal (`1.0`, `1.1`, `1.2`) setting\n\t * this setting to `1` would allow two decimals in axis tooltip, e.g. `1.15`.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/value-axis/#Tooltip_number_format} for more info\n\t */\n\textraTooltipPrecision?: number;\n\n\t/**\n\t * If your series relies on dynamically calculated values, like value\n\t * changes, percents, or total sums, set this to `true`.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/value-axis/#Calculated_values} for more info\n\t */\n\tcalculateTotals?: boolean;\n\n\t/**\n\t * This setting can be set to an instance of another [[ValueAxis]].\n\t *\n\t * If set the grid of this axis will be synced with grid of the target axis.\n\t *\n\t * NOTE: this is not 100% guaranteed to work. In some rare cases perfect\n\t * sync might not be possible.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/value-axis/#Syncing_grid} for more info\n\t */\n\tsyncWithAxis?: ValueAxis;\n\n\t/**\n\t * If set to `false`, the axis won't be auto-zoomed to a selection (this\n\t * works only if the other axis is a `DateAxis` or a `CategoryAxis`).\n\t * \n\t * IMPORTANT: This setting will be ignored if both X and Y axes are\n\t * a `ValueAxis`.\n\t *\n\t * @since 5.2.20\n\t * @default true\n\t */\n\tautoZoom?: boolean;\n\n}\n\nexport interface IValueAxisDataItem extends IAxisDataItem {\n\n\t/**\n\t * Value of the data item.\n\t */\n\tvalue?: number;\n\n\t/**\n\t * End value for axis items that span multiple values, like axis ranges.\n\t */\n\tendValue?: number;\n\n\t/**\n\t * @ignore\n\t */\n\tlabelEndValue?: number;\n\n\t/**\n\t * If set to `true` the values fo this data item will be factored in when\n\t * calculating scale of the [[ValueAxis]]. Useful for axis ranges.\n\t * \n\t * @since 5.1.4\n\t */\n\taffectsMinMax?: boolean;\n\n}\n\nexport interface IMinMaxStep {\n\tmin: number;\n\tmax: number;\n\tstep: number;\n}\n\nexport interface IValueAxisPrivate extends IAxisPrivate {\n\n\t/**\n\t * Calculated current minimum value of the axis scale.\n\t * \n\t * @readonly\n\t */\n\tmin?: number;\n\n\t/**\n\t * Calculated current maximum value of the axis scale.\n\t * \n\t * @readonly\n\t */\n\tmax?: number;\n\n\t/**\n\t * A minimum value of the axis scale.\n\t *\n\t * Can be useful in cases where axis zoom is currently being animated, and\n\t * `min` is reflecting current intermediate value, whereas `minFinal` will\n\t * show target value.\n\t * \n\t * @readonly\n\t */\n\tminFinal?: number;\n\n\t/**\n\t * A maximum value of the axis scale.\n\t *\n\t * Can be useful in cases where axis zoom is currently being animated, and\n\t * `max` is reflecting current intermediate value, whereas `maxFinal` will\n\t * show target value.\n\t * \n\t * @readonly\n\t */\n\tmaxFinal?: number;\n\n\t/**\n\t * Calculated minimum value of the currently viewable (zoomed) scope.\n\t * \n\t * @readonly\n\t */\n\tselectionMin?: number;\n\n\t/**\n\t * Calculated maximum value of the currently viewable (zoomed) scope.\n\t * \n\t * @readonly\n\t */\n\tselectionMax?: number;\n\n\t/**\n\t * A target minimum value of the viewable value scope.\n\t *\n\t * Can be useful in cases where axis zoom is currently being animated, and\n\t * `selectionMin` is reflecting current intermediate value,\n\t * whereas `selectionMinFinal` will show target value.\n\t * \n\t * @readonly\n\t */\n\tselectionMinFinal?: number;\n\n\t/**\n\t * A target maximum value of the viewable value scope.\n\t *\n\t * Can be useful in cases where axis zoom is currently being animated, and\n\t * `selectionMax` is reflecting current intermediate value,\n\t * whereas `selectionMaxFinal` will show target value.\n\t * \n\t * @readonly\n\t */\n\tselectionMaxFinal?: number;\n\n\t/**\n\t * When selection step changes, it might change during axis zoom animation.\n\t *\n\t * `selectionStepFinal` will show what step will be when animation is\n\t * finished.\n\t * \n\t * @readonly\n\t */\n\tselectionStepFinal?: number;\n\n\t/**\n\t * Value step between grid lines.\n\t * \n\t * @readonly\n\t */\n\tstep?: number;\n\n\t/**\n\t * Decimal places used when formatting axis labels.\n\t * \n\t * @readonly\n\t */\n\tstepDecimalPlaces?: number;\n\n}\n\nexport interface IValueAxisEvents extends IAxisEvents {\n\n}\n\n/**\n * Creates a value axis.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/value-axis/} for more info\n * @important\n */\nexport class ValueAxis extends Axis {\n\tpublic static className: string = \"ValueAxis\";\n\tpublic static classNames: Array = Axis.classNames.concat([ValueAxis.className]);\n\n\tdeclare public _settings: IValueAxisSettings;\n\tdeclare public _privateSettings: IValueAxisPrivate;\n\tdeclare public _dataItemSettings: IValueAxisDataItem;\n\tdeclare public _events: IValueAxisEvents;\n\n\tprotected _dirtyExtremes: boolean = false;\n\tprotected _dirtySelectionExtremes: boolean = false;\n\tprotected _dseHandled = false;\n\tprotected _deltaMinMax: number = 1;\n\tprotected _minReal: number | undefined;\n\tprotected _maxReal: number | undefined;\n\n\tprotected _minRealLog: number | undefined;\n\n\tprotected _baseValue: number = 0;\n\tprotected _syncDp?: MultiDisposer;\n\tprotected _minLogAdjusted: number = 1;\n\t/**\n\t * @ignore\n\t */\n\tpublic markDirtyExtremes() {\n\t\tthis._dirtyExtremes = true;\n\t\tthis.markDirty();\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic markDirtySelectionExtremes() {\n\t\tthis._dirtySelectionExtremes = true;\n\t\tthis.markDirty();\n\t}\n\n\tprotected _afterNew() {\n\t\tthis._settings.themeTags = $utils.mergeTags(this._settings.themeTags, [\"axis\"]);\n\t\tthis.setPrivateRaw(\"name\", \"value\");\n\t\tthis.addTag(\"value\");\n\t\tsuper._afterNew();\n\t}\n\n\tpublic _prepareChildren() {\n\t\tsuper._prepareChildren();\n\n\t\tif (this.isDirty(\"syncWithAxis\")) {\n\t\t\tlet previousValue = this._prevSettings.syncWithAxis;\n\t\t\tif (previousValue) {\n\t\t\t\tif (this._syncDp) {\n\t\t\t\t\tthis._syncDp.dispose();\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet syncWithAxis = this.get(\"syncWithAxis\");\n\t\t\tif (syncWithAxis) {\n\t\t\t\tthis._syncDp = new MultiDisposer([\n\t\t\t\t\tsyncWithAxis.onPrivate(\"selectionMinFinal\", () => {\n\t\t\t\t\t\tthis._dirtySelectionExtremes = true;\n\t\t\t\t\t}),\n\t\t\t\t\tsyncWithAxis.onPrivate(\"selectionMaxFinal\", () => {\n\t\t\t\t\t\tthis._dirtySelectionExtremes = true;\n\t\t\t\t\t})\n\t\t\t\t])\n\t\t\t}\n\t\t}\n\n\t\tlet someDirty = false;\n\t\tif (this.isDirty(\"min\") || this.isDirty(\"max\") || this.isDirty(\"maxPrecision\") || this.isDirty(\"numberFormat\")) {\n\t\t\tsomeDirty = true;\n\t\t\tthis.ghostLabel.set(\"text\", \"\");\n\t\t}\n\n\t\t//if (this._dirtyExtremes || this.isPrivateDirty(\"width\") || this.isPrivateDirty(\"height\") || this.isDirty(\"min\") || this.isDirty(\"max\") || this.isDirty(\"extraMin\") || this.isDirty(\"extraMax\") || this.isDirty(\"logarithmic\") || this.isDirty(\"treatZeroAs\") || this.isDirty(\"baseValue\") || this.isDirty(\"strictMinMax\") || this.isDirty(\"maxPrecision\")) {\n\t\tif (this._sizeDirty || this._dirtyExtremes || this._valuesDirty || someDirty || this.isPrivateDirty(\"width\") || this.isPrivateDirty(\"height\") || this.isDirty(\"extraMin\") || this.isDirty(\"extraMax\") || this.isDirty(\"logarithmic\") || this.isDirty(\"treatZeroAs\") || this.isDirty(\"baseValue\") || this.isDirty(\"strictMinMax\") || this.isDirty(\"strictMinMaxSelection\")) {\n\t\t\tthis._getMinMax();\n\t\t\tthis._dirtyExtremes = false;\n\t\t}\n\t\t\n\t\tthis._handleSizeDirty();\n\n\t\tif (this._dirtySelectionExtremes && !this._isPanning && this.get(\"autoZoom\", true)) {\n\n\t\t\tconst chart = this.chart;\n\t\t\tlet getMM = false;\n\t\t\t// #1563\n\t\t\tif (chart) {\n\t\t\t\tconst letter = this.get(\"renderer\").getPrivate(\"letter\");\n\t\t\t\tif (letter == \"Y\") {\n\t\t\t\t\tchart.xAxes.each((axis) => {\n\t\t\t\t\t\tif (axis.className != \"ValueAxis\") {\n\t\t\t\t\t\t\tgetMM = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\telse if (letter == \"X\") {\n\t\t\t\t\tchart.yAxes.each((axis) => {\n\t\t\t\t\t\tif (axis.className != \"ValueAxis\") {\n\t\t\t\t\t\t\tgetMM = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (getMM) {\n\t\t\t\tthis._getSelectionMinMax();\n\t\t\t}\n\t\t\tthis._dirtySelectionExtremes = false;\n\t\t}\n\n\t\tthis._groupData();\n\n\t\tif (this._sizeDirty || this._valuesDirty || this.isDirty(\"start\") || this.isDirty(\"end\") || this.isPrivateDirty(\"min\") || this.isPrivateDirty(\"selectionMax\") || this.isPrivateDirty(\"selectionMin\") || this.isPrivateDirty(\"max\") || this.isPrivateDirty(\"step\") || this.isPrivateDirty(\"width\") || this.isPrivateDirty(\"height\") || this.isDirty(\"logarithmic\")) {\n\t\t\tthis._handleRangeChange();\n\t\t\tthis._prepareAxisItems();\n\t\t\tthis._updateAxisRanges();\n\t\t}\n\n\t\tthis._baseValue = this.baseValue();\n\n\t}\n\n\tprotected _handleSizeDirty() {\n\t\tif (this._sizeDirty && !this._dseHandled) {\n\t\t\tthis._dirtySelectionExtremes = true;\n\t\t\tthis._dseHandled = true;\n\t\t}\n\t}\n\n\tpublic _clearDirty(): void {\n\t\tsuper._clearDirty();\n\t\tthis._dseHandled = false;\n\t}\n\n\tprotected _groupData() {\n\n\t}\n\n\tprotected _formatText(value: number) {\n\t\tconst numberFormat = this.get(\"numberFormat\");\n\t\tconst formatter = this.getNumberFormatter();\n\n\t\tlet text = \"\";\n\n\t\tif (numberFormat) {\n\t\t\ttext = formatter.format(value, numberFormat);\n\t\t}\n\t\telse {\n\t\t\ttext = formatter.format(value, undefined, this.getPrivate(\"stepDecimalPlaces\"));\n\t\t}\n\t\treturn text;\n\t}\n\n\tprotected _prepareAxisItems() {\n\t\tconst min = this.getPrivate(\"min\");\n\t\tconst max = this.getPrivate(\"max\");\n\n\t\tif ($type.isNumber(min) && $type.isNumber(max)) {\n\n\t\t\tconst logarithmic = this.get(\"logarithmic\");\n\t\t\tconst step = this.getPrivate(\"step\")!;\n\t\t\tconst selectionMin = this.getPrivate(\"selectionMin\")!;\n\t\t\tconst selectionMax = this.getPrivate(\"selectionMax\")! + step;\n\n\t\t\tlet value = selectionMin - step;\n\t\t\tlet differencePower = 1;\n\t\t\tlet minLog: number = min;\n\n\t\t\tif (logarithmic) {\n\t\t\t\tvalue = this._minLogAdjusted;\n\n\t\t\t\tif (value < selectionMin) {\n\t\t\t\t\twhile (value < selectionMin) {\n\t\t\t\t\t\tvalue += step;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tminLog = value;\n\n\t\t\t\tif (minLog <= 0) {\n\t\t\t\t\tminLog = 1;\n\t\t\t\t\tif (step < 1) {\n\t\t\t\t\t\tif ($type.isNumber(this._minRealLog)) {\n\t\t\t\t\t\t\tminLog = this._minRealLog;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tminLog = Math.pow(10, -50);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tdifferencePower = Math.log(selectionMax - step) * Math.LOG10E - Math.log(minLog) * Math.LOG10E;\n\n\t\t\t\tif (differencePower > 2) {\n\t\t\t\t\tvalue = Math.pow(10, Math.log(minLog) * Math.LOG10E - 50);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/// minor grid\n\t\t\tconst renderer = this.get(\"renderer\");\n\t\t\tconst minorLabelsEnabled = renderer.get(\"minorLabelsEnabled\");\n\t\t\tconst minorGridEnabled = renderer.get(\"minorGridEnabled\", minorLabelsEnabled);\n\n\t\t\tlet stepPower = Math.pow(10, Math.floor(Math.log(Math.abs(step)) * Math.LOG10E));\n\n\t\t\tconst stepAdjusted = Math.round(step / stepPower);\n\n\t\t\tlet minorGridCount = 2;\n\n\t\t\tif ($math.round(stepAdjusted / 5, 10) % 1 == 0) {\n\t\t\t\tminorGridCount = 5;\n\t\t\t}\n\n\t\t\tif ($math.round(stepAdjusted / 10, 10) % 1 == 0) {\n\t\t\t\tminorGridCount = 10;\n\t\t\t}\n\n\t\t\tlet minorStep = step / minorGridCount;\n\n\t\t\t// end of minor grid\n\t\t\tlet i = 0;\n\t\t\tlet m = 0;\n\t\t\tlet previous = -Infinity;\n\n\t\t\twhile (value < selectionMax) {\n\t\t\t\tlet dataItem: DataItem;\n\t\t\t\tif (this.dataItems.length < i + 1) {\n\t\t\t\t\tdataItem = new DataItem(this, undefined, {});\n\t\t\t\t\tthis._dataItems.push(dataItem);\n\t\t\t\t\tthis.processDataItem(dataItem);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tdataItem = this.dataItems[i];\n\t\t\t\t}\n\n\t\t\t\tthis._createAssets(dataItem, []);\n\t\t\t\tthis._toggleDataItem(dataItem, true);\n\n\t\t\t\tdataItem.setRaw(\"value\", value);\n\t\t\t\tconst label = dataItem.get(\"label\");\n\t\t\t\tif (label) {\n\t\t\t\t\tlabel.set(\"text\", this._formatText(value));\n\t\t\t\t}\n\n\t\t\t\tthis._prepareDataItem(dataItem);\n\n\t\t\t\tlet nextValue = value;\n\t\t\t\tif (!logarithmic) {\n\t\t\t\t\tnextValue += step;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (differencePower > 2) {\n\t\t\t\t\t\tnextValue = Math.pow(10, Math.log(minLog) * Math.LOG10E + i - 50);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tnextValue += step;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// minor grid\n\t\t\t\tif (minorGridEnabled) {\n\t\t\t\t\tlet minorValue = value + minorStep;\n\n\t\t\t\t\tif (logarithmic) {\n\t\t\t\t\t\tif (differencePower > 2) {\n\t\t\t\t\t\t\tlet minorMinMaxStep = this._adjustMinMax(value, nextValue, 10);\n\t\t\t\t\t\t\tminorStep = minorMinMaxStep.step;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tminorValue = value + minorStep;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (minorValue < nextValue - step * 0.00000000001) {\n\t\t\t\t\t\tlet minorDataItem: DataItem;\n\t\t\t\t\t\tif (this.minorDataItems.length < m + 1) {\n\t\t\t\t\t\t\tminorDataItem = new DataItem(this, undefined, {});\n\t\t\t\t\t\t\tthis.minorDataItems.push(minorDataItem);\n\t\t\t\t\t\t\tthis.processDataItem(minorDataItem);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tminorDataItem = this.minorDataItems[m];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis._createAssets(minorDataItem, [\"minor\"], true);\n\t\t\t\t\t\tthis._toggleDataItem(minorDataItem, true);\n\t\t\t\t\t\tminorDataItem.setRaw(\"value\", minorValue);\n\n\t\t\t\t\t\tconst minorLabel = minorDataItem.get(\"label\");\n\t\t\t\t\t\tif (minorLabel) {\n\t\t\t\t\t\t\tif (minorLabelsEnabled) {\n\t\t\t\t\t\t\t\tminorLabel.set(\"text\", this._formatText(minorValue));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tminorLabel.setPrivate(\"visible\", false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis._prepareDataItem(minorDataItem);\n\t\t\t\t\t\tminorValue += minorStep;\n\t\t\t\t\t\tm++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvalue = nextValue;\n\n\t\t\t\tif (previous == value) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tlet stepPower = Math.pow(10, Math.floor(Math.log(Math.abs(step)) * Math.LOG10E));\n\t\t\t\tif (stepPower < 1 && !logarithmic) {\n\t\t\t\t\t// exponent is less then 1 too. Count decimals of exponent\n\t\t\t\t\tlet decCount = Math.round(Math.abs(Math.log(Math.abs(stepPower)) * Math.LOG10E)) + 2;\n\t\t\t\t\t// round value to avoid floating point issues\n\t\t\t\t\tvalue = $math.round(value, decCount);\n\t\t\t\t}\n\t\t\t\ti++;\n\n\t\t\t\tprevious = value;\n\t\t\t}\n\n\t\t\tfor (let j = i; j < this.dataItems.length; j++) {\n\t\t\t\tthis._toggleDataItem(this.dataItems[j], false);\n\t\t\t}\n\n\t\t\tfor (let j = m; j < this.minorDataItems.length; j++) {\n\t\t\t\tthis._toggleDataItem(this.minorDataItems[j], false);\n\t\t\t}\n\n\t\t\t$array.each(this.series, (series) => {\n\t\t\t\tif (series.inited) {\n\t\t\t\t\tseries._markDirtyAxes();\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tthis._updateGhost();\n\t\t}\n\t}\n\n\n\tpublic _prepareDataItem(dataItem: DataItem, count?: number) {\n\t\tlet renderer = this.get(\"renderer\");\n\t\tlet value = dataItem.get(\"value\")!;\n\t\tlet endValue = dataItem.get(\"endValue\");\n\n\t\tlet position = this.valueToPosition(value);\n\n\t\tlet endPosition = position;\n\t\tlet fillEndPosition = this.valueToPosition(value + this.getPrivate(\"step\")!);\n\n\t\tif ($type.isNumber(endValue)) {\n\t\t\tendPosition = this.valueToPosition(endValue);\n\t\t\tfillEndPosition = endPosition;\n\t\t}\n\n\t\tif (dataItem.get(\"isRange\")) {\n\t\t\tif (endValue == null) {\n\t\t\t\tfillEndPosition = position;\n\t\t\t}\n\t\t}\n\n\t\tlet labelEndPosition = endPosition;\n\n\t\tlet labelEndValue = dataItem.get(\"labelEndValue\");\n\t\tif (labelEndValue != null) {\n\t\t\tlabelEndPosition = this.valueToPosition(labelEndValue);\n\t\t}\n\n\t\trenderer.updateLabel(dataItem.get(\"label\"), position, labelEndPosition, count);\n\n\t\tconst grid = dataItem.get(\"grid\");\n\t\trenderer.updateGrid(grid, position, endPosition);\n\t\tif (grid) {\n\t\t\tif (value == this.get(\"baseValue\", 0)) {\n\t\t\t\tgrid.addTag(\"base\");\n\t\t\t\tgrid._applyThemes();\n\t\t\t}\n\t\t\telse if (grid.hasTag(\"base\")) {\n\t\t\t\tgrid.removeTag(\"base\");\n\t\t\t\tgrid._applyThemes();\n\t\t\t}\n\t\t}\n\n\t\trenderer.updateTick(dataItem.get(\"tick\"), position, labelEndPosition, count);\n\t\trenderer.updateFill(dataItem.get(\"axisFill\"), position, fillEndPosition);\n\n\t\tthis._processBullet(dataItem);\n\t\trenderer.updateBullet(dataItem.get(\"bullet\"), position, endPosition);\n\n\t\tif (!dataItem.get(\"isRange\")) {\n\t\t\tconst fillRule = this.get(\"fillRule\");\n\t\t\tif (fillRule) {\n\t\t\t\tfillRule(dataItem)\n\t\t\t}\n\t\t}\n\t}\n\n\n\tprotected _handleRangeChange() {\n\t\tlet selectionMin: number = this.positionToValue(this.get(\"start\", 0));\n\t\tlet selectionMax: number = this.positionToValue(this.get(\"end\", 1));\n\n\t\tconst gridCount = this.get(\"renderer\").gridCount();\n\t\tlet minMaxStep: IMinMaxStep = this._adjustMinMax(selectionMin, selectionMax, gridCount, true);\n\n\t\tlet stepDecimalPlaces = $utils.decimalPlaces(minMaxStep.step);\n\t\tthis.setPrivateRaw(\"stepDecimalPlaces\", stepDecimalPlaces);\n\n\t\tselectionMin = $math.round(selectionMin, stepDecimalPlaces);\n\t\tselectionMax = $math.round(selectionMax, stepDecimalPlaces);\n\n\t\tminMaxStep = this._adjustMinMax(selectionMin, selectionMax, gridCount, true);\n\n\t\tlet step = minMaxStep.step;\n\t\tselectionMin = minMaxStep.min;\n\t\tselectionMax = minMaxStep.max;\n\n\t\tif (this.getPrivate(\"selectionMin\") !== selectionMin || this.getPrivate(\"selectionMax\") !== selectionMax || this.getPrivate(\"step\") !== step) {\n\t\t\t// do not change to setPrivate, will cause SO\n\t\t\tthis.setPrivateRaw(\"selectionMin\", selectionMin);\n\t\t\tthis.setPrivateRaw(\"selectionMax\", selectionMax);\n\n\t\t\tthis.setPrivateRaw(\"step\", step);\n\t\t}\n\t}\n\n\t/**\n\t * Converts a relative position to a corresponding numeric value from axis\n\t * scale.\n\t *\n\t * @param position Relative position\n\t * @return Value\n\t */\n\tpublic positionToValue(position: number): number {\n\t\tconst min = this.getPrivate(\"min\")!;\n\t\tconst max = this.getPrivate(\"max\")!;\n\n\t\tif (!this.get(\"logarithmic\")) {\n\t\t\treturn position * (max - min) + min;\n\t\t}\n\t\telse {\n\t\t\treturn Math.pow(Math.E, (position * ((Math.log(max) * Math.LOG10E - Math.log(min) * Math.LOG10E)) + Math.log(min) * Math.LOG10E) / Math.LOG10E);\n\t\t}\n\t}\n\n\t/**\n\t * Convers value to a relative position on axis.\n\t *\n\t * @param value Value\n\t * @return Relative position\n\t */\n\tpublic valueToPosition(value: number): number {\n\n\t\tconst min = this.getPrivate(\"min\")!;\n\t\tconst max = this.getPrivate(\"max\")!;\n\n\t\tif (!this.get(\"logarithmic\")) {\n\t\t\treturn (value - min) / (max - min);\n\t\t}\n\t\telse {\n\t\t\tif (value <= 0) {\n\t\t\t\tlet treatZeroAs = this.get(\"treatZeroAs\");\n\t\t\t\tif ($type.isNumber(treatZeroAs)) {\n\t\t\t\t\tvalue = treatZeroAs;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn (Math.log(value) * Math.LOG10E - Math.log(min) * Math.LOG10E) / ((Math.log(max) * Math.LOG10E - Math.log(min) * Math.LOG10E));\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic valueToFinalPosition(value: number): number {\n\n\t\tconst min = this.getPrivate(\"minFinal\")!;\n\t\tconst max = this.getPrivate(\"maxFinal\")!;\n\n\t\tif (!this.get(\"logarithmic\")) {\n\t\t\treturn (value - min) / (max - min);\n\t\t}\n\t\telse {\n\t\t\tif (value <= 0) {\n\t\t\t\tlet treatZeroAs = this.get(\"treatZeroAs\");\n\t\t\t\tif ($type.isNumber(treatZeroAs)) {\n\t\t\t\t\tvalue = treatZeroAs;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn (Math.log(value) * Math.LOG10E - Math.log(min) * Math.LOG10E) / ((Math.log(max) * Math.LOG10E - Math.log(min) * Math.LOG10E));\n\t\t}\n\t}\n\n\t/**\n\t * Returns X coordinate in pixels corresponding to specific value.\n\t *\n\t * @param value Numeric value\n\t * @param location Location\n\t * @param baseValue Base value\n\t * @return X coordinate\n\t */\n\tpublic getX(value: number, location: number, baseValue: number) {\n\t\tvalue = baseValue + (value - baseValue) * location;\n\n\t\tconst position = this.valueToPosition(value);\n\t\treturn this._settings.renderer.positionToCoordinate(position);\n\t}\n\n\t/**\n\t * Returns X coordinate in pixels corresponding to specific value.\n\t *\n\t * @param value Numeric value\n\t * @param location Location\n\t * @param baseValue Base value\n\t * @return X coordinate\n\t */\n\tpublic getY(value: number, location: number, baseValue: number) {\n\t\tvalue = baseValue + (value - baseValue) * location;\n\n\t\tconst position = this.valueToPosition(value)\n\t\treturn this._settings.renderer.positionToCoordinate(position);\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic getDataItemCoordinateX(dataItem: DataItem, field: string, _cellLocation: number, axisLocation: number): number {\n\t\treturn this._settings.renderer.positionToCoordinate(this.getDataItemPositionX(dataItem, field, _cellLocation, axisLocation));\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic getDataItemPositionX(dataItem: DataItem, field: string, _cellLocation: number, axisLocation: number) {\n\t\tlet value = dataItem.get(field as any);\n\n\t\tconst stackToItem = dataItem.get(\"stackToItemX\");\n\t\tif (stackToItem) {\n\t\t\tconst series = dataItem.component as XYSeries;\n\t\t\tvalue = value * axisLocation + series.getStackedXValueWorking(dataItem, field);\n\t\t}\n\t\telse {\n\t\t\tvalue = this._baseValue + (value - this._baseValue) * axisLocation;\n\t\t}\n\n\t\treturn this.valueToPosition(value);\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic getDataItemCoordinateY(dataItem: DataItem, field: string, _cellLocation: number, axisLocation: number): number {\n\t\treturn this._settings.renderer.positionToCoordinate(this.getDataItemPositionY(dataItem, field, _cellLocation, axisLocation));\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic getDataItemPositionY(dataItem: DataItem, field: string, _cellLocation: number, axisLocation: number): number {\n\t\tlet value = dataItem.get(field as any);\n\n\t\tconst stackToItem = dataItem.get(\"stackToItemY\");\n\t\tif (stackToItem) {\n\t\t\tconst series = dataItem.component as XYSeries;\n\t\t\tvalue = value * axisLocation + series.getStackedYValueWorking(dataItem, field);\n\t\t}\n\t\telse {\n\t\t\tvalue = this._baseValue + (value - this._baseValue) * axisLocation;\n\t\t}\n\n\t\treturn this.valueToPosition(value);\n\t}\n\n\t/**\n\t * Returns relative position of axis' `baseValue`.\n\t *\n\t * @return Base value position\n\t */\n\tpublic basePosition(): number {\n\t\treturn this.valueToPosition(this.baseValue());\n\t}\n\n\t/**\n\t * Base value of the [[ValueAxis]], which determines positive and negative\n\t * values.\n\t *\n\t * @return Base value\n\t */\n\tpublic baseValue(): number {\n\t\tconst min = Math.min(this.getPrivate(\"minFinal\", -Infinity), this.getPrivate(\"selectionMin\", -Infinity));\n\t\tconst max = Math.max(this.getPrivate(\"maxFinal\", Infinity), this.getPrivate(\"selectionMax\", Infinity));\n\t\tlet baseValue = this.get(\"baseValue\", 0);\n\n\t\tif (baseValue < min) {\n\t\t\tbaseValue = min;\n\t\t}\n\n\t\tif (baseValue > max) {\n\t\t\tbaseValue = max\n\t\t}\n\n\t\treturn baseValue;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic cellEndValue(value: number): number {\n\t\treturn value;\n\t}\n\n\tprotected fixSmallStep(step: number): number {\n\t\t// happens because of floating point error\n\t\tif (1 + step === 1) {\n\t\t\tstep *= 2;\n\t\t\treturn this.fixSmallStep(step);\n\t\t}\n\t\treturn step;\n\t}\n\n\tprotected _fixMin(min: number) {\n\t\treturn min;\n\t}\n\n\tprotected _fixMax(max: number) {\n\t\treturn max;\n\t}\n\n\tpublic _calculateTotals() {\n\t\tif (this.get(\"calculateTotals\")) {\n\t\t\tlet series = this.series[0];\n\t\t\tif (series) {\n\t\t\t\tlet startIndex = series.startIndex();\n\n\t\t\t\tif (series.dataItems.length > 0) {\n\n\t\t\t\t\tif (startIndex > 0) {\n\t\t\t\t\t\tstartIndex--;\n\t\t\t\t\t}\n\t\t\t\t\tlet endIndex = series.endIndex();\n\t\t\t\t\tif (endIndex < series.dataItems.length) {\n\t\t\t\t\t\tendIndex++;\n\t\t\t\t\t}\n\n\t\t\t\t\tlet field: string | undefined;\n\t\t\t\t\tlet vc: string | undefined;\n\n\t\t\t\t\tif (series.get(\"yAxis\") == this) {\n\t\t\t\t\t\tfield = \"valueY\";\n\t\t\t\t\t\tvc = \"vcy\";\n\t\t\t\t\t}\n\t\t\t\t\telse if (series.get(\"xAxis\") == this) {\n\t\t\t\t\t\tfield = \"valueX\";\n\t\t\t\t\t\tvc = \"vcx\";\n\t\t\t\t\t}\n\n\t\t\t\t\tlet fieldWorking = field + \"Working\";\n\n\t\t\t\t\tif (field) {\n\t\t\t\t\t\tfor (let i = startIndex; i < endIndex; i++) {\n\t\t\t\t\t\t\tlet sum = 0;\n\t\t\t\t\t\t\tlet total = 0;\n\n\t\t\t\t\t\t\t$array.each(this.series, (series) => {\n\t\t\t\t\t\t\t\tif (!series.get(\"excludeFromTotal\")) {\n\t\t\t\t\t\t\t\t\tlet dataItem = series.dataItems[i];\n\t\t\t\t\t\t\t\t\tif (dataItem) {\n\t\t\t\t\t\t\t\t\t\tlet value = dataItem.get(fieldWorking as any) * series.get(vc as any);\n\n\t\t\t\t\t\t\t\t\t\tif (!$type.isNaN(value)) {\n\t\t\t\t\t\t\t\t\t\t\tsum += value;\n\t\t\t\t\t\t\t\t\t\t\ttotal += Math.abs(value);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\t$array.each(this.series, (series) => {\n\t\t\t\t\t\t\t\tif (!series.get(\"excludeFromTotal\")) {\n\t\t\t\t\t\t\t\t\tlet dataItem = series.dataItems[i];\n\t\t\t\t\t\t\t\t\tif (dataItem) {\n\t\t\t\t\t\t\t\t\t\tlet value = dataItem.get(fieldWorking as any) * series.get(vc as any);\n\n\t\t\t\t\t\t\t\t\t\tif (!$type.isNaN(value)) {\n\t\t\t\t\t\t\t\t\t\t\tdataItem.set((field + \"Total\") as any, total);\n\t\t\t\t\t\t\t\t\t\t\tdataItem.set((field + \"Sum\") as any, sum);\n\t\t\t\t\t\t\t\t\t\t\tdataItem.set((field + \"TotalPercent\") as any, value / total * 100);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _getSelectionMinMax() {\n\t\tconst min = this.getPrivate(\"minFinal\");\n\t\tconst max = this.getPrivate(\"maxFinal\");\n\n\t\tconst minDefined = this.get(\"min\");\n\t\tconst maxDefined = this.get(\"max\");\n\n\t\tlet extraMin = this.get(\"extraMin\", 0);\n\t\tlet extraMax = this.get(\"extraMax\", 0);\n\n\t\tif (this.get(\"logarithmic\")) {\n\t\t\tif (this.get(\"extraMin\") == null) {\n\t\t\t\textraMin = 0.1;\n\t\t\t}\n\t\t\tif (this.get(\"extraMax\") == null) {\n\t\t\t\textraMax = 0.2;\n\t\t\t}\n\t\t}\n\n\t\tconst gridCount = this.get(\"renderer\").gridCount();\n\t\tconst selectionStrictMinMax = this.get(\"strictMinMaxSelection\");\n\t\tlet strictMinMax = this.get(\"strictMinMax\");\n\n\t\tif ($type.isNumber(min) && $type.isNumber(max)) {\n\t\t\tlet selectionMin = max;\n\t\t\tlet selectionMax = min;\n\n\t\t\t$array.each(this.series, (series) => {\n\t\t\t\tif (!series.get(\"ignoreMinMax\")) {\n\t\t\t\t\tlet seriesMin: number | undefined;\n\t\t\t\t\tlet seriesMax: number | undefined;\n\t\t\t\t\tconst outOfSelection = series.getPrivate(\"outOfSelection\");\n\n\t\t\t\t\tif (series.get(\"xAxis\") === this) {\n\t\t\t\t\t\tif (!outOfSelection) {\n\t\t\t\t\t\t\tlet minX = series.getPrivate(\"minX\");\n\t\t\t\t\t\t\tlet maxX = series.getPrivate(\"maxX\");\n\n\t\t\t\t\t\t\t// solves #90085\n\t\t\t\t\t\t\tif (series.startIndex() != 0 || series.endIndex() != series.dataItems.length) {\n\t\t\t\t\t\t\t\tminX = undefined;\n\t\t\t\t\t\t\t\tmaxX = undefined;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tseriesMin = series.getPrivate(\"selectionMinX\", minX);\n\t\t\t\t\t\t\tseriesMax = series.getPrivate(\"selectionMaxX\", maxX);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (series.get(\"yAxis\") === this) {\n\t\t\t\t\t\tif (!outOfSelection) {\n\n\t\t\t\t\t\t\tlet minY = series.getPrivate(\"minY\");\n\t\t\t\t\t\t\tlet maxY = series.getPrivate(\"maxY\");\n\n\t\t\t\t\t\t\t// solves #90085\n\t\t\t\t\t\t\tif (series.startIndex() != 0 || series.endIndex() != series.dataItems.length) {\n\t\t\t\t\t\t\t\tminY = undefined;\n\t\t\t\t\t\t\t\tmaxY = undefined;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tseriesMin = series.getPrivate(\"selectionMinY\", minY);\n\t\t\t\t\t\t\tseriesMax = series.getPrivate(\"selectionMaxY\", maxY);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!series.isHidden() && !series.isShowing()) {\n\t\t\t\t\t\tif ($type.isNumber(seriesMin)) {\n\t\t\t\t\t\t\tselectionMin = Math.min(selectionMin, seriesMin);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($type.isNumber(seriesMax)) {\n\t\t\t\t\t\t\tselectionMax = Math.max(selectionMax, seriesMax);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tthis.axisRanges.each((range) => {\n\t\t\t\tif (range.get(\"affectsMinMax\")) {\n\t\t\t\t\tlet value = range.get(\"value\");\n\t\t\t\t\tif (value != null) {\n\t\t\t\t\t\tselectionMin = Math.min(selectionMin, value);\n\t\t\t\t\t\tselectionMax = Math.max(selectionMax, value);\n\t\t\t\t\t}\n\t\t\t\t\tvalue = range.get(\"endValue\");\n\t\t\t\t\tif (value != null) {\n\t\t\t\t\t\tselectionMin = Math.min(selectionMin, value);\n\t\t\t\t\t\tselectionMax = Math.max(selectionMax, value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tif (selectionMin > selectionMax) {\n\t\t\t\t[selectionMin, selectionMax] = [selectionMax, selectionMin]\n\t\t\t}\n\n\t\t\tif ($type.isNumber(minDefined)) {\n\t\t\t\tif (strictMinMax) {\n\t\t\t\t\tselectionMin = minDefined;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tselectionMin = min;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (strictMinMax) {\n\t\t\t\tif ($type.isNumber(this._minReal)) {\n\t\t\t\t\tselectionMin = this._minReal;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($type.isNumber(maxDefined)) {\n\t\t\t\tif (strictMinMax) {\n\t\t\t\t\tselectionMax = maxDefined;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tselectionMax = max;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (strictMinMax) {\n\t\t\t\tif ($type.isNumber(this._maxReal)) {\n\t\t\t\t\tselectionMax = this._maxReal;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (selectionMin === selectionMax) {\n\t\t\t\tlet smin = selectionMin;\n\t\t\t\tselectionMin -= this._deltaMinMax;\n\t\t\t\tselectionMax += this._deltaMinMax;\n\n\t\t\t\tif (selectionMin < min) {\n\t\t\t\t\tlet d = smin - min;\n\t\t\t\t\tif (d == 0) {\n\t\t\t\t\t\td = this._deltaMinMax;\n\t\t\t\t\t}\n\n\t\t\t\t\tselectionMin = smin - d;\n\t\t\t\t\tselectionMax = smin + d;\n\n\t\t\t\t\tstrictMinMax = true;\n\t\t\t\t}\n\n\t\t\t\tlet minMaxStep2 = this._adjustMinMax(selectionMin, selectionMax, gridCount, strictMinMax);\n\t\t\t\tselectionMin = minMaxStep2.min;\n\t\t\t\tselectionMax = minMaxStep2.max;\n\t\t\t}\n\n\t\t\tlet selectionMinReal = selectionMin;\n\t\t\tlet selectionMaxReal = selectionMax;\n\n\t\t\tlet delta = selectionMax - selectionMin;\n\n\t\t\tselectionMin -= delta * extraMin;\n\t\t\tselectionMax += delta * extraMax;\t\t\t\n\n\t\t\tlet minMaxStep: IMinMaxStep = this._adjustMinMax(selectionMin, selectionMax, gridCount);\n\n\t\t\tselectionMin = minMaxStep.min;\n\t\t\tselectionMax = minMaxStep.max;\n\n\t\t\tselectionMin = $math.fitToRange(selectionMin, min, max);\n\t\t\tselectionMax = $math.fitToRange(selectionMax, min, max);\n\n\t\t\t// do it for the second time !important\t\t\t\n\t\t\tminMaxStep = this._adjustMinMax(selectionMin, selectionMax, gridCount, true);\n\n\t\t\tif (!strictMinMax) {\n\t\t\t\tselectionMin = minMaxStep.min;\n\t\t\t\tselectionMax = minMaxStep.max;\n\t\t\t}\n\n\t\t\tconst syncWithAxis = this.get(\"syncWithAxis\");\n\t\t\tif (syncWithAxis) {\n\t\t\t\tminMaxStep = this._syncAxes(selectionMin, selectionMax, minMaxStep.step, syncWithAxis.getPrivate(\"selectionMinFinal\", syncWithAxis.getPrivate(\"minFinal\", 0)), syncWithAxis.getPrivate(\"selectionMaxFinal\", syncWithAxis.getPrivate(\"maxFinal\", 1)), syncWithAxis.getPrivate(\"selectionStepFinal\", syncWithAxis.getPrivate(\"step\", 1)));\n\n\t\t\t\tif (minMaxStep.min < min) {\n\t\t\t\t\tminMaxStep.min = min;\n\t\t\t\t}\n\n\t\t\t\tif (minMaxStep.max > max) {\n\t\t\t\t\tminMaxStep.max = max;\n\t\t\t\t}\n\n\t\t\t\tselectionMin = minMaxStep.min;\n\t\t\t\tselectionMax = minMaxStep.max;\n\t\t\t}\n\t\n\t\t\tif (strictMinMax) {\n\t\t\t\tif ($type.isNumber(minDefined)) {\n\t\t\t\t\tselectionMin = Math.max(selectionMin, minDefined);\n\t\t\t\t}\n\n\t\t\t\tif ($type.isNumber(maxDefined)) {\n\t\t\t\t\tselectionMax = Math.min(selectionMax, maxDefined);\n\t\t\t\t}\t\t\t\n\t\t\t}\n\n\t\t\tif (selectionStrictMinMax) {\n\t\t\t\tselectionMin = selectionMinReal - (selectionMaxReal - selectionMinReal) * extraMin;\n\t\t\t\tselectionMax = selectionMaxReal + (selectionMaxReal - selectionMinReal) * extraMax;\n\t\t\t}\n\n\t\t\tif (strictMinMax) {\n\t\t\t\tif ($type.isNumber(minDefined)) {\n\t\t\t\t\tselectionMin = minDefined;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tselectionMin = selectionMinReal;\n\t\t\t\t}\n\t\n\t\t\t\tif ($type.isNumber(maxDefined)) {\n\t\t\t\t\tselectionMax = maxDefined;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tselectionMax = selectionMaxReal;\n\t\t\t\t}\n\t\n\t\t\t\tif (selectionMax - selectionMin <= 0.00000001) {\n\t\t\t\t\tselectionMin -= this._deltaMinMax;\n\t\t\t\t\tselectionMax += this._deltaMinMax;\n\t\t\t\t}\n\t\n\t\t\t\tlet delta = selectionMax - selectionMin;\n\n\t\t\t\tselectionMin -= delta * extraMin;\n\t\t\t\tselectionMax += delta * extraMax;\n\t\t\t}\t\t\n\n\t\t\tif (this.get(\"logarithmic\")) {\n\n\t\t\t\tif (selectionMin <= 0) {\n\t\t\t\t\tselectionMin = selectionMinReal * (1 - Math.min(extraMin, 0.99));\n\t\t\t\t}\n\n\t\t\t\tif (selectionMin < min) {\n\t\t\t\t\tselectionMin = min;\n\t\t\t\t}\n\t\t\t\tif (selectionMax > max) {\n\t\t\t\t\tselectionMax = max;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet len = Math.min(20, Math.ceil(Math.log(this.getPrivate(\"maxZoomFactor\", 100) + 1) / Math.LN10) + 2);\n\n\t\t\tlet start = $math.round(this.valueToFinalPosition(selectionMin), len);\n\t\t\tlet end = $math.round(this.valueToFinalPosition(selectionMax), len);\n\n\t\t\tthis.setPrivateRaw(\"selectionMinFinal\", selectionMin);\n\t\t\tthis.setPrivateRaw(\"selectionMaxFinal\", selectionMax);\n\t\t\tthis.setPrivateRaw(\"selectionStepFinal\", minMaxStep.step);\n\n\t\t\tthis.zoom(start, end);\n\t\t}\n\t}\n\n\n\tprotected _getMinMax() {\n\t\tlet minDefined = this.get(\"min\");\n\t\tlet maxDefined = this.get(\"max\");\n\n\t\tlet min = Infinity;\n\t\tlet max = -Infinity;\n\n\t\tlet extraMin = this.get(\"extraMin\", 0);\n\t\tlet extraMax = this.get(\"extraMax\", 0);\n\n\t\tif (this.get(\"logarithmic\")) {\n\t\t\tif (this.get(\"extraMin\") == null) {\n\t\t\t\textraMin = 0.1;\n\t\t\t}\n\t\t\tif (this.get(\"extraMax\") == null) {\n\t\t\t\textraMax = 0.2;\n\t\t\t}\n\t\t}\n\n\t\tlet minDiff = Infinity;\n\n\t\t$array.each(this.series, (series) => {\n\t\t\tif (!series.get(\"ignoreMinMax\")) {\n\t\t\t\tlet seriesMin: number | undefined;\n\t\t\t\tlet seriesMax: number | undefined;\n\t\t\t\tif (series.get(\"xAxis\") === this) {\n\t\t\t\t\tseriesMin = series.getPrivate(\"minX\");\n\t\t\t\t\tseriesMax = series.getPrivate(\"maxX\");\n\t\t\t\t}\n\t\t\t\telse if (series.get(\"yAxis\") === this) {\n\t\t\t\t\tseriesMin = series.getPrivate(\"minY\");\n\t\t\t\t\tseriesMax = series.getPrivate(\"maxY\");\n\t\t\t\t}\n\n\t\t\t\tif ($type.isNumber(seriesMin) && $type.isNumber(seriesMax)) {\n\t\t\t\t\tmin = Math.min(min, seriesMin);\n\t\t\t\t\tmax = Math.max(max, seriesMax);\n\n\t\t\t\t\tlet diff = seriesMax - seriesMin;\n\n\t\t\t\t\tif (diff <= 0) {\n\t\t\t\t\t\tdiff = Math.abs(seriesMax / 100);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (diff < minDiff) {\n\t\t\t\t\t\tminDiff = diff;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\tthis.axisRanges.each((range) => {\n\t\t\tif (range.get(\"affectsMinMax\")) {\n\t\t\t\tlet value = range.get(\"value\");\n\t\t\t\tif (value != null) {\n\t\t\t\t\tmin = Math.min(min, value);\n\t\t\t\t\tmax = Math.max(max, value);\n\t\t\t\t}\n\t\t\t\tvalue = range.get(\"endValue\");\n\t\t\t\tif (value != null) {\n\t\t\t\t\tmin = Math.min(min, value);\n\t\t\t\t\tmax = Math.max(max, value);\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\tif (this.get(\"logarithmic\")) {\n\t\t\tlet treatZeroAs = this.get(\"treatZeroAs\");\n\t\t\tif ($type.isNumber(treatZeroAs)) {\n\t\t\t\tif (min <= 0) {\n\t\t\t\t\tmin = treatZeroAs;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (min <= 0) {\n\t\t\t\tnew Error(\"Logarithmic value axis can not have values <= 0.\");\n\t\t\t}\n\t\t}\n\n\t\tif (min === 0 && max === 0) {\n\t\t\tmax = 0.9;\n\t\t\tmin = -0.9;\n\t\t}\n\n\t\tif ($type.isNumber(minDefined)) {\n\t\t\tmin = minDefined;\n\t\t}\n\t\tif ($type.isNumber(maxDefined)) {\n\t\t\tmax = maxDefined;\n\t\t}\n\n\t\t// meaning no min/max found on series/ranges and no min/max was defined\n\t\tif (min === Infinity || max === -Infinity) {\n\t\t\tthis.setPrivate(\"minFinal\", undefined);\n\t\t\tthis.setPrivate(\"maxFinal\", undefined);\n\t\t\treturn;\n\t\t}\n\n\t\tif (min > max) {\n\t\t\t[min, max] = [max, min];\n\t\t}\n\n\t\tconst initialMin = min;\n\t\tconst initialMax = max;\n\n\t\t// adapter\n\t\tlet minAdapted = this.adapters.fold(\"min\", min);\n\t\tlet maxAdapted = this.adapters.fold(\"max\", max);\n\n\t\tthis._minRealLog = min;\n\n\t\tif ($type.isNumber(minAdapted)) {\n\t\t\tmin = minAdapted;\n\t\t}\n\n\t\tif ($type.isNumber(maxAdapted)) {\n\t\t\tmax = maxAdapted;\n\t\t}\n\n\t\t// DateAxis does some magic here\n\t\tmin = this._fixMin(min);\n\t\tmax = this._fixMax(max);\n\n\t\t// this happens if starLocation and endLocation are 0.5 and DateAxis has only one date\t\t\n\t\tif (max - min <= 1 / Math.pow(10, 15)) {\n\t\t\tif (max - min !== 0) {\n\t\t\t\tthis._deltaMinMax = (max - min) / 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis._getDelta(max);\n\t\t\t}\n\n\t\t\tmin -= this._deltaMinMax;\n\t\t\tmax += this._deltaMinMax;\n\t\t}\n\n\t\t// add extras\n\t\tmin -= (max - min) * extraMin;\n\t\tmax += (max - min) * extraMax;\n\n\t\tif (this.get(\"logarithmic\")) {\n\t\t\t// don't let min go below 0 if real min is >= 0\n\t\t\tif (min < 0 && initialMin >= 0) {\n\t\t\t\tmin = 0;\n\t\t\t}\n\t\t\t// don't let max go above 0 if real max is <= 0\n\t\t\tif (max > 0 && initialMax <= 0) {\n\t\t\t\tmax = 0;\n\t\t\t}\n\t\t}\n\n\t\tthis._minReal = min;\n\t\tthis._maxReal = max;\n\n\t\tlet strictMinMax = this.get(\"strictMinMax\");\n\t\tlet strictMinMaxSelection = this.get(\"strictMinMaxSelection\", false);\n\t\tif (strictMinMaxSelection) {\n\t\t\tstrictMinMax = strictMinMaxSelection;\n\t\t}\n\n\t\tlet strict = strictMinMax;\n\t\tif ($type.isNumber(maxDefined)) {\n\t\t\tstrict = true;\n\t\t}\n\n\t\tlet gridCount = this.get(\"renderer\").gridCount();\n\n\t\tlet minMaxStep: IMinMaxStep = this._adjustMinMax(min, max, gridCount, strict);\n\n\t\tmin = minMaxStep.min;\n\t\tmax = minMaxStep.max;\n\n\t\t// do it for the second time with strict true (importat!)\n\t\tminMaxStep = this._adjustMinMax(min, max, gridCount, true);\n\n\t\tmin = minMaxStep.min;\n\t\tmax = minMaxStep.max;\n\n\t\t// return min max if strict\n\t\tif (strictMinMax) {\n\t\t\tif ($type.isNumber(minDefined)) {\n\t\t\t\tmin = minDefined;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmin = this._minReal;\n\t\t\t}\n\n\t\t\tif ($type.isNumber(maxDefined)) {\n\t\t\t\tmax = maxDefined;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmax = this._maxReal;\n\t\t\t}\n\n\t\t\tif (max - min <= 0.00000001) {\n\t\t\t\tmin -= this._deltaMinMax;\n\t\t\t\tmax += this._deltaMinMax;\n\t\t\t}\n\n\t\t\tlet delta = max - min;\n\t\t\tmin -= delta * extraMin;\n\t\t\tmax += delta * extraMax;\n\t\t}\n\n\t\tminAdapted = this.adapters.fold(\"min\", min);\n\t\tmaxAdapted = this.adapters.fold(\"max\", max);\n\n\t\tif ($type.isNumber(minAdapted)) {\n\t\t\tmin = minAdapted;\n\t\t}\n\n\t\tif ($type.isNumber(maxAdapted)) {\n\t\t\tmax = maxAdapted;\n\t\t}\n\n\t\tif (minDiff == Infinity) {\n\t\t\tminDiff = (max - min)\n\t\t}\n\n\t\t// this is to avoid floating point number error\n\t\tlet decCount = Math.round(Math.abs(Math.log(Math.abs(max - min)) * Math.LOG10E)) + 5;\n\n\t\tmin = $math.round(min, decCount);\n\t\tmax = $math.round(max, decCount);\n\n\t\t\n\n\t\tconst syncWithAxis = this.get(\"syncWithAxis\");\n\t\tif (syncWithAxis) {\n\t\t\tminMaxStep = this._syncAxes(min, max, minMaxStep.step, syncWithAxis.getPrivate(\"minFinal\", syncWithAxis.getPrivate(\"min\", 0)), syncWithAxis.getPrivate(\"maxFinal\", syncWithAxis.getPrivate(\"max\", 1)), syncWithAxis.getPrivate(\"step\", 1));\n\t\t\tmin = minMaxStep.min;\n\t\t\tmax = minMaxStep.max;\n\t\t}\n\n\n\t\tthis.setPrivateRaw(\"maxZoomFactor\", Math.max(1, Math.ceil((max - min) / minDiff * this.get(\"maxZoomFactor\", 100))));\n\t\tthis._fixZoomFactor();\n\n\t\tif (this.get(\"logarithmic\")) {\n\t\t\tthis._minLogAdjusted = min;\n\t\t\tmin = this._minReal;\n\t\t\tmax = this._maxReal;\n\n\t\t\tif (min <= 0) {\n\t\t\t\tmin = initialMin * (1 - Math.min(extraMin, 0.99));\n\t\t\t}\n\t\t}\n\n\t\t\n\n\t\tif ($type.isNumber(min) && $type.isNumber(max)) {\n\t\t\tif (this.getPrivate(\"minFinal\") !== min || this.getPrivate(\"maxFinal\") !== max) {\n\n\t\t\t\tthis.setPrivate(\"minFinal\", min);\n\t\t\t\tthis.setPrivate(\"maxFinal\", max);\n\t\t\t\tthis._saveMinMax(min, max);\n\n\t\t\t\tconst duration = this.get(\"interpolationDuration\", 0);\n\t\t\t\tconst easing = this.get(\"interpolationEasing\");\n\n\t\t\t\tthis.animatePrivate({ key: \"min\", to: min, duration, easing });\n\t\t\t\tthis.animatePrivate({ key: \"max\", to: max, duration, easing });\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _fixZoomFactor() {\n\t}\n\n\tprotected _getDelta(max: number) {\n\t\t// the number by which we need to raise 10 to get difference\n\t\tlet exponent: number = Math.log(Math.abs(max)) * Math.LOG10E;\n\n\t\t// here we find a number which is power of 10 and has the same count of numbers as difference has\n\t\tlet power = Math.pow(10, Math.floor(exponent));\n\n\t\t// reduce this number by 10 times\n\t\tpower = power / 10;\n\n\t\tthis._deltaMinMax = power;\n\t}\n\n\tprotected _saveMinMax(_min: number, _max: number) {\n\n\t}\n\n\n\tprotected _adjustMinMax(min: number, max: number, gridCount: number, strictMode?: boolean): IMinMaxStep {\n\t\t// will fail if 0\n\t\tif (gridCount <= 1) {\n\t\t\tgridCount = 1;\n\t\t}\n\n\t\tgridCount = Math.round(gridCount);\n\n\t\tlet initialMin: number = min;\n\t\tlet initialMax: number = max;\n\n\t\tlet difference = max - min;\n\n\t\t// in case min and max is the same, use max\n\t\tif (difference === 0) {\n\t\t\tdifference = Math.abs(max);\n\t\t}\n\n\t\t// the number by which we need to raise 10 to get difference\n\t\tlet exponent: number = Math.log(Math.abs(difference)) * Math.LOG10E;\n\n\t\t// here we find a number which is power of 10 and has the same count of numbers as difference has\n\t\tlet power = Math.pow(10, Math.floor(exponent));\n\n\t\t// reduce this number by 10 times\n\t\tpower = power / 10;\n\n\t\tlet extra: number = power;\n\t\tif (strictMode) {\n\t\t\textra = 0;\n\t\t}\n\n\t\t// round down min\n\t\tif (strictMode) {\n\t\t\tmin = Math.floor(min / power) * power;\n\t\t\t// round up max\n\t\t\tmax = Math.ceil(max / power) * power;\n\t\t}\n\t\telse {\n\t\t\tmin = Math.ceil(min / power) * power - extra;\n\t\t\t// round up max\n\t\t\tmax = Math.floor(max / power) * power + extra;\n\t\t}\n\n\t\t// don't let min go below 0 if real min is >= 0\n\t\tif (min < 0 && initialMin >= 0) {\n\t\t\tmin = 0;\n\t\t}\n\t\t// don't let max go above 0 if real max is <= 0\n\t\tif (max > 0 && initialMax <= 0) {\n\t\t\tmax = 0;\n\t\t}\n\n\t\texponent = Math.log(Math.abs(difference)) * Math.LOG10E;\n\t\tpower = Math.pow(10, Math.floor(exponent));\n\t\tpower = power / 100; // used to be 10 in v4, but this caused issue that there could be limited number of grids with even very small minGridDistance\n\n\t\t// approximate difference between two grid lines\n\t\tlet step = Math.ceil((difference / gridCount) / power) * power;\n\t\tlet stepPower = Math.pow(10, Math.floor(Math.log(Math.abs(step)) * Math.LOG10E));\n\n\t\t// the step should divide by 2, 5, and 10.\n\t\tlet stepDivisor: number = Math.ceil(step / stepPower); // number 0 - 10\n\n\n\t\tif (stepDivisor > 5) {\n\t\t\tstepDivisor = 10;\n\t\t}\n\t\telse if (stepDivisor <= 5 && stepDivisor > 2) {\n\t\t\tstepDivisor = 5;\n\t\t}\n\n\t\t// now get real step\n\t\tstep = Math.ceil(step / (stepPower * stepDivisor)) * stepPower * stepDivisor;\n\n\n\t\tlet maxPrecision = this.get(\"maxPrecision\");\n\t\tif ($type.isNumber(maxPrecision)) {\n\n\t\t\tlet ceiledStep = $math.ceil(step, maxPrecision);\n\t\t\tif (maxPrecision < Number.MAX_VALUE && step !== ceiledStep) {\n\t\t\t\tstep = ceiledStep;\n\t\t\t\tif (step == 0) {\n\t\t\t\t\tstep = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet decCount: number = 0;\n\t\t// in case numbers are smaller than 1\n\t\tif (stepPower < 1) {\n\t\t\t// exponent is less then 1 too. Count decimals of exponent\n\t\t\tdecCount = Math.round(Math.abs(Math.log(Math.abs(stepPower)) * Math.LOG10E)) + 1;\n\t\t\t// round step\n\t\t\tstep = $math.round(step, decCount);\n\t\t}\n\n\t\t// final min and max\n\t\tlet minCount = Math.floor(min / step);\n\n\t\tmin = $math.round(step * minCount, decCount);\n\n\t\tlet maxCount: number;\n\n\t\tif (!strictMode) {\n\t\t\tmaxCount = Math.ceil(max / step);\n\t\t}\n\t\telse {\n\t\t\tmaxCount = Math.floor(max / step);\n\t\t}\n\n\t\tif (maxCount === minCount) {\n\t\t\tmaxCount++;\n\t\t}\n\n\t\tmax = $math.round(step * maxCount, decCount);\n\n\t\tif (max < initialMax) {\n\t\t\tmax = max + step;\n\t\t}\n\n\t\tif (min > initialMin) {\n\t\t\tmin = min - step;\n\t\t}\n\n\n\t\tstep = this.fixSmallStep(step);\n\n\t\treturn { min: min, max: max, step: step };\n\t}\n\n\t/**\n\t * Returns text to be used in an axis tooltip for specific relative position.\n\t *\n\t * @param position Position\n\t * @return Tooltip text\n\t */\n\tpublic getTooltipText(position: number, _adjustPosition?: boolean): string | undefined {\n\t\tconst numberFormat = this.get(\"tooltipNumberFormat\", this.get(\"numberFormat\"));\n\t\tconst formatter = this.getNumberFormatter();\n\t\tconst extraDecimals = this.get(\"extraTooltipPrecision\", 0);\n\t\tconst decimals = this.getPrivate(\"stepDecimalPlaces\", 0) + extraDecimals;\n\t\tconst value = $math.round(this.positionToValue(position), decimals);\n\n\t\tif (numberFormat) {\n\t\t\treturn formatter.format(value, numberFormat);\n\t\t}\n\t\telse {\n\t\t\treturn formatter.format(value, undefined, decimals);\n\t\t}\n\t}\n\n\t/**\n\t * Returns a data item from series that is closest to the `position`.\n\t *\n\t * @param series Series\n\t * @param position Relative position\n\t * @return Data item\n\t */\n\tpublic getSeriesItem(series: XYSeries, position: number): DataItem | undefined {\n\t\tlet fieldName = (this.getPrivate(\"name\")! + this.get(\"renderer\").getPrivate(\"letter\")!);\n\t\tlet value = this.positionToValue(position);\n\n\t\tlet index: number | undefined = undefined;\n\t\tlet oldDiff: number;\n\t\t$array.each(series.dataItems, (dataItem, i) => {\n\t\t\tconst diff = Math.abs(dataItem.get(fieldName) - value);\n\t\t\tif (index === undefined || diff < oldDiff) {\n\t\t\t\tindex = i;\n\t\t\t\toldDiff = diff;\n\t\t\t}\n\t\t});\n\n\t\tif (index != null) {\n\t\t\treturn series.dataItems[index];\n\t\t}\n\t}\n\n\t/**\n\t * Zooms the axis to specific `start` and `end` values.\n\t *\n\t * Optional `duration` specifies duration of zoom animation in milliseconds.\n\t *\n\t * @param start Start value\n\t * @param end End value\n\t * @param duration Duration in milliseconds\n\t */\n\tpublic zoomToValues(start: number, end: number, duration?: number) {\n\t\tconst min = this.getPrivate(\"minFinal\", 0);\n\t\tconst max = this.getPrivate(\"maxFinal\", 0);\n\t\tif (this.getPrivate(\"min\") != null && this.getPrivate(\"max\") != null) {\n\t\t\tthis.zoom((start - min) / (max - min), (end - min) / (max - min), duration);\n\t\t}\n\t}\n\n\n\t/**\n\t * Syncs with a target axis.\n\t *\n\t * @param min Min\n\t * @param max Max\n\t * @param step Step\n\t */\n\tprotected _syncAxes(min: number, max: number, step: number, syncMin: number, syncMax: number, syncStep: number) {\n\t\tlet axis = this.get(\"syncWithAxis\");\n\t\tif (axis) {\n\t\t\tlet count: number = Math.round(syncMax - syncMin) / syncStep;\n\t\t\tlet currentCount = Math.round((max - min) / step);\n\n\t\t\tlet gridCount = this.get(\"renderer\").gridCount();\n\n\t\t\tif ($type.isNumber(count) && $type.isNumber(currentCount)) {\n\t\t\t\tlet synced = false;\n\t\t\t\tlet c = 0\n\t\t\t\tlet diff = (max - min) * 0.01;\n\t\t\t\tlet omin = min;\n\t\t\t\tlet omax = max;\n\t\t\t\tlet ostep = step;\n\n\t\t\t\twhile (synced != true) {\n\t\t\t\t\tsynced = this._checkSync(omin, omax, ostep, count);\n\t\t\t\t\tc++;\n\t\t\t\t\tif (c > 500) {\n\t\t\t\t\t\tsynced = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (!synced) {\n\t\t\t\t\t\tif (c / 3 == Math.round(c / 3)) {\n\t\t\t\t\t\t\tomin = min - diff * c;\n\t\t\t\t\t\t\tif (min >= 0 && omin < 0) {\n\t\t\t\t\t\t\t\tomin = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tomax = max + diff * c;\n\t\t\t\t\t\t\tif (omax <= 0 && omax > 0) {\n\t\t\t\t\t\t\t\tomax = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet minMaxStep = this._adjustMinMax(omin, omax, gridCount, true);\n\t\t\t\t\t\tomin = minMaxStep.min;\n\t\t\t\t\t\tomax = minMaxStep.max;\n\t\t\t\t\t\tostep = minMaxStep.step;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tmin = omin;\n\t\t\t\t\t\tmax = omax;\n\t\t\t\t\t\tstep = ostep;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn { min: min, max: max, step: step };\n\t}\n\n\t/**\n\t * Returns `true` if axis needs to be resunced with some other axis.\n\t */\n\tprotected _checkSync(min: number, max: number, step: number, count: number): boolean {\n\t\tlet currentCount = (max - min) / step;\n\t\tfor (let i = 1; i < count; i++) {\n\t\t\tif ($math.round(currentCount / i, 1) == count || currentCount * i == count) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Returns relative position between two grid lines of the axis.\n\t *\n\t * @return Position\n\t */\n\tpublic getCellWidthPosition(): number {\n\t\tlet max = this.getPrivate(\"selectionMax\", this.getPrivate(\"max\"));\n\t\tlet min = this.getPrivate(\"selectionMin\", this.getPrivate(\"min\"));\n\n\t\tif ($type.isNumber(max) && $type.isNumber(min)) {\n\t\t\treturn this.getPrivate(\"step\", 1) / (max - min);\n\t\t}\n\t\treturn 0.05;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic nextPosition(count?: number) {\n\t\tif (count == null) {\n\t\t\tcount = 1;\n\t\t}\n\n\t\tif (this.get(\"renderer\").getPrivate(\"letter\") == \"Y\") {\n\t\t\tcount *= -1;\n\t\t}\n\n\t\tlet value = this.positionToValue(this.getPrivate(\"tooltipPosition\", 0));\n\t\tvalue += this.getPrivate(\"step\", 1) * count;\n\t\tvalue = $math.fitToRange(value, this.getPrivate(\"selectionMin\", 0), this.getPrivate(\"selectionMax\", 1));\n\n\t\treturn this.toGlobalPosition(this.valueToPosition(value));\n\t}\n}\n","import type { DataItem } from \"../../../core/render/Component\";\nimport type { Graphics } from \"../../../core/render/Graphics\";\nimport type { Template } from \"../../../core/util/Template\";\nimport type { ListTemplate } from \"../../../core/util/List\";\nimport type { CategoryAxis } from \"../axes/CategoryAxis\";\nimport type { DateAxis } from \"../axes/DateAxis\";\nimport type { ValueAxis } from \"../axes/ValueAxis\";\nimport type { IAxisDataItem } from \"../axes/Axis\";\nimport type { ILegendDataItem } from \"../../../core/render/Legend\";\nimport type { Sprite } from \"../../../core/render/Sprite\";\n\nimport { XYSeries, IXYSeriesPrivate, IXYSeriesSettings, IXYSeriesDataItem, IXYSeriesAxisRange } from \"./XYSeries\";\nimport { Percent } from \"../../../core/util/Percent\";\nimport { visualSettings } from \"../../../core/render/Graphics\";\n\nimport * as $array from \"../../../core/util/Array\";\nimport * as $type from \"../../../core/util/Type\";\n\nexport interface IBaseColumnSeriesDataItem extends IXYSeriesDataItem {\n\n\t/**\n\t * An actual [[Graphics]] element (Column/Slice/Candlestick/OHLC).\n\t */\n\tgraphics?: Graphics;\n\n\t/**\n\t * In case axis ranges are added to the series, it creates a separate\n\t * element ([[Graphics]]) for each axis range. This array holds them all.\n\t */\n\trangeGraphics?: Array;\n\n\t/**\n\t * If data items from this series are used to feed a [[Legend]], this\n\t * will hold a reference to the equivalent Legend data item.\n\t * \n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/legend/#Data_item_list} for more info\n\t */\n\tlegendDataItem?: DataItem;\n}\n\nexport interface IBaseColumnSeriesSettings extends IXYSeriesSettings {\n\n\t/**\n\t * Indicates if series must divvy up available space with other column\n\t * series (`true`; default) or take up the whole available space (`false`).\n\t *\n\t * @default true\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/column-series/#Clustering} for more info\n\t */\n\tclustered?: boolean;\n\n\t/**\n\t * Whether positions of bullets should be calculated based on portion of\n\t * column currently visual (`true`) or the whole length/height of the\n\t * column (`false`).\n\t *\n\t * @default true\n\t */\n\tadjustBulletPosition?: boolean;\n\n\t/**\n\t * If set to `true` will use color of the last visible column for legend\n\t * marker. Otherwise, series `fill`/`stroke` will be used.\n\t *\n\t * @since 5.1.13\n\t */\n\tuseLastColorForLegendMarker?: boolean\n\n}\n\nexport interface IBaseColumnSeriesPrivate extends IXYSeriesPrivate { }\n\nexport interface IBaseColumnSeriesAxisRange extends IXYSeriesAxisRange {\n\n\t/**\n\t * A list of actual [[Graphics]] elements for an axis range.\n\t *\n\t * Can be used to ajust the look of the axis range columns.\n\t */\n\tcolumns: ListTemplate;\n\n}\n\n/**\n * Base class for all \"column-based\" series\n */\nexport abstract class BaseColumnSeries extends XYSeries {\n\n\tdeclare public _settings: IBaseColumnSeriesSettings;\n\tdeclare public _privateSettings: IBaseColumnSeriesPrivate;\n\tdeclare public _dataItemSettings: IBaseColumnSeriesDataItem;\n\tdeclare public _axisRangeType: IBaseColumnSeriesAxisRange;\n\n\tpublic static className: string = \"BaseColumnSeries\";\n\tpublic static classNames: Array = XYSeries.classNames.concat([BaseColumnSeries.className]);\n\n\t/**\n\t * @ignore\n\t */\n\tpublic abstract makeColumn(dataItem: DataItem, listTemplate: ListTemplate): Graphics\n\n\t/**\n\t * ListTemplate of columns in series.\n\t */\n\tpublic abstract columns: ListTemplate;\n\n\tprotected _makeGraphics(listTemplate: ListTemplate, dataItem: DataItem): Graphics {\n\t\treturn this.makeColumn(dataItem, listTemplate);\n\t}\n\n\tprotected _ph: number = 0;\n\tprotected _pw: number = 0;\n\n\tpublic _makeFieldNames() {\n\t\tsuper._makeFieldNames();\n\n\t\tconst xAxis = this.get(\"xAxis\");\n\t\tconst yAxis = this.get(\"yAxis\");\n\n\t\tconst categoryAxis = \"CategoryAxis\";\n\t\tconst valueAxis = \"ValueAxis\";\n\n\t\tif (xAxis.isType>(categoryAxis)) {\n\t\t\tif (!this.get(\"openCategoryXField\")) {\n\t\t\t\tthis._xOpenField = this._xField;\n\t\t\t}\n\t\t}\n\n\t\tif (xAxis.isType>(valueAxis)) {\n\t\t\tif (!this.get(\"openValueXField\")) {\n\t\t\t\tthis._xOpenField = this._xField;\n\t\t\t}\n\t\t}\n\n\t\tif (yAxis.isType>(categoryAxis)) {\n\t\t\tif (!this.get(\"openCategoryYField\")) {\n\t\t\t\tthis._yOpenField = this._yField;\n\t\t\t}\n\t\t}\n\n\t\tif (yAxis.isType>(valueAxis)) {\n\t\t\tif (!this.get(\"openValueYField\")) {\n\t\t\t\tthis._yOpenField = this._yField;\n\t\t\t}\n\t\t}\n\t}\n\n\n\tpublic _prepareChildren() {\n\t\tsuper._prepareChildren();\n\n\t\tconst xAxis = this.get(\"xAxis\");\n\t\tconst yAxis = this.get(\"yAxis\");\n\n\t\tconst len = this.dataItems.length;\n\t\tconst startIndex = Math.max(0, this.startIndex() - 2);\n\t\tconst endIndex = Math.min(this.endIndex() + 2, len - 1);\n\n\t\tif (xAxis.inited && yAxis.inited) {\n\t\t\tfor (let i = startIndex; i <= endIndex; i++) {\n\t\t\t\tlet dataItem = this.dataItems[i];\n\t\t\t\tthis._createGraphics(dataItem);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic _updateChildren() {\n\t\tconst chart = this.chart;\n\t\tif (chart) {\n\t\t\tthis._ph = chart.plotContainer.height();\n\t\t\tthis._pw = chart.plotContainer.width();\n\t\t}\n\n\t\tconst xAxis = this.get(\"xAxis\");\n\t\tconst yAxis = this.get(\"yAxis\");\n\t\tconst baseAxis = this.get(\"baseAxis\")!;\n\n\t\tconst columnsTemplate = this.columns.template;\n\t\tif (this.isDirty(\"fill\")) {\n\t\t\tif (columnsTemplate.get(\"fill\") == null) {\n\t\t\t\tcolumnsTemplate.set(\"fill\", this.get(\"fill\"));\n\t\t\t}\n\t\t}\n\n\t\tif (this.isDirty(\"fillPattern\")) {\n\t\t\tif (columnsTemplate.get(\"fillPattern\") == null) {\n\t\t\t\tcolumnsTemplate.set(\"fillPattern\", this.get(\"fillPattern\"));\n\t\t\t}\n\t\t}\n\n\t\tif (this.isDirty(\"stroke\")) {\n\t\t\tif (columnsTemplate.get(\"stroke\") == null) {\n\t\t\t\tcolumnsTemplate.set(\"stroke\", this.get(\"stroke\"));\n\t\t\t}\n\t\t}\n\n\t\tlet index = 0;\n\t\tlet clusterCount = 0;\n\t\tlet i = 0;\n\n\t\t$array.each(baseAxis.series, (series) => {\n\t\t\tif (series instanceof BaseColumnSeries) {\n\t\t\t\tconst stacked = series.get(\"stacked\");\n\n\t\t\t\tif (stacked && i == 0) {\n\t\t\t\t\tclusterCount++;\n\t\t\t\t}\n\n\t\t\t\tif (!stacked && series.get(\"clustered\")) {\n\t\t\t\t\tclusterCount++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (series === this) {\n\t\t\t\tindex = clusterCount - 1;\n\t\t\t}\n\t\t\ti++;\n\t\t})\n\n\t\tif (!this.get(\"clustered\")) {\n\t\t\tindex = 0;\n\t\t\tclusterCount = 1;\n\t\t}\n\n\t\tif (clusterCount === 0) {\n\t\t\tclusterCount = 1;\n\t\t\tindex = 0;\n\t\t}\n\n\t\tconst xRenderer = xAxis.get(\"renderer\");\n\t\tconst yRenderer = yAxis.get(\"renderer\");\n\n\t\tconst cellStartLocation = \"cellStartLocation\";\n\t\tconst cellEndLocation = \"cellEndLocation\";\n\n\t\tconst cellLocationX0 = xRenderer.get(cellStartLocation, 0);\n\t\tconst cellLocationX1 = xRenderer.get(cellEndLocation, 1);\n\n\t\tconst cellLocationY0 = yRenderer.get(cellStartLocation, 0);\n\t\tconst cellLocationY1 = yRenderer.get(cellEndLocation, 1);\n\n\t\tthis._aLocationX0 = cellLocationX0 + (index / clusterCount) * (cellLocationX1 - cellLocationX0);\n\t\tthis._aLocationX1 = cellLocationX0 + (index + 1) / clusterCount * (cellLocationX1 - cellLocationX0);;\n\n\t\tthis._aLocationY0 = cellLocationY0 + (index / clusterCount) * (cellLocationY1 - cellLocationY0);\n\t\tthis._aLocationY1 = cellLocationY0 + (index + 1) / clusterCount * (cellLocationY1 - cellLocationY0);\n\n\t\tif (xAxis.inited && yAxis.inited) {\n\t\t\tif (this._axesDirty || this._valuesDirty || this._stackDirty || this.isDirty(\"vcx\") || this.isDirty(\"vcy\") || this._sizeDirty) {\n\t\t\t\tconst len = this.dataItems.length;\n\n\t\t\t\tlet startIndex = Math.max(0, this.startIndex() - 2);\n\t\t\t\tlet endIndex = Math.min(this.endIndex() + 2, len - 1);\n\n\t\t\t\tfor (let i = 0; i < startIndex; i++) {\n\t\t\t\t\tthis._toggleColumn(this.dataItems[i], false);\n\t\t\t\t}\n\t\t\t\tlet previous = this.dataItems[startIndex];\n\n\t\t\t\tfor (let i = startIndex; i <= endIndex; i++) {\n\t\t\t\t\tlet dataItem = this.dataItems[i];\n\t\t\t\t\tif (dataItem.get(\"valueX\") != null && dataItem.get(\"valueY\") != null) {\n\t\t\t\t\t\tprevious = dataItem;\n\t\t\t\t\t\tif (i > 0 && startIndex > 0) {\n\t\t\t\t\t\t\tfor (let j = i - 1; j >= 0; j--) {\n\t\t\t\t\t\t\t\tlet dataItem = this.dataItems[j];\n\t\t\t\t\t\t\t\tif (dataItem.get(\"valueX\") != null && dataItem.get(\"valueY\") != null) {\n\t\t\t\t\t\t\t\t\tprevious = dataItem;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis._toggleColumn(dataItem, false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (let i = startIndex; i <= endIndex; i++) {\n\t\t\t\t\tlet dataItem = this.dataItems[i];\n\t\t\t\t\tthis._updateGraphics(dataItem, previous);\n\t\t\t\t\tif (dataItem.get(\"valueX\") != null && dataItem.get(\"valueY\") != null) {\n\t\t\t\t\t\tprevious = dataItem;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (let i = endIndex + 1; i < len; i++) {\n\t\t\t\t\tthis._toggleColumn(this.dataItems[i], false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthis._skipped = true;\n\t\t}\n\t\tthis.updateLegendMarker(this.get(\"tooltipDataItem\"));\n\t\tsuper._updateChildren();\n\t}\n\n\n\tprotected _createGraphics(dataItem: DataItem) {\n\t\tlet graphics = dataItem.get(\"graphics\");\n\t\tif (!graphics) {\n\n\t\t\tgraphics = this._makeGraphics(this.columns, dataItem);\n\t\t\tdataItem.set(\"graphics\", graphics);\n\t\t\tgraphics._setDataItem(dataItem);\n\n\t\t\tconst legendDataItem = dataItem.get(\"legendDataItem\");\n\t\t\tif (legendDataItem) {\n\t\t\t\tconst markerRectangle = legendDataItem.get(\"markerRectangle\");\n\t\t\t\tif (markerRectangle) {\n\t\t\t\t\tconst ds = markerRectangle.states.lookup(\"default\")!;\n\t\t\t\t\t$array.each(visualSettings, (setting: any) => {\n\t\t\t\t\t\tconst value = graphics!.get(setting, this.get(setting));\n\t\t\t\t\t\tmarkerRectangle.set(setting, value);\n\t\t\t\t\t\tds.set(setting, value);\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet graphicsArray: Array | undefined = dataItem.get(\"rangeGraphics\");\n\t\t\tif (graphicsArray) {\n\t\t\t\t$array.each(graphicsArray, (graphics) => {\n\t\t\t\t\tgraphics.dispose();\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tgraphicsArray = [];\n\t\t\tdataItem.setRaw(\"rangeGraphics\", graphicsArray);\n\n\t\t\tthis.axisRanges.each((axisRange) => {\n\t\t\t\tconst container = axisRange.container!;\n\t\t\t\tconst rangeGraphics = this._makeGraphics(axisRange.columns, dataItem);\n\t\t\t\tif (graphicsArray) {\n\t\t\t\t\tgraphicsArray.push(rangeGraphics);\n\t\t\t\t}\n\t\t\t\trangeGraphics.setPrivate(\"list\", axisRange.columns);\n\t\t\t\tcontainer.children.push(rangeGraphics);\n\t\t\t})\n\t\t}\n\t}\n\n\tpublic createAxisRange(axisDataItem: DataItem): this[\"_axisRangeType\"] {\n\t\t$array.each(this.dataItems, (dataItem) => {\n\t\t\tconst graphics = dataItem.get(\"graphics\");\n\t\t\tif (graphics) {\n\t\t\t\tgraphics.dispose();\n\t\t\t\tdataItem.set(\"graphics\", undefined);\n\t\t\t}\n\t\t})\n\n\t\treturn super.createAxisRange(axisDataItem);\n\t}\n\n\tprotected _updateGraphics(dataItem: DataItem, previousDataItem: DataItem) {\n\t\tlet graphics = dataItem.get(\"graphics\")!;\n\n\t\t//if (!graphics) {\n\t\t//\tthis._createGraphics(dataItem);\n\t\t//\tgraphics = dataItem.get(\"graphics\")!;\n\t\t//}\n\n\t\tconst xField = this._xField;\n\t\tconst yField = this._yField;\n\n\t\tconst valueX = dataItem.get(xField as any);\n\t\tconst valueY = dataItem.get(yField as any);\n\n\t\tif (valueX != null && valueY != null) {\n\t\t\tconst xOpenField = this._xOpenField;\n\t\t\tconst yOpenField = this._yOpenField;\n\n\t\t\tconst locationX = this.get(\"locationX\", dataItem.get(\"locationX\", 0.5));\n\t\t\tconst locationY = this.get(\"locationY\", dataItem.get(\"locationY\", 0.5));\n\n\t\t\tconst openLocationX = this.get(\"openLocationX\", dataItem.get(\"openLocationX\", locationX));\n\t\t\tconst openLocationY = this.get(\"openLocationY\", dataItem.get(\"openLocationY\", locationY));\n\n\t\t\tconst width = graphics.get(\"width\");\n\t\t\tconst height = graphics.get(\"height\");\n\n\t\t\tconst stacked = this.get(\"stacked\");\n\n\t\t\tconst xAxis = this.get(\"xAxis\");\n\t\t\tconst yAxis = this.get(\"yAxis\");\n\t\t\tconst baseAxis = this.get(\"baseAxis\");\n\n\t\t\tconst xStart = xAxis.get(\"start\");\n\t\t\tconst xEnd = xAxis.get(\"end\");\n\n\t\t\tconst yStart = yAxis.get(\"start\");\n\t\t\tconst yEnd = yAxis.get(\"end\");\n\n\t\t\tlet l!: number;\n\t\t\tlet r!: number;\n\t\t\tlet t!: number;\n\t\t\tlet b!: number;\n\n\t\t\tlet vcy = this.get(\"vcy\", 1);\n\t\t\tlet vcx = this.get(\"vcx\", 1);\n\n\t\t\tlet fitW = false;\n\t\t\tlet fitH = false;\n\n\t\t\tif (yAxis.isType>(\"CategoryAxis\") && xAxis.isType>(\"CategoryAxis\")) {\n\n\t\t\t\tlet startLocation = this._aLocationX0 + openLocationX - 0.5;\n\t\t\t\tlet endLocation = this._aLocationX1 + locationX - 0.5;\n\n\t\t\t\tif (width instanceof Percent) {\n\t\t\t\t\tlet offset: number = (endLocation - startLocation) * (1 - width.value) / 2;\n\t\t\t\t\tstartLocation += offset;\n\t\t\t\t\tendLocation -= offset;\n\t\t\t\t}\n\n\t\t\t\tl = xAxis.getDataItemPositionX(dataItem, xOpenField, startLocation, vcx);\n\t\t\t\tr = xAxis.getDataItemPositionX(dataItem, xField, endLocation, vcx);\n\n\t\t\t\tstartLocation = this._aLocationY0 + openLocationY - 0.5;\n\t\t\t\tendLocation = this._aLocationY1 + locationY - 0.5;\n\n\t\t\t\tif (height instanceof Percent) {\n\t\t\t\t\tlet offset: number = (endLocation - startLocation) * (1 - height.value) / 2;\n\t\t\t\t\tstartLocation += offset;\n\t\t\t\t\tendLocation -= offset;\n\t\t\t\t}\n\n\t\t\t\tt = yAxis.getDataItemPositionY(dataItem, yOpenField, startLocation, vcy);\n\t\t\t\tb = yAxis.getDataItemPositionY(dataItem, yField, endLocation, vcy);\n\n\t\t\t\tdataItem.setRaw(\"point\", { x: l + (r - l) / 2, y: t + (b - t) / 2 });\n\t\t\t}\n\t\t\telse if (xAxis === baseAxis) {\n\n\t\t\t\tlet startLocation = this._aLocationX0 + openLocationX - 0.5;\n\t\t\t\tlet endLocation = this._aLocationX1 + locationX - 0.5;\n\n\t\t\t\tif (width instanceof Percent) {\n\t\t\t\t\tlet offset: number = (endLocation - startLocation) * (1 - width.value) / 2;\n\t\t\t\t\tstartLocation += offset;\n\t\t\t\t\tendLocation -= offset;\n\t\t\t\t}\n\n\t\t\t\tl = xAxis.getDataItemPositionX(dataItem, xOpenField, startLocation, vcx);\n\t\t\t\tr = xAxis.getDataItemPositionX(dataItem, xField, endLocation, vcx);\n\t\t\t\tt = yAxis.getDataItemPositionY(dataItem, yField, locationY, vcy);\n\n\t\t\t\tif (this._yOpenField !== this._yField) {\n\t\t\t\t\tb = yAxis.getDataItemPositionY(dataItem, yOpenField, openLocationY, vcy);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (stacked) {\n\t\t\t\t\t\tlet stackToItemY = dataItem.get(\"stackToItemY\")!;\n\t\t\t\t\t\tif (stackToItemY) {\n\t\t\t\t\t\t\tb = yAxis.getDataItemPositionY(stackToItemY, yField, openLocationY, (stackToItemY.component as XYSeries).get(\"vcy\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tb = yAxis.basePosition();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tb = yAxis.basePosition();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdataItem.setRaw(\"point\", { x: l + (r - l) / 2, y: t });\n\n\t\t\t\tfitH = true;\n\t\t\t}\n\t\t\telse if (yAxis === baseAxis) {\n\t\t\t\tlet startLocation = this._aLocationY0 + openLocationY - 0.5;\n\t\t\t\tlet endLocation = this._aLocationY1 + locationY - 0.5;\n\n\t\t\t\tif (height instanceof Percent) {\n\t\t\t\t\tlet offset: number = (endLocation - startLocation) * (1 - height.value) / 2;\n\t\t\t\t\tstartLocation += offset;\n\t\t\t\t\tendLocation -= offset;\n\t\t\t\t}\n\n\t\t\t\tt = yAxis.getDataItemPositionY(dataItem, yOpenField, startLocation, vcy);\n\t\t\t\tb = yAxis.getDataItemPositionY(dataItem, yField, endLocation, vcy);\n\t\t\t\tr = xAxis.getDataItemPositionX(dataItem, xField, locationX, vcx);\n\n\t\t\t\tif (this._xOpenField !== this._xField) {\n\t\t\t\t\tl = xAxis.getDataItemPositionX(dataItem, xOpenField, openLocationX, vcx);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (stacked) {\n\t\t\t\t\t\tlet stackToItemX = dataItem.get(\"stackToItemX\")!;\n\t\t\t\t\t\tif (stackToItemX) {\n\t\t\t\t\t\t\tl = xAxis.getDataItemPositionX(stackToItemX, xField, openLocationX, (stackToItemX.component as XYSeries).get(\"vcx\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tl = xAxis.basePosition();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tl = xAxis.basePosition();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfitW = true;\n\n\t\t\t\tdataItem.setRaw(\"point\", { x: r, y: t + (b - t) / 2 });\n\t\t\t}\n\n\t\t\tthis._updateSeriesGraphics(dataItem, graphics!, l, r, t, b, fitW, fitH);\n\n\t\t\tif ((l < xStart && r < xStart) || (l > xEnd && r > xEnd) || (t < yStart && b <= yStart) || (t >= yEnd && b > yEnd) || $type.isNaN(l) || $type.isNaN(t)) {\n\t\t\t\tthis._toggleColumn(dataItem, false);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis._toggleColumn(dataItem, true);\n\t\t\t}\n\n\t\t\tlet rangeGraphics = dataItem.get(\"rangeGraphics\")!;\n\t\t\tif (rangeGraphics) {\n\t\t\t\t$array.each(rangeGraphics, (graphics) => {\n\t\t\t\t\tthis._updateSeriesGraphics(dataItem, graphics, l, r, t, b, fitW, fitH);\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tthis._applyGraphicsStates(dataItem, previousDataItem);\n\t\t}\n\t\telse {\n\t\t\tthis._toggleColumn(dataItem, false);\n\t\t}\n\t}\n\n\tprotected _updateSeriesGraphics(dataItem: DataItem, graphics: Graphics, l: number, r: number, t: number, b: number, fitW: boolean, fitH: boolean) {\n\t\tconst width = graphics.get(\"width\");\n\t\tconst height = graphics.get(\"height\");\n\t\tconst maxWidth = graphics.get(\"maxWidth\");\n\t\tconst maxHeight = graphics.get(\"maxHeight\");\n\n\t\tconst ptl = this.getPoint(l, t);\n\t\tconst pbr = this.getPoint(r, b);\n\n\t\tconst tooltipPoint = dataItem.get(\"point\");\n\n\t\tif (tooltipPoint) {\n\t\t\tconst point = this.getPoint(tooltipPoint.x, tooltipPoint.y);\n\t\t\ttooltipPoint.x = point.x + this._x;\n\t\t\ttooltipPoint.y = point.y + this._y;\n\t\t}\n\n\t\tl = ptl.x;\n\t\tr = pbr.x;\n\n\t\tt = ptl.y;\n\t\tb = pbr.y;\n\n\t\tif ($type.isNumber(width)) {\n\t\t\tconst offset: number = ((r - l) - width) / 2;\n\t\t\tl += offset;\n\t\t\tr -= offset;\n\t\t}\n\n\t\tif ($type.isNumber(maxWidth) && maxWidth < Math.abs(r - l)) {\n\t\t\tconst offset: number = ((r - l) - maxWidth) / 2;\n\t\t\tl += offset;\n\t\t\tr -= offset;\n\t\t}\n\n\t\tif ($type.isNumber(height)) {\n\t\t\tconst offset: number = ((b - t) - height) / 2;\n\t\t\tt += offset;\n\t\t\tb -= offset;\n\t\t}\n\n\t\tif ($type.isNumber(maxHeight) && maxHeight < Math.abs(b - t)) {\n\t\t\tconst offset: number = ((b - t) - maxHeight) / 2;\n\t\t\tt += offset;\n\t\t\tb -= offset;\n\t\t}\n\n\t\tif (this.get(\"adjustBulletPosition\")) {\n\t\t\tif (fitW) {\n\t\t\t\tr = Math.min(Math.max(0, r), this._pw);\n\t\t\t\tl = Math.min(Math.max(0, l), this._pw);\n\t\t\t}\n\n\t\t\tif (fitH) {\n\t\t\t\tt = Math.min(Math.max(0, t), this._ph);\n\t\t\t\tb = Math.min(Math.max(0, b), this._ph);\n\t\t\t}\n\t\t}\n\n\t\tdataItem.setRaw(\"left\", l);\n\t\tdataItem.setRaw(\"right\", r);\n\t\tdataItem.setRaw(\"top\", t);\n\t\tdataItem.setRaw(\"bottom\", b);\n\n\t\tgraphics.setPrivate(\"width\", r - l);\n\t\tgraphics.setPrivate(\"height\", b - t);\n\t\tgraphics.set(\"x\", l);\n\t\tgraphics.set(\"y\", b - (b - t));\n\t}\n\n\tprotected _handleDataSetChange() {\n\t\tsuper._handleDataSetChange();\n\t\t$array.each(this._dataItems, (dataItem) => {\n\t\t\tthis._toggleColumn(dataItem, false);\n\t\t})\n\t}\n\n\tpublic _applyGraphicsStates(dataItem: DataItem, previousDataItem: DataItem) {\n\n\t\tconst graphics = dataItem.get(\"graphics\")!;\n\n\t\tconst dropFromOpen = graphics.states.lookup(\"dropFromOpen\");\n\t\tconst riseFromOpen = graphics.states.lookup(\"riseFromOpen\");\n\n\t\tconst dropFromPrevious = graphics.states.lookup(\"dropFromPrevious\");\n\t\tconst riseFromPrevious = graphics.states.lookup(\"riseFromPrevious\");\n\n\t\tif (dropFromOpen || dropFromPrevious || riseFromOpen || riseFromPrevious) {\n\t\t\tconst xAxis = this.get(\"xAxis\");\n\t\t\tconst yAxis = this.get(\"yAxis\");\n\t\t\tconst baseAxis = this.get(\"baseAxis\");\n\n\t\t\tlet open: number | undefined;\n\t\t\tlet close: number | undefined;\n\t\t\tlet previousClose: number | undefined;\n\n\t\t\tif (baseAxis === xAxis && yAxis.isType>(\"ValueAxis\")) {\n\t\t\t\topen = dataItem.get(this._yOpenField as any);\n\t\t\t\tclose = dataItem.get(this._yField as any);\n\n\t\t\t\tpreviousClose = previousDataItem.get(this._yField as any);\n\t\t\t}\n\t\t\telse if (baseAxis === yAxis && xAxis.isType>(\"ValueAxis\")) {\n\t\t\t\topen = dataItem.get(this._xOpenField as any);\n\t\t\t\tclose = dataItem.get(this._xField as any);\n\n\t\t\t\tpreviousClose = previousDataItem.get(this._xField as any);\n\t\t\t}\n\n\t\t\tif ($type.isNumber(open) && $type.isNumber(close)) {\n\t\t\t\tif (close < open) {\n\t\t\t\t\tif (dropFromOpen) {\n\t\t\t\t\t\tdropFromOpen.apply();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (riseFromOpen) {\n\t\t\t\t\t\triseFromOpen.apply();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($type.isNumber(previousClose)) {\n\t\t\t\t\tif (close < previousClose) {\n\t\t\t\t\t\tif (dropFromPrevious) {\n\t\t\t\t\t\t\tdropFromPrevious.apply();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (riseFromPrevious) {\n\t\t\t\t\t\t\triseFromPrevious.apply();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic disposeDataItem(dataItem: DataItem) {\n\t\tsuper.disposeDataItem(dataItem);\n\t\tconst graphics = dataItem.get(\"graphics\");\n\t\tif (graphics) {\n\t\t\tthis.columns.removeValue(graphics);\n\t\t\tgraphics.dispose();\n\t\t}\n\n\t\tconst rangeGraphics = dataItem.get(\"rangeGraphics\")!;\n\t\tif (rangeGraphics) {\n\t\t\t$array.each(rangeGraphics, (graphics) => {\n\t\t\t\tconst list = graphics.getPrivate(\"list\");\n\t\t\t\tif (list) {\n\t\t\t\t\tlist.removeValue(graphics);\n\t\t\t\t}\n\t\t\t\tgraphics.dispose();\n\t\t\t})\n\t\t}\n\t}\n\n\t/**\n\t * Hides series's data item.\n\t * \n\t * @param dataItem Data item\n\t * @param duration Animation duration in milliseconds\n\t * @return Promise\n\t */\n\tpublic async hideDataItem(dataItem: DataItem, duration?: number): Promise {\n\t\tconst promises = [super.hideDataItem(dataItem, duration)];\n\t\tconst graphics = dataItem.get(\"graphics\");\n\t\tif (graphics) {\n\t\t\tpromises.push(graphics.hide(duration));\n\t\t}\n\n\t\tconst rangeGraphics = dataItem.get(\"rangeGraphics\")!;\n\t\tif (rangeGraphics) {\n\t\t\t$array.each(rangeGraphics, (graphics) => {\n\t\t\t\tpromises.push(graphics.hide(duration));\n\t\t\t})\n\t\t}\n\n\t\tawait Promise.all(promises);\n\t}\n\n\tprotected _toggleColumn(dataItem: DataItem, visible: boolean) {\n\t\tconst graphics = dataItem.get(\"graphics\");\n\t\tif (graphics) {\n\t\t\tgraphics.setPrivate(\"visible\", visible);\n\t\t}\n\n\t\tconst rangeGraphics = dataItem.get(\"rangeGraphics\")!;\n\t\tif (rangeGraphics) {\n\t\t\t$array.each(rangeGraphics, (graphics) => {\n\t\t\t\tgraphics.setPrivate(\"visible\", visible);\n\t\t\t})\n\t\t}\n\n\t\tconst bullets = dataItem.bullets;\n\t\tif (bullets) {\n\t\t\t$array.each(bullets, (bullet) => {\n\t\t\t\tbullet.setPrivate(\"hidden\", !visible);\n\t\t\t})\n\t\t}\n\t}\n\n\t/**\n\t * Shows series's data item.\n\t * \n\t * @param dataItem Data item\n\t * @param duration Animation duration in milliseconds\n\t * @return Promise\n\t */\n\tpublic async showDataItem(dataItem: DataItem, duration?: number): Promise {\n\t\tconst promises = [super.showDataItem(dataItem, duration)];\n\t\tconst graphics = dataItem.get(\"graphics\");\n\t\tif (graphics) {\n\t\t\tpromises.push(graphics.show(duration));\n\t\t}\n\n\t\tconst rangeGraphics = dataItem.get(\"rangeGraphics\")!;\n\t\tif (rangeGraphics) {\n\t\t\t$array.each(rangeGraphics, (graphics) => {\n\t\t\t\tpromises.push(graphics.show(duration));\n\t\t\t})\n\t\t}\n\n\t\tawait Promise.all(promises);\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic updateLegendMarker(dataItem?: DataItem) {\n\t\tlet legendDataItem = this.get(\"legendDataItem\");\n\n\t\tif (this.get(\"useLastColorForLegendMarker\")) {\n\t\t\tif (!dataItem) {\n\t\t\t\tconst lastDataItem = this.dataItems[this.endIndex() - 1];\n\t\t\t\tif (lastDataItem) {\n\t\t\t\t\tdataItem = lastDataItem;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (legendDataItem) {\n\n\t\t\tlet graphics: Template | Graphics = this.columns.template;\n\t\t\tif (dataItem) {\n\t\t\t\tlet column = dataItem.get(\"graphics\");\n\t\t\t\tif (column) {\n\t\t\t\t\tgraphics = column;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst markerRectangle = legendDataItem.get(\"markerRectangle\");\n\n\t\t\tif (markerRectangle) {\n\t\t\t\tif (!legendDataItem.get(\"itemContainer\").get(\"disabled\")) {\n\t\t\t\t\tconst ds = markerRectangle.states.lookup(\"default\")!;\n\t\t\t\t\t$array.each(visualSettings, (setting: any) => {\n\t\t\t\t\t\tconst value = graphics.get(setting, this.get(setting));\n\t\t\t\t\t\tmarkerRectangle.set(setting, value);\n\t\t\t\t\t\tds.set(setting, value);\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n\tprotected _getTooltipTarget(dataItem: DataItem): Sprite {\n\t\tif (this.get(\"seriesTooltipTarget\") == \"bullet\") {\n\t\t\treturn super._getTooltipTarget(dataItem);\n\t\t}\n\n\t\tlet column = dataItem.get(\"graphics\");\n\t\tif (column) {\n\t\t\treturn column;\n\t\t}\n\t\treturn this;\n\t}\n}\n","import { RoundedRectangle, IRoundedRectangleSettings, IRoundedRectanglePrivate } from \"../../../core/render/RoundedRectangle\";\n\n\nexport interface ICandlestickSettings extends IRoundedRectangleSettings {\n\n\t/**\n\t * X0 position of the low value in pixels.\n\t */\n\tlowX0?: number;\n\n\t/**\n\t * Y0 position of the low value in pixels.\n\t */\n\tlowY0?: number;\n\n\t/**\n\t * X2 position of the low value in pixels.\n\t */\n\tlowX1?: number;\n\n\t/**\n\t * Y1 position of the low value in pixels.\n\t */\n\tlowY1?: number;\n\n\t/**\n\t * X0 position of the high value in pixels.\n\t */\n\thighX0?: number;\n\n\t/**\n\t * Y0 position of the high value in pixels.\n\t */\n\thighY0?: number;\n\n\t/**\n\t * Xz position of the high value in pixels.\n\t */\n\thighX1?: number;\n\n\t/**\n\t * Y1 position of the high value in pixels.\n\t */\n\thighY1?: number;\n\n\t/**\n\t * Orientation of the cnadlestick.\n\t */\n\torientation?: \"horizontal\" | \"vertical\"\n\n}\n\nexport interface ICandlestickPrivate extends IRoundedRectanglePrivate {\n}\n\n/**\n * A candle element used in a [[CandlestickSeries]].\n */\nexport class Candlestick extends RoundedRectangle {\n\n\tdeclare public _settings: ICandlestickSettings;\n\tdeclare public _privateSettings: ICandlestickPrivate;\n\n\tpublic static className: string = \"Candlestick\";\n\tpublic static classNames: Array = RoundedRectangle.classNames.concat([Candlestick.className]);\n\n\tpublic _beforeChanged() {\n\t\tsuper._beforeChanged();\n\n\t\tif (this.isDirty(\"lowX0\") || this.isDirty(\"lowY0\") || this.isDirty(\"lowX1\") || this.isDirty(\"lowY1\") || this.isDirty(\"highX0\") || this.isDirty(\"highX1\") || this.isDirty(\"highY0\") || this.isDirty(\"highY1\")) {\n\t\t\tthis._clear = true;\n\t\t}\n\t}\n\n\tpublic _draw() {\n\t\tsuper._draw();\n\n\t\tconst display = this._display;\n\n\t\tdisplay.moveTo(this.get(\"lowX0\", 0), this.get(\"lowY0\", 0));\n\t\tdisplay.lineTo(this.get(\"lowX1\", 0), this.get(\"lowY1\", 0));\n\n\t\tdisplay.moveTo(this.get(\"highX0\", 0), this.get(\"highY0\", 0));\n\t\tdisplay.lineTo(this.get(\"highX1\", 0), this.get(\"highY1\", 0));\n\t}\n}\n","import type { DataItem } from \"../../../core/render/Component\";\n\nimport { ColumnSeries, IColumnSeriesPrivate, IColumnSeriesSettings, IColumnSeriesDataItem, IColumnSeriesAxisRange } from \"./ColumnSeries\";\nimport { Candlestick } from \"./Candlestick\";\nimport { Template } from \"../../../core/util/Template\";\nimport { ListTemplate } from \"../../../core/util/List\";\n\nimport * as $utils from \"../../../core/util/Utils\";\nimport * as $array from \"../../../core/util/Array\";\n\nexport interface ICandlestickSeriesDataItem extends IColumnSeriesDataItem {\n}\n\nexport interface ICandlestickSeriesSettings extends IColumnSeriesSettings {\n}\n\nexport interface ICandlestickSeriesPrivate extends IColumnSeriesPrivate {\n}\n\nexport interface ICandlestickSeriesAxisRange extends IColumnSeriesAxisRange {\n\n\t/**\n\t * A list of [[Candlestick]] element in series.\n\t *\n\t * @readonly\n\t */\n\tcolumns: ListTemplate\n\n}\n\n/**\n * Candlestick series.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/candlestick-series/} for more info\n * @important\n */\nexport class CandlestickSeries extends ColumnSeries {\n\n\tdeclare public _settings: ICandlestickSeriesSettings;\n\tdeclare public _privateSettings: ICandlestickSeriesPrivate;\n\tdeclare public _dataItemSettings: ICandlestickSeriesDataItem;\n\tdeclare public _axisRangeType: ICandlestickSeriesAxisRange;\n\n\tpublic static className: string = \"CandlestickSeries\";\n\tpublic static classNames: Array = ColumnSeries.classNames.concat([CandlestickSeries.className]);\n\n\t/**\n\t * @ignore\n\t */\n\tpublic makeColumn(dataItem: DataItem, listTemplate: ListTemplate): Candlestick {\n\t\tconst column = this.mainContainer.children.push(listTemplate.make());\n\t\tcolumn._setDataItem(dataItem);\n\t\tlistTemplate.push(column);\n\t\treturn column;\n\t}\n\n\t/**\n\t * A list of candles in the series.\n\t *\n\t * `columns.template` can be used to configure candles.\n\t *\n\t * @default new ListTemplate\n\t */\n\tpublic readonly columns: ListTemplate = this.addDisposer(new ListTemplate(\n\t\tTemplate.new({\n\t\t\tthemeTags: [\"autocolor\"]\n\t\t}),\n\t\t() => Candlestick._new(this._root, {\n\t\t\tthemeTags: $utils.mergeTags(this.columns.template.get(\"themeTags\", []), [\"candlestick\", \"series\", \"column\"])\n\t\t}, [this.columns.template])\n\t));\n\n\tprotected _updateGraphics(dataItem: DataItem, previousDataItem: DataItem) {\n\t\tsuper._updateGraphics(dataItem, previousDataItem);\n\n\t\tconst xAxis = this.getRaw(\"xAxis\");\n\t\tconst yAxis = this.getRaw(\"yAxis\");\n\t\tconst baseAxis = this.getRaw(\"baseAxis\");\n\n\t\tlet vcy = this.get(\"vcy\", 1);\n\t\tlet vcx = this.get(\"vcx\", 1);\n\n\t\tlet lx0: number;\n\t\tlet lx1: number;\n\t\tlet ly0: number;\n\t\tlet ly1: number;\n\n\t\tlet hx0: number;\n\t\tlet hx1: number;\n\t\tlet hy0: number;\n\t\tlet hy1: number;\n\n\t\tlet locationX = this.get(\"locationX\", dataItem.get(\"locationX\", 0.5));\n\t\tlet locationY = this.get(\"locationY\", dataItem.get(\"locationY\", 0.5));\n\n\t\tlet openLocationX = this.get(\"openLocationX\", dataItem.get(\"openLocationX\", locationX));\n\t\tlet openLocationY = this.get(\"openLocationY\", dataItem.get(\"openLocationY\", locationY));\n\n\t\tlet orientation: \"horizontal\" | \"vertical\";\n\n\t\tif (yAxis === baseAxis) {\n\t\t\tlet open = xAxis.getDataItemPositionX(dataItem, this._xOpenField, 1, vcx);\n\t\t\tlet close = xAxis.getDataItemPositionX(dataItem, this._xField, 1, vcx);\n\n\t\t\tlx1 = xAxis.getDataItemPositionX(dataItem, this._xLowField, 1, vcx);\n\t\t\thx1 = xAxis.getDataItemPositionX(dataItem, this._xHighField, 1, vcx);\n\n\t\t\thx0 = Math.max(open, close);\n\t\t\tlx0 = Math.min(open, close);\n\n\t\t\tlet startLocation = this._aLocationY0 + openLocationY - 0.5;\n\t\t\tlet endLocation = this._aLocationY1 + locationY - 0.5;\n\n\t\t\tly0 = yAxis.getDataItemPositionY(dataItem, this._yField, startLocation + (endLocation - startLocation) / 2, vcy);\n\t\t\tly1 = ly0;\n\t\t\thy0 = ly0;\n\t\t\thy1 = ly0;\n\n\t\t\torientation = \"horizontal\";\n\t\t}\n\t\telse {\n\t\t\tlet open = yAxis.getDataItemPositionY(dataItem, this._yOpenField, 1, vcy);\n\t\t\tlet close = yAxis.getDataItemPositionY(dataItem, this._yField, 1, vcy);\n\n\t\t\tly1 = yAxis.getDataItemPositionY(dataItem, this._yLowField, 1, vcy);\n\t\t\thy1 = yAxis.getDataItemPositionY(dataItem, this._yHighField, 1, vcy);\n\n\t\t\thy0 = Math.max(open, close);\n\t\t\tly0 = Math.min(open, close);\n\n\t\t\tlet startLocation = this._aLocationX0 + openLocationX - 0.5;\n\t\t\tlet endLocation = this._aLocationX1 + locationX - 0.5;\n\n\t\t\tlx0 = xAxis.getDataItemPositionX(dataItem, this._xField, startLocation + (endLocation - startLocation) / 2, vcx);\n\t\t\tlx1 = lx0;\n\t\t\thx0 = lx0;\n\t\t\thx1 = lx0;\n\n\t\t\torientation = \"vertical\";\n\t\t}\n\n\t\tthis._updateCandleGraphics(dataItem, lx0, lx1, ly0, ly1, hx0, hx1, hy0, hy1, orientation)\n\t}\n\n\tprotected _updateCandleGraphics(dataItem: DataItem, lx0: number, lx1: number, ly0: number, ly1: number, hx0: number, hx1: number, hy0: number, hy1: number, orientation: \"horizontal\" | \"vertical\") {\n\t\tlet column = dataItem.get(\"graphics\") as Candlestick;\n\n\t\tif (column) {\n\t\t\tlet pl0 = this.getPoint(lx0, ly0);\n\t\t\tlet pl1 = this.getPoint(lx1, ly1);\n\n\t\t\tlet ph0 = this.getPoint(hx0, hy0);\n\t\t\tlet ph1 = this.getPoint(hx1, hy1);\n\n\t\t\tlet x = column.x();\n\t\t\tlet y = column.y();\n\n\t\t\tcolumn.set(\"lowX0\", pl0.x - x);\n\t\t\tcolumn.set(\"lowY0\", pl0.y - y);\n\n\t\t\tcolumn.set(\"lowX1\", pl1.x - x);\n\t\t\tcolumn.set(\"lowY1\", pl1.y - y);\n\n\t\t\tcolumn.set(\"highX0\", ph0.x - x);\n\t\t\tcolumn.set(\"highY0\", ph0.y - y);\n\n\t\t\tcolumn.set(\"highX1\", ph1.x - x);\n\t\t\tcolumn.set(\"highY1\", ph1.y - y);\n\n\t\t\tcolumn.set(\"orientation\", orientation);\n\n\t\t\tlet rangeGraphics = dataItem.get(\"rangeGraphics\")!;\n\t\t\tif (rangeGraphics) {\n\t\t\t\t$array.each(rangeGraphics, (column: any) => {\n\t\t\t\t\tcolumn.set(\"lowX0\", pl0.x - x);\n\t\t\t\t\tcolumn.set(\"lowY0\", pl0.y - y);\n\n\t\t\t\t\tcolumn.set(\"lowX1\", pl1.x - x);\n\t\t\t\t\tcolumn.set(\"lowY1\", pl1.y - y);\n\n\t\t\t\t\tcolumn.set(\"highX0\", ph0.x - x);\n\t\t\t\t\tcolumn.set(\"highY0\", ph0.y - y);\n\n\t\t\t\t\tcolumn.set(\"highX1\", ph1.x - x);\n\t\t\t\t\tcolumn.set(\"highY1\", ph1.y - y);\n\n\t\t\t\t\tcolumn.set(\"orientation\", orientation);\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _processAxisRange(axisRange: this[\"_axisRangeType\"]) {\n\t\tsuper._processAxisRange(axisRange);\n\t\taxisRange.columns = new ListTemplate(\n\t\t\tTemplate.new({}),\n\t\t\t() => Candlestick._new(this._root, {\n\t\t\t\tthemeTags: $utils.mergeTags(axisRange.columns.template.get(\"themeTags\", []), [\"candlestick\", \"series\", \"column\"]),\n\t\t\t}, [this.columns.template, axisRange.columns.template])\n\t\t);\n\t}\n}\n","import type { DataItem } from \"../../../core/render/Component\";\r\n\r\nimport { BaseColumnSeries, IBaseColumnSeriesPrivate, IBaseColumnSeriesSettings, IBaseColumnSeriesDataItem, IBaseColumnSeriesAxisRange } from \"./BaseColumnSeries\";\r\nimport { Template } from \"../../../core/util/Template\";\r\nimport { ListTemplate } from \"../../../core/util/List\";\r\nimport { RoundedRectangle } from \"../../../core/render/RoundedRectangle\";\r\n\r\nimport * as $utils from \"../../../core/util/Utils\";\r\n\r\nexport interface IColumnSeriesDataItem extends IBaseColumnSeriesDataItem { }\r\n\r\nexport interface IColumnSeriesSettings extends IBaseColumnSeriesSettings { }\r\n\r\nexport interface IColumnSeriesPrivate extends IBaseColumnSeriesPrivate { }\r\n\r\nexport interface IColumnSeriesAxisRange extends IBaseColumnSeriesAxisRange {\r\n\t/**\r\n\t * A list of actual columns in a range.\r\n\t */\r\n\tcolumns: ListTemplate\r\n}\r\n\r\nexport class ColumnSeries extends BaseColumnSeries {\r\n\r\n\tdeclare public _settings: IColumnSeriesSettings;\r\n\tdeclare public _privateSettings: IColumnSeriesPrivate;\r\n\tdeclare public _dataItemSettings: IColumnSeriesDataItem;\r\n\tdeclare public _axisRangeType: IColumnSeriesAxisRange;\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tpublic makeColumn(dataItem: DataItem, listTemplate: ListTemplate): RoundedRectangle {\r\n\t\tconst column = this.mainContainer.children.push(listTemplate.make());\r\n\t\tcolumn._setDataItem(dataItem);\r\n\t\tlistTemplate.push(column);\r\n\t\treturn column;\r\n\t}\r\n\r\n\t/**\r\n\t * A [[TemplateList]] of all columns in series.\r\n\t *\r\n\t * `columns.template` can be used to set default settings for all columns,\r\n\t * or to change on existing ones.\r\n\t */\r\n\tpublic readonly columns: ListTemplate = this.addDisposer(new ListTemplate(\r\n\t\tTemplate.new({}),\r\n\t\t() => RoundedRectangle._new(this._root, {\r\n\t\t\tposition: \"absolute\",\r\n\t\t\tthemeTags: $utils.mergeTags(this.columns.template.get(\"themeTags\", []), [\"series\", \"column\"])\r\n\t\t}, [this.columns.template])\r\n\t));\r\n\r\n\tpublic static className: string = \"ColumnSeries\";\r\n\tpublic static classNames: Array = BaseColumnSeries.classNames.concat([ColumnSeries.className]);\r\n\r\n\r\n\tprotected _processAxisRange(axisRange: this[\"_axisRangeType\"]) {\r\n\t\tsuper._processAxisRange(axisRange);\r\n\t\taxisRange.columns = new ListTemplate(\r\n\t\t\tTemplate.new({}),\r\n\t\t\t() => RoundedRectangle._new(this._root, {\r\n\t\t\t\tposition: \"absolute\",\r\n\t\t\t\tthemeTags: $utils.mergeTags(axisRange.columns.template.get(\"themeTags\", []), [\"series\", \"column\"]),\r\n\t\t\t}, [this.columns.template, axisRange.columns.template])\r\n\t\t);\r\n\t}\r\n}\r\n","import type { Axis } from \"../axes/Axis\";\nimport type { AxisRenderer } from \"../axes/AxisRenderer\";\n\nimport { XYSeries, IXYSeriesPrivate, IXYSeriesSettings, IXYSeriesDataItem, IXYSeriesAxisRange } from \"./XYSeries\";\nimport { Graphics } from \"../../../core/render/Graphics\";\nimport { CurveFactory, line, area } from \"d3-shape\";\nimport { Template } from \"../../../core/util/Template\";\nimport { ListTemplate } from \"../../../core/util/List\";\nimport { color } from \"../../../core/util/Color\";\nimport { DataItem } from \"../../../core/render/Component\";\nimport { Rectangle } from \"../../../core/render/Rectangle\";\nimport * as $type from \"../../../core/util/Type\";\nimport * as $array from \"../../../core/util/Array\";\nimport * as $utils from \"../../../core/util/Utils\";\n\nexport interface IPointOptions {\n}\n\nexport interface ILineSeriesDataItem extends IXYSeriesDataItem {\n}\n\nexport interface ILineSeriesSettings extends IXYSeriesSettings {\n\n\t/**\n\t * If set to `true` the line will connect over \"gaps\" - categories or time\n\t * intervals with no data.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/line-series/#Gaps} for more info\n\t * @default true\n\t */\n\tconnect?: boolean;\n\n\t/**\n\t * If there are more than `autoGapCount` base time intervals (e.g. days) with\n\t * no data, the line will break and will display gap.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/line-series/#Auto_gaps_with_dates} for more info\n\t * @default 1.1\n\t */\n\tautoGapCount?: number;\n\n\t/**\n\t * @ignore\n\t */\n\tcurveFactory?: CurveFactory;\n\n\t/**\n\t * Allows simplifying the line with many points.\n\t *\n\t * If set, the series will skip points that are closer than X pixels to each\n\t * other.\n\t *\n\t * With many data points, this allows having smoother, less cluttered lines.\n\t *\n\t * @default 0\n\t * @since 5.2.7\n\t */\n\tminDistance?: number;\n\n\n}\n\nexport interface ILineSeriesPrivate extends IXYSeriesPrivate {\n}\n\n/**\n * Interface representing a [[LineSeries]] axis range.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/axis-ranges/#Series_axis_ranges} for more info\n */\nexport interface ILineSeriesAxisRange extends IXYSeriesAxisRange {\n\n\t/**\n\t * A list template to use when applying line settings to the line segments covered\n\t * by an axis range.\n\t */\n\tstrokes?: ListTemplate;\n\n\t/**\n\t * A list template to use when applying fill settings to the fill segments covered\n\t * by an axis range.\n\t */\n\tfills?: ListTemplate;\n}\n\n/**\n * Used to plot line and/or area series.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/line-series/} for more info\n * @important\n */\nexport class LineSeries extends XYSeries {\n\n\tdeclare public _settings: ILineSeriesSettings;\n\tdeclare public _privateSettings: ILineSeriesPrivate;\n\tdeclare public _dataItemSettings: ILineSeriesDataItem;\n\tdeclare public _axisRangeType: ILineSeriesAxisRange;\n\n\tpublic static className: string = \"LineSeries\";\n\tpublic static classNames: Array = XYSeries.classNames.concat([LineSeries.className]);\n\n\tprotected _endIndex!: number;\n\n\tprotected _strokeGenerator = line();\n\tprotected _fillGenerator = area();\n\n\tprotected _legendStroke?: Graphics;\n\tprotected _legendFill?: Graphics;\n\n\tprotected _afterNew() {\n\t\tthis._fillGenerator.y0(function(p: number[]) {\n\t\t\treturn p[3];\n\t\t});\n\n\t\tthis._fillGenerator.x0(function(p: number[]) {\n\t\t\treturn p[2];\n\t\t});\n\n\t\tthis._fillGenerator.y1(function(p: number[]) {\n\t\t\treturn p[1];\n\t\t});\n\n\t\tthis._fillGenerator.x1(function(p: number[]) {\n\t\t\treturn p[0];\n\t\t});\n\n\t\tsuper._afterNew();\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic makeStroke(strokes: ListTemplate): Graphics {\n\t\tconst stroke = this.mainContainer.children.push(strokes.make());\n\t\tstrokes.push(stroke);\n\t\treturn stroke;\n\t}\n\n\t/**\n\t * A [[TemplateList]] of all line segments in series.\n\t *\n\t * `strokes.template` can be used to set default settings for all line\n\t * segments, or to change on existing ones.\n\t *\n\t * @default new ListTemplate\n\t */\n\tpublic readonly strokes: ListTemplate = this.addDisposer(new ListTemplate(\n\t\tTemplate.new({}),\n\t\t() => Graphics._new(this._root, {\n\t\t\tthemeTags: $utils.mergeTags(this.strokes.template.get(\"themeTags\", []), [\"line\", \"series\", \"stroke\"])\n\t\t}, [this.strokes.template]),\n\t));\n\n\t/**\n\t * @ignore\n\t */\n\tpublic makeFill(fills: ListTemplate): Graphics {\n\t\tconst fill = this.mainContainer.children.push(fills.make());\n\t\tfills.push(fill);\n\t\treturn fill;\n\t}\n\n\t/**\n\t * A [[TemplateList]] of all segment fills in series.\n\t *\n\t * `fills.template` can be used to set default settings for all segment\n\t * fills, or to change on existing ones.\n\t *\n\t * @default new ListTemplate\n\t */\n\tpublic readonly fills: ListTemplate = this.addDisposer(new ListTemplate(\n\t\tTemplate.new({}),\n\t\t() => Graphics._new(this._root, {\n\t\t\tthemeTags: $utils.mergeTags(this.strokes.template.get(\"themeTags\", []), [\"line\", \"series\", \"fill\"])\n\t\t}, [this.fills.template]),\n\t));\n\n\t// custom set from data\n\tprotected _fillTemplate: Template | undefined;\n\tprotected _strokeTemplate: Template | undefined;\n\n\tprotected _previousPoint: Array = [0, 0, 0, 0];\n\n\tprotected _dindex = 0;\n\tprotected _sindex = 0;\n\n\tpublic _updateChildren() {\n\n\t\tthis._strokeTemplate = undefined;\n\t\tthis._fillTemplate = undefined;\n\n\t\tlet xAxis = this.get(\"xAxis\");\n\t\tlet yAxis = this.get(\"yAxis\");\n\n\t\tif (this.isDirty(\"stroke\")) {\n\t\t\tconst stroke = this.get(\"stroke\");\n\t\t\tthis.strokes.template.set(\"stroke\", stroke);\n\t\t\tconst legendStroke = this._legendStroke;\n\t\t\tif (legendStroke) {\n\t\t\t\tlegendStroke.states.lookup(\"default\")!.set(\"stroke\", stroke);\n\t\t\t}\n\t\t}\n\t\tif (this.isDirty(\"fill\")) {\n\t\t\tconst fill = this.get(\"fill\");\n\t\t\tthis.fills.template.set(\"fill\", fill);\n\t\t\tconst legendFill = this._legendFill;\n\t\t\tif (legendFill) {\n\t\t\t\tlegendFill.states.lookup(\"default\")!.set(\"fill\", fill);\n\t\t\t}\n\t\t}\n\n\t\tif (this.isDirty(\"fillPattern\")) {\n\t\t\tconst fillPattern = this.get(\"fillPattern\");\n\t\t\tthis.fills.template.set(\"fillPattern\", fillPattern);\n\t\t\tconst legendFill = this._legendFill;\n\t\t\tif (legendFill) {\n\t\t\t\tlegendFill.states.lookup(\"default\")!.set(\"fillPattern\", fillPattern);\n\t\t\t}\n\t\t}\n\n\t\tif (this.isDirty(\"curveFactory\")) {\n\t\t\tconst curveFactory = this.get(\"curveFactory\")!;\n\t\t\tif (curveFactory) {\n\t\t\t\tthis._strokeGenerator.curve(curveFactory);\n\t\t\t\tthis._fillGenerator.curve(curveFactory);\n\t\t\t}\n\t\t}\n\n\t\tif (xAxis.inited && yAxis.inited) {\n\t\t\tif (this._axesDirty || this._valuesDirty || this._stackDirty || this.isDirty(\"vcx\") || this.isDirty(\"vcy\") || this._sizeDirty || this.isDirty(\"connect\") || this.isDirty(\"curveFactory\")) {\n\n\t\t\t\tthis.fills.each((fill) => {\n\t\t\t\t\tfill.setPrivate(\"visible\", false);\n\t\t\t\t})\n\n\t\t\t\tthis.strokes.each((fill) => {\n\t\t\t\t\tfill.setPrivate(\"visible\", false);\n\t\t\t\t})\n\n\t\t\t\tthis.axisRanges.each((axisRange) => {\n\t\t\t\t\tlet fills = axisRange.fills;\n\t\t\t\t\tif (fills) {\n\t\t\t\t\t\tfills.each((fill) => {\n\t\t\t\t\t\t\tfill.setPrivate(\"visible\", false);\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\n\t\t\t\t\tlet strokes = axisRange.strokes;\n\t\t\t\t\tif (strokes) {\n\t\t\t\t\t\tstrokes.each((stroke) => {\n\t\t\t\t\t\t\tstroke.setPrivate(\"visible\", false);\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t})\n\n\t\t\t\tlet startIndex = this.startIndex();\n\n\t\t\t\tlet strokeTemplateField = this.strokes.template.get(\"templateField\");\n\t\t\t\tlet fillTemplateField = this.fills.template.get(\"templateField\");\n\n\t\t\t\tlet strokeTemplateFound = true;\n\t\t\t\tlet fillTemplateFound = true;\n\n\t\t\t\tif (strokeTemplateField) {\n\t\t\t\t\tstrokeTemplateFound = false;\n\t\t\t\t}\n\t\t\t\tif (fillTemplateField) {\n\t\t\t\t\tfillTemplateFound = false;\n\t\t\t\t}\n\n\t\t\t\tfor (let i = startIndex - 1; i >= 0; i--) {\n\t\t\t\t\tlet dataItem = this.dataItems[i];\n\t\t\t\t\tlet hasValues = true;\n\t\t\t\t\tlet dataContext = dataItem.dataContext as any;\n\t\t\t\t\tif (strokeTemplateField) {\n\t\t\t\t\t\tif (dataContext[strokeTemplateField]) {\n\t\t\t\t\t\t\tstrokeTemplateFound = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (fillTemplateField) {\n\t\t\t\t\t\tif (dataContext[fillTemplateField]) {\n\t\t\t\t\t\t\tfillTemplateFound = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$array.each(this._valueFields, (field) => {\n\t\t\t\t\t\tif (!$type.isNumber(dataItem.get(field as any))) {\n\t\t\t\t\t\t\thasValues = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\tif (hasValues && strokeTemplateFound && fillTemplateFound) {\n\t\t\t\t\t\tstartIndex = i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t\tlet len = this.dataItems.length;\n\t\t\t\tlet endIndex = this.endIndex();\n\n\t\t\t\tif (endIndex < len) {\n\t\t\t\t\tendIndex++;\n\t\t\t\t\tfor (let i = endIndex; i < len; i++) {\n\t\t\t\t\t\tlet dataItem = this.dataItems[i];\n\t\t\t\t\t\tlet hasValues = true;\n\t\t\t\t\t\t$array.each(this._valueFields, (field) => {\n\t\t\t\t\t\t\tif (!$type.isNumber(dataItem.get(field as any))) {\n\t\t\t\t\t\t\t\thasValues = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t\tif (hasValues) {\n\t\t\t\t\t\t\tendIndex = i + 1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (startIndex > 0) {\n\t\t\t\t\tstartIndex--;\n\t\t\t\t}\n\n\t\t\t\tthis._endIndex = endIndex;\n\n\t\t\t\tthis._clearGraphics();\n\t\t\t\tthis._sindex = 0;\n\t\t\t\tthis._dindex = startIndex;\n\t\t\t\tif (this.dataItems.length == 1) {\n\t\t\t\t\tthis._startSegment(0);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// this is done to avoid recursion with a lot of segments\n\t\t\t\t\twhile (this._dindex < endIndex - 1) {\n\t\t\t\t\t\tthis._startSegment(this._dindex);\n\t\t\t\t\t\tthis._sindex++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthis._skipped = true;\n\t\t}\n\n\t\tsuper._updateChildren();\n\t}\n\n\tprotected _clearGraphics() {\n\t\tthis.strokes.clear();\n\t\tthis.fills.clear();\n\n\t\tthis.axisRanges.each((axisRange) => {\n\t\t\taxisRange.fills!.clear();\n\t\t\taxisRange.strokes!.clear();\n\t\t})\n\t}\n\n\tprotected _startSegment(dataItemIndex: number) {\n\t\tlet endIndex = this._endIndex;\n\t\tlet currentEndIndex = endIndex;\n\n\t\tconst autoGapCount = this.get(\"autoGapCount\")!;\n\t\tconst connect = this.get(\"connect\");\n\n\t\tconst fill = this.makeFill(this.fills);\n\n\t\tconst fillTemplate = this._fillTemplate;\n\t\tconst originalTemplate = this.fills.template;\n\t\tif (fillTemplate && fillTemplate != originalTemplate) {\n\t\t\tfill.template = fillTemplate;\n\t\t}\n\n\t\tfill.setPrivate(\"visible\", true);\n\n\t\tconst stroke = this.makeStroke(this.strokes);\n\n\t\tconst strokeTemplate = this._strokeTemplate;\n\t\tif (strokeTemplate && strokeTemplate != this.strokes.template) {\n\t\t\tstroke.template = strokeTemplate;\n\t\t}\n\n\t\tstroke.setPrivate(\"visible\", true);\n\n\t\tlet xAxis = this.get(\"xAxis\");\n\t\tlet yAxis = this.get(\"yAxis\");\n\t\tlet baseAxis = this.get(\"baseAxis\")!;\n\n\t\tlet vcx = this.get(\"vcx\", 1);\n\t\tlet vcy = this.get(\"vcy\", 1);\n\n\t\tlet xField = this._xField;\n\t\tlet yField = this._yField;\n\n\t\tlet xOpenField = this._xOpenField;\n\t\tlet yOpenField = this._yOpenField;\n\n\t\tconst xOpenFieldValue = this.get(\"openValueXField\");\n\t\tconst yOpenFieldValue = this.get(\"openValueYField\");\n\n\t\tif (!xOpenFieldValue) {\n\t\t\txOpenField = this._xField;\n\t\t}\n\n\t\tif (!yOpenFieldValue) {\n\t\t\tyOpenField = this._yField;\n\t\t}\n\n\t\tconst stacked = this.get(\"stacked\");\n\n\t\tconst basePosX = xAxis.basePosition();\n\t\tconst basePosY = yAxis.basePosition();\n\n\t\tlet baseField: string;\n\t\tif (baseAxis === yAxis) {\n\t\t\tbaseField = this._yField;\n\t\t}\n\t\telse {\n\t\t\tbaseField = this._xField;\n\t\t}\n\n\t\tconst segments: Array>> = [];\n\t\tlet points: Array> = [];\n\t\tsegments.push(points);\n\n\t\tconst strokeTemplateField = this.strokes.template.get(\"templateField\");\n\t\tconst fillTemplateField = this.fills.template.get(\"templateField\");\n\n\t\tlet locationX = this.get(\"locationX\", 0.5);\n\t\tlet locationY = this.get(\"locationY\", 0.5);\n\n\t\tlet openLocationX = this.get(\"openLocationX\", locationX);\n\t\tlet openLocationY = this.get(\"openLocationY\", locationY);\n\n\t\tconst minDistance = this.get(\"minDistance\", 0);\n\n\t\tlet i: number;\n\n\t\tlet fillVisible = this.fills.template.get(\"visible\");\n\t\tif (this.axisRanges.length > 0) {\n\t\t\tfillVisible = true;\n\t\t}\n\n\t\tlet getOpen = false;\n\t\tif (stacked || xOpenFieldValue || yOpenFieldValue) {\n\t\t\tgetOpen = true;\n\t\t}\n\n\t\tconst o = {\n\t\t\tpoints, segments, stacked, getOpen, basePosX, basePosY, fillVisible, xField, yField, xOpenField, yOpenField, vcx, vcy, baseAxis, xAxis, yAxis, locationX, locationY, openLocationX, openLocationY, minDistance\n\t\t}\n\n\n\t\tlet rangeStrokeTemplate = this._strokeTemplate;\n\t\tlet rangeFillTemplate = this._fillTemplate;\n\n\t\tfor (i = dataItemIndex; i < currentEndIndex; i++) {\n\t\t\tthis._dindex = i;\n\t\t\tconst dataItem = this._dataItems[i];\n\n\t\t\tlet valueX = dataItem.get(xField as any);\n\t\t\tlet valueY = dataItem.get(yField as any);\n\n\t\t\tif (valueX == null || valueY == null) {\n\t\t\t\tif (!connect) {\n\t\t\t\t\tpoints = [];\n\t\t\t\t\tsegments.push(points);\n\t\t\t\t\to.points = points;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis._getPoints(dataItem, o);\n\t\t\t}\n\n\t\t\tif (strokeTemplateField) {\n\t\t\t\tlet strokeTemplate = (dataItem.dataContext as any)[strokeTemplateField]\n\t\t\t\tif (strokeTemplate) {\n\t\t\t\t\tif (!(strokeTemplate instanceof Template)) {\n\t\t\t\t\t\tstrokeTemplate = Template.new(strokeTemplate);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._strokeTemplate = strokeTemplate;\n\t\t\t\t\tif (i > dataItemIndex) {\n\t\t\t\t\t\tcurrentEndIndex = i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\trangeStrokeTemplate = strokeTemplate;\n\t\t\t\t\t\tstroke.template = strokeTemplate;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (fillTemplateField) {\n\t\t\t\tlet fillTemplate = (dataItem.dataContext as any)[fillTemplateField]\n\t\t\t\tif (fillTemplate) {\n\t\t\t\t\tif (!(fillTemplate instanceof Template)) {\n\t\t\t\t\t\tfillTemplate = Template.new(fillTemplate);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._fillTemplate = fillTemplate;\n\t\t\t\t\tif (i > dataItemIndex) {\n\t\t\t\t\t\tcurrentEndIndex = i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\trangeFillTemplate = fillTemplate;\n\t\t\t\t\t\tfill.template = fillTemplate;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!connect) {\n\t\t\t\tlet nextItem = this.dataItems[i + 1];\n\t\t\t\tif (nextItem) {\n\t\t\t\t\tif (baseAxis.shouldGap(dataItem, nextItem, autoGapCount, baseField)) {\n\t\t\t\t\t\tpoints = [];\n\t\t\t\t\t\tsegments.push(points);\n\t\t\t\t\t\to.points = points;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfill.setRaw(\"userData\", [dataItemIndex, i]);\n\t\tstroke.setRaw(\"userData\", [dataItemIndex, i]);\n\n\t\tif (i === endIndex) {\n\t\t\tthis._endLine(points, segments[0][0]);\n\t\t}\n\n\t\tif (stroke) {\n\t\t\tthis._drawStroke(stroke, segments);\n\t\t}\n\n\t\tif (fill) {\n\t\t\tthis._drawFill(fill, segments);\n\t\t}\n\n\t\tthis.axisRanges.each((axisRange) => {\n\t\t\tconst container = axisRange.container;\n\t\t\tconst fills = axisRange.fills!;\n\t\t\tconst fill = this.makeFill(fills);\n\t\t\tif (container) {\n\t\t\t\tcontainer.children.push(fill);\n\t\t\t}\n\n\t\t\tfill.setPrivate(\"visible\", true);\n\t\t\tthis._drawFill(fill, segments);\n\n\t\t\tconst strokes = axisRange.strokes!;\n\t\t\tconst stroke = this.makeStroke(strokes);\n\t\t\tif (container) {\n\t\t\t\tcontainer.children.push(stroke);\n\t\t\t}\n\n\t\t\tif (rangeStrokeTemplate && rangeStrokeTemplate != this.strokes.template) {\n\t\t\t\tstroke.template = rangeStrokeTemplate;\n\t\t\t}\n\n\t\t\tif (rangeFillTemplate && rangeFillTemplate != this.fills.template) {\n\t\t\t\tfill.template = rangeFillTemplate;\n\t\t\t}\n\n\t\t\tstroke.setPrivate(\"visible\", true);\n\t\t\tthis._drawStroke(stroke, segments);\n\n\t\t\tfill.setRaw(\"userData\", [dataItemIndex, i]);\n\t\t\tstroke.setRaw(\"userData\", [dataItemIndex, i]);\n\t\t})\n\t}\n\n\tprotected _getPoints(dataItem: DataItem, o: { points: Array>, segments: number[][][], stacked: boolean | undefined, getOpen: boolean, basePosX: number, basePosY: number, fillVisible: boolean | undefined, xField: string, yField: string, xOpenField: string, yOpenField: string, vcx: number, vcy: number, baseAxis: Axis, xAxis: Axis, yAxis: Axis, locationX: number, locationY: number, openLocationX: number, openLocationY: number, minDistance: number }) {\n\t\tlet points = o.points;\n\n\t\tlet itemLocationX = dataItem.get(\"locationX\", o.locationX);\n\t\tlet itemLocationY = dataItem.get(\"locationY\", o.locationY);\n\n\t\tlet xPos = o.xAxis.getDataItemPositionX(dataItem, o.xField, itemLocationX, o.vcx);\n\t\tlet yPos = o.yAxis.getDataItemPositionY(dataItem, o.yField, itemLocationY, o.vcy);\n\n\t\tif (this._shouldInclude(xPos)) {\n\n\t\t\tconst iPoint = this.getPoint(xPos, yPos);\n\t\t\tconst point = [iPoint.x, iPoint.y];\n\n\t\t\tiPoint.x += this._x;\n\t\t\tiPoint.y += this._y;\n\n\t\t\tdataItem.set(\"point\", iPoint);\n\n\t\t\tif (o.fillVisible) {\n\t\t\t\tlet xPos0: number = xPos;\n\t\t\t\tlet yPos0: number = yPos;\n\n\t\t\t\tif (o.baseAxis === o.xAxis) {\n\t\t\t\t\tyPos0 = o.basePosY;\n\t\t\t\t}\n\t\t\t\telse if (o.baseAxis === o.yAxis) {\n\t\t\t\t\txPos0 = o.basePosX;\n\t\t\t\t}\n\n\t\t\t\tif (o.getOpen) {\n\t\t\t\t\tlet valueX = dataItem.get(o.xOpenField as any);\n\t\t\t\t\tlet valueY = dataItem.get(o.yOpenField as any);\n\n\t\t\t\t\tif (valueX != null && valueY != null) {\n\t\t\t\t\t\tlet itemLocationX = dataItem.get(\"openLocationX\", o.openLocationX);\n\t\t\t\t\t\tlet itemLocationY = dataItem.get(\"openLocationY\", o.openLocationY);\n\n\t\t\t\t\t\tif (o.stacked) {\n\t\t\t\t\t\t\tlet stackToItemX = dataItem.get(\"stackToItemX\")!;\n\t\t\t\t\t\t\tlet stackToItemY = dataItem.get(\"stackToItemY\")!;\n\n\t\t\t\t\t\t\tif (stackToItemX) {\n\t\t\t\t\t\t\t\txPos0 = o.xAxis.getDataItemPositionX(stackToItemX, o.xField, itemLocationX, (stackToItemX.component as XYSeries).get(\"vcx\"));\n\t\t\t\t\t\t\t\tif ($type.isNaN(xPos0)) {\n\t\t\t\t\t\t\t\t\txPos0 = o.basePosX;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tif (o.yAxis === o.baseAxis) {\n\t\t\t\t\t\t\t\t\txPos0 = o.basePosX;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\txPos0 = o.xAxis.getDataItemPositionX(dataItem, o.xOpenField, itemLocationX, o.vcx);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (stackToItemY) {\n\t\t\t\t\t\t\t\tyPos0 = o.yAxis.getDataItemPositionY(stackToItemY, o.yField, itemLocationY, (stackToItemY.component as XYSeries).get(\"vcy\"));\n\t\t\t\t\t\t\t\tif ($type.isNaN(yPos0)) {\n\t\t\t\t\t\t\t\t\tyPos0 = o.basePosY;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tif (o.xAxis === o.baseAxis) {\n\t\t\t\t\t\t\t\t\tyPos0 = o.basePosY;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tyPos0 = o.yAxis.getDataItemPositionY(dataItem, o.yOpenField, itemLocationY, o.vcy);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\txPos0 = o.xAxis.getDataItemPositionX(dataItem, o.xOpenField, itemLocationX, o.vcx);\n\t\t\t\t\t\t\tyPos0 = o.yAxis.getDataItemPositionY(dataItem, o.yOpenField, itemLocationY, o.vcy);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet closeIPoint = this.getPoint(xPos0, yPos0);\n\n\t\t\t\tpoint[2] = closeIPoint.x;\n\t\t\t\tpoint[3] = closeIPoint.y;\n\t\t\t}\n\n\t\t\tif (o.minDistance > 0) {\n\t\t\t\tconst p0 = point[0];\n\t\t\t\tconst p1 = point[1];\n\t\t\t\tconst p2 = point[2];\n\t\t\t\tconst p3 = point[3];\n\n\t\t\t\tconst prev = this._previousPoint;\n\n\t\t\t\tconst pp0 = prev[0];\n\t\t\t\tconst pp1 = prev[1];\n\t\t\t\tconst pp2 = prev[2];\n\t\t\t\tconst pp3 = prev[3];\n\n\t\t\t\tif (Math.hypot(p0 - pp0, p1 - pp1) > o.minDistance || (p2 && p3 && Math.hypot(p2 - pp2, p3 - pp3) > o.minDistance)) {\n\t\t\t\t\tpoints.push(point);\n\t\t\t\t\tthis._previousPoint = point;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tpoints.push(point);\n\t\t\t}\n\t\t}\n\t}\n\n\n\tprotected _endLine(_points: Array>, _firstPoint: Array) {\n\n\t}\n\n\tprotected _drawStroke(graphics: Graphics, segments: number[][][]) {\n\t\tif (graphics.get(\"visible\") && !graphics.get(\"forceHidden\")) {\n\t\t\tgraphics.set(\"draw\", (display) => {\n\t\t\t\t$array.each(segments, (segment) => {\n\t\t\t\t\tthis._strokeGenerator.context(display as any);\n\t\t\t\t\tthis._strokeGenerator(segment as [number, number][]);\n\t\t\t\t})\n\t\t\t})\n\t\t}\n\t}\n\n\tprotected _drawFill(graphics: Graphics, segments: number[][][]) {\n\t\tif (graphics.get(\"visible\") && !graphics.get(\"forceHidden\")) {\n\t\t\tgraphics.set(\"draw\", (display) => {\n\t\t\t\t$array.each(segments, (segment) => {\n\t\t\t\t\tthis._fillGenerator.context(display as any);\n\t\t\t\t\tthis._fillGenerator(segment as [number, number][]);\n\t\t\t\t})\n\t\t\t})\n\t\t}\n\t}\n\n\tprotected _processAxisRange(axisRange: this[\"_axisRangeType\"]) {\n\t\tsuper._processAxisRange(axisRange);\n\t\taxisRange.fills = new ListTemplate(\n\t\t\tTemplate.new({}),\n\t\t\t() => Graphics._new(this._root, {\n\t\t\t\tthemeTags: $utils.mergeTags(axisRange.fills!.template.get(\"themeTags\", []), [\"line\", \"series\", \"fill\"]),\n\t\t\t}, [this.fills.template, axisRange.fills!.template]),\n\t\t);\n\n\t\taxisRange.strokes = new ListTemplate(\n\t\t\tTemplate.new({}),\n\t\t\t() => Graphics._new(this._root, {\n\t\t\t\tthemeTags: $utils.mergeTags(axisRange.strokes!.template.get(\"themeTags\", []), [\"line\", \"series\", \"stroke\"]),\n\t\t\t}, [this.strokes.template, axisRange.strokes!.template])\n\t\t);\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic createLegendMarker(_dataItem?: DataItem) {\n\n\t\tconst legendDataItem = this.get(\"legendDataItem\");\n\n\t\tif (legendDataItem) {\n\t\t\tconst marker = legendDataItem.get(\"marker\");\n\n\t\t\tconst markerRectangle = legendDataItem.get(\"markerRectangle\");\n\t\t\tif (markerRectangle) {\n\t\t\t\tmarkerRectangle.setPrivate(\"visible\", false);\n\t\t\t}\n\n\t\t\tmarker.set(\"background\", Rectangle.new(marker._root, { fillOpacity: 0, fill: color(0x000000) }))\n\n\t\t\tconst legendStroke = marker.children.push(Graphics._new(marker._root, {\n\t\t\t\tthemeTags: [\"line\", \"series\", \"legend\", \"marker\", \"stroke\"], interactive: false\n\t\t\t}, [this.strokes.template]));\n\n\t\t\tthis._legendStroke = legendStroke;\n\n\t\t\tconst legendFill = marker.children.push(Graphics._new(marker._root, {\n\t\t\t\tthemeTags: [\"line\", \"series\", \"legend\", \"marker\", \"fill\"]\n\t\t\t}, [this.fills.template]));\n\n\t\t\tthis._legendFill = legendFill;\n\n\t\t\tconst disabledColor = this._root.interfaceColors.get(\"disabled\");\n\n\t\t\tlegendStroke.states.create(\"disabled\", { fill: disabledColor, stroke: disabledColor });\n\t\t\tlegendFill.states.create(\"disabled\", { fill: disabledColor, stroke: disabledColor });\n\n\t\t\tif (this.bullets.length > 0) {\n\t\t\t\tconst bulletFunction = this.bullets.getIndex(0);\n\t\t\t\tif (bulletFunction) {\n\t\t\t\t\tconst bullet = bulletFunction(marker._root, this, new DataItem(this, { legend: true }, {}));\n\t\t\t\t\tif (bullet) {\n\t\t\t\t\t\tconst sprite = bullet.get(\"sprite\");\n\t\t\t\t\t\tif (sprite instanceof Graphics) {\n\t\t\t\t\t\t\tsprite.states.create(\"disabled\", { fill: disabledColor, stroke: disabledColor });\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (sprite) {\n\t\t\t\t\t\t\tsprite.set(\"tooltipText\", undefined);\n\t\t\t\t\t\t\tsprite.set(\"tooltipHTML\", undefined);\n\n\t\t\t\t\t\t\tmarker.children.push(sprite);\n\t\t\t\t\t\t\tsprite.setAll({ x: marker.width() / 2, y: marker.height() / 2 });\n\n\t\t\t\t\t\t\tmarker.events.on(\"boundschanged\", ()=>{\n\t\t\t\t\t\t\t\tsprite.setAll({ x: marker.width() / 2, y: marker.height() / 2 });\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import type { Axis, IAxisPrivate, IAxisDataItem } from \"../axes/Axis\";\nimport type { AxisRenderer } from \"../axes/AxisRenderer\";\nimport type { IPoint } from \"../../../core/util/IPoint\";\nimport type { Sprite } from \"../../../core/render/Sprite\";\nimport type { Bullet } from \"../../../core/render/Bullet\";\nimport type { XYChart } from \"../XYChart\";\n//import type { CategoryAxis } from \"../axes/CategoryAxis\";\nimport type { DateAxis } from \"../axes/DateAxis\";\nimport type { ITimeInterval } from \"../../../core/util/Time\";\n\nimport { DataItem } from \"../../../core/render/Component\";\nimport { Series, ISeriesSettings, ISeriesDataItem, ISeriesPrivate, ISeriesEvents } from \"../../../core/render/Series\";\nimport { List } from \"../../../core/util/List\";\nimport { Container } from \"../../../core/render/Container\";\nimport { Graphics } from \"../../../core/render/Graphics\";\n\nimport type { IDisposer } from \"../../../core/util/Disposer\";\n\nimport * as $type from \"../../../core/util/Type\";\nimport * as $object from \"../../../core/util/Object\";\nimport * as $array from \"../../../core/util/Array\";\nimport * as $utils from \"../../../core/util/Utils\";\n\n/**\n * @ignore\n */\nfunction min(left: number | undefined, right: number | undefined): number | undefined {\n\tif (left == null) {\n\t\treturn right;\n\n\t} else if (right == null) {\n\t\treturn left;\n\n\t} else if (right < left) {\n\t\treturn right;\n\n\t} else {\n\t\treturn left;\n\t}\n}\n\n/**\n * @ignore\n */\nfunction max(left: number | undefined, right: number | undefined): number | undefined {\n\tif (left == null) {\n\t\treturn right;\n\n\t} else if (right == null) {\n\t\treturn left;\n\n\t} else if (right > left) {\n\t\treturn right;\n\n\t} else {\n\t\treturn left;\n\t}\n}\n\n/**\n * Interface representing a series axis range.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/axis-ranges/#Series_axis_ranges} for more info\n */\nexport interface IXYSeriesAxisRange {\n\n\t/**\n\t * Related axis data item.\n\t */\n\taxisDataItem: DataItem;\n\n\t/**\n\t * A [[Container]] element that range's elements are placed in.\n\t */\n\tcontainer?: Container;\n\n\t/**\n\t * Target series.\n\t */\n\tseries?: XYSeries;\n\n}\n\nexport interface IXYAxisPrivate extends IAxisPrivate {\n\tmin?: number;\n\tmax?: number;\n}\n\nexport interface IXYAxis extends Axis {\n\t_privateSettings: IXYAxisPrivate;\n}\n\nexport interface IXYSeriesEvents extends ISeriesEvents {\n\n\t/**\n\t * Kicks in when axis starts using different data set, e.g. data\n\t * of different granularit on [[DateAxis]].\n\t *\n\t * @since 5.1.1\n\t */\n\tdatasetchanged: {\n\t\tid: string\n\t}\n}\n\n/**\n * XY chart series data item.\n */\nexport interface IXYSeriesDataItem extends ISeriesDataItem {\n\tvalueX?: number;\n\tvalueXWorking?: number;\n\tvalueXChange?: number;\n\tvalueXChangePercent?: number;\n\tvalueXChangeSelection?: number;\n\tvalueXChangeSelectionPercent?: number;\n\tvalueXChangePrevious?: number;\n\tvalueXChangePreviousPercent?: number;\n\tvalueXWorkingOpen?: number;\n\tvalueXWorkingClose?: number;\n\n\tvalueY?: number;\n\tvalueYChange?: number;\n\tvalueYWorking?: number;\n\tvalueYChangePercent?: number;\n\tvalueYChangeSelection?: number;\n\tvalueYChangeSelectionPercent?: number;\n\tvalueYChangePrevious?: number;\n\tvalueYChangePreviousPercent?: number;\n\tvalueYWorkingOpen?: number;\n\tvalueYWorkingClose?: number;\n\n\topenValueX?: number;\n\topenValueXWorking?: number;\n\topenValueXChange?: number;\n\topenValueXChangePercent?: number;\n\topenValueXChangeSelection?: number;\n\topenValueXChangeSelectionPercent?: number;\n\topenValueXChangePrevious?: number;\n\topenValueXChangePreviousPercent?: number;\n\topenValueXWorkingOpen?: number;\n\topenValueXWorkingClose?: number;\n\topenValueY?: number;\n\topenValueYWorking?: number;\n\topenValueYChange?: number;\n\topenValueYChangePercent?: number;\n\topenValueYChangeSelection?: number;\n\topenValueYChangeSelectionPercent?: number;\n\topenValueYChangePrevious?: number;\n\topenValueYChangePreviousPercent?: number;\n\topenValueYWorkingOpen?: number;\n\topenValueYWorkingClose?: number;\n\n\tlowValueX?: number;\n\tlowValueXWorking?: number;\n\tlowValueXChange?: number;\n\tlowValueXChangePercent?: number;\n\tlowValueXChangeSelection?: number;\n\tlowValueXChangeSelectionPercent?: number;\n\tlowValueXChangePrevious?: number;\n\tlowValueXChangePreviousPercent?: number;\n\tlowValueXWorkingOpen?: number;\n\tlowValueXWorkingClose?: number;\n\n\thighValueX?: number;\n\thighValueXWorking?: number;\n\thighValueXChange?: number;\n\thighValueXChangePercent?: number;\n\thighValueXChangeSelection?: number;\n\thighValueXChangeSelectionPercent?: number;\n\thighValueXChangePrevious?: number;\n\thighValueXChangePreviousPercent?: number;\n\thighValueXWorkingOpen?: number;\n\thighValueXWorkingClose?: number;\n\n\tlowValueY?: number;\n\tlowValueYWorking?: number;\n\tlowValueYChange?: number;\n\tlowValueYChangePercent?: number;\n\tlowValueYChangeSelection?: number;\n\tlowValueYChangeSelectionPercent?: number;\n\tlowValueYChangePrevious?: number;\n\tlowValueYChangePreviousPercent?: number;\n\tlowValueYWorkingOpen?: number;\n\tlowValueYWorkingClose?: number;\n\n\thighValueY?: number;\n\thighValueYWorking?: number;\n\thighValueYChange?: number;\n\thighValueYChangePercent?: number;\n\thighValueYChangeSelection?: number;\n\thighValueYChangeSelectionPercent?: number;\n\thighValueYChangePrevious?: number;\n\thighValueYChangePreviousPercent?: number;\n\thighValueYWorkingOpen?: number;\n\thighValueYWorkingClose?: number;\n\n\tcategoryX?: string;\n\tcategoryY?: string;\n\n\topenCategoryX?: string;\n\topenCategoryY?: string;\n\n\tlocationX?: number;\n\tlocationY?: number;\n\n\topenLocationX?: number;\n\topenLocationY?: number;\n\n\tstackToItemX?: DataItem;\n\tstackToItemY?: DataItem;\n\n\tleft?: number;\n\tright?: number;\n\ttop?: number;\n\tbottom?: number;\n\n\tpoint?: IPoint;\n\n\toriginals?: Array>;\n}\n\nexport interface IXYSeriesSettings extends ISeriesSettings {\n\n\t/**\n\t * Minimal distance between data items in pixels.\n\t *\n\t * If data items are closer than this, bullets are turned off to avoid\n\t * overcrowding.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/#Bullets} for more info\n\t */\n\tminBulletDistance?: number;\n\n\t/**\n\t * X axis series uses.\n\t *\n\t * **IMPORTANT:** `xAxis` needs to be set when creating the series. Updating\n\t * this setting on previously created series object will not work.\n\t */\n\txAxis: IXYAxis;\n\n\t/**\n\t * Y axis series uses.\n\t *\n\t * **IMPORTANT:** `yAxis` needs to be set when creating the series. Updating\n\t * this setting on previously created series object will not work.\n\t */\n\tyAxis: IXYAxis;\n\n\t/**\n\t * If set to `true` series will be stacked to other series that also have\n\t * this setting set to `true`.\n\t *\n\t * NOTE: for series stack properly, all stacked series must have same number\n\t * of data items with the same timestamp/category.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/#Stacked_series} for more info\n\t */\n\tstacked?: boolean;\n\n\t/**\n\t * Whether to stack negative values from zero (`true`) or from whatever\n\t * previous series value is (`false`).\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/#Negative_value_stacking} for more info\n\t */\n\tstackToNegative?: boolean;\n\n\t/**\n\t * Base axis for the series.\n\t *\n\t * A base axis will dictate direction series plot.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/#Base_axis} for more info\n\t */\n\tbaseAxis?: IXYAxis;\n\n\t/**\n\t * Input data field for X value.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/#Data_fields} for more info\n\t */\n\tvalueXField?: string;\n\n\t/**\n\t * Input data field for Y value.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/#Data_fields} for more info\n\t */\n\tvalueYField?: string;\n\n\t/**\n\t * Exclude series values when calculating totals for category/interval.\n\t *\n\t * @default false\n\t */\n\texcludeFromTotal?: boolean;\n\n\t/**\n\t * Display data field for X value.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/#Data_fields} for more info\n\t */\n\tvalueXShow?: \"valueXWorking\" | \"valueXChange\" | \"valueXChangePercent\" | \"valueXChangeSelection\" | \"valueXChangeSelectionPercent\" | \"valueXChangePrevious\" | \"valueXChangePreviousPercent\" | \"valueXTotal\" | \"valueXTotalPercent\" | \"valueXSum\";\n\n\t/**\n\t * Display data field for Y value.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/#Data_fields} for more info\n\t */\n\tvalueYShow?: \"valueYWorking\" | \"valueYChange\" | \"valueYChangePercent\" | \"valueYChangeSelection\" | \"valueYChangeSelectionPercent\" | \"valueYChangePrevious\" | \"valueYChangePreviousPercent\" | \"valueYTotal\" | \"valueYTotalPercent\" | \"valueYSum\";\n\n\t/**\n\t * Indicates what aggregate value to use for collective data item, when\n\t * aggregating X values from several data items.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/date-axis/#Dynamic_data_item_grouping} for more info\n\t */\n\tvalueXGrouped?: \"open\" | \"close\" | \"low\" | \"high\" | \"average\" | \"sum\" | \"extreme\";\n\n\t/**\n\t * Indicates what aggregate value to use for collective data item, when\n\t * aggregating X values from several data items.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/date-axis/#Dynamic_data_item_grouping} for more info\n\t */\n\tvalueYGrouped?: \"open\" | \"close\" | \"low\" | \"high\" | \"average\" | \"sum\" | \"extreme\";\n\n\t/**\n\t * Input data field for X open value.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/#Data_fields} for more info\n\t */\n\topenValueXField?: string;\n\n\t/**\n\t * Input data field for X open value.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/#Data_fields} for more info\n\t */\n\topenValueYField?: string;\n\n\t/**\n\t * Display data field for X open value.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/#Data_fields} for more info\n\t */\n\topenValueXShow?: \"openValueXWorking\" | \"openValueXChange\" | \"openValueXChangePercent\" | \"openValueXChangeSelection\" | \"openValueXChangeSelectionPercent\" | \"openValueXChangePrevious\" | \"openValueXChangePreviousPercent\";\n\n\t/**\n\t * Display data field for Y open value.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/#Data_fields} for more info\n\t */\n\topenValueYShow?: \"openValueYWorking\" | \"openValueYChange\" | \"openValueYChangePercent\" | \"openValueYChangeSelection\" | \"openValueYChangeSelectionPercent\" | \"openValueYChangePrevious\" | \"openValueYChangePreviousPercent\";\n\n\t/**\n\t * Display data field for Y open value.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/date-axis/#Dynamic_data_item_grouping} for more info\n\t */\n\topenValueXGrouped?: \"open\" | \"close\" | \"low\" | \"high\" | \"average\" | \"sum\" | \"extreme\";\n\n\t/**\n\t * Display data field for Y open value.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/date-axis/#Dynamic_data_item_grouping} for more info\n\t */\n\topenValueYGrouped?: \"open\" | \"close\" | \"low\" | \"high\" | \"average\" | \"sum\" | \"extreme\";\n\n\n\n\t/**\n\t * Input data field for X low value.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/candlestick-series/} for more info\n\t */\n\tlowValueXField?: string;\n\n\t/**\n\t * Input data field for Y low value.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/candlestick-series/} for more info\n\t */\n\tlowValueYField?: string;\n\n\t/**\n\t * Input data field for X high value.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/candlestick-series/} for more info\n\t */\n\thighValueXField?: string;\n\n\t/**\n\t * Input data field for Y high value.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/candlestick-series/} for more info\n\t */\n\thighValueYField?: string;\n\n\t/**\n\t * Display data field for X low value.\n\t */\n\tlowValueXShow?: \"lowValueXWorking\" | \"lowValueXChange\" | \"lowValueXChangePercent\" | \"lowValueXChangeSelection\" | \"lowValueXChangeSelectionPercent\" | \"lowValueXChangePrevious\" | \"lowValueXChangePreviousPercent\";\n\n\t/**\n\t * Display data field for Y low value.\n\t */\n\tlowValueYShow?: \"lowValueYWorking\" | \"lowValueYChange\" | \"lowValueYChangePercent\" | \"lowValueYChangeSelection\" | \"lowValueYChangeSelectionPercent\" | \"lowValueYChangePrevious\" | \"lowValueYChangePreviousPercent\";\n\n\t/**\n\t * Indicates what aggregate value to use for collective data item, when\n\t * aggregating X low values from several data items.\n\t */\n\tlowValueXGrouped?: \"open\" | \"close\" | \"low\" | \"high\" | \"average\" | \"sum\" | \"extreme\";\n\n\t/**\n\t * Indicates what aggregate value to use for collective data item, when\n\t * aggregating Y low values from several data items.\n\t */\n\tlowValueYGrouped?: \"open\" | \"close\" | \"low\" | \"high\" | \"average\" | \"sum\" | \"extreme\";\n\n\t/**\n\t * Display data field for X high value.\n\t */\n\thighValueXShow?: \"highValueXWorking\" | \"highValueXChange\" | \"highValueXChangePercent\" | \"highValueXChangeSelection\" | \"highValueXChangeSelectionPercent\" | \"highValueXChangePrevious\" | \"highValueXChangePreviousPercent\";\n\n\t/**\n\t * Display data field for Y low value.\n\t */\n\thighValueYShow?: \"highValueYWorking\" | \"highValueYChange\" | \"highValueYChangePercent\" | \"highValueYChangeSelection\" | \"highValueYChangeSelectionPercent\" | \"highValueYChangePrevious\" | \"highValueYChangePreviousPercent\";\n\n\t/**\n\t * Indicates what aggregate value to use for collective data item, when\n\t * aggregating X high values from several data items.\n\t */\n\thighValueXGrouped?: \"open\" | \"close\" | \"high\" | \"high\" | \"average\" | \"sum\" | \"extreme\";\n\n\t/**\n\t * Indicates what aggregate value to use for collective data item, when\n\t * aggregating X high values from several data items.\n\t */\n\thighValueYGrouped?: \"open\" | \"close\" | \"high\" | \"high\" | \"average\" | \"sum\" | \"extreme\";\n\n\t/**\n\t * Horizontal location of the low data point relative to its cell.\n\t *\n\t * `0` - beginning, `0.5` - middle, `1` - end.\n\t *\n\t * @default 0.5\n\t */\n\tlowLocationX?: number;\n\n\t/**\n\t * Vertical location of the low data point relative to its cell.\n\t *\n\t * `0` - beginning, `0.5` - middle, `1` - end.\n\t *\n\t * @default 0.5\n\t */\n\tlowLocationY?: number;\n\n\t/**\n\t * Horizontal location of the high data point relative to its cell.\n\t *\n\t * `0` - beginning, `0.5` - middle, `1` - end.\n\t *\n\t * @default 0.5\n\t */\n\thighLocationX?: number;\n\n\t/**\n\t * Vertical location of the high data point relative to its cell.\n\t *\n\t * `0` - beginning, `0.5` - middle, `1` - end.\n\t *\n\t * @default 0.5\n\t */\n\thighLocationY?: number;\n\n\n\t/**\n\t * Input data field for X category.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/#Data_fields} for more info\n\t */\n\tcategoryXField?: string;\n\n\t/**\n\t * Input data field for Y category.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/#Data_fields} for more info\n\t */\n\tcategoryYField?: string;\n\n\t/**\n\t * Display data field for X category.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/#Data_fields} for more info\n\t */\n\topenCategoryXField?: string;\n\n\t/**\n\t * Display data field for Y category.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/#Data_fields} for more info\n\t */\n\topenCategoryYField?: string;\n\n\t/**\n\t * If set to `true` this series will be ignored when calculating scale of the\n\t * related axes.\n\t *\n\t * @default false\n\t */\n\tignoreMinMax?: boolean;\n\n\t/**\n\t * @ignore\n\t */\n\tvcx?: number;\n\n\t/**\n\t * @ignore\n\t */\n\tvcy?: number;\n\n\t/**\n\t * Horizontal location of the data point relative to its cell.\n\t *\n\t * `0` - beginning, `0.5` - middle, `1` - end.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/line-series/#Data_item_location} for more info\n\t * @default 0.5\n\t */\n\tlocationX?: number;\n\n\t/**\n\t * Vertical location of the data point relative to its cell.\n\t *\n\t * `0` - beginning, `0.5` - middle, `1` - end.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/line-series/#Data_item_location} for more info\n\t * @default 0.5\n\t */\n\tlocationY?: number;\n\n\t/**\n\t * Horizontal location of the open data point relative to its cell.\n\t *\n\t * `0` - beginning, `0.5` - middle, `1` - end.\n\t *\n\t * @default 0.5\n\t */\n\topenLocationX?: number;\n\n\t/**\n\t * Vertical location of the open data point relative to its cell.\n\t *\n\t * `0` - beginning, `0.5` - middle, `1` - end.\n\t *\n\t * @default 0.5\n\t */\n\topenLocationY?: number;\n\n\t/**\n\t * If set to `true` [[XYCursor]] will show closest data item from series\n\t * even if it is outside currently hovered date axis interval.\n\t *\n\t * This setting is relevant only if `baseAxis` is a date axis.\n\t */\n\tsnapTooltip?: boolean;\n\n\t/**\n\t * Text to use for series legend label when no particular category/interval\n\t * is selected.\n\t */\n\tlegendRangeLabelText?: string;\n\n\t/**\n\t * Text to use for series legend value label when no particular\n\t * category/interval is selected.\n\t */\n\tlegendRangeValueText?: string;\n\n\n\t/**\n\t * If set to `true`, series bullets will be masked by plot area.\n\t */\n\tmaskBullets?: boolean;\n\n\t/**\n\t * Whether series' tooltip should inherit its color from series or its first\n\t * bullet.\n\t *\n\t * @default \"series\"\n\t */\n\tseriesTooltipTarget?: \"series\" | \"bullet\";\n\n\t/**\n\t * Indicates horizontal position at which to show series' tooltip at.\n\t *\n\t * @default \"value\"\n\t * @since 5.0.16\n\t */\n\ttooltipPositionX?: \"open\" | \"value\" | \"low\" | \"high\";\n\n\t/**\n\t * Indicates vertical position at which to show series' tooltip at.\n\t *\n\t * @default \"value\"\n\t * @since 5.0.16\n\t */\n\ttooltipPositionY?: \"open\" | \"value\" | \"low\" | \"high\";\n\n\n\t/**\n\t * If set to `true` data items for this series won't be grouped even if\n\t * the `groupData: true` is set on a related [[DateAxis]].\n\t * \n\t * @since 5.0.19\n\t */\n\tgroupDataDisabled?: boolean;\n\n\t/**\n\t * A [[DataItem]] that is being used for current tooltip, e.g. by a chart\n\t * cursor.\n\t *\n\t * @since 5.1.2\n\t */\n\ttooltipDataItem?: DataItem\n\n\t/**\n\t * If set to `true`, when data is grouped, the `originals` setting of the\n\t * group data items will be populated by the original (source) data items\n\t * that fall into the group.\n\t *\n\t * Please note that if `groupDataCallback` is set, this setting is ignored\n\t * as originals will always be included, regardless of the value.\n\t *\n\t * @since 5.1.11\n\t * @default false\n\t */\n\tgroupDataWithOriginals?: boolean;\n\n\t/**\n\t * A custom function to call when grouping data items.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/date-axis/#Custom_aggregation_functions} for more info\n\t * @since 5.1.11\n\t */\n\tgroupDataCallback?: (dataItem: DataItem, interval: ITimeInterval) => void;\n\n}\n\nexport interface IXYSeriesPrivate extends ISeriesPrivate {\n\n\tminX?: number;\n\tmaxX?: number;\n\n\tminY?: number;\n\tmaxY?: number;\n\n\tselectionMinX?: number;\n\tselectionMaxX?: number;\n\n\tselectionMinY?: number;\n\tselectionMaxY?: number;\n\n\tvalueXAverage?: number;\n\tvalueXCount?: number;\n\tvalueXSum?: number;\n\tvalueXAbsoluteSum?: number;\n\tvalueXLow?: number;\n\tvalueXHigh?: number;\n\tvalueXOpen?: number;\n\tvalueXClose?: number;\n\n\tvalueYAverage?: number;\n\tvalueYCount?: number;\n\tvalueYSum?: number;\n\tvalueYAbsoluteSum?: number;\n\tvalueYLow?: number;\n\tvalueYHigh?: number;\n\tvalueYOpen?: number;\n\tvalueYClose?: number;\n\n\tvalueXAverageSelection?: number;\n\tvalueXCountSelection?: number;\n\tvalueXSumSelection?: number;\n\tvalueXAbsoluteSumSelection?: number;\n\tvalueXLowSelection?: number;\n\tvalueXHighSelection?: number;\n\tvalueXOpenSelection?: number;\n\tvalueXCloseSelection?: number;\n\n\tvalueYAverageSelection?: number;\n\tvalueYCountSelection?: number;\n\tvalueYSumSelection?: number;\n\tvalueYAbsoluteSumSelection?: number;\n\tvalueYLowSelection?: number;\n\tvalueYHighSelection?: number;\n\tvalueYOpenSelection?: number;\n\tvalueYCloseSelection?: number;\n\n\topenValueXAverage?: number;\n\topenValueXCount?: number;\n\topenValueXSum?: number;\n\topenValueXAbsoluteSum?: number;\n\topenValueXLow?: number;\n\topenValueXHigh?: number;\n\topenValueXOpen?: number;\n\topenValueXClose?: number;\n\n\topenValueYAverage?: number;\n\topenValueYCount?: number;\n\topenValueYSum?: number;\n\topenValueYAbsoluteSum?: number;\n\topenValueYLow?: number;\n\topenValueYHigh?: number;\n\topenValueYOpen?: number;\n\topenValueYClose?: number;\n\n\topenValueXAverageSelection?: number;\n\topenValueXCountSelection?: number;\n\topenValueXSumSelection?: number;\n\topenValueXAbsoluteSumSelection?: number;\n\topenValueXLowSelection?: number;\n\topenValueXHighSelection?: number;\n\topenValueXOpenSelection?: number;\n\topenValueXCloseSelection?: number;\n\n\topenValueYAverageSelection?: number;\n\topenValueYCountSelection?: number;\n\topenValueYSumSelection?: number;\n\topenValueYAbsoluteSumSelection?: number;\n\topenValueYLowSelection?: number;\n\topenValueYHighSelection?: number;\n\topenValueYOpenSelection?: number;\n\topenValueYCloseSelection?: number;\n\n\tlowValueXAverage?: number;\n\tlowValueXCount?: number;\n\tlowValueXSum?: number;\n\tlowValueXAbsoluteSum?: number;\n\tlowValueXLow?: number;\n\tlowValueXHigh?: number;\n\tlowValueXlow?: number;\n\tlowValueXClose?: number;\n\n\tlowValueYAverage?: number;\n\tlowValueYCount?: number;\n\tlowValueYSum?: number;\n\tlowValueYAbsoluteSum?: number;\n\tlowValueYLow?: number;\n\tlowValueYHigh?: number;\n\tlowValueYlow?: number;\n\tlowValueYClose?: number;\n\n\tlowValueXAverageSelection?: number;\n\tlowValueXCountSelection?: number;\n\tlowValueXSumSelection?: number;\n\tlowValueXAbsoluteSumSelection?: number;\n\tlowValueXLowSelection?: number;\n\tlowValueXHighSelection?: number;\n\tlowValueXlowSelection?: number;\n\tlowValueXCloseSelection?: number;\n\n\tlowValueYAverageSelection?: number;\n\tlowValueYCountSelection?: number;\n\tlowValueYSumSelection?: number;\n\tlowValueYAbsoluteSumSelection?: number;\n\tlowValueYLowSelection?: number;\n\tlowValueYHighSelection?: number;\n\tlowValueYlowSelection?: number;\n\tlowValueYCloseSelection?: number;\n\n\thighValueXAverage?: number;\n\thighValueXCount?: number;\n\thighValueXSum?: number;\n\thighValueXAbsoluteSum?: number;\n\thighValueXLow?: number;\n\thighValueXHigh?: number;\n\thighValueXhigh?: number;\n\thighValueXClose?: number;\n\n\thighValueYAverage?: number;\n\thighValueYCount?: number;\n\thighValueYSum?: number;\n\thighValueYAbsoluteSum?: number;\n\thighValueYLow?: number;\n\thighValueYHigh?: number;\n\thighValueYhigh?: number;\n\thighValueYClose?: number;\n\n\thighValueXAverageSelection?: number;\n\thighValueXCountSelection?: number;\n\thighValueXSumSelection?: number;\n\thighValueXAbsoluteSumSelection?: number;\n\thighValueXLowSelection?: number;\n\thighValueXHighSelection?: number;\n\thighValueXhighSelection?: number;\n\thighValueXCloseSelection?: number;\n\n\thighValueYAverageSelection?: number;\n\thighValueYCountSelection?: number;\n\thighValueYSumSelection?: number;\n\thighValueYAbsoluteSumSelection?: number;\n\thighValueYLowSelection?: number;\n\thighValueYHighSelection?: number;\n\thighValueYhighSelection?: number;\n\thighValueYCloseSelection?: number;\n\n\toutOfSelection?: boolean;\n\n\tdoNotUpdateLegend?: boolean;\n}\n\n\n/**\n * A base class for all XY chart series.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/} for more info\n */\nexport abstract class XYSeries extends Series {\n\tpublic static className: string = \"XYSeries\";\n\tpublic static classNames: Array = Series.classNames.concat([XYSeries.className]);\n\n\tdeclare public _settings: IXYSeriesSettings;\n\tdeclare public _privateSettings: IXYSeriesPrivate;\n\tdeclare public _dataItemSettings: IXYSeriesDataItem;\n\tdeclare public _axisRangeType: IXYSeriesAxisRange;\n\tdeclare public _events: IXYSeriesEvents;\n\n\tprotected _xField!: string;\n\tprotected _yField!: string;\n\tprotected _xOpenField!: string;\n\tprotected _yOpenField!: string;\n\n\tprotected _xLowField!: string;\n\tprotected _xHighField!: string;\n\tprotected _yLowField!: string;\n\tprotected _yHighField!: string;\n\n\tprotected _axesDirty: boolean = false;\n\tpublic _stackDirty: boolean = false;\n\n\tprotected _selectionProcessed = false;\n\n\tdeclare public chart: XYChart | undefined;\n\n\tpublic _dataSets: { [index: string]: Array> } = {};\n\n\tpublic _mainContainerMask: Graphics | undefined;\n\n\tprotected _x: number = 0;\n\tprotected _y: number = 0;\n\n\tpublic _bullets: { [index: string]: Sprite } = {};\n\n\t/**\n\t * A [[Container]] that us used to put series' elements in.\n\t *\n\t * @default Container.new()\n\t */\n\tpublic readonly mainContainer: Container = this.children.push(Container.new(this._root, {}));\n\n\t/**\n\t * A list of axis ranges that affect the series.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/axis-ranges/} for more info\n\t */\n\tpublic readonly axisRanges: List = new List();\n\n\tprotected _skipped: boolean = false;\n\n\tprotected _couldStackTo: Array = [];\n\n\tprotected _reallyStackedTo: { [index: number]: XYSeries } = {};\n\n\tpublic _stackedSeries: { [index: number]: XYSeries } = {};\n\n\tprotected _aLocationX0: number = 0;\n\tprotected _aLocationX1: number = 1;\n\tprotected _aLocationY0: number = 0;\n\tprotected _aLocationY1: number = 1;\n\n\tprotected _showBullets: boolean = true;\n\n\tprotected valueXFields = [\n\t\t\"valueX\",\n\t\t\"openValueX\",\n\t\t\"lowValueX\",\n\t\t\"highValueX\"\n\t];\n\n\tprotected valueYFields = [\n\t\t\"valueY\",\n\t\t\"openValueY\",\n\t\t\"lowValueY\",\n\t\t\"highValueY\"\n\t];\n\n\tpublic _valueXFields!: Array;\n\tpublic _valueYFields!: Array;\n\n\t// used for full min/max\n\tprotected _valueXShowFields!: Array;\n\tprotected _valueYShowFields!: Array;\n\n\t// used for selection (uses working)\n\tpublic __valueXShowFields!: Array;\n\tpublic __valueYShowFields!: Array;\n\n\tprotected _emptyDataItem = new DataItem(this, undefined, {});\n\n\tpublic _dataSetId?: string;\n\n\tprotected _tooltipFieldX?: string;\n\tprotected _tooltipFieldY?: string;\n\n\tpublic _posXDp?: IDisposer;\n\tpublic _posYDp?: IDisposer;\n\n\tprotected _afterNew() {\n\t\tthis.fields.push(\"categoryX\", \"categoryY\", \"openCategoryX\", \"openCategoryY\");\n\t\tthis.valueFields.push(\"valueX\", \"valueY\", \"openValueX\", \"openValueY\", \"lowValueX\", \"lowValueY\", \"highValueX\", \"highValueY\");\n\n\t\tthis._setRawDefault(\"vcx\", 1);\n\t\tthis._setRawDefault(\"vcy\", 1);\n\t\t// this can't go to themes, as data might be parsed before theme\n\t\tthis._setRawDefault(\"valueXShow\", \"valueXWorking\");\n\t\tthis._setRawDefault(\"valueYShow\", \"valueYWorking\");\n\n\t\tthis._setRawDefault(\"openValueXShow\", \"openValueXWorking\");\n\t\tthis._setRawDefault(\"openValueYShow\", \"openValueYWorking\");\n\n\t\tthis._setRawDefault(\"lowValueXShow\", \"lowValueXWorking\");\n\t\tthis._setRawDefault(\"lowValueYShow\", \"lowValueYWorking\");\n\n\t\tthis._setRawDefault(\"highValueXShow\", \"highValueXWorking\");\n\t\tthis._setRawDefault(\"highValueYShow\", \"highValueYWorking\");\n\n\t\tthis._setRawDefault(\"lowValueXGrouped\", \"low\");\n\t\tthis._setRawDefault(\"lowValueYGrouped\", \"low\");\n\n\t\tthis._setRawDefault(\"highValueXGrouped\", \"high\");\n\t\tthis._setRawDefault(\"highValueYGrouped\", \"high\");\n\n\n\n\t\tsuper._afterNew();\n\n\t\tthis.set(\"maskContent\", true);\n\n\t\tthis._disposers.push(this.axisRanges.events.onAll((change) => {\n\t\t\tif (change.type === \"clear\") {\n\t\t\t\t$array.each(change.oldValues, (axisRange) => {\n\t\t\t\t\tthis._removeAxisRange(axisRange);\n\t\t\t\t});\n\t\t\t} else if (change.type === \"push\") {\n\t\t\t\tthis._processAxisRange(change.newValue);\n\t\t\t} else if (change.type === \"setIndex\") {\n\t\t\t\tthis._processAxisRange(change.newValue);\n\t\t\t} else if (change.type === \"insertIndex\") {\n\t\t\t\tthis._processAxisRange(change.newValue);\n\t\t\t} else if (change.type === \"removeIndex\") {\n\t\t\t\tthis._removeAxisRange(change.oldValue);\n\t\t\t} else if (change.type === \"moveIndex\") {\n\t\t\t\tthis._processAxisRange(change.value);\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Unknown IStreamEvent type\");\n\t\t\t}\n\t\t}))\n\n\t\tthis.states.create(\"hidden\", { opacity: 1, visible: false });\n\n\t\tthis.onPrivate(\"startIndex\", ()=>{\n\t\t\tthis.root.events.once(\"frameended\", ()=>{\n\t\t\t\tthis.updateLegendValue();\t\t\t\n\t\t\t})\t\t\t\n\t\t})\n\n\t\tthis.onPrivate(\"endIndex\", ()=>{\t\t\t\n\t\t\tthis.root.events.once(\"frameended\", ()=>{\n\t\t\t\tthis.updateLegendValue();\t\t\t\n\t\t\t})\n\t\t})\t\t\n\n\t\tthis._makeFieldNames();\n\t}\n\n\tprotected _processAxisRange(axisRange: this[\"_axisRangeType\"]) {\n\t\tconst container = Container.new(this._root, {});\n\t\taxisRange.container = container;\n\t\tthis.children.push(container);\n\n\t\taxisRange.series = this;\n\n\t\tconst axisDataItem = axisRange.axisDataItem;\n\t\taxisDataItem.setRaw(\"isRange\", true);\n\n\t\tconst axis = >axisDataItem.component;\n\t\tif (axis) {\n\t\t\taxis._processAxisRange(axisDataItem, [\"range\", \"series\"]);\n\n\t\t\tconst bullet = axisDataItem.get(\"bullet\");\n\t\t\tif (bullet) {\n\t\t\t\tconst sprite = bullet.get(\"sprite\");\n\t\t\t\tif (sprite) {\n\t\t\t\t\tsprite.setPrivate(\"visible\", false);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst axisFill = axisDataItem.get(\"axisFill\");\n\t\t\tif (axisFill) {\n\t\t\t\tcontainer.set(\"mask\", axisFill);\n\t\t\t}\n\t\t\taxis._seriesAxisRanges.push(axisDataItem);\n\t\t}\n\t}\n\n\tprotected _removeAxisRange(axisRange: this[\"_axisRangeType\"]) {\n\t\tconst axisDataItem = axisRange.axisDataItem;\n\t\tconst axis = >axisDataItem.component;\n\t\taxis.disposeDataItem(axisDataItem);\n\n\t\t$array.remove(axis._seriesAxisRanges, axisDataItem);\n\n\t\tconst container = axisRange.container;\n\t\tif (container) {\n\t\t\tcontainer.dispose();\n\t\t}\n\t}\n\n\tprotected _updateFields() {\n\t\tsuper._updateFields();\n\n\t\tthis._valueXFields = [];\n\t\tthis._valueYFields = [];\n\t\tthis._valueXShowFields = [];\n\t\tthis._valueYShowFields = [];\n\n\t\tthis.__valueXShowFields = [];\n\t\tthis.__valueYShowFields = [];\n\n\t\tif (this.valueXFields) {\n\t\t\t$array.each(this.valueXFields as Array, (key) => {\n\t\t\t\tconst field = this.get((key + \"Field\"));\n\t\t\t\tif (field) {\n\t\t\t\t\tthis._valueXFields.push(key);\n\t\t\t\t\tlet field = this.get((key + \"Show\"));\n\t\t\t\t\tthis.__valueXShowFields.push(field);\n\n\t\t\t\t\tif (field.indexOf(\"Working\") != -1) {\n\t\t\t\t\t\tthis._valueXShowFields.push(field.split(\"Working\")[0]);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis._valueXShowFields.push(field);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tif (this.valueYFields) {\n\t\t\t$array.each(this.valueYFields as Array, (key) => {\n\t\t\t\tconst field = this.get((key + \"Field\"));\n\n\t\t\t\tif (field) {\n\t\t\t\t\tthis._valueYFields.push(key);\n\t\t\t\t\tlet field = this.get((key + \"Show\"));\n\t\t\t\t\tthis.__valueYShowFields.push(field);\n\n\t\t\t\t\tif (field.indexOf(\"Working\") != -1) {\n\t\t\t\t\t\tthis._valueYShowFields.push(field.split(\"Working\")[0]);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis._valueYShowFields.push(field);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tprotected _dispose() {\n\t\tsuper._dispose();\n\n\t\tthis._bullets = {};\n\t\tconst chart = this.chart;\n\t\tif (chart) {\n\t\t\tchart.series.removeValue(this);\n\t\t}\n\n\t\t$array.removeFirst(this.get(\"xAxis\").series, this);\n\t\t$array.removeFirst(this.get(\"yAxis\").series, this);\n\t}\n\n\t// TODO use SelectKeys\n\tprotected _min(key: Key, value: number | undefined) {\n\t\tlet newValue = min(this.getPrivate(key) as any, value);\n\t\tthis.setPrivate(key, newValue as any);\n\t}\n\n\t// TODO use SelectKeys\n\tprotected _max(key: Key, value: number | undefined) {\n\t\tlet newValue = max(this.getPrivate(key) as any, value);\n\t\tthis.setPrivate(key, newValue as any);\n\t}\n\n\tprotected _shouldMakeBullet(dataItem: DataItem): boolean {\n\n\t\tconst xAxis = this.get(\"xAxis\");\n\t\tconst yAxis = this.get(\"yAxis\");\n\t\tconst baseAxis = this.get(\"baseAxis\");\n\n\t\tif (!xAxis.inited || !yAxis.inited) {\n\t\t\treturn false\n\t\t}\n\t\tconst minBulletDistance = this.get(\"minBulletDistance\", 0);\n\t\tif (minBulletDistance > 0) {\n\t\t\tlet startIndex = this.startIndex();\n\t\t\tlet endIndex = this.endIndex();\n\n\t\t\tlet count = endIndex - startIndex;\n\n\t\t\tif (xAxis == baseAxis) {\n\t\t\t\tif (xAxis.get(\"renderer\").axisLength() / count < minBulletDistance / 5) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (yAxis == baseAxis) {\n\t\t\t\tif (yAxis.get(\"renderer\").axisLength() / count < minBulletDistance / 5) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (dataItem.get(this._xField as any) != null && dataItem.get(this._yField as any) != null) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprotected _makeFieldNames() {\n\t\tconst xAxis = this.get(\"xAxis\");\n\t\tconst yAxis = this.get(\"yAxis\");\n\t\tconst xName = xAxis.getPrivate(\"name\")!;\n\t\tconst xCapName = $utils.capitalizeFirst(xName);\n\n\t\tconst yName = yAxis.getPrivate(\"name\")!;\n\t\tconst yCapName = $utils.capitalizeFirst(yName);\n\n\t\tconst xLetter = xAxis.get(\"renderer\").getPrivate(\"letter\")!\n\t\tconst yLetter = yAxis.get(\"renderer\").getPrivate(\"letter\")!\n\n\t\tconst open = \"open\";\n\t\tconst low = \"low\";\n\t\tconst high = \"high\";\n\t\tconst show = \"Show\";\n\n\t\tif (xAxis.className === \"ValueAxis\") {\n\t\t\tthis._xField = this.get((xName + xLetter! + show));\n\t\t\tthis._xOpenField = this.get((open + xCapName + xLetter! + show));\n\t\t\tthis._xLowField = this.get((low + xCapName + xLetter! + show));\n\t\t\tthis._xHighField = this.get((high + xCapName + xLetter! + show));\n\t\t}\n\t\telse {\n\t\t\tthis._xField = (xName + xLetter!);\n\t\t\tthis._xOpenField = (open + xCapName + xLetter!);\n\t\t\tthis._xLowField = (low + xCapName + xLetter!);\n\t\t\tthis._xHighField = (high + xCapName + xLetter!);\n\t\t}\n\n\t\tif (yAxis.className === \"ValueAxis\") {\n\t\t\tthis._yField = this.get((yName + yLetter! + show));\n\t\t\tthis._yOpenField = this.get((open + yCapName + yLetter! + show));\n\t\t\tthis._yLowField = this.get((low + yCapName + yLetter! + show));\n\t\t\tthis._yHighField = this.get((high + yCapName + yLetter! + show));\n\t\t}\n\t\telse {\n\t\t\tthis._yField = (yName + yLetter!);\n\t\t\tthis._yOpenField = (open + yCapName + yLetter!);\n\t\t\tthis._yLowField = (low + yCapName + yLetter!);\n\t\t\tthis._yHighField = (high + yCapName + yLetter!);\n\t\t}\n\t}\n\n\tprotected _fixVC() {\n\t\tconst xAxis = this.get(\"xAxis\");\n\t\tconst yAxis = this.get(\"yAxis\");\n\t\tconst baseAxis = this.get(\"baseAxis\");\n\t\tconst hiddenState = this.states.lookup(\"hidden\");\n\t\tconst sequencedInterpolation = this.get(\"sequencedInterpolation\");\n\n\t\tif (hiddenState) {\n\t\t\tlet value = 0;\n\t\t\tif (sequencedInterpolation) {\n\t\t\t\tvalue = 0.999999999999; // makes animate, good for stacked\n\t\t\t}\n\n\t\t\tif (xAxis === baseAxis) {\n\t\t\t\thiddenState.set(\"vcy\", value);\n\t\t\t}\n\t\t\telse if (yAxis === baseAxis) {\n\t\t\t\thiddenState.set(\"vcx\", value);\n\t\t\t}\n\t\t\telse {\n\t\t\t\thiddenState.set(\"vcy\", value);\n\t\t\t\thiddenState.set(\"vcx\", value);\n\t\t\t}\n\t\t}\n\t}\n\n\n\tprotected _handleMaskBullets() {\n\t\tif (this.isDirty(\"maskBullets\")) {\n\t\t\tthis.bulletsContainer.set(\"maskContent\", this.get(\"maskBullets\"));\n\t\t}\n\t}\n\n\tpublic _fixPosition() {\n\t\tconst xAxis = this.get(\"xAxis\");\n\t\tconst yAxis = this.get(\"yAxis\");\n\n\t\tthis.set(\"x\", xAxis.x() - $utils.relativeToValue(xAxis.get(\"centerX\", 0), xAxis.width()) - xAxis.parent!.get(\"paddingLeft\", 0));\n\t\tthis.set(\"y\", yAxis.y() - $utils.relativeToValue(yAxis.get(\"centerY\", 0), yAxis.height()) - yAxis.parent!.get(\"paddingTop\", 0));\n\n\t\tthis.bulletsContainer.set(\"y\", this.y());\n\t\tthis.bulletsContainer.set(\"x\", this.x());\n\t}\n\n\n\tpublic _prepareChildren() {\n\t\tsuper._prepareChildren();\n\n\t\tthis._bullets = {};\n\n\t\tif (this.isDirty(\"valueYShow\") || this.isDirty(\"valueXShow\") || this.isDirty(\"openValueYShow\") || this.isDirty(\"openValueXShow\") || this.isDirty(\"lowValueYShow\") || this.isDirty(\"lowValueXShow\") || this.isDirty(\"highValueYShow\") || this.isDirty(\"highValueXShow\")) {\n\t\t\tthis._updateFields();\n\t\t\tthis._makeFieldNames();\n\t\t\tthis._valuesDirty = true;\n\t\t}\n\n\t\tif (this.isDirty(\"xAxis\") || this.isDirty(\"yAxis\")) {\n\t\t\tthis._valuesDirty = true;\n\t\t}\n\n\t\tthis.set(\"width\", this.get(\"xAxis\").width());\n\t\tthis.set(\"height\", this.get(\"yAxis\").height());\n\n\t\tthis._handleMaskBullets();\n\n\t\tconst xAxis = this.get(\"xAxis\");\n\t\tconst yAxis = this.get(\"yAxis\");\n\t\tconst baseAxis = this.get(\"baseAxis\");\n\n\t\tconst tooltipPositionX = this.get(\"tooltipPositionX\");\n\t\tlet tooltipFieldX: string;\n\n\t\tswitch (tooltipPositionX) {\n\t\t\tcase \"open\":\n\t\t\t\ttooltipFieldX = this._xOpenField;\n\t\t\t\tbreak;\n\t\t\tcase \"low\":\n\t\t\t\ttooltipFieldX = this._xLowField;\n\t\t\t\tbreak;\n\t\t\tcase \"high\":\n\t\t\t\ttooltipFieldX = this._xHighField;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ttooltipFieldX = this._xField;\n\t\t}\n\t\tthis._tooltipFieldX = tooltipFieldX;\n\n\t\tconst tooltipPositionY = this.get(\"tooltipPositionY\");\n\t\tlet tooltipFieldY: string;\n\t\tswitch (tooltipPositionY) {\n\t\t\tcase \"open\":\n\t\t\t\ttooltipFieldY = this._yOpenField;\n\t\t\t\tbreak;\n\t\t\tcase \"low\":\n\t\t\t\ttooltipFieldY = this._yLowField;\n\t\t\t\tbreak;\n\t\t\tcase \"high\":\n\t\t\t\ttooltipFieldY = this._yHighField;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ttooltipFieldY = this._yField;\n\t\t}\n\t\tthis._tooltipFieldY = tooltipFieldY;\n\n\t\tif (this.isDirty(\"baseAxis\")) {\n\t\t\tthis._fixVC();\n\t\t}\n\n\n\t\tthis._fixPosition();\n\n\t\tconst stacked = this.get(\"stacked\");\n\n\t\tif (this.isDirty(\"stacked\")) {\n\t\t\tif (stacked) {\n\t\t\t\tif (this._valuesDirty && !this._dataProcessed) {\n\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis._stack();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis._unstack();\n\t\t\t}\n\t\t}\n\n\t\tif (this._valuesDirty && !this._dataProcessed) {\n\t\t\tthis._dataProcessed = true;\n\n\t\t\tif (stacked) {\n\t\t\t\tthis._stack();\n\t\t\t}\n\n\t\t\t$array.each(this.dataItems, (dataItem) => {\n\t\t\t\t$array.each(this._valueXShowFields, (key) => {\n\t\t\t\t\tlet value = dataItem.get(key);\n\t\t\t\t\tif (value != null) {\n\t\t\t\t\t\tif (stacked) {\n\t\t\t\t\t\t\tvalue += this.getStackedXValue(dataItem, key);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis._min(\"minX\", value);\n\t\t\t\t\t\tthis._max(\"maxX\", value);\n\t\t\t\t\t}\n\t\t\t\t})\n\n\t\t\t\t$array.each(this._valueYShowFields, (key) => {\n\t\t\t\t\tlet value = dataItem.get(key);\n\t\t\t\t\tif (value != null) {\n\t\t\t\t\t\tif (stacked) {\n\t\t\t\t\t\t\tvalue += this.getStackedYValue(dataItem, key);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis._min(\"minY\", value);\n\t\t\t\t\t\tthis._max(\"maxY\", value);\n\t\t\t\t\t}\n\t\t\t\t})\n\n\t\t\t\txAxis.processSeriesDataItem(dataItem, this._valueXFields);\n\t\t\t\tyAxis.processSeriesDataItem(dataItem, this._valueYFields);\n\t\t\t})\n\n\t\t\txAxis._seriesValuesDirty = true;\n\t\t\tyAxis._seriesValuesDirty = true;\n\n\t\t\tif (!this.get(\"ignoreMinMax\")) {\n\t\t\t\tif (this.isPrivateDirty(\"minX\") || this.isPrivateDirty(\"maxX\")) {\n\t\t\t\t\txAxis.markDirtyExtremes();\n\t\t\t\t}\n\t\t\t\tif (this.isPrivateDirty(\"minY\") || this.isPrivateDirty(\"maxY\")) {\n\t\t\t\t\tyAxis.markDirtyExtremes();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._markStakedDirtyStack();\n\n\t\t\t//this.updateLegendMarker(undefined); // causes legend marker to change color instantly when on\n\t\t\tif (!this.get(\"tooltipDataItem\")) {\n\t\t\t\tthis.updateLegendValue(undefined);\n\t\t\t}\n\t\t}\n\n\t\tif (this.isDirty(\"vcx\") || this.isDirty(\"vcy\")) {\n\t\t\tthis._markStakedDirtyStack();\n\t\t}\n\n\t\tif (!this._dataGrouped) {\n\t\t\txAxis._groupSeriesData(this);\n\t\t\tyAxis._groupSeriesData(this);\n\t\t\tthis._dataGrouped = true;\n\t\t}\n\n\t\tif (this._valuesDirty || this.isPrivateDirty(\"startIndex\") || this.isPrivateDirty(\"adjustedStartIndex\") || this.isPrivateDirty(\"endIndex\") || this.isDirty(\"vcx\") || this.isDirty(\"vcy\") || this._stackDirty || this._sizeDirty) {\n\t\t\tlet startIndex = this.startIndex();\n\t\t\tlet endIndex = this.endIndex();\n\t\t\tlet minBulletDistance = this.get(\"minBulletDistance\", 0);\n\t\t\tif (minBulletDistance > 0 && baseAxis) {\n\t\t\t\tif (baseAxis.get(\"renderer\").axisLength() / (endIndex - startIndex) > minBulletDistance) {\n\t\t\t\t\tthis._showBullets = true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis._showBullets = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ((this._psi != startIndex || this._pei != endIndex || this.isDirty(\"vcx\") || this.isDirty(\"vcy\") || this.isPrivateDirty(\"adjustedStartIndex\") || this._stackDirty || this._valuesDirty) && !this._selectionProcessed) {\n\t\t\t\tthis._selectionProcessed = true;\n\n\t\t\t\tconst vcx = this.get(\"vcx\", 1);\n\t\t\t\tconst vcy = this.get(\"vcy\", 1);\n\t\t\t\tconst stacked = this.get(\"stacked\", false);\n\t\t\t\tconst outOfSelection = this.getPrivate(\"outOfSelection\");\n\n\t\t\t\tif (baseAxis === xAxis || !baseAxis) {\n\t\t\t\t\tyAxis._calculateTotals();\n\t\t\t\t\tthis.setPrivateRaw(\"selectionMinY\", undefined);\n\t\t\t\t\tthis.setPrivateRaw(\"selectionMaxY\", undefined);\n\t\t\t\t\tif (!outOfSelection) {\n\t\t\t\t\t\tfor (let i = startIndex; i < endIndex; i++) {\n\t\t\t\t\t\t\tthis.processYSelectionDataItem(this.dataItems[i], vcy, stacked);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tyAxis.markDirtySelectionExtremes();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (baseAxis === yAxis || !baseAxis) {\n\t\t\t\t\txAxis._calculateTotals();\n\t\t\t\t\tthis.setPrivateRaw(\"selectionMinX\", undefined);\n\t\t\t\t\tthis.setPrivateRaw(\"selectionMaxX\", undefined);\n\t\t\t\t\tif (!outOfSelection) {\n\t\t\t\t\t\tfor (let i = startIndex; i < endIndex; i++) {\n\t\t\t\t\t\t\tthis.processXSelectionDataItem(this.dataItems[i], vcx, stacked);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tyAxis.markDirtySelectionExtremes();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (baseAxis === xAxis || !baseAxis) {\n\t\t\t\t\tif (this.get(\"valueYShow\") !== \"valueYWorking\") {\n\t\t\t\t\t\tconst selectionMinY = this.getPrivate(\"selectionMinY\");\n\t\t\t\t\t\tif (selectionMinY != null) {\n\t\t\t\t\t\t\tthis.setPrivateRaw(\"minY\", selectionMinY);\n\t\t\t\t\t\t\tyAxis.markDirtyExtremes();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst selectionMaxY = this.getPrivate(\"selectionMaxY\");\n\t\t\t\t\t\tif (selectionMaxY != null) {\n\t\t\t\t\t\t\tthis.setPrivateRaw(\"maxY\", selectionMaxY);\n\t\t\t\t\t\t\tyAxis.markDirtyExtremes();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (baseAxis === yAxis || !baseAxis) {\n\t\t\t\t\tif (this.get(\"valueXShow\") !== \"valueXWorking\") {\n\t\t\t\t\t\tconst selectionMinX = this.getPrivate(\"selectionMinX\");\n\t\t\t\t\t\tif (selectionMinX != null) {\n\t\t\t\t\t\t\tthis.setPrivateRaw(\"minX\", selectionMinX);\n\t\t\t\t\t\t\tyAxis.markDirtyExtremes();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst selectionMaxX = this.getPrivate(\"selectionMaxX\")\n\t\t\t\t\t\tif (selectionMaxX != null) {\n\t\t\t\t\t\t\tthis.setPrivateRaw(\"maxX\", selectionMaxX);\n\t\t\t\t\t\t\txAxis.markDirtyExtremes();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (this.isPrivateDirty(\"selectionMinX\") || this.isPrivateDirty(\"selectionMaxX\")) {\n\t\t\t\t\txAxis.markDirtySelectionExtremes();\n\t\t\t\t}\n\n\t\t\t\tif (this.isPrivateDirty(\"selectionMinY\") || this.isPrivateDirty(\"selectionMaxY\")) {\n\t\t\t\t\tyAxis.markDirtySelectionExtremes();\n\t\t\t\t}\n\t\t\t\t// this.updateLegendValue(undefined); flickers while panning\n\t\t\t}\n\t\t}\n\t}\n\n\n\tprotected _makeRangeMask() {\n\t\tif (this.axisRanges.length > 0) {\n\t\t\tlet mainContainerMask = this._mainContainerMask;\n\t\t\tif (mainContainerMask == null) {\n\t\t\t\tmainContainerMask = this.children.push(Graphics.new(this._root, {}));\n\t\t\t\tthis._mainContainerMask = mainContainerMask;\n\n\t\t\t\tmainContainerMask.set(\"draw\", (display, target) => {\n\t\t\t\t\tconst parent = this.parent;\n\t\t\t\t\tif (parent) {\n\t\t\t\t\t\tconst w = this._root.container.width();\n\t\t\t\t\t\tconst h = this._root.container.height();\n\t\t\t\t\t\tdisplay.moveTo(-w, -h);\n\t\t\t\t\t\tdisplay.lineTo(-w, h * 2);\n\t\t\t\t\t\tdisplay.lineTo(w * 2, h * 2);\n\t\t\t\t\t\tdisplay.lineTo(w * 2, -h);\n\t\t\t\t\t\tdisplay.lineTo(-w, -h);\n\n\n\t\t\t\t\t\tthis.axisRanges.each((axisRange) => {\n\t\t\t\t\t\t\tconst fill = axisRange.axisDataItem.get(\"axisFill\");\n\n\t\t\t\t\t\t\tif (parent) {\n\t\t\t\t\t\t\t\tif (fill) {\n\t\t\t\t\t\t\t\t\tlet draw = fill.get(\"draw\");\n\t\t\t\t\t\t\t\t\tif (draw) {\n\t\t\t\t\t\t\t\t\t\tdraw(display, target);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\tthis.mainContainer._display.mask = mainContainerMask!._display;\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tmainContainerMask.markDirty();\n\t\t\tmainContainerMask._markDirtyKey(\"fill\");\n\t\t}\n\t\telse {\n\t\t\tthis.mainContainer._display.mask = null;\n\t\t}\n\t}\n\n\n\tpublic _updateChildren() {\n\t\tsuper._updateChildren();\n\n\t\t// save for performance\n\t\tthis._x = this.x();\n\t\tthis._y = this.y();\n\t\tthis._makeRangeMask();\n\t}\n\n\tprotected _stack() {\n\t\tconst chart = this.chart;\n\t\tif (chart) {\n\t\t\tconst seriesIndex = chart.series.indexOf(this);\n\n\t\t\tthis._couldStackTo = [];\n\n\t\t\tif (seriesIndex > 0) {\n\t\t\t\tlet series: XYSeries;\n\n\t\t\t\tfor (let i = seriesIndex - 1; i >= 0; i--) {\n\t\t\t\t\tseries = chart.series.getIndex(i)!;\n\t\t\t\t\tif (series.get(\"xAxis\") === this.get(\"xAxis\") && series.get(\"yAxis\") === this.get(\"yAxis\") && series.className === this.className) {\n\t\t\t\t\t\tthis._couldStackTo.push(series);\n\t\t\t\t\t\tif (!series.get(\"stacked\")) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._stackDataItems();\n\t\t}\n\t}\n\n\tpublic _unstack() {\n\n\t\t$object.each(this._reallyStackedTo, (_key, value) => {\n\t\t\tdelete (value._stackedSeries[this.uid]);\n\t\t})\n\n\t\tthis._reallyStackedTo = {};\n\t\t$array.each(this.dataItems, (dataItem) => {\n\t\t\tdataItem.setRaw(\"stackToItemY\", undefined);\n\t\t\tdataItem.setRaw(\"stackToItemX\", undefined);\n\t\t})\n\t}\n\n\tprotected _stackDataItems() {\n\t\t// this works only with the same number of data @todo: search by date/category?\n\t\tconst baseAxis = this.get(\"baseAxis\");\n\t\tconst xAxis = this.get(\"xAxis\");\n\t\tconst yAxis = this.get(\"yAxis\");\n\n\t\tlet field: \"valueX\" | \"valueY\";\n\t\tlet stackToItemKey: \"stackToItemX\" | \"stackToItemY\";\n\t\tif (baseAxis === xAxis) {\n\t\t\tfield = \"valueY\";\n\t\t\tstackToItemKey = \"stackToItemY\";\n\t\t}\n\t\telse if (baseAxis === yAxis) {\n\t\t\tfield = \"valueX\";\n\t\t\tstackToItemKey = \"stackToItemX\";\n\t\t}\n\n\t\tlet len = this._couldStackTo.length;\n\t\tlet index = 0;\n\t\tconst stackToNegative = this.get(\"stackToNegative\");\n\n\t\tthis._reallyStackedTo = {};\n\n\t\t$array.each(this.dataItems, (dataItem) => {\n\t\t\tfor (let s = 0; s < len; s++) {\n\t\t\t\tlet stackToSeries = this._couldStackTo[s];\n\t\t\t\tlet stackToItem = stackToSeries.dataItems[index];\n\t\t\t\tlet value = dataItem.get(field);\n\n\t\t\t\tif (stackToItem) {\n\t\t\t\t\tlet stackValue = stackToItem.get(field);\n\t\t\t\t\tif (stackToNegative) {\n\t\t\t\t\t\tif ($type.isNumber(value)) {\n\t\t\t\t\t\t\tif ($type.isNumber(stackValue)) {\n\t\t\t\t\t\t\t\tif (value >= 0 && stackValue >= 0) {\n\t\t\t\t\t\t\t\t\tdataItem.setRaw(stackToItemKey, stackToItem);\n\t\t\t\t\t\t\t\t\tthis._reallyStackedTo[stackToSeries.uid] = stackToSeries;\n\t\t\t\t\t\t\t\t\tstackToSeries._stackedSeries[this.uid] = this;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (value < 0 && stackValue < 0) {\n\t\t\t\t\t\t\t\t\tdataItem.setRaw(stackToItemKey, stackToItem);\n\t\t\t\t\t\t\t\t\tthis._reallyStackedTo[stackToSeries.uid] = stackToSeries;\n\t\t\t\t\t\t\t\t\tstackToSeries._stackedSeries[this.uid] = this;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif ($type.isNumber(value) && $type.isNumber(stackValue)) {\n\t\t\t\t\t\t\tdataItem.setRaw(stackToItemKey, stackToItem);\n\t\t\t\t\t\t\tthis._reallyStackedTo[stackToSeries.uid] = stackToSeries;\n\t\t\t\t\t\t\tstackToSeries._stackedSeries[this.uid] = this;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tindex++;\n\t\t})\n\t}\n\n\tprotected processXSelectionDataItem(dataItem: DataItem, vcx: number, stacked: boolean) {\n\t\t$array.each(this.__valueXShowFields, (key) => {\n\t\t\tlet value = dataItem.get(key);\n\t\t\tif (value != null) {\n\t\t\t\tif (stacked) {\n\t\t\t\t\tvalue += this.getStackedXValueWorking(dataItem, key);\n\t\t\t\t}\n\n\t\t\t\tthis._min(\"selectionMinX\", value);\n\t\t\t\tthis._max(\"selectionMaxX\", value * vcx);\n\t\t\t}\n\t\t})\n\t}\n\n\tprotected processYSelectionDataItem(dataItem: DataItem, vcy: number, stacked: boolean) {\n\t\t$array.each(this.__valueYShowFields, (key) => {\n\n\t\t\tlet value = dataItem.get(key);\n\t\t\tif (value != null) {\n\t\t\t\tif (stacked) {\n\t\t\t\t\tvalue += this.getStackedYValueWorking(dataItem, key);\n\t\t\t\t}\n\n\t\t\t\tthis._min(\"selectionMinY\", value);\n\t\t\t\tthis._max(\"selectionMaxY\", value * vcy);\n\t\t\t}\n\t\t})\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic getStackedYValueWorking(dataItem: DataItem, key: string): number {\n\t\tconst stackToItem = dataItem.get(\"stackToItemY\");\n\n\t\tif (stackToItem) {\n\t\t\tconst stackedToSeries = stackToItem.component as XYSeries;\n\n\t\t\treturn stackToItem.get(key as any, 0) * stackedToSeries.get(\"vcy\", 1) + this.getStackedYValueWorking(stackToItem, key);\n\t\t}\n\t\treturn 0;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic getStackedXValueWorking(dataItem: DataItem, key: string): number {\n\t\tconst stackToItem = dataItem.get(\"stackToItemX\");\n\n\t\tif (stackToItem) {\n\t\t\tconst stackedToSeries = stackToItem.component as XYSeries;\n\t\t\treturn stackToItem.get(key as any, 0) * stackedToSeries.get(\"vcx\", 1) + this.getStackedXValueWorking(stackToItem, key);\n\t\t}\n\t\treturn 0;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic getStackedYValue(dataItem: DataItem, key: string): number {\n\t\tconst stackToItem = dataItem.get(\"stackToItemY\");\n\n\t\tif (stackToItem) {\n\t\t\treturn stackToItem.get(key as any, 0) + this.getStackedYValue(stackToItem, key);\n\t\t}\n\t\treturn 0;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic getStackedXValue(dataItem: DataItem, key: string): number {\n\t\tconst stackToItem = dataItem.get(\"stackToItemX\");\n\n\t\tif (stackToItem) {\n\t\t\treturn stackToItem.get(key as any, 0) + this.getStackedXValue(stackToItem, key);\n\t\t}\n\t\treturn 0;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic createLegendMarker(_dataItem?: DataItem) {\n\t\tthis.updateLegendMarker();\n\t}\n\n\tpublic _markDirtyAxes() {\n\t\tthis._axesDirty = true;\n\t\tthis.markDirty();\n\t}\n\n\tpublic _markDataSetDirty() {\n\t\tthis._afterDataChange();\n\t\tthis._valuesDirty = true;\n\t\tthis._dataProcessed = false;\n\t\tthis._aggregatesCalculated = false;\n\t\tthis.markDirty();\n\t}\n\n\tpublic _clearDirty() {\n\t\tsuper._clearDirty();\n\t\tthis._axesDirty = false;\n\t\tthis._selectionProcessed = false;\n\t\tthis._stackDirty = false;\n\t\tthis._dataProcessed = false;\n\t}\n\n\tpublic _positionBullet(bullet: Bullet) {\n\t\tlet sprite = bullet.get(\"sprite\");\n\t\tif (sprite) {\n\t\t\tlet dataItem = sprite.dataItem as DataItem;\n\n\t\t\tlet locationX = bullet.get(\"locationX\", dataItem.get(\"locationX\", 0.5));\n\t\t\tlet locationY = bullet.get(\"locationY\", dataItem.get(\"locationY\", 0.5));\n\n\t\t\tlet xAxis = this.get(\"xAxis\");\n\t\t\tlet yAxis = this.get(\"yAxis\");\n\n\t\t\tlet positionX = xAxis.getDataItemPositionX(dataItem, this._xField, locationX, this.get(\"vcx\", 1));\n\t\t\tlet positionY = yAxis.getDataItemPositionY(dataItem, this._yField, locationY, this.get(\"vcy\", 1))\n\n\t\t\tlet point = this.getPoint(positionX, positionY);\n\n\t\t\tlet left = dataItem.get(\"left\", point.x);\n\t\t\tlet right = dataItem.get(\"right\", point.x);\n\t\t\tlet top = dataItem.get(\"top\", point.y);\n\t\t\tlet bottom = dataItem.get(\"bottom\", point.y);\n\n\t\t\tlet x = 0;\n\t\t\tlet y = 0;\n\n\t\t\tlet w = right - left;\n\t\t\tlet h = bottom - top;\n\n\t\t\tif (this._shouldShowBullet(positionX, positionY)) {\n\t\t\t\tsprite.setPrivate(\"visible\", !bullet.getPrivate(\"hidden\"));\n\n\t\t\t\tlet field = bullet.get(\"field\");\n\n\t\t\t\tconst baseAxis = this.get(\"baseAxis\");\n\t\t\t\tconst xAxis = this.get(\"xAxis\");\n\t\t\t\tconst yAxis = this.get(\"yAxis\");\n\n\t\t\t\tif (field != undefined) {\n\t\t\t\t\tlet realField: string | undefined;\n\n\t\t\t\t\tif (baseAxis == xAxis) {\n\t\t\t\t\t\tif (field == \"value\") {\n\t\t\t\t\t\t\trealField = this._yField;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (field == \"open\") {\n\t\t\t\t\t\t\trealField = this._yOpenField;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (field == \"high\") {\n\t\t\t\t\t\t\trealField = this._yHighField;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (field == \"low\") {\n\t\t\t\t\t\t\trealField = this._yLowField;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (realField) {\n\t\t\t\t\t\t\tpositionY = yAxis.getDataItemPositionY(dataItem, realField as any, 0, this.get(\"vcy\", 1))\n\n\t\t\t\t\t\t\tpoint = yAxis.get(\"renderer\").positionToPoint(positionY);\n\n\t\t\t\t\t\t\ty = point.y;\n\t\t\t\t\t\t\tx = left + w * locationX;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (field == \"value\") {\n\t\t\t\t\t\t\trealField = this._xField;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (field == \"open\") {\n\t\t\t\t\t\t\trealField = this._xOpenField;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (field == \"high\") {\n\t\t\t\t\t\t\trealField = this._xHighField;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (field == \"low\") {\n\t\t\t\t\t\t\trealField = this._xLowField;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (realField) {\n\t\t\t\t\t\t\tpositionX = xAxis.getDataItemPositionX(dataItem, realField as any, 0, this.get(\"vcx\", 1));\n\n\t\t\t\t\t\t\tpoint = xAxis.get(\"renderer\").positionToPoint(positionX);\n\n\t\t\t\t\t\t\tx = point.x;\n\t\t\t\t\t\t\ty = bottom - h * locationY;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tx = left + w * locationX;\n\t\t\t\t\ty = bottom - h * locationY;\n\t\t\t\t}\n\n\t\t\t\tconst stacked = bullet.get(\"stacked\");\n\t\t\t\tif (stacked) {\n\t\t\t\t\tconst chart = this.chart;\n\t\t\t\t\tif (baseAxis == xAxis) {\n\t\t\t\t\t\tlet previousBullet = this._bullets[positionX + \"_\" + positionY];\n\t\t\t\t\t\tif (previousBullet) {\n\t\t\t\t\t\t\tlet previousBounds = previousBullet.bounds();\n\t\t\t\t\t\t\tlet bounds = sprite.localBounds();\n\t\t\t\t\t\t\tlet yo = y;\n\t\t\t\t\t\t\ty = previousBounds.top;\n\n\t\t\t\t\t\t\tif (stacked == \"down\") {\n\t\t\t\t\t\t\t\ty = previousBounds.bottom - bounds.top;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (stacked == \"auto\") {\n\t\t\t\t\t\t\t\tif (chart) {\n\t\t\t\t\t\t\t\t\tif (yo < chart.plotContainer.height() / 2) {\n\t\t\t\t\t\t\t\t\t\ty = previousBounds.bottom - bounds.top;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\ty += bounds.bottom;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\ty += bounds.bottom;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._bullets[positionX + \"_\" + positionY] = sprite;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tlet previousBullet = this._bullets[positionX + \"_\" + positionY];\n\t\t\t\t\t\tif (previousBullet) {\n\t\t\t\t\t\t\tlet previousBounds = previousBullet.bounds();\n\t\t\t\t\t\t\tlet bounds = sprite.localBounds();\n\t\t\t\t\t\t\tlet xo = x;\n\t\t\t\t\t\t\tx = previousBounds.right;\n\n\t\t\t\t\t\t\tif (stacked == \"down\") {\n\t\t\t\t\t\t\t\tx = previousBounds.left - bounds.right;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (stacked == \"auto\") {\n\t\t\t\t\t\t\t\tif (chart) {\n\t\t\t\t\t\t\t\t\tif (xo < chart.plotContainer.width() / 2) {\n\t\t\t\t\t\t\t\t\t\tx = previousBounds.left - bounds.right;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tx -= bounds.left;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tx -= bounds.left;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis._bullets[positionX + \"_\" + positionY] = sprite;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (sprite.isType(\"Label\")) {\n\t\t\t\t\tsprite.setPrivate(\"maxWidth\", Math.abs(w));\n\t\t\t\t\tsprite.setPrivate(\"maxHeight\", Math.abs(h));\n\t\t\t\t}\n\n\t\t\t\tsprite.setAll({ x, y });\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsprite.setPrivate(\"visible\", false);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _shouldShowBullet(_positionX: number, _positionY: number): boolean {\n\t\treturn this._showBullets;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic setDataSet(id: string) {\n\t\tif (this._dataSets[id]) {\n\t\t\tthis._handleDataSetChange();\n\t\t\tthis._dataItems = this._dataSets[id];\n\t\t\tthis._markDataSetDirty();\n\t\t\tthis._dataSetId = id;\n\n\t\t\tconst type = \"datasetchanged\";\n\t\t\tif (this.events.isEnabled(type)) {\n\t\t\t\tthis.events.dispatch(type, { type: type, target: this, id: id });\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic resetGrouping() {\n\t\t$object.each(this._dataSets, (_key, dataSet) => {\n\t\t\tif (dataSet != this._mainDataItems) {\n\t\t\t\t$array.each(dataSet, (dataItem) => {\n\t\t\t\t\tthis.disposeDataItem(dataItem);\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t\tthis._dataSets = {};\n\t\tthis._dataItems = this.mainDataItems;\n\t}\n\n\tprotected _handleDataSetChange() {\n\t\t$array.each(this._dataItems, (dataItem) => {\n\t\t\tlet bullets = dataItem.bullets;\n\t\t\tif (bullets) {\n\t\t\t\t$array.each(bullets, (bullet) => {\n\t\t\t\t\tif (bullet) {\n\t\t\t\t\t\tlet sprite = bullet.get(\"sprite\");\n\t\t\t\t\t\tif (sprite) {\n\t\t\t\t\t\t\tsprite.setPrivate(\"visible\", false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\n\t\tthis._selectionProcessed = false; // for totals to be calculated\n\t}\n\n\t/**\n\t * Shows hidden series.\n\t *\n\t * @param duration Duration of animation in milliseconds\n\t * @return Animation promise\n\t */\n\tpublic async show(duration?: number): Promise {\n\t\tthis._fixVC();\n\t\tlet promises: Array> = [];\n\t\tpromises.push(super.show(duration).then(() => {\n\t\t\tthis._isShowing = false;\n\t\t\tlet xAxis = this.get(\"xAxis\");\n\t\t\tlet yAxis = this.get(\"yAxis\");\n\t\t\tlet baseAxis = this.get(\"baseAxis\");\n\t\t\tif (yAxis !== baseAxis) {\n\t\t\t\tyAxis.markDirtySelectionExtremes();\n\t\t\t}\n\t\t\tif (xAxis !== baseAxis) {\n\t\t\t\txAxis.markDirtySelectionExtremes();\n\t\t\t}\n\t\t}));\n\t\tpromises.push(this.bulletsContainer.show(duration));\n\t\tpromises.push(this._sequencedShowHide(true, duration));\n\t\tawait Promise.all(promises);\n\t}\n\n\t/**\n\t * Hides series.\n\t *\n\t * @param duration Duration of animation in milliseconds\n\t * @return Animation promise\n\t */\n\tpublic async hide(duration?: number): Promise {\n\t\tthis._fixVC();\n\t\tlet promises: Promise[] = [];\n\t\tpromises.push(super.hide(duration).then(() => {\n\t\t\tthis._isHiding = false;\n\t\t}));\n\t\tpromises.push(this.bulletsContainer.hide(duration));\n\t\tpromises.push(this._sequencedShowHide(false, duration));\n\t\tawait Promise.all(promises);\n\t}\n\n\t/**\n\t * Shows series's data item.\n\t *\n\t * @param dataItem Data item\n\t * @param duration Animation duration in milliseconds\n\t * @return Promise\n\t */\n\tpublic async showDataItem(dataItem: DataItem, duration?: number): Promise {\n\t\tconst promises = [super.showDataItem(dataItem, duration)];\n\n\t\tif (!$type.isNumber(duration)) {\n\t\t\tduration = this.get(\"stateAnimationDuration\", 0);\n\t\t}\n\n\t\tconst easing = this.get(\"stateAnimationEasing\");\n\n\t\t$array.each(this._valueFields, (key) => {\n\t\t\tpromises.push(dataItem.animate({ key: key + \"Working\" as any, to: dataItem.get(key as any), duration: duration!, easing: easing }).waitForStop());\n\t\t})\n\n\t\tawait Promise.all(promises);\n\t}\n\n\t/**\n\t * Hides series's data item.\n\t *\n\t * @param dataItem Data item\n\t * @param duration Animation duration in milliseconds\n\t * @return Promise\n\t */\n\tpublic async hideDataItem(dataItem: DataItem, duration?: number): Promise {\n\t\tconst promises = [super.hideDataItem(dataItem, duration)];\n\n\t\tconst hiddenState = this.states.create(\"hidden\", {})\n\n\t\tif (!$type.isNumber(duration)) {\n\t\t\tduration = hiddenState.get(\"stateAnimationDuration\", this.get(\"stateAnimationDuration\", 0));\n\t\t}\n\n\t\tconst easing = hiddenState.get(\"stateAnimationEasing\", this.get(\"stateAnimationEasing\"));\n\n\t\tconst xAxis = this.get(\"xAxis\");\n\t\tconst yAxis = this.get(\"yAxis\");\n\t\tconst baseAxis = this.get(\"baseAxis\");\n\t\tconst stacked = this.get(\"stacked\");\n\n\t\tif (baseAxis === xAxis || !baseAxis) {\n\n\t\t\t$array.each(this._valueYFields, (key) => {\n\t\t\t\tlet min = yAxis.getPrivate(\"min\");\n\t\t\t\tlet baseValue = yAxis.baseValue();\n\n\t\t\t\tif ($type.isNumber(min) && min > baseValue) {\n\t\t\t\t\tbaseValue = min;\n\t\t\t\t}\n\t\t\t\tif (stacked) {\n\t\t\t\t\tbaseValue = 0;\n\t\t\t\t}\n\n\t\t\t\tlet value = dataItem.get(key as any);\n\t\t\t\tif (value != null) {\n\t\t\t\t\tpromises.push(dataItem.animate({ key: key + \"Working\" as any, to: baseValue, duration: duration!, easing: easing }).waitForStop());\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\tif (baseAxis === yAxis || !baseAxis) {\n\n\t\t\tlet min = xAxis.getPrivate(\"min\");\n\t\t\tlet baseValue = xAxis.baseValue();\n\t\t\tif ($type.isNumber(min) && min > baseValue) {\n\t\t\t\tbaseValue = min;\n\t\t\t}\n\t\t\tif (stacked) {\n\t\t\t\tbaseValue = 0;\n\t\t\t}\n\n\t\t\t$array.each(this._valueXFields, (key) => {\n\t\t\t\tlet value = dataItem.get(key as any);\n\t\t\t\tif (value != null) {\n\t\t\t\t\tpromises.push(dataItem.animate({ key: key + \"Working\" as any, to: baseValue, duration: duration!, easing: easing }).waitForStop());\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\tawait Promise.all(promises);\n\t}\n\n\tpublic _markDirtyStack() {\n\t\tthis._stackDirty = true;\n\t\tthis.markDirty();\n\t\tthis._markStakedDirtyStack();\n\t}\n\n\tprotected _markStakedDirtyStack() {\n\t\tconst stackedSeries = this._stackedSeries;\n\t\tif (stackedSeries) {\n\n\t\t\t$object.each(stackedSeries, (_key, value) => {\n\t\t\t\tif (!value._stackDirty) {\n\t\t\t\t\tvalue._markDirtyStack();\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}\n\n\tpublic _afterChanged() {\n\t\tsuper._afterChanged();\n\t\tif (this._skipped) {\n\t\t\tthis._markDirtyAxes();\n\t\t\tthis._skipped = false;\n\t\t}\n\t}\n\n\t/**\n\t * Shows a tooltip for specific data item.\n\t *\n\t * @param dataItem Data item\n\t */\n\tpublic showDataItemTooltip(dataItem: DataItem | undefined) {\n\t\tif (!this.getPrivate(\"doNotUpdateLegend\")) {\n\t\t\tthis.updateLegendMarker(dataItem);\n\t\t\tthis.updateLegendValue(dataItem);\n\t\t}\n\n\t\tconst tooltip = this.get(\"tooltip\");\n\n\t\tif (tooltip) {\n\t\t\tif (!this.isHidden() && this.get(\"visible\")) {\n\t\t\t\ttooltip._setDataItem(dataItem);\n\n\t\t\t\tif (dataItem) {\n\t\t\t\t\tlet locationX = this.get(\"locationX\", 0);\n\t\t\t\t\tlet locationY = this.get(\"locationY\", 1);\n\n\t\t\t\t\tlet itemLocationX = dataItem.get(\"locationX\", locationX);\n\t\t\t\t\tlet itemLocationY = dataItem.get(\"locationY\", locationY);\n\n\t\t\t\t\tconst xAxis = this.get(\"xAxis\");\n\t\t\t\t\tconst yAxis = this.get(\"yAxis\");\n\n\t\t\t\t\tconst vcx = this.get(\"vcx\", 1);\n\t\t\t\t\tconst vcy = this.get(\"vcy\", 1);\n\n\t\t\t\t\tconst xPos = xAxis.getDataItemPositionX(dataItem, this._tooltipFieldX!, this._aLocationX0 + (this._aLocationX1 - this._aLocationX0) * itemLocationX, vcx);\n\t\t\t\t\tconst yPos = yAxis.getDataItemPositionY(dataItem, this._tooltipFieldY!, this._aLocationY0 + (this._aLocationY1 - this._aLocationY0) * itemLocationY, vcy);\n\n\t\t\t\t\tconst point = this.getPoint(xPos, yPos);\n\n\t\t\t\t\tlet show = true;\n\t\t\t\t\t$array.each(this._valueFields, (field) => {\n\t\t\t\t\t\tif (dataItem.get(field as any) == null) {\n\t\t\t\t\t\t\tshow = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\n\t\t\t\t\tif (show) {\n\t\t\t\t\t\tconst chart = this.chart;\n\t\t\t\t\t\tif (chart && chart.inPlot(point)) {\n\t\t\t\t\t\t\ttooltip.label.text.markDirtyText();\n\t\t\t\t\t\t\ttooltip.set(\"tooltipTarget\", this._getTooltipTarget(dataItem));\n\t\t\t\t\t\t\ttooltip.set(\"pointTo\", this._display.toGlobal({ x: point.x, y: point.y }));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\ttooltip._setDataItem(undefined);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\ttooltip._setDataItem(undefined);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.hideTooltip();\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic hideTooltip(): Promise | undefined {\n\t\tconst tooltip = this.get(\"tooltip\");\n\t\tif (tooltip) {\n\t\t\ttooltip.set(\"tooltipTarget\", this);\n\t\t}\n\t\treturn super.hideTooltip();\n\t}\n\n\tprotected _getTooltipTarget(dataItem: DataItem): Sprite {\n\t\tif (this.get(\"seriesTooltipTarget\") == \"bullet\") {\n\t\t\tconst bullets = dataItem.bullets;\n\t\t\tif (bullets && bullets.length > 0) {\n\t\t\t\tconst bullet = bullets[0];\n\t\t\t\tconst sprite = bullet.get(\"sprite\");\n\t\t\t\tif (sprite) {\n\t\t\t\t\treturn sprite;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic updateLegendValue(dataItem?: DataItem | undefined) {\n\t\tconst legendDataItem = this.get(\"legendDataItem\");\n\n\t\tif (legendDataItem) {\n\n\t\t\tconst label = legendDataItem.get(\"label\");\n\t\t\tif (label) {\n\t\t\t\tlet txt = \"\";\n\t\t\t\tif (dataItem) {\n\t\t\t\t\tlabel._setDataItem(dataItem);\n\t\t\t\t\ttxt = this.get(\"legendLabelText\", label.get(\"text\", this.get(\"name\", \"\")));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tlabel._setDataItem(this._emptyDataItem);\n\t\t\t\t\ttxt = this.get(\"legendRangeLabelText\", this.get(\"legendLabelText\", label.get(\"text\", this.get(\"name\", \"\"))));\n\t\t\t\t}\n\n\t\t\t\tlabel.set(\"text\", txt);\n\t\t\t}\n\n\t\t\tconst valueLabel = legendDataItem.get(\"valueLabel\");\n\t\t\tif (valueLabel) {\n\t\t\t\tlet txt = \"\";\n\t\t\t\tif (dataItem) {\n\t\t\t\t\tvalueLabel._setDataItem(dataItem);\n\t\t\t\t\ttxt = this.get(\"legendValueText\", valueLabel.get(\"text\", \"\"));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvalueLabel._setDataItem(this._emptyDataItem);\n\t\t\t\t\ttxt = this.get(\"legendRangeValueText\", valueLabel.get(\"text\", \"\"));\n\t\t\t\t}\n\n\t\t\t\tvalueLabel.set(\"text\", txt);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _getItemReaderLabel(): string {\n\t\tlet text = \"X: {\" + this._xField;\n\t\tif (this.get(\"xAxis\").isType>(\"DateAxis\")) {\n\t\t\ttext += \".formatDate()\";\n\t\t}\n\t\ttext += \"}; Y: {\" + this._yField;\n\t\tif (this.get(\"yAxis\").isType>(\"DateAxis\")) {\n\t\t\ttext += \".formatDate()\";\n\t\t}\n\t\ttext += \"}\";\n\t\treturn text;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic getPoint(positionX: number, positionY: number): IPoint {\n\t\tlet x = this.get(\"xAxis\").get(\"renderer\").positionToCoordinate(positionX);\n\t\tlet y = this.get(\"yAxis\").get(\"renderer\").positionToCoordinate(positionY);\n\n\t\t// if coordinate is super big, canvas fails to draw line, capping to some big number (won't make any visual difference)\n\t\tlet max = 999999999;\n\t\tif (y < -max) {\n\t\t\ty = -max;\n\t\t}\n\t\tif (y > max) {\n\t\t\ty = max;\n\t\t}\n\n\t\tif (x < -max) {\n\t\t\tx = -max;\n\t\t}\n\t\tif (x > max) {\n\t\t\tx = max;\n\t\t}\n\n\t\treturn { x: x, y: y };\n\t}\n\n\tprotected _shouldInclude(_position: number): boolean {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic handleCursorHide() {\n\t\tthis.hideTooltip();\n\t\tthis.updateLegendValue(undefined);\n\t\tthis.updateLegendMarker(undefined);\n\t}\n\n\tprotected _afterDataChange() {\n\t\tsuper._afterDataChange();\n\t\tthis.get(\"xAxis\")._markDirtyKey(\"start\");\n\t\tthis.get(\"yAxis\")._markDirtyKey(\"start\");\n\t\tthis.resetExtremes();\n\t}\n\n\n\t/**\n\t * Resets cached axis scale values.\n\t */\n\tpublic resetExtremes() {\n\t\tthis.setPrivate(\"selectionMinX\", undefined);\n\t\tthis.setPrivate(\"selectionMaxX\", undefined);\n\t\tthis.setPrivate(\"selectionMinY\", undefined);\n\t\tthis.setPrivate(\"selectionMaxY\", undefined);\n\n\t\tthis.setPrivate(\"minX\", undefined);\n\t\tthis.setPrivate(\"minY\", undefined);\n\t\tthis.setPrivate(\"maxX\", undefined);\n\t\tthis.setPrivate(\"maxY\", undefined);\n\t}\n\n\t/**\n\t * Creates and returns an axis range object.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/axis-ranges/} for more info\n\t * @param axisDataItem Axis data item\n\t * @return Axis range\n\t */\n\tpublic createAxisRange(axisDataItem: DataItem): this[\"_axisRangeType\"] {\n\t\treturn this.axisRanges.push({\n\t\t\taxisDataItem: axisDataItem\n\t\t})\n\t}\n\n\t/**\n\t * A list of series's main (ungrouped) data items.\n\t *\n\t * @return Data items\n\t */\n\tpublic get mainDataItems(): Array> {\n\t\treturn this._mainDataItems;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic _adjustStartIndex(index: number): number {\n\t\tconst xAxis = this.get(\"xAxis\");\n\t\tconst baseAxis = this.get(\"baseAxis\");\n\n\t\tif (baseAxis == xAxis && xAxis.isType>(\"DateAxis\")) {\n\t\t\tconst baseDuration = xAxis.baseDuration();\n\t\t\tconst minSelection = xAxis.getPrivate(\"selectionMin\", xAxis.getPrivate(\"min\", 0));\n\t\t\tconst dl = baseDuration * this.get(\"locationX\", 0.5);\n\n\t\t\tlet value = -Infinity;\n\n\t\t\twhile (value < minSelection) {\n\t\t\t\tconst dataItem = this.dataItems[index];\n\t\t\t\tif (dataItem) {\n\t\t\t\t\tconst open = dataItem.open;\n\t\t\t\t\tif (open) {\n\t\t\t\t\t\tvalue = open[\"valueX\"];\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tvalue = dataItem.get(\"valueX\", 0);\n\t\t\t\t\t}\n\t\t\t\t\tvalue += dl;\n\n\t\t\t\t\tif (value < minSelection) {\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn index;\n\t}\n}\n","import { Scrollbar, IScrollbarPrivate, IScrollbarSettings } from \"../../core/render/Scrollbar\";\nimport { XYChart } from \"./XYChart\";\nimport { Graphics } from \"../../core/render/Graphics\";\nimport * as $utils from \"../../core/util/Utils\";\n\nexport interface IXYChartScrollbarSettings extends IScrollbarSettings {\n\n}\n\nexport interface IXYChartScrollbarPrivate extends IScrollbarPrivate {\n}\n\n/**\n * Creates a scrollbar with chart preview in it.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/scrollbars/#Scrollbar_with_chart_preview} for more info\n * @important\n */\nexport class XYChartScrollbar extends Scrollbar {\n\n\tdeclare public _settings: IXYChartScrollbarSettings;\n\tdeclare public _privateSettings: IXYChartScrollbarPrivate;\n\n\tpublic static className: string = \"XYChartScrollbar\";\n\tpublic static classNames: Array = Scrollbar.classNames.concat([XYChartScrollbar.className]);\n\n\t/**\n\t * An instance of an [[XYChart]] that is used to plot chart preview in\n\t * scrollbar.\n\t */\n\tpublic readonly chart: XYChart = this.children.push(XYChart.new(this._root, {\n\t\tthemeTags: [\"chart\"],\n\t\tinteractive: false,\n\t\tinteractiveChildren: false,\n\t\tpanX: false,\n\t\tpanY: false,\n\t\twheelX: \"none\",\n\t\twheelY: \"none\"\n\t}));\n\n\t/**\n\t * A graphics element that is displayed over inactive portion of the\n\t * scrollbarpreview, to dim it down.\n\t */\n\tpublic readonly overlay: Graphics = this.children.push(Graphics.new(this._root, {\n\t\tthemeTags: [\"overlay\"],\n\t\tinteractive: false\n\t}));\n\n\tprotected _afterNew() {\n\t\tthis._addOrientationClass();\n\t\tthis._settings.themeTags = $utils.mergeTags(this._settings.themeTags, [\"scrollbar\", \"xy\", \"chart\", this._settings.orientation]);\n\n\t\tconst children = this.children;\n\t\tchildren.moveValue(this.thumb);\n\t\tchildren.moveValue(this.startGrip);\n\t\tchildren.moveValue(this.endGrip);\n\n\t\tthis.thumb.set(\"opacity\", 0);\n\t\tthis.thumb.states.create(\"hover\", { opacity: 0.2 });\n\n\t\tconst plotContainer = this.chart.plotContainer;\n\t\tplotContainer.set(\"interactive\", false);\n\t\tplotContainer.remove(\"background\");\n\t\tplotContainer.children.removeValue(this.chart.zoomOutButton);\n\n\t\tsuper._afterNew();\n\t}\n\n\tprotected _updateThumb() {\n\t\tsuper._updateThumb();\n\n\t\tthis.overlay.set(\"draw\", (display) => {\n\t\t\tconst startGrip = this.startGrip;\n\t\t\tconst endGrip = this.endGrip;\n\n\t\t\tlet x0 = startGrip.x();\n\t\t\tlet y0 = startGrip.y();\n\n\t\t\tlet x1 = endGrip.x();\n\t\t\tlet y1 = endGrip.y();\n\n\t\t\tconst h = this.height();\n\t\t\tconst w = this.width();\n\n\t\t\tif (x0 > x1) {\n\t\t\t\t[x0, x1] = [x1, x0]\n\t\t\t}\n\n\t\t\tif (y0 > y1) {\n\t\t\t\t[y0, y1] = [y1, y0]\n\t\t\t}\n\n\t\t\tif (this.get(\"orientation\") === \"horizontal\") {\n\t\t\t\tdisplay.moveTo(0, 0);\n\t\t\t\tdisplay.lineTo(x0, 0);\n\t\t\t\tdisplay.lineTo(x0, h);\n\t\t\t\tdisplay.lineTo(0, h);\n\t\t\t\tdisplay.lineTo(0, 0);\n\n\t\t\t\tdisplay.moveTo(x1, 0);\n\t\t\t\tdisplay.lineTo(w, 0);\n\t\t\t\tdisplay.lineTo(w, h);\n\t\t\t\tdisplay.lineTo(x1, h);\n\t\t\t\tdisplay.lineTo(x1, 0);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdisplay.moveTo(0, 0);\n\t\t\t\tdisplay.lineTo(0, y0);\n\t\t\t\tdisplay.lineTo(w, y0);\n\t\t\t\tdisplay.lineTo(w, 0);\n\t\t\t\tdisplay.lineTo(0, 0);\n\n\t\t\t\tdisplay.moveTo(0, y1);\n\t\t\t\tdisplay.lineTo(0, h);\n\t\t\t\tdisplay.lineTo(w, h);\n\t\t\t\tdisplay.lineTo(w, y1);\n\t\t\t\tdisplay.lineTo(0, y1);\n\t\t\t}\n\t\t})\n\t}\n}\n","import type { DataItem } from \"../../../core/render/Component\";\nimport type { AxisRenderer } from \"./AxisRenderer\";\nimport { Axis, IAxisSettings, IAxisPrivate, IAxisDataItem, IAxisEvents } from \"./Axis\";\nimport type { IXYSeriesDataItem, XYSeries } from \"../series/XYSeries\";\nimport * as $array from \"../../../core/util/Array\";\nimport * as $type from \"../../../core/util/Type\";\nimport * as $math from \"../../../core/util/Math\";\nimport * as $utils from \"../../../core/util/Utils\";\nimport { populateString } from \"../../../core/util/PopulateString\";\nimport type { Tooltip } from \"../../../core/render/Tooltip\";\nimport { ValueAxis } from \"./ValueAxis\";\n\nexport interface ICategoryAxisSettings extends IAxisSettings {\n\n\t/**\n\t * A function that can be used to specify how to configure axis fills.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/#Axis_fills} for more info\n\t */\n\tfillRule?: (dataItem: DataItem, index?: number) => void;\n\n\t/**\n\t * A field in data which holds categories.\n\t */\n\tcategoryField: string;\n\n\t/**\n\t * Relative location of where axis cell starts: 0 - beginning, 1 - end.\n\t *\n\t * @default 0\n\t */\n\tstartLocation?: number;\n\n\t/**\n\t * Relative location of where axis cell ends: 0 - beginning, 1 - end.\n\t *\n\t * @default 1\n\t */\n\tendLocation?: number;\n}\n\nexport interface ICategoryAxisDataItem extends IAxisDataItem {\n\n\t/**\n\t * Named category.\n\t */\n\tcategory?: string;\n\n\t/**\n\t * Named end category (for axis items that span multiple categories, like\n\t * axis ranges).\n\t */\n\tendCategory?: string;\n\n\t/**\n\t * Index of the data item.\n\t */\n\tindex?: number;\n\n\t/**\n\t * Relative location of the category within cell: 0 - start, 1 - end.\n\t */\n\tcategoryLocation?: number;\n\n\t/**\n\t * Relative location of the end category within cell: 0 - start, 1 - end.\n\t */\n\tendCategoryLocation?: number;\n\n\t/**\n\t * A distance to shift data item relative to its original position.\n\t *\n\t * The value is 0 to 1, where 1 is full witdth of the axis.\n\t *\n\t * Can be used to sort data items without modifying order of the actual data.\n\t */\n\tdeltaPosition?: number;\n\n}\n\nexport interface ICategoryAxisPrivate extends IAxisPrivate {\n\n\t/**\n\t * Start index of the current zoom scope.\n\t */\n\tstartIndex?: number;\n\n\t/**\n\t * End index of the current zoom scope.\n\t */\n\tendIndex?: number;\n\n}\n\nexport interface ICategoryAxisEvents extends IAxisEvents {\n\n}\n\n/**\n * Creates a category axis.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/category-axis/} for more info\n * @important\n */\nexport class CategoryAxis extends Axis {\n\tpublic static className: string = \"CategoryAxis\";\n\tpublic static classNames: Array = Axis.classNames.concat([CategoryAxis.className]);\n\n\tdeclare public _settings: ICategoryAxisSettings;\n\tdeclare public _privateSettings: ICategoryAxisPrivate;\n\tdeclare public _dataItemSettings: ICategoryAxisDataItem;\n\tdeclare public _events: ICategoryAxisEvents;\n\n\tprotected _frequency: number = 1;\n\n\tprotected _itemMap: { [index: string]: DataItem } = {};\n\n\tprotected _afterNew() {\n\t\tthis._settings.themeTags = $utils.mergeTags(this._settings.themeTags, [\"axis\"]);\n\t\tthis.fields.push(\"category\");\n\t\tthis.setPrivateRaw(\"name\", \"category\");\n\t\tthis.addTag(\"category\");\n\t\tsuper._afterNew();\n\t}\n\n\tpublic _prepareChildren() {\n\t\tsuper._prepareChildren();\n\n\t\tconst len = this.dataItems.length;\n\t\tlet i = 0;\n\t\tif (this._valuesDirty) {\n\t\t\tthis._itemMap = {};\n\t\t\t$array.each(this.dataItems, (dataItem) => {\n\t\t\t\tdataItem.setRaw(\"index\", i);\n\t\t\t\tthis._itemMap[dataItem.get(\"category\") as string] = dataItem;\n\t\t\t\ti++;\n\t\t\t})\n\n\t\t\tthis.setPrivateRaw(\"maxZoomFactor\", len);\n\t\t}\n\n\t\tthis.setPrivateRaw(\"startIndex\", Math.max(Math.round(this.get(\"start\", 0) * len), 0));\n\t\tthis.setPrivateRaw(\"endIndex\", Math.min(Math.round(this.get(\"end\", 1) * len), len));\n\n\t\tif (this._sizeDirty || this._valuesDirty || (this.isDirty(\"start\") || this.isDirty(\"end\") || this.isPrivateDirty(\"endIndex\") || this.isPrivateDirty(\"startIndex\") || this.isPrivateDirty(\"width\") || this.isPrivateDirty(\"height\"))) {\n\t\t\tif (this.dataItems.length > 0) {\n\t\t\t\tthis._handleRangeChange();\n\t\t\t\tthis._prepareAxisItems();\n\t\t\t\tthis._updateAxisRanges();\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _handleRangeChange() {\n\t\t$array.each(this.series, (series) => {\n\t\t\tlet startCategory = this.dataItems[this.startIndex()].get(\"category\");\n\t\t\tlet endCategory = this.dataItems[this.endIndex() - 1].get(\"category\");\n\n\t\t\tlet baseAxis = series.get(\"baseAxis\");\n\t\t\tlet xAxis = series.get(\"xAxis\");\n\t\t\tlet yAxis = series.get(\"yAxis\");\n\n\t\t\tif (xAxis instanceof CategoryAxis && yAxis instanceof CategoryAxis) {\n\t\t\t\tseries._markDirtyAxes();\n\t\t\t}\n\t\t\telse if (baseAxis === this) {\n\t\t\t\tlet key: string | undefined;\n\t\t\t\tlet openKey: string | undefined;\n\t\t\t\tlet otherAxis = yAxis;\n\t\t\t\tif (xAxis === baseAxis) {\n\t\t\t\t\tif (series.get(\"categoryXField\")) {\n\t\t\t\t\t\tkey = \"categoryX\";\n\t\t\t\t\t}\n\t\t\t\t\tif (series.get(\"openCategoryXField\")) {\n\t\t\t\t\t\topenKey = \"openCategoryX\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (yAxis === baseAxis) {\n\t\t\t\t\tif (series.get(\"categoryYField\")) {\n\t\t\t\t\t\tkey = \"categoryY\";\n\t\t\t\t\t}\n\t\t\t\t\tif (series.get(\"openCategoryYField\")) {\n\t\t\t\t\t\topenKey = \"openCategoryY\";\n\t\t\t\t\t}\n\t\t\t\t\totherAxis = xAxis;\n\t\t\t\t}\n\n\t\t\t\tif (otherAxis instanceof ValueAxis) {\n\n\t\t\t\t\tif (key || openKey) {\n\t\t\t\t\t\tlet startDataItem: DataItem | undefined;\n\t\t\t\t\t\tlet endDataItem: DataItem | undefined;\n\n\t\t\t\t\t\tfor (let i = 0, len = series.dataItems.length; i < len; i++) {\n\t\t\t\t\t\t\tlet dataItem = series.dataItems[i];\n\t\t\t\t\t\t\tif (key) {\n\t\t\t\t\t\t\t\tif (dataItem.get(key as any) === startCategory) {\n\t\t\t\t\t\t\t\t\tstartDataItem = dataItem;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (openKey) {\n\t\t\t\t\t\t\t\tif (dataItem.get(openKey as any) === startCategory) {\n\t\t\t\t\t\t\t\t\tstartDataItem = dataItem;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (let i = series.dataItems.length - 1; i >= 0; i--) {\n\t\t\t\t\t\t\tlet dataItem = series.dataItems[i];\n\t\t\t\t\t\t\tif (key) {\n\t\t\t\t\t\t\t\tif (dataItem.get(key as any) === endCategory) {\n\t\t\t\t\t\t\t\t\tendDataItem = dataItem;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (openKey) {\n\t\t\t\t\t\t\t\tif (dataItem.get(openKey as any) === endCategory) {\n\t\t\t\t\t\t\t\t\tendDataItem = dataItem;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet startIndex = 0;\n\t\t\t\t\t\tlet endIndex = series.dataItems.length;\n\n\t\t\t\t\t\tif (startDataItem) {\n\t\t\t\t\t\t\tstartIndex = series.dataItems.indexOf(startDataItem);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (endDataItem) {\n\t\t\t\t\t\t\tendIndex = series.dataItems.indexOf(endDataItem) + 1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tseries.setPrivate(\"startIndex\", startIndex);\n\t\t\t\t\t\tseries.setPrivate(\"endIndex\", endIndex);\n\n\t\t\t\t\t\tlet hasValue = false;\n\t\t\t\t\t\tfor (let i = startIndex; i < endIndex; i++) {\n\t\t\t\t\t\t\tconst dataItem = series.dataItems[i];\n\n\t\t\t\t\t\t\t$array.each(series.__valueXShowFields, (key) => {\n\t\t\t\t\t\t\t\tlet value = dataItem.get(key);\n\t\t\t\t\t\t\t\tif (value != null) {\n\t\t\t\t\t\t\t\t\thasValue = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\t$array.each(series.__valueYShowFields, (key) => {\n\t\t\t\t\t\t\t\tlet value = dataItem.get(key);\n\t\t\t\t\t\t\t\tif (value != null) {\n\t\t\t\t\t\t\t\t\thasValue = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\tif (hasValue) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tseries.setPrivate(\"outOfSelection\", !hasValue);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tseries._markDirtyAxes();\t// must be outside\n\t\t\t}\n\t\t})\n\t}\n\n\n\tprotected _prepareAxisItems() {\n\t\tconst renderer = this.get(\"renderer\");\n\t\tconst len = this.dataItems.length;\n\n\t\tlet startIndex = this.startIndex();\n\t\tif (startIndex > 0) {\n\t\t\tstartIndex--;\n\t\t}\n\n\t\tlet endIndex = this.endIndex();\n\t\tif (endIndex < len) {\n\t\t\tendIndex++;\n\t\t}\n\n\t\tconst minorLabelsEnabled = renderer.get(\"minorLabelsEnabled\");\n\t\tconst minorGridEnabled = renderer.get(\"minorGridEnabled\", minorLabelsEnabled);\n\n\t\tlet maxCount = renderer.axisLength() / Math.max(renderer.get(\"minGridDistance\")!, 1);\n\t\tlet frequency = Math.max(1, Math.min(len, Math.ceil((endIndex - startIndex) / maxCount)));\n\n\t\tstartIndex = Math.floor(startIndex / frequency) * frequency;\n\t\tthis._frequency = frequency;\n\n\t\tfor (let j = 0; j < len; j++) {\n\t\t\tthis._toggleDataItem(this.dataItems[j], false);\n\t\t}\n\n\t\tlet f = this.dataItems[startIndex].get(\"index\", 0);\n\n\t\tfor (let i = startIndex; i < endIndex; i = i + frequency) {\n\t\t\tlet dataItem = this.dataItems[i];\n\n\t\t\tthis._createAssets(dataItem, []);\n\t\t\tthis._toggleDataItem(dataItem, true);\n\n\t\t\tlet count = frequency;\n\t\t\tif (minorGridEnabled) {\n\t\t\t\tcount = 1;\n\t\t\t}\n\n\t\t\tthis._prepareDataItem(dataItem, f, count);\n\n\t\t\tf++;\n\t\t}\n\n\t\tif (renderer.get(\"minorGridEnabled\")) {\n\t\t\tfor (let i = startIndex; i < endIndex; i++) {\n\t\t\t\tlet dataItem = this.dataItems[i];\n\t\t\t\tif (i % frequency != 0) {\n\t\t\t\t\tthis._createAssets(dataItem, [\"minor\"], true);\n\t\t\t\t\tthis._toggleDataItem(dataItem, true);\n\t\t\t\t\tthis._prepareDataItem(dataItem, 0, 1);\n\n\t\t\t\t\tif (!minorLabelsEnabled) {\n\t\t\t\t\t\tdataItem.get(\"label\")?.setPrivate(\"visible\", false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis._updateGhost();\n\t}\n\n\n\tpublic _prepareDataItem(dataItem: DataItem, fillIndex?: number, count?: number) {\n\t\tlet renderer = this.get(\"renderer\");\n\n\t\tlet categoryLocation = dataItem.get(\"categoryLocation\", 0);\n\t\tlet endCategoryLocation = dataItem.get(\"endCategoryLocation\", 1);\n\n\t\tlet index: number | undefined = dataItem.get(\"index\");\n\n\t\tif (!$type.isNumber(index)) {\n\t\t\tindex = this.categoryToIndex(dataItem.get(\"category\")!);\n\t\t}\n\n\t\tlet position = this.indexToPosition(index, categoryLocation);\n\n\t\tlet endCategory = dataItem.get(\"endCategory\")!;\n\t\tlet endIndex: number;\n\t\tif (endCategory) {\n\t\t\tendIndex = this.categoryToIndex(endCategory);\n\t\t\tif (!$type.isNumber(endIndex)) {\n\t\t\t\tendIndex = index;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tendIndex = index;\n\t\t}\n\n\t\tlet endPosition = this.indexToPosition(endIndex, endCategoryLocation);\n\n\t\tlet fillEndIndex: number;\n\t\tlet fillEndPosition: number;\n\n\t\tif (dataItem.get(\"isRange\")) {\n\t\t\tfillEndIndex = endIndex;\n\t\t}\n\t\telse {\n\t\t\tfillEndIndex = index + this._frequency - 1;\n\t\t}\n\n\t\tfillEndPosition = this.indexToPosition(fillEndIndex, endCategoryLocation);\n\n\t\trenderer.updateLabel(dataItem.get(\"label\"), position, endPosition, count);\n\t\trenderer.updateGrid(dataItem.get(\"grid\"), position, endPosition);\n\t\trenderer.updateTick(dataItem.get(\"tick\"), position, endPosition, count);\n\t\trenderer.updateFill(dataItem.get(\"axisFill\"), position, fillEndPosition);\n\n\t\tthis._processBullet(dataItem);\n\t\trenderer.updateBullet(dataItem.get(\"bullet\"), position, endPosition);\n\n\t\tconst fillRule = this.get(\"fillRule\");\n\t\tif (fillRule) {\n\t\t\tfillRule(dataItem, fillIndex)\n\t\t}\n\t}\n\n\tpublic startIndex() {\n\t\tlet len = this.dataItems.length;\n\t\treturn Math.min(Math.max(this.getPrivate(\"startIndex\", 0), 0), len - 1);\n\t}\n\n\tpublic endIndex() {\n\t\tlet len = this.dataItems.length;\n\t\treturn Math.max(1, Math.min(this.getPrivate(\"endIndex\", len), len));\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic baseValue(): any {\n\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic basePosition() {\n\t\treturn 0;\n\t}\n\n\t/**\n\t * Returns X coordinate in pixels corresponding to specific category index.\n\t *\n\t * @param value Index\n\t * @return X coordinate\n\t */\n\tpublic getX(value: string): number {\n\t\tlet axisDataItem = this._itemMap[value];\n\t\tif (axisDataItem) {\n\t\t\treturn this._settings.renderer.positionToCoordinate(this.indexToPosition(axisDataItem.get(\"index\", 0)));\n\t\t}\n\t\treturn NaN;\n\t}\n\n\t/**\n\t * Returns Y coordinate in pixels corresponding to specific category index.\n\t *\n\t * @param value Index\n\t * @return Y coordinate\n\t */\n\tpublic getY(value: string): number {\n\t\tlet axisDataItem = this._itemMap[value];\n\t\tif (axisDataItem) {\n\t\t\treturn this._settings.renderer.positionToCoordinate(this.indexToPosition(axisDataItem.get(\"index\", 0)));\n\t\t}\n\t\treturn NaN;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic getDataItemPositionX(dataItem: DataItem, field: string, cellLocation: number, _axisLocation?: number): number {\n\t\tconst category = dataItem.get(field as any);\n\t\tconst axisDataItem = this._itemMap[category];\n\n\t\tif (axisDataItem) {\n\t\t\treturn this.indexToPosition(axisDataItem.get(\"index\", 0), cellLocation);\n\t\t}\n\t\treturn NaN;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic getDataItemCoordinateX(dataItem: DataItem, field: string, cellLocation: number, _axisLocation?: number): number {\n\t\treturn this._settings.renderer.positionToCoordinate(this.getDataItemPositionX(dataItem, field, cellLocation, _axisLocation));\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic getDataItemPositionY(dataItem: DataItem, field: string, cellLocation: number, _axisLocation?: number): number {\n\t\tconst category = dataItem.get(field as any);\n\t\tconst axisDataItem = this._itemMap[category];\n\t\tif (axisDataItem) {\n\t\t\treturn this.indexToPosition(axisDataItem.get(\"index\", 0), cellLocation);\n\t\t}\n\t\treturn NaN;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic getDataItemCoordinateY(dataItem: DataItem, field: string, cellLocation: number, _axisLocation?: number): number {\n\t\treturn this._settings.renderer.positionToCoordinate(this.getDataItemPositionY(dataItem, field, cellLocation, _axisLocation));\n\t}\n\n\t/**\n\t * Converts category index to a relative position.\n\t *\n\t * `location` indicates relative position within category: 0 - start, 1 - end.\n\t *\n\t * If not set, will use middle (0.5) of the category.\n\t *\n\t * @param index Index\n\t * @param location Location\n\t * @return Index\n\t */\n\tpublic indexToPosition(index: number, location?: number): number {\n\t\tif (!$type.isNumber(location)) {\n\t\t\tlocation = 0.5;\n\t\t}\n\n\t\tlet len = this.dataItems.length;\n\n\t\tlet startLocation = this.get(\"startLocation\", 0);\n\t\tlet endLocation = this.get(\"endLocation\", 1);\n\n\t\tlen -= startLocation;\n\t\tlen -= (1 - endLocation);\n\n\t\tlet position = (index + location - startLocation) / len;\n\n\t\tlet dataItem = this.dataItems[index];\n\t\tif (dataItem) {\n\t\t\tposition += dataItem.get(\"deltaPosition\", 0);\n\t\t}\n\n\t\treturn position;\n\t}\n\n\t/**\n\t * Returns an index of a category.\n\t *\n\t * @param category Category to look up\n\t * @return Index\n\t */\n\tpublic categoryToIndex(category: string): number {\n\t\tlet dataItem = this._itemMap[category];\n\t\tif (dataItem) {\n\t\t\treturn dataItem.get(\"index\")!;\n\t\t}\n\t\treturn NaN;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic dataItemToPosition(dataItem: DataItem): number {\n\t\treturn this.indexToPosition(dataItem.get(\"index\")!);\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic roundAxisPosition(position: number, location: number): number {\n\t\tposition += (0.5 - location) / this.dataItems.length;\n\t\treturn this.indexToPosition(this.axisPositionToIndex(position), location);\n\t}\n\n\t/**\n\t * Returns an index of the category that corresponds to specific pixel\n\t * position within axis.\n\t *\n\t * @param position Position (px)\n\t * @return Category index\n\t */\n\tpublic axisPositionToIndex(position: number): number {\n\t\tlet len = this.dataItems.length;\n\t\treturn $math.fitToRange(Math.floor(position * len), 0, len - 1);//$math.fitToRange(Math.floor((end - start) * len * position + len * start), 0, len - 1);\n\t}\n\n\t/**\n\t * Returns text to be used in an axis tooltip for specific relative position.\n\t *\n\t * @param position Position\n\t * @return Tooltip text\n\t */\n\tpublic getTooltipText(position: number, _adjustPosition?: boolean): string | undefined {\n\t\t//@todo number formatter + tag\n\t\tconst dataItem = this.dataItems[this.axisPositionToIndex(position)];\n\t\tif (dataItem) {\n\t\t\tconst label = dataItem.get(\"label\")\n\t\t\tif (label) {\n\t\t\t\treturn populateString(label, this.get(\"tooltipText\", \"\"));\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _updateTooltipText(tooltip: Tooltip, position: number) {\n\t\ttooltip._setDataItem(this.dataItems[this.axisPositionToIndex(position)]);\n\t\ttooltip.label.text.markDirtyText();\n\t}\n\n\t/**\n\t * Returns a data item from series that is closest to the `position`.\n\t *\n\t * @param series Series\n\t * @param position Relative position\n\t * @return Data item\n\t */\n\tpublic getSeriesItem(series: XYSeries, position: number): DataItem | undefined {\n\t\tif (this.dataItems.length > 0) {\n\t\t\tlet fieldName = (this.getPrivate(\"name\")! + this.get(\"renderer\").getPrivate(\"letter\")!);\n\t\t\tlet index = this.axisPositionToIndex(position);\n\t\t\t// try simple first\n\t\t\tlet seriesDataItem = series.dataItems[index];\n\t\t\tlet axisDataItem = this.dataItems[index];\n\t\t\tlet category = axisDataItem.get(\"category\");\n\n\t\t\tif (seriesDataItem && axisDataItem) {\n\t\t\t\tif (seriesDataItem.get(fieldName) === category) {\n\t\t\t\t\treturn seriesDataItem;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if not found, try looking\n\t\t\tfor (let i = 0, len = series.dataItems.length; i < len; i++) {\n\t\t\t\tlet dataItem = series.dataItems[i];\n\t\t\t\tif (dataItem.get(fieldName) === category) {\n\t\t\t\t\treturn dataItem;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Zooms the axis to specific `start` and `end` indexes.\n\t *\n\t * Optional `duration` specifies duration of zoom animation in milliseconds.\n\t *\n\t * @param start Start index\n\t * @param end End index\n\t * @param duration Duration in milliseconds\n\t */\n\tpublic zoomToIndexes(start: number, end: number, duration?: number) {\n\t\tlet len = this.dataItems.length;\n\t\tthis.zoom(start / len, end / len, duration);\n\t}\n\n\tpublic zoomToCategories(startCategory: string, endCategory: string, duration?: number) {\n\t\tthis.zoomToIndexes(this.categoryToIndex(startCategory), this.categoryToIndex(endCategory) + 1, duration);\n\t}\n\n\t/**\n\t * Returns position span between start and end of a single cell in axis.\n\t *\n\t * @since 5.2.30\n\t * @return Position\n\t */\n\tpublic getCellWidthPosition(): number {\n\t\treturn this._frequency / this.dataItems.length / (this.get(\"end\", 1) - this.get(\"start\", 0));\n\t}\n\t\n\t/**\n\t * @ignore\n\t */\t\n\tpublic nextPosition(count?:number){\n\t\tif(count == null){\n\t\t\tcount = 1;\n\t\t}\n\n\t\tif(this.get(\"renderer\").getPrivate(\"letter\") == \"Y\"){\n\t\t\tcount *= -1;\n\t\t}\n\n\t\tconst position = this.getPrivate(\"tooltipPosition\", 0);\n\n\t\tconst index = $math.fitToRange(this.axisPositionToIndex(position) + count, 0, this.dataItems.length - 1);\t\t\n\t\treturn this.toGlobalPosition(this.indexToPosition(index));\n\t}\n}\n","import type { DataItem } from \"../../../core/render/Component\";\nimport type { AxisRenderer } from \"./AxisRenderer\";\nimport { CategoryAxis, ICategoryAxisSettings, ICategoryAxisPrivate, ICategoryAxisDataItem, ICategoryAxisEvents } from \"./CategoryAxis\";\nimport type { ITimeInterval } from \"../../../core/util/Time\";\nimport * as $time from \"../../../core/util/Time\";\nimport * as $type from \"../../../core/util/Type\";\nimport * as $array from \"../../../core/util/Array\";\nimport * as $utils from \"../../../core/util/Utils\";\nimport type { Tooltip } from \"../../../core/render/Tooltip\";\n\nexport interface ICategoryDateAxisSettings extends ICategoryAxisSettings {\n\n\t/**\n\t * Indicates granularity of data.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/date-axis/#Data_granularity} for more info\n\t */\n\tbaseInterval: ITimeInterval;\n\n\t/**\n\t * A list of intervals the axis is allowed to show grid/labels on.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/date-axis/#Grid_granularity} for more info\n\t */\n\tgridIntervals?: Array;\n\n\t/**\n\t * Display \"period change\" labels using different format.\n\t *\n\t * If set to `true`, will use `periodChangeDateFormats` instead\n\t * of `dateFormats` for such labels, e.g. for month start.\n\t *\n\t * @default true\n\t */\n\tmarkUnitChange?: boolean;\n\n\t/**\n\t * Date formats used for intermediate labels.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/date-axis/#Date_formats} for more info\n\t */\n\tdateFormats?: { [index: string]: string };\n\n\t/**\n\t * Date formats used for \"period change\" labels.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/date-axis/#Date_formats} for more info\n\t */\n\tperiodChangeDateFormats?: { [index: string]: string };\n\n\t/**\n\t * A date format to use for axis tooltip.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/formatters/formatting-dates/} for more info\n\t */\n\ttooltipDateFormat?: string;\n\n}\n\nexport interface ICategoryDateAxisDataItem extends ICategoryAxisDataItem {\n}\n\nexport interface ICategoryDateAxisPrivate extends ICategoryAxisPrivate {\n\n\t/**\n\t * Current base interval.\n\t */\n\tbaseInterval: ITimeInterval;\n\n}\n\nexport interface ICategoryDateAxisEvents extends ICategoryAxisEvents {\n}\n\n\n/**\n * Category-based date axis.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/category-date-axis/} for more info\n * @important\n */\nexport class CategoryDateAxis extends CategoryAxis {\n\tpublic static className: string = \"CategoryDateAxis\";\n\tpublic static classNames: Array = CategoryAxis.classNames.concat([CategoryDateAxis.className]);\n\n\tdeclare public _settings: ICategoryDateAxisSettings;\n\tdeclare public _privateSettings: ICategoryDateAxisPrivate;\n\tdeclare public _dataItemSettings: ICategoryDateAxisDataItem;\n\tdeclare public _events: ICategoryDateAxisEvents;\n\n\tprotected _frequency: number = 1;\n\n\tprotected _itemMap: { [index: string]: DataItem } = {};\n\n\tprotected _afterNew() {\n\t\tthis._settings.themeTags = $utils.mergeTags(this._settings.themeTags, [\"axis\"]);\n\t\tthis.fields.push(\"category\");\n\t\tsuper._afterNew();\n\t}\n\n\n\tprotected _prepareAxisItems() {\n\t\t// temp\n\t\tthis.setPrivateRaw(\"baseInterval\", this.get(\"baseInterval\"));\n\n\t\tconst renderer = this.get(\"renderer\");\n\t\tconst len = this.dataItems.length;\n\n\t\tlet startIndex = this.startIndex();\n\t\tif (startIndex > 0) {\n\t\t\tstartIndex--;\n\t\t}\n\n\t\tlet endIndex = this.endIndex();\n\t\tif (endIndex < len) {\n\t\t\tendIndex++;\n\t\t}\n\n\t\tlet maxCount = renderer.axisLength() / Math.max(renderer.get(\"minGridDistance\")!, 1 / Number.MAX_SAFE_INTEGER);\n\n\t\tlet frequency = Math.min(len, Math.ceil((endIndex - startIndex) / maxCount));\n\t\tstartIndex = Math.floor(startIndex / frequency) * frequency;\n\t\tthis._frequency = frequency;\n\n\t\tfor (let j = 0; j < len; j++) {\n\t\t\tthis._toggleDataItem(this.dataItems[j], false);\n\t\t}\n\n\t\tlet startTime = Number(this.dataItems[startIndex].get(\"category\"));\n\t\tlet endTime = Number(this.dataItems[endIndex - 1].get(\"category\"));\n\t\tlet realDuration = (endTime - startTime);\n\t\tif (endIndex - startIndex < maxCount) {\n\t\t\trealDuration = (endTime - startTime) - ((endTime - startTime) / this.baseDuration() - (endIndex - startIndex)) * this.baseDuration();\n\t\t}\n\n\t\t// if all items are on axis\n\t\tlet gridInterval = $time.chooseInterval(0, realDuration, maxCount, this.get(\"gridIntervals\")!);\n\n\t\tconst nextGridUnit = $time.getNextUnit(gridInterval.timeUnit);\n\t\tconst baseInterval = this.getPrivate(\"baseInterval\");\n\n\t\tif ($time.getIntervalDuration(gridInterval) < this.baseDuration()) {\n\t\t\tgridInterval = { ...baseInterval };\n\t\t}\n\n\t\tconst formats = this.get(\"dateFormats\")!;\n\n\t\tlet previousValue = -Infinity;\n\t\tlet previousIndex = -Infinity;\n\t\tlet previousUnitValue = -Infinity;\n\t\tlet format: string;\n\n\t\tlet selectedItems: Array<{ format: string, dataItem: DataItem }> = [];\n\t\tlet changed = false;\n\n\t\tfor (let i = startIndex; i < endIndex; i++) {\n\t\t\tlet dataItem = this.dataItems[i];\n\t\t\tlet index = dataItem.get(\"index\")!;\n\t\t\tlet skip = false;\n\n\t\t\tlet value = Number(dataItem.get(\"category\"));\n\t\t\tlet date = new Date(value);\n\t\t\tlet unitValue = $time.getUnitValue(date, gridInterval.timeUnit);\n\n\t\t\tformat = formats[gridInterval.timeUnit];\n\t\t\tlet added = false;\n\n\t\t\tif (gridInterval.timeUnit != \"year\" && gridInterval.timeUnit != \"week\") {\n\t\t\t\tif (nextGridUnit && this.get(\"markUnitChange\") && $type.isNumber(previousValue)) {\n\n\t\t\t\t\tif ($time.checkChange(value, previousValue, nextGridUnit, this._root.utc)) {\n\t\t\t\t\t\tformat = this.get(\"periodChangeDateFormats\")![gridInterval.timeUnit];\n\n\t\t\t\t\t\tif (index - frequency * 0.5 < previousIndex) {\n\t\t\t\t\t\t\tselectedItems.pop();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tselectedItems.push({ format: format, dataItem: dataItem });\n\t\t\t\t\t\tchanged = true;\n\t\t\t\t\t\tadded = true;\n\t\t\t\t\t\tpreviousIndex = index;\n\t\t\t\t\t\tpreviousUnitValue = unitValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet shouldAdd = false;\n\t\t\tif (gridInterval.timeUnit === \"day\" || gridInterval.timeUnit === \"week\") {\n\t\t\t\tif (index - previousIndex >= frequency) {\n\t\t\t\t\tshouldAdd = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (unitValue % gridInterval.count === 0) {\n\t\t\t\t\tif (unitValue != previousUnitValue) {\n\t\t\t\t\t\tshouldAdd = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!added && shouldAdd) {\n\t\t\t\tif (index - frequency * 0.7 < previousIndex) {\n\t\t\t\t\tif (changed) {\n\t\t\t\t\t\tskip = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!skip) {\n\t\t\t\t\tselectedItems.push({ format: format, dataItem: dataItem });\n\t\t\t\t\tpreviousIndex = index;\n\t\t\t\t\tpreviousUnitValue = unitValue;\n\t\t\t\t}\n\t\t\t\tchanged = false;\n\n\t\t\t}\n\n\t\t\tpreviousValue = value;\n\n\t\t}\n\n\t\tif (selectedItems.length > 0) {\n\t\t\tlet f = selectedItems[0].dataItem.get(\"index\", 0);\n\n\t\t\t$array.each(selectedItems, (item) => {\n\t\t\t\tconst dataItem = item.dataItem;\n\t\t\t\tconst format = item.format;\n\t\t\t\tthis._createAssets(dataItem, []);\n\n\t\t\t\tthis._toggleDataItem(dataItem, true);\n\n\t\t\t\tlet value = Number(dataItem.get(\"category\"));\n\t\t\t\tlet date = new Date(value);\n\n\t\t\t\tconst label = dataItem.get(\"label\");\n\t\t\t\tif (label) {\n\t\t\t\t\tlabel.set(\"text\", this._root.dateFormatter.format(date, format!));\n\t\t\t\t}\n\t\t\t\tf++;\n\t\t\t\tthis._prepareDataItem(dataItem, f, frequency);\n\t\t\t})\n\n\t\t}\n\t}\n\n\t/**\n\t * Returns a duration of currently active `baseInterval` in milliseconds.\n\t *\n\t * @return Duration\n\t */\n\tpublic baseDuration(): number {\n\t\treturn $time.getIntervalDuration(this.getPrivate(\"baseInterval\"));\n\t}\n\n\n\t/**\n\t * Returns text to be used in an axis tooltip for specific relative position.\n\t *\n\t * @param position Position\n\t * @return Tooltip text\n\t */\n\tpublic getTooltipText(position: number, _adjustPosition?: boolean): string | undefined {\n\t\t//@todo number formatter + tag\n\t\tlet dataItem = this.dataItems[this.axisPositionToIndex(position)];\n\n\t\tif (dataItem) {\n\t\t\tlet format = this.get(\"dateFormats\")![this.getPrivate(\"baseInterval\").timeUnit];\n\t\t\treturn this._root.dateFormatter.format(new Date(dataItem.get(\"category\", 0)), this.get(\"tooltipDateFormat\", format));\n\t\t}\n\t}\n\n\tprotected _updateTooltipText(tooltip: Tooltip, position: number) {\n\t\ttooltip.label.set(\"text\", this.getTooltipText(position));\n\t}\n\n}\n","import type { AxisRenderer } from \"./AxisRenderer\";\nimport type { TimeUnit } from \"../../../core/util/Time\"\n\nimport { ValueAxis, IValueAxisSettings, IValueAxisPrivate, IValueAxisDataItem, IValueAxisEvents, IMinMaxStep } from \"./ValueAxis\";\n\nimport * as $utils from \"../../../core/util/Utils\";\nimport * as $math from \"../../../core/util/Math\";\n\nexport interface IDurationAxisSettings extends IValueAxisSettings {\n\n\t/**\n\t * A base unit (granularity) of data.\n\t *\n\t * Used to indicate what are the base units of your data.\n\t *\n\t * Available options: `\"millisecond\"`, `\"second\"` (default), `\"minute\"`, `\"hour\"`, `\"day\"`, `\"week\"`, `\"month\"`, and `\"year\"`.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/formatters/formatting-durations/#Base_unit} for more info\n\t * @default \"second\"\n\t */\n\tbaseUnit?: TimeUnit\n\n}\n\nexport interface IDurationAxisDataItem extends IValueAxisDataItem {\n}\n\nexport interface IDurationAxisPrivate extends IValueAxisPrivate {\n\n\t/**\n\t * A format to used by axis to format its labels.\n\t *\n\t * @readonly\n\t */\n\tdurationFormat: string;\n\n}\n\nexport interface IDurationAxisEvents extends IValueAxisEvents {\n}\n\n/**\n * Creates a duration axis.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/axes/duration-axis/} for more info\n * @important\n */\nexport class DurationAxis extends ValueAxis {\n\tpublic static className: string = \"DurationAxis\";\n\tpublic static classNames: Array = ValueAxis.classNames.concat([DurationAxis.className]);\n\n\tdeclare public _settings: IDurationAxisSettings;\n\tdeclare public _privateSettings: IDurationAxisPrivate;\n\tdeclare public _dataItemSettings: IDurationAxisDataItem;\n\tdeclare public _events: IDurationAxisEvents;\n\n\tprotected _dataGrouped: boolean = false;\n\tprotected _groupingCalculated: boolean = false;\n\tprotected _intervalDuration: number = 1;\n\n\tpublic _afterNew() {\n\t\tthis._settings.themeTags = $utils.mergeTags(this._settings.themeTags, [\"axis\"]);\n\t\tsuper._afterNew();\n\t}\n\n\n\tprotected _adjustMinMax(min: number, max: number, gridCount: number, strictMode?: boolean): IMinMaxStep {\n\t\tlet minMaxStep: IMinMaxStep;\n\n\t\tconst durationFormatter = this.getDurationFormatter();\n\t\tconst baseUnit = this.get(\"baseUnit\");\n\t\t// we don't allow to go to smaller units, setting so to avoid invalidation\n\t\tthis.setRaw(\"maxPrecision\", 0);\n\n\t\tif (baseUnit == \"millisecond\" || baseUnit == \"second\" || baseUnit == \"minute\" || baseUnit == \"hour\") {\n\t\t\t// will fail if 0\n\t\t\tif (gridCount <= 1) {\n\t\t\t\tgridCount = 1;\n\t\t\t}\n\n\t\t\tgridCount = Math.round(gridCount);\n\n\t\t\t//let initialMin: number = min;\n\t\t\t//let initialMax: number = max;\n\n\t\t\tlet difference = max - min;\n\n\t\t\t// in case min and max is the same, use max\n\t\t\tif (difference === 0) {\n\t\t\t\tdifference = Math.abs(max);\n\t\t\t}\n\n\t\t\tlet step = difference / gridCount;\n\n\t\t\tlet divisors = [60, 30, 20, 15, 10, 2, 1];\n\t\t\tlet realDivisor = 1;\n\n\t\t\tif (baseUnit == \"hour\") {\n\t\t\t\tdivisors = [24, 12, 6, 4, 2, 1];\n\t\t\t}\n\n\t\t\tfor (let divisor of divisors) {\n\t\t\t\tif (difference / divisor > gridCount) {\n\t\t\t\t\trealDivisor = divisor;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet count = Math.ceil(((max - min) / realDivisor) / gridCount);\n\n\t\t\tlet exponent: number = Math.log(Math.abs(count)) * Math.LOG10E;\n\t\t\tlet power = Math.pow(10, Math.floor(exponent)) / 10;\n\t\t\tlet reducedCount = count / power;\n\n\t\t\t// find closest to divisor\n\t\t\tlet closest = $math.closest(divisors, reducedCount);\n\t\t\tcount = closest * power;\n\n\t\t\tstep = realDivisor * count;\n\n\t\t\tmin = Math.floor(min / step) * step;\n\t\t\tmax = Math.ceil(max / step) * step;\n\n\t\t\t/*\n\t\t\tcausese SO with seconds\n\t\t\tif (strictMode) {\n\t\t\t\tmin -= step;\n\t\t\t\tif (min < 0 && initialMin >= 0) {\n\t\t\t\t\tmin = 0;\n\t\t\t\t}\n\t\t\t\tmax += step;\n\n\t\t\t\tif (max > 0 && initialMax <= 0) {\n\t\t\t\t\tmax = 0;\n\t\t\t\t}\n\t\t\t}*/\n\t\t\tminMaxStep = { min: min, max: max, step: step };\n\t\t}\n\t\telse {\n\t\t\tminMaxStep = super._adjustMinMax(min, max, gridCount, strictMode);\n\t\t}\n\n\t\t// choose duration formatter based on step\n\t\tthis.setPrivateRaw(\"durationFormat\", durationFormatter.getFormat(minMaxStep.step, minMaxStep.max, baseUnit));\n\n\t\treturn minMaxStep;\n\t}\n\n\tprotected _formatText(value: number) {\n\t\tconst formatter = this.getDurationFormatter();\n\t\treturn formatter.format(value, this.getPrivate(\"durationFormat\"), this.get(\"baseUnit\"));\n\t}\n\n\t/**\n\t * Returns text to be used in an axis tooltip for specific relative position.\n\t *\n\t * @param position Position\n\t * @return Tooltip text\n\t */\n\tpublic getTooltipText(position: number, _adjustPosition?: boolean): string | undefined {\n\t\tconst formatter = this.getDurationFormatter();\n\t\tconst extraDecimals = this.get(\"extraTooltipPrecision\", 0);\n\t\tconst decimals = this.getPrivate(\"stepDecimalPlaces\", 0) + extraDecimals;\n\t\tconst value = $math.round(this.positionToValue(position), decimals);\n\n\t\treturn formatter.format(value, this.getPrivate(\"durationFormat\"), this.get(\"baseUnit\"));\n\t}\n}\n","import { Candlestick, ICandlestickSettings, ICandlestickPrivate } from \"./Candlestick\";\n\n\nexport interface IOHLCSettings extends ICandlestickSettings {\n}\n\nexport interface IOHLCPrivate extends ICandlestickPrivate {\n}\n\nexport class OHLC extends Candlestick {\n\n\tdeclare public _settings: IOHLCSettings;\n\tdeclare public _privateSettings: IOHLCPrivate;\n\n\tpublic static className: string = \"OHLC\";\n\tpublic static classNames: Array = Candlestick.classNames.concat([OHLC.className]);\n\n\tpublic _draw() {\n\n\t\tconst display = this._display;\n\n\t\tdisplay.moveTo(this.get(\"lowX1\", 0), this.get(\"lowY1\", 0));\n\t\tdisplay.lineTo(this.get(\"highX1\", 0), this.get(\"highY1\", 0));\n\n\t\tlet w = this.width();\n\t\tlet h = this.height();\n\n\t\tif (this.get(\"orientation\") == \"vertical\") {\n\n\t\t\tlet lY = h;\n\t\t\tlet hY = 0;\n\t\t\tdisplay.moveTo(0, lY);\n\t\t\tdisplay.lineTo(w / 2, lY);\n\n\t\t\tdisplay.moveTo(w / 2, hY);\n\t\t\tdisplay.lineTo(w, hY);\n\t\t}\n\t\telse {\n\t\t\tlet lX = 0;\n\t\t\tlet hX = w;\n\n\t\t\tdisplay.moveTo(lX, 0);\n\t\t\tdisplay.lineTo(lX, h / 2);\n\n\t\t\tdisplay.moveTo(hX, h / 2);\n\t\t\tdisplay.lineTo(hX, h);\n\t\t}\n\t}\n}\n","import type { DataItem } from \"../../../core/render/Component\";\n\nimport { CandlestickSeries, ICandlestickSeriesPrivate, ICandlestickSeriesSettings, ICandlestickSeriesDataItem, ICandlestickSeriesAxisRange } from \"./CandlestickSeries\";\nimport { OHLC } from \"./OHLC\";\nimport { Template } from \"../../../core/util/Template\";\nimport { ListTemplate } from \"../../../core/util/List\";\n\nimport * as $utils from \"../../../core/util/Utils\";\n\nexport interface IOHLCSeriesDataItem extends ICandlestickSeriesDataItem {\n}\n\nexport interface IOHLCSeriesSettings extends ICandlestickSeriesSettings {\n}\n\nexport interface IOHLCSeriesPrivate extends ICandlestickSeriesPrivate {\n}\n\nexport interface IOHLCSeriesAxisRange extends ICandlestickSeriesAxisRange {\n\n\t/**\n\t * List of [[OHLC]] columns in a range.\n\t */\n\tcolumns: ListTemplate\n\n}\n\n/**\n * OHLC series.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/candlestick-series/} for more info\n * @important\n */\nexport class OHLCSeries extends CandlestickSeries {\n\n\tdeclare public _settings: IOHLCSeriesSettings;\n\tdeclare public _privateSettings: IOHLCSeriesPrivate;\n\tdeclare public _dataItemSettings: IOHLCSeriesDataItem;\n\tdeclare public _axisRangeType: IOHLCSeriesAxisRange;\n\n\tpublic static className: string = \"OHLCSeries\";\n\tpublic static classNames: Array = CandlestickSeries.classNames.concat([OHLCSeries.className]);\n\n\t/**\n\t * @ignore\n\t */\n\tpublic makeColumn(dataItem: DataItem, listTemplate: ListTemplate): OHLC {\n\t\tconst column = this.mainContainer.children.push(listTemplate.make());\n\t\tcolumn._setDataItem(dataItem);\n\t\tlistTemplate.push(column);\n\t\treturn column;\n\t}\n\n\t/**\n\t * A list of OHLC bars in the series.\n\t *\n\t * `columns.template` can be used to configure OHLC bars.\n\t *\n\t * @default new ListTemplate\n\t */\n\tpublic readonly columns: ListTemplate = this.addDisposer(new ListTemplate(\n\t\tTemplate.new({\n\t\t\tthemeTags: [\"autocolor\"]\n\t\t}),\n\t\t() => OHLC._new(this._root, {\n\t\t\tthemeTags: $utils.mergeTags(this.columns.template.get(\"themeTags\", []), [\"ohlc\", \"series\", \"column\"])\n\t\t}, [this.columns.template])\n\t));\n\n\tprotected _processAxisRange(axisRange: this[\"_axisRangeType\"]) {\n\t\tsuper._processAxisRange(axisRange);\n\t\taxisRange.columns = new ListTemplate(\n\t\t\tTemplate.new({}),\n\t\t\t() => OHLC._new(this._root, {\n\t\t\t\tthemeTags: $utils.mergeTags(axisRange.columns.template.get(\"themeTags\", []), [\"ohlc\", \"series\", \"column\"]),\n\t\t\t}, [this.columns.template, axisRange.columns.template])\n\t\t);\n\t}\n}\n","import { LineSeries, ILineSeriesSettings, ILineSeriesPrivate, ILineSeriesDataItem } from \"./LineSeries\";\nimport { curveMonotoneYTension } from \"../../../core/render/MonotoneYTension\";\n\nexport interface ISmoothedYLineSeriesDataItem extends ILineSeriesDataItem {\n\n}\n\nexport interface ISmoothedYLineSeriesSettings extends ILineSeriesSettings {\n\n\t/**\n\t * A tension force for the smoothing (0-1). The smaller the value the more\n\t * curvy the line will be.\n\t *\n\t * @default 0.5\n\t */\n\ttension?: number;\n\n}\n\nexport interface ISmoothedYLineSeriesPrivate extends ILineSeriesPrivate {\n}\n\n/**\n * Smoothed line series suitable for vertical plots.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/smoothed-series/} for more info\n */\nexport class SmoothedYLineSeries extends LineSeries {\n\tpublic static className: string = \"SmoothedYLineSeries\";\n\tpublic static classNames: Array = LineSeries.classNames.concat([SmoothedYLineSeries.className]);\n\n\tdeclare public _settings: ISmoothedYLineSeriesSettings;\n\tdeclare public _privateSettings: ISmoothedYLineSeriesPrivate;\n\tdeclare public _dataItemSettings: ISmoothedYLineSeriesDataItem;\n\n\tprotected _afterNew() {\n\t\tthis._setDefault(\"curveFactory\", curveMonotoneYTension(this.get(\"tension\", 0.5)) as any);\n\t\tsuper._afterNew();\n\t}\n\n\tpublic _updateChildren() {\n\t\tif (this.isDirty(\"tension\")) {\n\t\t\tthis.set(\"curveFactory\", curveMonotoneYTension(this.get(\"tension\", 0.5)) as any);\n\t\t\tthis._valuesDirty = true;\n\t\t}\n\n\t\tsuper._updateChildren();\n\t}\n}\n","import { LineSeries, ILineSeriesSettings, ILineSeriesPrivate, ILineSeriesDataItem } from \"./LineSeries\";\nimport { curveMonotoneXTension } from \"../../../core/render/MonotoneXTension\";\n\n\nexport interface ISmoothedXLineSeriesDataItem extends ILineSeriesDataItem {\n\n}\n\nexport interface ISmoothedXLineSeriesSettings extends ILineSeriesSettings {\n\n\t/**\n\t * A tension force for the smoothing (0-1). The smaller the value the more\n\t * curvy the line will be.\n\t *\n\t * @default 0.5\n\t */\n\ttension?: number;\n\n}\n\nexport interface ISmoothedXLineSeriesPrivate extends ILineSeriesPrivate {\n}\n\n/**\n * Smoothed line series suitable for horizontal plots.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/smoothed-series/} for more info\n */\nexport class SmoothedXLineSeries extends LineSeries {\n\tpublic static className: string = \"SmoothedXLineSeries\";\n\tpublic static classNames: Array = LineSeries.classNames.concat([SmoothedXLineSeries.className]);\n\n\tdeclare public _settings: ISmoothedXLineSeriesSettings;\n\tdeclare public _privateSettings: ISmoothedXLineSeriesPrivate;\n\tdeclare public _dataItemSettings: ISmoothedXLineSeriesDataItem;\n\n\tprotected _afterNew() {\n\t\tthis._setDefault(\"curveFactory\", curveMonotoneXTension(this.get(\"tension\", 0.5)) as any);\n\t\tsuper._afterNew();\n\t}\n\n\tpublic _updateChildren() {\n\t\tif (this.isDirty(\"tension\")) {\n\t\t\tthis.set(\"curveFactory\", curveMonotoneXTension(this.get(\"tension\", 0.5)) as any);\n\t\t\tthis._valuesDirty = true;\n\t\t}\n\n\t\tsuper._updateChildren();\n\t}\n}\n","import { LineSeries, ILineSeriesSettings, ILineSeriesPrivate, ILineSeriesDataItem } from \"./LineSeries\";\nimport { curveCardinal, CurveCardinalFactory } from \"d3-shape\";\n\nexport interface SmoothedXYLineSeriesDataItem extends ILineSeriesDataItem {\n\n}\n\nexport interface ISmoothedXYLineSeriesDataItem extends ILineSeriesDataItem {\n\n}\n\nexport interface SmoothedXYLineSeriesProperties extends ILineSeriesSettings {\n\n\t/**\n\t * A tension force for the smoothing (0-1). The smaller the value the more\n\t * curvy the line will be.\n\t *\n\t * @default 0.5\n\t */\n\ttension?: number;\n\n\t/**\n\t * @ignore\n\t*/\n\tcurveFactory?: CurveCardinalFactory\n\n}\n\nexport interface SmoothedXYLineSeriesPrivate extends ILineSeriesPrivate {\n}\n\n/**\n * Smoothed line series suitable for XY (scatter) charts\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/smoothed-series/} for more info\n */\nexport class SmoothedXYLineSeries extends LineSeries {\n\tpublic static className: string = \"SmoothedXYLineSeries\";\n\tpublic static classNames: Array = LineSeries.classNames.concat([SmoothedXYLineSeries.className]);\n\n\tdeclare public _settings: SmoothedXYLineSeriesProperties;\n\tdeclare public _privateSettings: SmoothedXYLineSeriesPrivate;\n\tdeclare public _dataItemSettings: SmoothedXYLineSeriesDataItem;\n\n\tprotected _afterNew() {\n\t\tthis._setDefault(\"curveFactory\", curveCardinal.tension(this.get(\"tension\", 0.5)));\n\t\tsuper._afterNew();\n\t}\n\n\tpublic _updateChildren() {\n\t\tif (this.isDirty(\"tension\")) {\n\t\t\tthis.set(\"curveFactory\", curveCardinal.tension(this.get(\"tension\", 0.5)) as any);\n\t\t\tthis._valuesDirty = true;\n\t\t}\n\n\t\tsuper._updateChildren();\n\t}\n}\n","function Step(context, t) {\n this._context = context;\n this._t = t;\n}\n\nStep.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = this._y = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: {\n if (this._t <= 0) {\n this._context.lineTo(this._x, y);\n this._context.lineTo(x, y);\n } else {\n var x1 = this._x * (1 - this._t) + x * this._t;\n this._context.lineTo(x1, this._y);\n this._context.lineTo(x1, y);\n }\n break;\n }\n }\n this._x = x, this._y = y;\n }\n};\n\nexport default function(context) {\n return new Step(context, 0.5);\n}\n\nexport function stepBefore(context) {\n return new Step(context, 0);\n}\n\nexport function stepAfter(context) {\n return new Step(context, 1);\n}\n","import { LineSeries, ILineSeriesSettings, ILineSeriesPrivate, ILineSeriesDataItem } from \"./LineSeries\";\nimport type { AxisRenderer } from \"../axes/AxisRenderer\";\nimport type { Axis } from \"../axes/Axis\";\nimport { Percent, p100 } from \"../../../core/util/Percent\";\nimport type { DataItem } from \"../../../core/render/Component\";\nimport { curveStepAfter } from \"d3-shape\";\n\nexport interface IStepLineSeriesDataItem extends ILineSeriesDataItem {\n}\n\nexport interface IStepLineSeriesSettings extends ILineSeriesSettings {\n\n\t/**\n\t * Width of the step in percent relative to the cell width.\n\t *\n\t * NOTE: setting this to less than 100% makes sense only when risers are\n\t * disabled: `noRisers: true`\n\t *\n\t * @default 100%\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/step-line-series/#Step_width} for more info\n\t */\n\tstepWidth?: Percent;\n\n\t/**\n\t * Disables vertical connecting lines for the steps.\n\t *\n\t * @default false\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/xy-chart/series/step-line-series/#Disabling_risers} for more info\n\t */\n\tnoRisers?: boolean;\n\n}\n\nexport interface IStepLineSeriesPrivate extends ILineSeriesPrivate {\n}\n\nexport class StepLineSeries extends LineSeries {\n\tpublic static className: string = \"StepLineSeries\";\n\tpublic static classNames: Array = LineSeries.classNames.concat([StepLineSeries.className]);\n\n\tdeclare public _settings: IStepLineSeriesSettings;\n\tdeclare public _privateSettings: IStepLineSeriesPrivate;\n\tdeclare public _dataItemSettings: IStepLineSeriesDataItem;\n\n\tprotected _afterNew() {\n\t\tthis._setDefault(\"curveFactory\", curveStepAfter);\n\t\tsuper._afterNew();\n\t}\n\n\n\tprotected _getPoints(dataItem: DataItem, o: { points: Array>, segments: number[][][], stacked: boolean | undefined, getOpen: boolean, basePosX: number, basePosY: number, fillVisible: boolean | undefined, xField: string, yField: string, xOpenField: string, yOpenField: string, vcx: number, vcy: number, baseAxis: Axis, xAxis: Axis, yAxis: Axis, locationX: number, locationY: number, openLocationX: number, openLocationY: number }) {\n\t\tlet points = o.points;\n\n\t\tlet width = this.get(\"stepWidth\", p100).value / 2;\n\n\t\tlet itemLocationX0 = dataItem.get(\"locationX\", o.locationX);\n\t\tlet itemLocationY0 = dataItem.get(\"locationY\", o.locationY);\n\t\tlet itemLocationX1 = itemLocationX0;\n\t\tlet itemLocationY1 = itemLocationY0;\n\n\t\tif (o.baseAxis === o.xAxis) {\n\t\t\titemLocationX0 -= width;\n\t\t\titemLocationX1 += width;\n\t\t}\n\t\telse if (o.baseAxis === o.yAxis) {\n\t\t\titemLocationY0 -= width;\n\t\t\titemLocationY1 += width;\n\t\t}\n\n\t\tlet xPos0 = o.xAxis.getDataItemPositionX(dataItem, o.xField, itemLocationX0, o.vcx);\n\t\tlet yPos0 = o.yAxis.getDataItemPositionY(dataItem, o.yField, itemLocationY0, o.vcy);\n\n\t\tlet xPos1 = o.xAxis.getDataItemPositionX(dataItem, o.xField, itemLocationX1, o.vcx);\n\t\tlet yPos1 = o.yAxis.getDataItemPositionY(dataItem, o.yField, itemLocationY1, o.vcy);\n\n\t\tif (this._shouldInclude(xPos0)) {\n\n\t\t\tconst iPoint0 = this.getPoint(xPos0, yPos0);\n\t\t\tconst point0 = [iPoint0.x, iPoint0.y];\n\n\t\t\tconst iPoint1 = this.getPoint(xPos1, yPos1);\n\t\t\tconst point1 = [iPoint1.x, iPoint1.y];\n\n\t\t\tif (o.fillVisible) {\n\t\t\t\tlet xOpenPos0: number = xPos0;\n\t\t\t\tlet yOpenPos0: number = yPos0;\n\t\t\t\tlet xOpenPos1: number = xPos1;\n\t\t\t\tlet yOpenPos1: number = yPos1;\n\n\t\t\t\tif (o.baseAxis === o.xAxis) {\n\t\t\t\t\tyOpenPos0 = o.basePosY;\n\t\t\t\t\tyOpenPos1 = o.basePosY;\n\t\t\t\t}\n\t\t\t\telse if (o.baseAxis === o.yAxis) {\n\t\t\t\t\txOpenPos0 = o.basePosX;\n\t\t\t\t\txOpenPos1 = o.basePosX;\n\t\t\t\t}\n\n\t\t\t\tif (o.getOpen) {\n\t\t\t\t\tlet valueX = dataItem.get(o.xOpenField as any);\n\t\t\t\t\tlet valueY = dataItem.get(o.yOpenField as any);\n\n\t\t\t\t\tif (valueX != null && valueY != null) {\n\t\t\t\t\t\titemLocationX0 = dataItem.get(\"openLocationX\", o.openLocationX);\n\t\t\t\t\t\titemLocationY0 = dataItem.get(\"openLocationY\", o.openLocationY);\n\n\t\t\t\t\t\titemLocationX1 = itemLocationX0;\n\t\t\t\t\t\titemLocationY1 = itemLocationY0;\n\n\t\t\t\t\t\tif (o.baseAxis === o.xAxis) {\n\t\t\t\t\t\t\titemLocationX0 -= width;\n\t\t\t\t\t\t\titemLocationX1 += width;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (o.baseAxis === o.yAxis) {\n\t\t\t\t\t\t\titemLocationY0 -= width;\n\t\t\t\t\t\t\titemLocationY1 += width;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (o.stacked) {\n\t\t\t\t\t\t\tlet stackToItemX = dataItem.get(\"stackToItemX\")!;\n\t\t\t\t\t\t\tlet stackToItemY = dataItem.get(\"stackToItemY\")!;\n\n\t\t\t\t\t\t\tif (stackToItemX) {\n\t\t\t\t\t\t\t\txOpenPos0 = o.xAxis.getDataItemPositionX(stackToItemX, o.xField, itemLocationX0, (stackToItemX.component as StepLineSeries).get(\"vcx\"));\n\t\t\t\t\t\t\t\txOpenPos1 = o.xAxis.getDataItemPositionX(stackToItemX, o.xField, itemLocationX1, (stackToItemX.component as StepLineSeries).get(\"vcx\"));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tif (o.yAxis === o.baseAxis) {\n\t\t\t\t\t\t\t\t\txOpenPos0 = o.basePosX;\n\t\t\t\t\t\t\t\t\txOpenPos1 = o.basePosX;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (o.baseAxis === o.yAxis) {\n\t\t\t\t\t\t\t\t\txOpenPos0 = o.xAxis.getDataItemPositionX(dataItem, o.xOpenField, itemLocationX0, o.vcx);\n\t\t\t\t\t\t\t\t\txOpenPos1 = o.xAxis.getDataItemPositionX(dataItem, o.xOpenField, itemLocationX1, o.vcx);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (stackToItemY) {\n\t\t\t\t\t\t\t\tyOpenPos0 = o.yAxis.getDataItemPositionY(stackToItemY, o.yField, itemLocationY0, (stackToItemY.component as StepLineSeries).get(\"vcy\"));\n\t\t\t\t\t\t\t\tyOpenPos1 = o.yAxis.getDataItemPositionY(stackToItemY, o.yField, itemLocationY1, (stackToItemY.component as StepLineSeries).get(\"vcy\"));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tif (o.xAxis === o.baseAxis) {\n\t\t\t\t\t\t\t\t\tyOpenPos0 = o.basePosY;\n\t\t\t\t\t\t\t\t\tyOpenPos1 = o.basePosY;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (o.baseAxis === o.yAxis) {\n\t\t\t\t\t\t\t\t\tyOpenPos0 = o.yAxis.getDataItemPositionY(dataItem, o.yOpenField, itemLocationY0, o.vcy);\n\t\t\t\t\t\t\t\t\tyOpenPos1 = o.yAxis.getDataItemPositionY(dataItem, o.yOpenField, itemLocationY1, o.vcy);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\txOpenPos0 = o.xAxis.getDataItemPositionX(dataItem, o.xOpenField, itemLocationX0, o.vcx);\n\t\t\t\t\t\t\tyOpenPos0 = o.yAxis.getDataItemPositionY(dataItem, o.yOpenField, itemLocationY0, o.vcy);\n\t\t\t\t\t\t\txOpenPos1 = o.xAxis.getDataItemPositionX(dataItem, o.xOpenField, itemLocationX1, o.vcx);\n\t\t\t\t\t\t\tyOpenPos1 = o.yAxis.getDataItemPositionY(dataItem, o.yOpenField, itemLocationY1, o.vcy);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet closeIPoint0 = this.getPoint(xOpenPos0, yOpenPos0);\n\t\t\t\tlet closeIPoint1 = this.getPoint(xOpenPos1, yOpenPos1);\n\n\t\t\t\tpoint0[2] = closeIPoint0.x;\n\t\t\t\tpoint0[3] = closeIPoint0.y;\n\n\t\t\t\tpoint1[2] = closeIPoint1.x;\n\t\t\t\tpoint1[3] = closeIPoint1.y;\n\t\t\t}\n\n\t\t\tpoints.push(point0);\n\t\t\tpoints.push(point1);\n\n\t\t\tdataItem.set(\"point\", {x:point0[0] + (point1[0] - point0[0]) / 2, y:point0[1] + (point1[1] - point0[1]) / 2 });\n\t\t}\n\n\t\tif (this.get(\"noRisers\")) {\n\t\t\to.points = [];\n\t\t\to.segments.push(points);\n\t\t}\n\t}\n}\n","import * as m from \"./../../dist/es2015/xy.js\";\nexport const am5xy = m;","export function point(that, x, y) {\n that._context.bezierCurveTo(\n that._x1 + that._k * (that._x2 - that._x0),\n that._y1 + that._k * (that._y2 - that._y0),\n that._x2 + that._k * (that._x1 - x),\n that._y2 + that._k * (that._y1 - y),\n that._x2,\n that._y2\n );\n}\n\nexport function Cardinal(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinal.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: point(this, this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; this._x1 = x, this._y1 = y; break;\n case 2: this._point = 3; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new Cardinal(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n"],"names":["XYChart","this","chartContainer","children","push","new","_root","width","layout","verticalLayout","height","horizontalLayout","yAxesAndPlotContainer","maskContent","plotsContainer","plotContainer","isMeasured","topPlotContainer","themeTags","icon","x","y","_afterNew","_defaultThemes","super","_disposers","xAxes","yAxes","root","zoomOutButton","events","on","zoomOut","hide","states","lookup","set","seriesContainer","_processAxis","bottomAxesContainer","leftAxesContainer","topGridContainer","bulletsContainer","event","_handlePlotDown","_handlePlotUp","_handlePlotMove","_maskGrid","_setUpTouch","_beforeChanged","isDirty","get","_display","cancelTouch","gridContainer","_removeSeries","series","_unstack","_posXDp","dispose","_posYDp","undefined","xAxis","markDirtyExtremes","yAxis","cursor","snapToSeries","handleWheel","wheelX","wheelY","wheelEvent","originalEvent","prevent","plotPoint","toLocal","point","wheelStep","shiftY","deltaY","shiftX","deltaX","wheelZoomPositionX","wheelZoomPositionY","each","axis","start","end","position","fixPosition","maxDeviation","newStart","Math","min","max","newEnd","getPrivate","Infinity","_handleWheelAnimation","zoom","delta","_getWheelSign","se","_fixWheel","preventDefault","_handleSetWheel","_wheelDp","abs","sign","diff","button","local","pointerId","_downPoints","length","getIndex","_downStartX","_downEndX","_downStartY","_downEndY","_downPoint","clientX","clientY","panX","panY","_panStart","_panEnd","eventType","isEnabled","dispatch","type","target","animation","_dispatchWheelAnimation","downPoint","_isPanning","_movePoints","_handlePinch","documentPointToRoot","scrollbarX","disableType","panStart","panEnd","enableType","scrollbarY","i","downPoints","movePoints","k","movePoint","w","h","downPoint0","downPoint1","movePoint0","movePoint1","downStartX","downEndX","downPos0","downPos1","movePos0","movePos1","d","s","e","sa","ea","downStartY","downEndY","_handleCursorPosition","cursorPoint","snapToSeriesBy","dataItems","isHidden","isHiding","startIndex","endIndex","dataItem","tooltipDataItem","closestItem","minDistance","distance","hypot","tooltip","_setDataItem","component","showDataItemTooltip","setRaw","handleMove","toGlobal","_updateCursor","updateCursor","_addCursor","_prepareChildren","_colorize","previous","_prevSettings","_disposeProperty","_setChart","_pushPropertyDisposer","_handleCursorSelectEnd","parent","topAxesContainer","_handleScrollbar","grip","_handleAxisSelection","setPrivate","getTooltipText","rightAxesContainer","_handleZoomOut","_processSeries","addDisposer","_fixPosition","isType","_markDirtyKey","_markDirtyAxes","_seriesAdded","colorSet","color","next","_setSoft","patternSet","pattern","behavior","downPositionX","downPositionY","positionX","positionY","position0","toAxisPosition","position1","axes","priority","axisStart","axisEnd","zoomAnimation","updateScrollbar","setPrivateRaw","container","onAll","change","oldValues","_removeAxis","newValue","processChart","setIndex","index","insertIndex","oldValue","Error","moveValue","value","newIndex","isDisposed","axisParent","removeValue","gridParent","topGridParent","_updateChartLayout","left","right","processAxis","force","indexOf","updateGrips","visible","show","inPlot","otherCharts","_otherCharts","global","chart","chartPlotContainer","documentPoint","rootPointToDocument","chartRoot","arrangeTooltips","hh","bounds","tooltipContainer","bottom","plotT","plotB","tooltips","closest","closestPoint","sum","_movePoint","maxTooltipDistance","maxTooltipDistanceBy","tooltipSeries","hidden","_tooltipToLocal","count","sort","a","b","prevY","centerY","top","_fy","reverse","prevBottom","_dispose","classNames","concat","className","XYChartDefaultTheme","setupDefaultRules","ic","interfaceColors","language","r","rule","bind","setAll","colors","paddingLeft","paddingRight","paddingTop","paddingBottom","pinchZoomX","pinchZoomY","legendLabelText","fill","fromHex","fillOpacity","saturation","cornerRadiusTR","cornerRadiusTL","cornerRadiusBR","cornerRadiusBL","focusable","create","strokeOpacity","inside","minGridDistance","opacity","minPosition","maxPosition","fontSize","text","populateText","centerX","layer","exportable","moveThreshold","forceInactive","strokeDasharray","role","ariaLabel","translate","minZoomCount","maxZoomCount","maxZoomFactor","snapTooltip","tooltipLocation","zoomX","zoomY","fixAxisSize","location","multiLocation","crisp","opposite","inversed","cellStartLocation","cellEndLocation","cursorOverStyle","startLocation","endLocation","fillRule","axisFill","gridIntervals","timeUnit","dateFormats","periodChangeDateFormats","tooltipDateFormats","markUnitChange","strictMinMax","groupData","groupCount","groupIntervals","endValue","intervalDuration","baseInterval","gridInterval","Date","locale","firstDayOfWeek","utc","timezone","getTime","val","round","baseValue","logarithmic","autoZoom","step","baseUnit","maskBullets","stackToNegative","locationX","locationY","openValueXGrouped","openValueYGrouped","valueXGrouped","valueYGrouped","seriesTooltipTarget","adjustBulletPosition","clustered","strokeWidth","connect","autoGapCount","draw","display","sprite","moveTo","lineTo","tension","lowValueXGrouped","lowValueYGrouped","highValueXGrouped","highValueYGrouped","interactive","draggable","rotation","XYCursor","_settings","_drawLines","setTimeout","lineX","_handleXLine","lineY","_handleYLine","_handleLineFocus","_handleLineBlur","document","ev","_handleLineMove","ctrlKey","key","dir","focused","m","nextPosition","_alwaysShow","alwaysShow","isFocus","_tooltipX","_updateXLine","_tooltipY","_updateYLine","_handleSyncWith","syncWith","_updateChildren","_getPoint","_toX","animate","to","duration","easing","_toY","_handleMove","_handleCursorDown","_handleCursorUp","native","_lastPoint2","selection","_inPlot","rootPoint","_getPosition","charAt","lastPoint","_lastPoint","skipEvent","xyPos","userPositionX","userPositionY","xy","handleCursorShow","_updateLines","_updateSelection","_onHide","handleCursorHide","_onShow","Axis","background","labelsContainer","axisHeader","axisRanges","disposeDataItem","_processAxisRange","renderer","ghostLabel","makeLabel","adapters","disable","tooltipText","tooltipHTML","_updateFinals","_start","_end","sAnimation","_sAnimation","eAnimation","_eAnimation","maxZoomFactorReal","minZoomFactor","playing","stop","_series","_createAssets","_rangesDirty","_prepareDataItem","above","grid","_dataItem","_index","markDirtySelectionExtremes","_calculateTotals","_updateAxisRanges","_bullets","axisRange","_seriesAxisRanges","_inversed","_axisLength","axisLength","_updateLC","rendererTags","addTag","toLowerCase","_applyThemes","label","_updateTooltipBounds","updateTooltipBounds","_updateBounds","axisHeadersContainer","onPrivate","markDirtySize","hideDataItem","_toggleFHDataItem","showDataItem","forceHidden","fh","tick","bullet","_toggleDataItem","v","tags","minor","remove","labels","makeGrid","makeTick","ticks","makeAxisFill","_processBullet","axisBullet","_afterChanged","_updatePositions","axisFills","_updateGhost","getCellWidthPosition","localBounds","gWidth","ceil","_getText","updateLabel","_cursorPosition","_snapToSeries","updateTooltip","getSeriesItem","updateLegendMarker","updateLegendValue","roundAxisPosition","_updateTooltipText","positionTooltip","_location","processSeriesDataItem","_fields","_clearDirty","_sizeDirty","coordinateToPosition","coordinate","toGlobalPosition","shouldGap","_nextItem","_autoGapCount","_fieldName","createAxisRange","axisDataItem","_groupSeriesData","AxisBullet","uid","AxisLabel","AxisLabelRadial","AxisRenderer","_new","template","make","gridCount","thumb","_handleThumbDown","_handleThumbUp","_handleThumbMove","once","_changed","pan","_thumbDownPoint","_downStart","_downEnd","_event","downStart","downEnd","extra","_getPan","_point1","_point2","positionToCoordinate","_tooltip","_updateSize","markDirty","_clear","toggleVisibility","_positionTooltip","AxisRendererX","gridTemplate","graphics","axisChildren","removeTag","_markDirtyRedraw","point1","point2","_ls","_lc","innerWidth","positionToPoint","updateTick","endPosition","updateGrid","updateBullet","bulletPosition","previousBullet","previousSprite","updateFill","x0","x1","fillDrawMethod","num","pointerOrientation","oldBounds","AxisRendererY","innerHeight","y0","y1","AxisTick","DateAxis","_setBaseInterval","interval","_baseDuration","_fixZoomFactor","baseMainDuration","_groupData","groupInterval","_handleRangeChange","_dataGrouped","mainDataSetId","setDataSet","resetGrouping","_seriesDataGrouped","intervals","baseDuration","_dataSets","fields","baseAxis","_valueYFields","_valueXFields","_mainDataItems","groupCallback","groupOriginals","newDataItem","previousTime","dataSetId","groupFieldValues","workingFields","field","firstTime","prevNewDataItem","dataContext","time","roundedTime","_makeDataItem","groupKey","currentValue","average","_dataSetId","_groupingCalculated","getGroupInterval","getIntervalMax","_intervalMax","getIntervalMin","_intervalMin","selectionMin","selectionMax","current","modifiedDifference","newId","fieldName","endIndex2","firstDataItem","lastDataItem","lastDate","firstDate","outOfSelection","_adjustStartIndex","_markDirtyPrivateKey","_adjustMinMax","_strictMode","_intervalDuration","_saveMinMax","id","_getM","_getMinorInterval","minorGridInterval","_prepareAxisItems","nextGridUnit","format","previousValue","formats","minorLabelsEnabled","minorGridEnabled","minorDuration","_dataItems","processDataItem","date","dateFormatter","labelEndValue","minorTimeUnit","minorCount","mmm","previousMinorValue","minorValue","minorFormats","minorDataItem","minorDataItems","minorEndValue","minorLabel","j","inited","positionToValue","_getDelta","_deltaMinMax","_fixMin","startTime","endTime","_fixMax","_updateDates","_date","open","close","_handleSizeDirty","getDataItemPositionX","cellLocation","axisLocation","openValue","closeValue","_baseValue","valueToPosition","getDataItemCoordinateX","getDataItemPositionY","getDataItemCoordinateY","firstDay","NaN","adjustPosition","snap","result","diValue","first","second","nextItem","value1","zoomToDates","zoomToValues","futureGroupInterval","baseMin","baseMax","futureMin","futureMax","positionToDate","dateToPosition","dtime","tooltipValue","_nextTime","GaplessDateAxis","valueFields","_getDates","_customDates","_dates","dates","found","_updateAllDates","extraMax","extraMin","len","baseCount","unshift","itemValue","nextDate","nextItemValue","valueToIndex","findex","floor","startValue","_seriesValuesDirty","maxCount","Number","MAX_SAFE_INTEGER","frequency","_frequency","realDuration","now","previousDataItem","selectedItems","_getIndexes","_m","_addMinorGrid","timeUnit2","previousLabel","worse","_pickWorse","dataItemA","dataItemB","valueA","valueB","getDate","mTimeUnit","maxValue","minorSelectedItems","firstValue","items","c","fullDuration","originalValue","realValue","_hasDate","_baseInterval","Grid","isPrivateDirty","ValueAxis","_dirtyExtremes","_dirtySelectionExtremes","syncWithAxis","_syncDp","someDirty","_valuesDirty","_getMinMax","getMM","letter","_getSelectionMinMax","_dseHandled","_formatText","numberFormat","formatter","getNumberFormatter","differencePower","minLog","_minLogAdjusted","_minRealLog","pow","log","LOG10E","stepPower","stepAdjusted","minorGridCount","minorStep","nextValue","decCount","fillEndPosition","labelEndPosition","hasTag","minMaxStep","stepDecimalPlaces","E","treatZeroAs","valueToFinalPosition","getX","getY","_cellLocation","getStackedXValueWorking","getStackedYValueWorking","basePosition","cellEndValue","fixSmallStep","vc","fieldWorking","total","minDefined","maxDefined","selectionStrictMinMax","seriesMin","seriesMax","minX","maxX","minY","maxY","isShowing","range","_minReal","_maxReal","smin","minMaxStep2","selectionMinReal","selectionMaxReal","_syncAxes","LN10","minDiff","initialMin","initialMax","minAdapted","fold","maxAdapted","strictMinMaxSelection","strict","animatePrivate","exponent","power","_min","_max","strictMode","difference","stepDivisor","maxPrecision","ceiledStep","MAX_VALUE","minCount","_adjustPosition","extraDecimals","decimals","oldDiff","syncMin","syncMax","syncStep","currentCount","synced","omin","omax","ostep","_checkSync","BaseColumnSeries","_makeGraphics","listTemplate","makeColumn","_makeFieldNames","categoryAxis","valueAxis","_xOpenField","_xField","_yOpenField","_yField","_createGraphics","_ph","_pw","columnsTemplate","columns","clusterCount","stacked","xRenderer","yRenderer","cellLocationX0","cellLocationX1","cellLocationY0","cellLocationY1","_aLocationX0","_aLocationX1","_aLocationY0","_aLocationY1","_axesDirty","_stackDirty","_toggleColumn","_updateGraphics","_skipped","legendDataItem","markerRectangle","ds","setting","graphicsArray","rangeGraphics","xField","yField","valueX","valueY","xOpenField","yOpenField","openLocationX","openLocationY","xStart","xEnd","yStart","yEnd","l","t","vcy","vcx","fitW","fitH","offset","stackToItemY","stackToItemX","_updateSeriesGraphics","_applyGraphicsStates","maxWidth","maxHeight","ptl","getPoint","pbr","tooltipPoint","_x","_y","_handleDataSetChange","dropFromOpen","riseFromOpen","dropFromPrevious","riseFromPrevious","previousClose","apply","list","promises","Promise","all","bullets","column","_getTooltipTarget","Candlestick","_draw","CandlestickSeries","mainContainer","getRaw","lx0","lx1","ly0","ly1","hx0","hx1","hy0","hy1","orientation","_xLowField","_xHighField","_yLowField","_yHighField","_updateCandleGraphics","pl0","pl1","ph0","ph1","ColumnSeries","LineSeries","strokes","fills","_fillGenerator","p","makeStroke","stroke","makeFill","_strokeTemplate","_fillTemplate","legendStroke","_legendStroke","legendFill","_legendFill","fillPattern","curveFactory","_strokeGenerator","curve","strokeTemplateField","fillTemplateField","strokeTemplateFound","fillTemplateFound","hasValues","_valueFields","_endIndex","_clearGraphics","_sindex","_dindex","_startSegment","clear","dataItemIndex","currentEndIndex","fillTemplate","originalTemplate","strokeTemplate","xOpenFieldValue","yOpenFieldValue","basePosX","basePosY","baseField","segments","points","fillVisible","getOpen","o","rangeStrokeTemplate","rangeFillTemplate","_getPoints","_endLine","_drawStroke","_drawFill","itemLocationX","itemLocationY","xPos","yPos","_shouldInclude","iPoint","xPos0","yPos0","closeIPoint","p0","p1","p2","p3","prev","_previousPoint","pp0","pp1","pp2","pp3","_points","_firstPoint","segment","context","createLegendMarker","marker","disabledColor","bulletFunction","legend","XYSeries","_setRawDefault","_removeAxisRange","_updateFields","_valueXShowFields","_valueYShowFields","__valueXShowFields","__valueYShowFields","valueXFields","split","valueYFields","_shouldMakeBullet","minBulletDistance","xName","xCapName","yName","yCapName","xLetter","yLetter","low","high","_fixVC","hiddenState","sequencedInterpolation","_handleMaskBullets","tooltipFieldX","tooltipFieldY","_tooltipFieldX","_tooltipFieldY","_dataProcessed","_stack","getStackedXValue","getStackedYValue","_markStakedDirtyStack","_showBullets","_psi","_pei","_selectionProcessed","processYSelectionDataItem","processXSelectionDataItem","selectionMinY","selectionMaxY","selectionMinX","selectionMaxX","_makeRangeMask","mainContainerMask","_mainContainerMask","mask","seriesIndex","_couldStackTo","_stackDataItems","_reallyStackedTo","_key","_stackedSeries","stackToItemKey","stackToSeries","stackToItem","stackValue","stackedToSeries","_markDataSetDirty","_afterDataChange","_aggregatesCalculated","_positionBullet","_shouldShowBullet","realField","previousBounds","yo","xo","_positionX","_positionY","dataSet","mainDataItems","then","_isShowing","_sequencedShowHide","_isHiding","waitForStop","_markDirtyStack","stackedSeries","markDirtyText","hideTooltip","txt","_emptyDataItem","valueLabel","_getItemReaderLabel","_position","resetExtremes","minSelection","dl","XYChartScrollbar","Scrollbar","interactiveChildren","Graphics","_addOrientationClass","startGrip","endGrip","_updateThumb","overlay","CategoryAxis","_itemMap","startCategory","endCategory","openKey","otherAxis","startDataItem","endDataItem","hasValue","f","fillIndex","categoryLocation","endCategoryLocation","categoryToIndex","indexToPosition","fillEndIndex","_axisLocation","category","dataItemToPosition","axisPositionToIndex","seriesDataItem","zoomToIndexes","zoomToCategories","CategoryDateAxis","previousIndex","previousUnitValue","changed","skip","unitValue","added","pop","shouldAdd","item","DurationAxis","durationFormatter","getDurationFormatter","divisors","realDivisor","divisor","reducedCount","getFormat","OHLC","lY","hY","lX","hX","OHLCSeries","List","Template","SmoothedYLineSeries","_setDefault","SmoothedXLineSeries","SmoothedXYLineSeries","Step","_context","_t","stepAfter","prototype","areaStart","_line","areaEnd","lineStart","_point","lineEnd","closePath","StepLineSeries","itemLocationX0","itemLocationY0","itemLocationX1","itemLocationY1","xPos1","yPos1","iPoint0","point0","iPoint1","xOpenPos0","yOpenPos0","xOpenPos1","yOpenPos1","closeIPoint0","closeIPoint1","am5xy","that","bezierCurveTo","_x1","_k","_x2","_x0","_y1","_y2","_y0","Cardinal","custom","cardinal"],"sourceRoot":""}