{"version":3,"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/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/AxisTick.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/axes/Grid.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/series/BaseColumnSeries.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/series/LineSeries.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/series/XYSeries.ts","webpack://@amcharts/amcharts5/./node_modules/d3-shape/src/curve/cardinal.js","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/XYChartScrollbar.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/axes/Axis.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/ValueAxis.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/DurationAxis.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/axes/AxisBullet.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/series/Candlestick.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/series/ColumnSeries.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/xy/series/CandlestickSeries.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"],"names":["chartContainer","children","push","_root","width","layout","verticalLayout","height","horizontalLayout","yAxesAndPlotContainer","maskContent","plotContainer","isMeasured","themeTags","icon","x","y","this","_defaultThemes","_afterNew","_disposers","xAxes","yAxes","root","zoomOutButton","events","on","zoomOut","set","states","lookup","seriesContainer","_processAxis","bottomAxesContainer","leftAxesContainer","topGridContainer","bulletsContainer","moveValue","fill","fillOpacity","event","_handlePlotDown","originalEvent","_handlePlotUp","_handlePlotMove","series","xAxis","get","yAxis","_removeSeries","wheelX","wheelY","_wheelDp","wheelEvent","preventDefault","plotPoint","toLocal","documentPointToRoot","clientX","clientY","wheelStep","shiftY","deltaY","shiftX","deltaX","each","axis","start","end","position","fixPosition","newStart","newEnd","Infinity","_handleWheelAnimation","zoom","getPrivate","delta","dispose","local","_downPoint","panX","panY","_panStart","_panEnd","eventType","isEnabled","dispatch","type","target","animation","_dispatchWheelAnimation","_event","undefined","_isPanning","downPoint","scrollbarX","disableType","panStart","panEnd","enableType","scrollbarY","cursor","snapToSeries","isHidden","isHiding","startIndex","endIndex","i","dataItem","dataItems","tooltipDataItem","point","distance","Math","abs","hypot","tooltip","_setDataItem","component","showDataItemTooltip","handleMove","toGlobal","_prepareChildren","_colorize","isDirty","_handleSetWheel","previous","_prevSettings","_disposeProperty","_setChart","_addCursor","_pushPropertyDisposer","_handleCursorSelectEnd","parent","topAxesContainer","e","_handleScrollbar","grip","setPrivate","getIndex","getTooltipText","rightAxesContainer","_handleZoomOut","_processSeries","colorSet","color","next","_setSoft","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","value","newIndex","isDisposed","axisParent","removeValue","gridContainer","gridParent","topGridParent","left","right","_axis","force","indexOf","setRaw","updateGrips","show","hide","otherCharts","_otherCharts","global","length","chart","chartPlotContainer","documentPoint","rootPointToDocument","chartRoot","closest","closestPoint","w","h","plotT","_display","plotB","tooltips","sum","minDistance","movePoint","_movePoint","maxTooltipDistance","tooltipSeries","hidden","inPlot","_tooltipToLocal","tooltipContainer","count","sort","a","b","ya","yb","centerY","top","bottom","min","_fy","max","XYChart","className","setupDefaultRules","ic","interfaceColors","language","r","rule","bind","setAll","colors","paddingLeft","paddingRight","paddingTop","paddingBottom","arrangeTooltips","saturation","cornerRadiusTR","cornerRadiusTL","cornerRadiusBR","cornerRadiusBL","focusable","create","strokeOpacity","inside","minGridDistance","opacity","minPosition","maxPosition","fontSize","text","populateText","centerX","visible","layer","exportable","snapToSeriesBy","strokeDasharray","minZoomCount","maxZoomCount","maxZoomFactor","maxDeviation","snapTooltip","tooltipLocation","zoomX","zoomY","fixAxisSize","location","multiLocation","opposite","inversed","cellStartLocation","cellEndLocation","cursorOverStyle","startLocation","endLocation","fillRule","axisFill","gridIntervals","timeUnit","dateFormats","translate","periodChangeDateFormats","tooltipDateFormats","markUnitChange","strictMinMax","groupData","groupCount","groupIntervals","endValue","intervalDuration","baseInterval","Date","locale","firstDayOfWeek","utc","timezone","getTime","val","round","baseValue","logarithmic","extraMin","extraMax","step","baseUnit","maskBullets","stackToNegative","locationX","locationY","openValueXGrouped","openValueYGrouped","valueXGrouped","valueYGrouped","seriesTooltipTarget","adjustBulletPosition","clustered","strokeWidth","role","connect","autoGapCount","draw","display","sprite","moveTo","lineTo","tension","lowValueXGrouped","lowValueYGrouped","highValueXGrouped","highValueYGrouped","_settings","_drawLines","setTimeout","lineX","_handleXLine","lineY","_handleYLine","_tooltipX","_updateXLine","_tooltipY","_updateYLine","syncWith","_updateChildren","_handleSyncWith","_getPoint","_toX","animate","key","to","duration","easing","_toY","_handleMove","_handleCursorDown","_handleCursorUp","native","_downPoints","selection","rootPoint","_inPlot","_getPosition","charAt","userPositionX","userPositionY","lastPoint","_lastPoint","skipEvent","alwaysShow","xyPos","xy","_handleCursorPosition","handleCursorShow","_updateLines","_updateSelection","handleCursorHide","_onHide","_onShow","_dispose","XYCursor","AxisLabel","AxisLabelRadial","ticks","template","grid","axisFills","labels","tick","make","labelsContainer","label","axisLength","thumb","_handleThumbDown","_handleThumbUp","_handleThumbMove","_changed","pan","_thumbDownPoint","_downStart","_downEnd","downStart","downEnd","extra","_getPan","_point1","_point2","_inversed","_end","_axisLength","_start","_tooltip","markDirty","_clear","AxisRenderer","AxisTick","_beforeChanged","isPrivateDirty","Grid","listTemplate","makeColumn","_makeFieldNames","categoryAxis","valueAxis","isType","_xOpenField","_xField","_yOpenField","_yField","len","inited","_createGraphics","_ph","_pw","baseAxis","columnsTemplate","columns","clusterCount","BaseColumnSeries","stacked","xRenderer","yRenderer","cellLocationX0","cellLocationX1","cellLocationY0","cellLocationY1","_aLocationX0","_aLocationX1","_aLocationY0","_aLocationY1","_axesDirty","_valuesDirty","_stackDirty","_sizeDirty","_toggleColumn","j","_updateGraphics","_skipped","graphics","_makeGraphics","legendDataItem","markerRectangle","stroke","axisRanges","axisRange","graphicsArray","rangeGraphics","previousDataItem","xField","yField","valueX","valueY","xOpenField","yOpenField","openLocationX","openLocationY","xStart","xEnd","yStart","yEnd","vcy","vcx","offset","getDataItemPositionX","getDataItemPositionY","stackToItemY","basePosition","stackToItemX","_updateSeriesGraphics","_applyGraphicsStates","l","t","fitW","fitH","maxWidth","maxHeight","ptl","getPoint","pbr","tooltipPoint","_x","_y","_handleDataSetChange","_dataItems","dropFromOpen","riseFromOpen","dropFromPrevious","riseFromPrevious","previousClose","apply","disposeDataItem","list","promises","hideDataItem","Promise","all","bullets","bullet","showDataItem","column","setting","_getTooltipTarget","strokes","fills","_fillGenerator","y0","p","x0","y1","x1","mainContainer","_strokeTemplate","_fillTemplate","legendStroke","_legendStroke","legendFill","_legendFill","curveFactory","_strokeGenerator","curve","strokeTemplateField","fillTemplateField","strokeTemplateFound","fillTemplateFound","hasValues","dataContext","_valueFields","field","_endIndex","_clearGraphics","_startSegment","clear","segmentIndex","dataItemIndex","currentEndIndex","makeFill","fillTemplate","originalTemplate","makeStroke","strokeTemplate","xOpenFieldValue","yOpenFieldValue","baseField","basePosX","basePosY","segments","points","fillVisible","getOpen","o","_getPoints","nextItem","shouldGap","_endLine","_drawStroke","_drawFill","itemLocationX","itemLocationY","xPos","yPos","_shouldInclude","iPoint","xPos0","yPos0","closeIPoint","_points","_firstPoint","segment","context","_processAxisRange","_dataItem","marker","disabledColor","bulletFunction","LineSeries","fields","valueFields","_setRawDefault","_removeAxisRange","axisDataItem","_seriesAxisRanges","_updateFields","_valueXFields","_valueYFields","_valueXShowFields","_valueYShowFields","__valueXShowFields","__valueYShowFields","valueXFields","split","valueYFields","xName","xCapName","yName","yCapName","xLetter","yLetter","open","low","high","_xLowField","_xHighField","_yLowField","_yHighField","hiddenState","sequencedInterpolation","_handleMaskBullets","tooltipFieldX","tooltipFieldY","_tooltipFieldX","_tooltipFieldY","_fixVC","_dataProcessed","_stack","_unstack","getStackedXValue","_min","_max","getStackedYValue","processSeriesDataItem","_seriesValuesDirty","markDirtyExtremes","_markStakedDirtyStack","updateLegendValue","_dataGrouped","_groupSeriesData","minBulletDistance","_showBullets","_psi","_pei","_selectionProcessed","_calculateTotals","processYSelectionDataItem","processXSelectionDataItem","markDirtySelectionExtremes","_mainContainerMask","mask","_markDirtyKey","_makeRangeMask","seriesIndex","_couldStackTo","_stackDataItems","_reallyStackedTo","_key","_stackedSeries","uid","stackToItemKey","s","stackToSeries","stackToItem","stackValue","getStackedXValueWorking","getStackedYValueWorking","stackedToSeries","updateLegendMarker","_afterDataChange","_aggregatesCalculated","_clearDirty","_shouldShowBullet","_positionX","_positionY","id","_dataSets","_markDataSetDirty","_dataSetId","then","_isShowing","_sequencedShowHide","_isHiding","waitForStop","stackedSeries","_markDirtyStack","_afterChanged","_markDirtyAxes","hideTooltip","markDirtyText","txt","_emptyDataItem","valueLabel","positionToCoordinate","_position","resetExtremes","XYSeries","that","_context","bezierCurveTo","_x1","_k","_x2","_x0","_y1","_y2","_y0","Cardinal","prototype","areaStart","_line","areaEnd","NaN","lineStart","_point","lineEnd","closePath","custom","cardinal","interactive","interactiveChildren","Graphics","_addOrientationClass","orientation","startGrip","endGrip","remove","_updateThumb","overlay","Scrollbar","XYChartScrollbar","Container","List","background","Rectangle","axisHeader","renderer","processAxis","ghostLabel","makeLabel","sAnimation","_sAnimation","eAnimation","_eAnimation","maxZoomFactorReal","minZoomFactor","_handleAxisSelection","playing","_series","_createAssets","_rangesDirty","_prepareDataItem","above","_index","_updateCursor","_updateLC","rendererTags","addTag","toLowerCase","_applyThemes","updateTooltipBounds","_updateBounds","_updateTooltipBounds","axisHeadersContainer","onPrivate","markDirtySize","_toggleDataItem","tags","makeGrid","makeTick","makeAxisFill","_processBullet","axisBullet","_updateChartLayout","_updatePositions","bounds","localBounds","_getText","updateLabel","_cursorPosition","_snapToSeries","updateTooltip","getSeriesItem","roundAxisPosition","_updateTooltipText","positionTooltip","_location","_fields","coordinate","_nextItem","_autoGapCount","_fieldName","Component","Axis","_itemMap","_handleRangeChange","_prepareAxisItems","_updateAxisRanges","startCategory","endCategory","CategoryAxis","openKey","otherAxis","startDataItem","endDataItem","maxCount","Number","MAX_SAFE_INTEGER","frequency","ceil","floor","_frequency","f","_updateGhost","fillIndex","categoryLocation","endCategoryLocation","categoryToIndex","indexToPosition","fillEndIndex","fillEndPosition","endPosition","updateGrid","updateTick","updateFill","updateBullet","cellLocation","_axisLocation","category","axisPositionToIndex","fieldName","seriesDataItem","zoomToIndexes","classNames","concat","startTime","endTime","realDuration","baseDuration","gridInterval","nextGridUnit","format","formats","previousValue","previousIndex","previousUnitValue","selectedItems","changed","skip","date","unitValue","added","pop","shouldAdd","item","dateFormatter","CategoryDateAxis","_dirtyExtremes","_dirtySelectionExtremes","syncWithAxis","_syncDp","_getMinMax","_getSelectionMinMax","_groupData","_baseValue","numberFormat","formatter","getNumberFormatter","selectionMin","selectionMax","processDataItem","_formatText","log","LOG10E","pow","stepPower","decCount","valueToPosition","hasTag","removeTag","positionToValue","gridCount","minMaxStep","_adjustMinMax","stepDecimalPlaces","E","treatZeroAs","_cellLocation","axisLocation","fixSmallStep","total","minDefined","maxDefined","seriesMin","seriesMax","isShowing","range","_minReal","_maxReal","_deltaMinMax","minMaxStep2","_syncAxes","valueToFinalPosition","minDiff","diff","minAdapted","adapters","fold","maxAdapted","_fixMin","_fixMax","exponent","power","strict","animatePrivate","strictMode","initialMin","initialMax","difference","stepDivisor","maxPrecision","ceiledStep","MAX_VALUE","minCount","extraDecimals","decimals","oldDiff","syncMin","syncMax","syncStep","currentCount","synced","c","omin","omax","ostep","_checkSync","ValueAxis","_setBaseInterval","interval","_baseDuration","baseMainDuration","_fixZoomFactor","groupInterval","setDataSet","_mainDataItems","mainDataSetId","newDataItem","previousTime","dataSetId","groupFieldValues","workingFields","time","roundedTime","_makeDataItem","groupKey","currentValue","average","_groupingCalculated","modifiedDifference","current","_strictMode","_intervalDuration","intervals","_date","close","_updateDates","openValue","closeValue","result","diValue","first","second","value1","zoomToValues","DateAxis","dates","_dates","found","itemValue","findex","_updateAllDates","valueToIndex","previousPosition","minDifference","realValue","GaplessDateAxis","durationFormatter","getDurationFormatter","divisors","realDivisor","divisor","reducedCount","getFormat","DurationAxis","Entity","AxisBullet","gridTemplate","axisChildren","point1","point2","_ls","_lc","innerWidth","toggleVisibility","fillDrawMethod","_positionTooltip","num","pointerOrientation","oldBounds","AxisRendererX","innerHeight","AxisRendererY","_draw","RoundedRectangle","Candlestick","Template","ColumnSeries","lx0","lx1","ly0","ly1","hx0","hx1","hy0","hy1","getRaw","_updateCandleGraphics","CandlestickSeries","lY","hX","OHLC","OHLCSeries","_setDefault","SmoothedYLineSeries","SmoothedXLineSeries","SmoothedXYLineSeries","Step","_t","stepAfter","itemLocationX0","itemLocationY0","itemLocationX1","itemLocationY1","xPos1","yPos1","iPoint0","point0","iPoint1","xOpenPos0","yOpenPos0","xOpenPos1","yOpenPos1","closeIPoint0","closeIPoint1","StepLineSeries","am5xy"],"mappings":"4PAuJA,yE,OAaC,iC,gDAA6D,IAAI,OAKjE,iC,gDAA6D,IAAI,OASjE,4C,gDAA8C,EAAKA,eAAeC,SAASC,KAAK,QAAc,EAAKC,MAAO,CAAEC,MAAO,KAAMC,OAAQ,EAAKF,MAAMG,oBAS5I,iD,gDAAmD,EAAKN,eAAeC,SAASC,KAAK,QAAc,EAAKC,MAAO,CAAEC,MAAO,KAAMG,OAAQ,KAAMF,OAAQ,EAAKF,MAAMK,sBAS/J,+C,gDAAiD,EAAKR,eAAeC,SAASC,KAAK,QAAc,EAAKC,MAAO,CAAEC,MAAO,KAAMC,OAAQ,EAAKF,MAAMG,oBAS/I,6C,gDAA+C,EAAKG,sBAAsBR,SAASC,KAAK,QAAc,EAAKC,MAAO,CAAEI,OAAQ,KAAMF,OAAQ,EAAKF,MAAMK,sBAarJ,yC,gDAA2C,EAAKC,sBAAsBR,SAASC,KAAK,QAAc,EAAKC,MAAO,CAAEC,MAAO,KAAMG,OAAQ,KAAMG,aAAa,OAQxJ,yC,gDAA2C,EAAKC,cAAcV,SAASC,KAAK,QAAc,EAAKC,MAAO,CAAEC,MAAO,KAAMG,OAAQ,KAAMK,YAAY,OAQ/I,4C,gDAA8C,QAAc,EAAKT,MA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AKuD,EAAahiC,EAG1BkjB,EAAOhkB,KAAKuiC,GACZve,EAAOhkB,KAAKu/B,GAEZ54B,EAASjF,IAAI,QAAS,CAACb,EAAE0hC,EAAO,IAAMhD,EAAO,GAAKgD,EAAO,IAAM,EAAGzhC,EAAEyhC,EAAO,IAAMhD,EAAO,GAAKgD,EAAO,IAAM,IAGvGxhC,KAAK8B,IAAI,cACZshB,EAAEH,OAAS,GACXG,EAAEJ,SAAS/jB,KAAKgkB,OA9IlB,qC,gDAAkC,mBAClC,sC,gDAA0C4B,EAAA,oBAA6B,CAACmd,EAAex0B,cAgJxF,EAlJA,CAAoCqX,EAAA,G,SCnC7B,MAAMod,GAAQ,I","file":"xy.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\";\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 { Color } from \"../../core/util/Color\";\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 type { Animation } from \"../../core/util/Entity\";\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 * Indicates maximum distance from pointer (moust or touch) to points\n\t * tooltips need to be shown for.\n\t *\n\t * Points that are further from pointer than this setting will not be shown.\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 * 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/#Tooltips} for more info\n\t * @default true\n\t */\n\tarrangeTooltips?: boolean\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}\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\n\t/**\n\t * Invoked when panning ends.\n\t *\n\t * @since 5.0.4\n\t */\n\tpanended: {};\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 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.yAxesAndPlotContainer.children.push(Container.new(this._root, { width: p100, height: p100, maskContent: false }));\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.plotContainer.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 _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.set(\"opacity\", 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\tplotContainer.children.moveValue(zoomOutButton);\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: [\"xy\", \"background\"],\n\t\t\tfill: Color.fromHex(0x000000),\n\t\t\tfillOpacity: 0\n\t\t}));\n\n\t\tthis._disposers.push(plotContainer.events.on(\"pointerdown\", (event) => {\n\t\t\tthis._handlePlotDown(event.originalEvent);\n\t\t}));\n\n\t\tthis._disposers.push(plotContainer.events.on(\"globalpointerup\", (event) => {\n\t\t\tthis._handlePlotUp(event.originalEvent);\n\t\t}));\n\n\t\tthis._disposers.push(plotContainer.events.on(\"globalpointermove\", (event) => {\n\t\t\tthis._handlePlotMove(event.originalEvent);\n\t\t}));\n\t}\n\n\tprotected _removeSeries(series: this[\"_seriesType\"]) {\n\t\tconst xAxis = series.get(\"xAxis\");\n\t\tif (xAxis) {\n\t\t\t$array.remove(xAxis.series, series);\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}\n\t\tsuper._removeSeries(series);\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\n\t\t\t\twheelEvent.preventDefault();\n\n\t\t\t\tconst plotPoint = plotContainer.toLocal(this._root.documentPointToRoot({ x: wheelEvent.clientX, y: wheelEvent.clientY }))\n\t\t\t\tconst wheelStep = this.get(\"wheelStep\", 0.2);\n\n\t\t\t\tconst shiftY = wheelEvent.deltaY / 100;\n\t\t\t\tconst shiftX = wheelEvent.deltaX / 100;\n\n\t\t\t\tif ((wheelX === \"zoomX\" || wheelX === \"zoomXY\") && shiftX != 0) {\n\t\t\t\t\tthis.xAxes.each((axis) => {\n\t\t\t\t\t\tif (axis.get(\"zoomX\")) {\n\t\t\t\t\t\t\tlet start = axis.get(\"start\")!;\n\t\t\t\t\t\t\tlet end = axis.get(\"end\")!;\n\n\t\t\t\t\t\t\tlet position = axis.fixPosition(plotPoint.x / plotContainer.width());\n\n\t\t\t\t\t\t\tlet newStart = start - wheelStep * (end - start) * shiftX * position;\n\t\t\t\t\t\t\tlet newEnd = end + wheelStep * (end - start) * shiftX * (1 - position);\n\t\t\t\t\t\t\tif (1 / (newEnd - newStart) < axis.get(\"maxZoomFactor\", Infinity) / axis.get(\"minZoomCount\", 1)) {\n\t\t\t\t\t\t\t\tthis._handleWheelAnimation(axis.zoom(newStart, newEnd));\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\tif ((wheelY === \"zoomX\" || wheelY === \"zoomXY\") && shiftY != 0) {\n\t\t\t\t\tthis.xAxes.each((axis) => {\n\t\t\t\t\t\tif (axis.get(\"zoomX\")) {\n\t\t\t\t\t\t\tlet start = axis.get(\"start\")!;\n\t\t\t\t\t\t\tlet end = axis.get(\"end\")!;\n\n\t\t\t\t\t\t\tlet position = axis.fixPosition(plotPoint.x / plotContainer.width());\n\n\t\t\t\t\t\t\tlet newStart = start - wheelStep * (end - start) * shiftY * position;\n\t\t\t\t\t\t\tlet newEnd = end + wheelStep * (end - start) * shiftY * (1 - position);\n\n\t\t\t\t\t\t\tif (1 / (newEnd - newStart) < axis.getPrivate(\"maxZoomFactor\", Infinity) / axis.get(\"minZoomCount\", 1)) {\n\t\t\t\t\t\t\t\tthis._handleWheelAnimation(axis.zoom(newStart, newEnd));\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\n\t\t\t\tif ((wheelX === \"zoomY\" || wheelX === \"zoomXY\") && shiftX != 0) {\n\t\t\t\t\tthis.yAxes.each((axis) => {\n\t\t\t\t\t\tif (axis.get(\"zoomY\")) {\n\t\t\t\t\t\t\tlet start = axis.get(\"start\")!;\n\t\t\t\t\t\t\tlet end = axis.get(\"end\")!;\n\n\t\t\t\t\t\t\tlet position = axis.fixPosition(plotPoint.y / plotContainer.height());\n\n\t\t\t\t\t\t\tlet newStart = start - wheelStep * (end - start) * shiftX * position;\n\t\t\t\t\t\t\tlet newEnd = end + wheelStep * (end - start) * shiftX * (1 - position);\n\t\t\t\t\t\t\tif (1 / (newEnd - newStart) < axis.get(\"maxZoomFactor\", Infinity) / axis.get(\"minZoomCount\", 1)) {\n\t\t\t\t\t\t\t\tthis._handleWheelAnimation(axis.zoom(newStart, newEnd));\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\tif ((wheelY === \"zoomY\" || wheelY === \"zoomXY\") && shiftY != 0) {\n\t\t\t\t\tthis.yAxes.each((axis) => {\n\t\t\t\t\t\tif (axis.get(\"zoomY\")) {\n\t\t\t\t\t\t\tlet start = axis.get(\"start\")!;\n\t\t\t\t\t\t\tlet end = axis.get(\"end\")!;\n\n\t\t\t\t\t\t\tlet position = axis.fixPosition(plotPoint.y / plotContainer.height());\n\n\t\t\t\t\t\t\tlet newStart = start - wheelStep * (end - start) * shiftY * position;\n\t\t\t\t\t\t\tlet newEnd = end + wheelStep * (end - start) * shiftY * (1 - position);\n\n\t\t\t\t\t\t\tif (1 / (newEnd - newStart) < axis.get(\"maxZoomFactor\", Infinity) / axis.get(\"minZoomCount\", 1)) {\n\t\t\t\t\t\t\t\tthis._handleWheelAnimation(axis.zoom(newStart, newEnd));\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\n\t\t\t\tif ((wheelX === \"panX\" || wheelX === \"panXY\") && shiftX != 0) {\n\t\t\t\t\tthis.xAxes.each((axis) => {\n\t\t\t\t\t\tif (axis.get(\"panX\")) {\n\t\t\t\t\t\t\tlet start = axis.get(\"start\")!;\n\t\t\t\t\t\t\tlet end = axis.get(\"end\")!;\n\n\t\t\t\t\t\t\tlet position = axis.fixPosition(plotPoint.x / plotContainer.width());\n\t\t\t\t\t\t\tlet delta = wheelStep * (end - start) * shiftX * position;\n\t\t\t\t\t\t\tlet newStart = start + delta;\n\t\t\t\t\t\t\tlet newEnd = end + delta;\n\n\t\t\t\t\t\t\tthis._handleWheelAnimation(axis.zoom(newStart, newEnd));\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\tif ((wheelY === \"panX\" || wheelY === \"panXY\") && shiftY != 0) {\n\t\t\t\t\tthis.xAxes.each((axis) => {\n\t\t\t\t\t\tif (axis.get(\"panX\")) {\n\t\t\t\t\t\t\tlet start = axis.get(\"start\")!;\n\t\t\t\t\t\t\tlet end = axis.get(\"end\")!;\n\n\t\t\t\t\t\t\tlet position = axis.fixPosition(plotPoint.x / plotContainer.width());\n\t\t\t\t\t\t\tlet delta = wheelStep * (end - start) * shiftY * position;\n\t\t\t\t\t\t\tlet newStart = start + delta;\n\t\t\t\t\t\t\tlet newEnd = end + delta;\n\n\t\t\t\t\t\t\tthis._handleWheelAnimation(axis.zoom(newStart, newEnd));\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\tif ((wheelX === \"panY\" || wheelX === \"panXY\") && shiftX != 0) {\n\t\t\t\t\tthis.yAxes.each((axis) => {\n\t\t\t\t\t\tif (axis.get(\"panY\")) {\n\t\t\t\t\t\t\tlet start = axis.get(\"start\")!;\n\t\t\t\t\t\t\tlet end = axis.get(\"end\")!;\n\n\t\t\t\t\t\t\tlet position = axis.fixPosition(plotPoint.y / plotContainer.height());\n\t\t\t\t\t\t\tlet delta = wheelStep * (end - start) * shiftX * position;\n\t\t\t\t\t\t\tlet newStart = start + delta;\n\t\t\t\t\t\t\tlet newEnd = end + delta;\n\n\t\t\t\t\t\t\tthis._handleWheelAnimation(axis.zoom(newStart, newEnd));\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\tif ((wheelY === \"panY\" || wheelY === \"panXY\") && shiftY != 0) {\n\t\t\t\t\tthis.yAxes.each((axis) => {\n\t\t\t\t\t\tif (axis.get(\"panY\")) {\n\t\t\t\t\t\t\tlet start = axis.get(\"start\")!;\n\t\t\t\t\t\t\tlet end = axis.get(\"end\")!;\n\n\t\t\t\t\t\t\tlet position = axis.fixPosition(plotPoint.y / plotContainer.height());\n\t\t\t\t\t\t\tlet delta = wheelStep * (end - start) * shiftY * position;\n\t\t\t\t\t\t\tlet newStart = start - delta;\n\t\t\t\t\t\t\tlet newEnd = end - delta;\n\n\t\t\t\t\t\t\tthis._handleWheelAnimation(axis.zoom(newStart, newEnd));\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._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 _handlePlotDown(event: IPointerEvent) {\n\n\t\t// TODO: handle multitouch\n\t\tif (this.get(\"panX\") || this.get(\"panY\")) {\n\t\t\tconst plotContainer = this.plotContainer;\n\n\t\t\tlet local = plotContainer.toLocal(this._root.documentPointToRoot({ x: event.clientX, y: event.clientY }));\n\n\t\t\tif (local.x >= 0 && local.y >= 0 && local.x <= plotContainer.width() && local.y <= this.height()) {\n\t\t\t\tthis._downPoint = local;\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 });\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: IPointerEvent) {\n\n\t\tif (this._downPoint) {\n\t\t\tif (this.get(\"panX\") || this.get(\"panY\")) {\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 });\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: IPointerEvent) {\n\t\t// TODO: handle multitouch\n\t\tconst downPoint = this._downPoint!;\n\n\t\tif (downPoint) {\n\t\t\tconst plotContainer = this.plotContainer;\n\n\t\t\tlet local = plotContainer.toLocal(this._root.documentPointToRoot({ x: event.clientX, y: event.clientY }));\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\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\tconst snapToSeries = cursor.get(\"snapToSeries\");\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\tconst point = closestItem.get(\"point\");\n\t\t\t\t\tif (point) {\n\t\t\t\t\t\tcursor.handleMove(series.toGlobal(point), 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.handleMove();\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\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) || \"\" : \"\";\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\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) || \"\" : \"\";\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\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}\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 = cursor.getPrivate(\"positionX\", 0.5);\n\t\tconst positionY = cursor.getPrivate(\"positionY\", 0.5);\n\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\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\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 (axis.get(\"start\") != 0 || axis.get(\"end\") != 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 (axis.get(\"start\") != 0 || axis.get(\"end\") != 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._otherCharts;\n\t\tconst global = plotContainer.toGlobal(point);\n\n\t\tif (point.x >= -0.1 && point.y >= -0.1 && point.x <= plotContainer.width() + 0.1 && point.y <= plotContainer.height() + 0.1) {\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\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 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 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\tconst tooltip = series.get(\"tooltip\");\n\t\t\t\tif (tooltip) {\n\t\t\t\t\tlet point = tooltip.get(\"pointTo\")!;\n\t\t\t\t\tif (point) {\n\t\t\t\t\t\tlet distance = Math.hypot(movePoint.x - point.x, movePoint.y - point.y);\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\tclosest = series;\n\t\t\t\t\t\t\tclosestPoint = point;\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) {\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) {\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 (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\n\t\t\t\ttooltips.sort((a, b) => {\n\t\t\t\t\tlet ya = a.get(\"pointTo\")!.y;\n\t\t\t\t\tlet yb = b.get(\"pointTo\")!.y;\n\t\t\t\t\tif (ya < yb) {\n\t\t\t\t\t\treturn 1\n\t\t\t\t\t}\n\t\t\t\t\telse if (ya > yb) {\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t})\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\n\t\t\t\t\tprevY = Math.min(prevY - height, tooltip._fy - height);\n\t\t\t\t\ttooltipContainer.children.moveValue(tooltip, 0);\n\t\t\t\t})\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttooltips.sort((a, b) => {\n\t\t\t\t\tlet ya = a.get(\"pointTo\")!.y;\n\t\t\t\t\tlet yb = b.get(\"pointTo\")!.y;\n\t\t\t\t\tif (ya < yb) {\n\t\t\t\t\t\treturn -1\n\t\t\t\t\t}\n\t\t\t\t\telse if (ya > yb) {\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t}\n\t\t\t\t})\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 + h, prevY + height) })\n\t\t\t\t\ttooltipContainer.children.moveValue(tooltip, 0);\n\t\t\t\t\tprevY = Math.max(prevY + height, tooltip._fy + height);\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}\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 { 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});\r\n\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\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});\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\tstrokeOpacity: 0.8,\r\n\t\t\t\tstrokeDasharray: [2, 2]\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\tstrokeOpacity: 0.8,\r\n\t\t\t\tstrokeDasharray: [2, 2]\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\t{\r\n\t\t\tconst rule = r(\"AxisRenderer\");\r\n\r\n\t\t\trule.setAll({\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});\r\n\r\n\t\t\tsetColor(rule, \"stroke\", ic, \"grid\");\r\n\t\t}\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\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\r\n\t\t\t\t\tlet min = axis.getPrivate(\"min\", 0);\r\n\t\t\t\t\tmin = $time.round(new Date(min), baseInterval.timeUnit, baseInterval.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((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\textraMin: 0,\r\n\t\t\textraMax: 0,\r\n\t\t\tstrictMinMax: false,\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\tr(\"Rectangle\", [\"column\", \"autocolor\", \"pro\"]).states.create(\"riseFromPrevious\", { fillOpacity: 1 });\r\n\t\tr(\"Rectangle\", [\"column\", \"autocolor\", \"pro\"]).states.create(\"dropFromPrevious\", { fillOpacity: 0 });\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 { IPointerEvent } from \"../../core/render/backend/Renderer\";\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\";\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\"`, and `\"y\"`.\n\t *\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.\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\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}\n\nexport interface IXYCursorEvents extends IContainerEvents {\n\n\t/**\n\t * Kicks in when cursor selection starts.\n\t *\n\t * Only when `behavior` is set.\n\t */\n\tselectended: {\n\t\ttarget: XYCursor;\n\t};\n\n\t/**\n\t * Kicks in when cursor selection ends.\n\t *\n\t * Only when `behavior` is set.\n\t */\n\tselectstarted: {\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\ttarget: XYCursor;\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}\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\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\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.lineX.events.on(\"positionchanged\", () => {\n\t\t\tthis._handleXLine();\n\t\t})\n\n\t\tthis.lineY.events.on(\"positionchanged\", () => {\n\t\t\tthis._handleYLine();\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\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\ttooltip.on(\"pointTo\", () => {\n\t\t\t\t\t\tthis._updateXLine(tooltip);\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\ttooltip.on(\"pointTo\", () => {\n\t\t\t\t\t\tthis._updateYLine(tooltip);\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, 2);\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, 2);\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 _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\tif (this.get(\"alwaysShow\")) {\n\t\t\t\t\tthis._movePoint = this.toGlobal(this._getPoint(this.get(\"positionX\", 0), this.get(\"positionY\", 0)));\n\t\t\t\t\tthis.handleMove();\n\t\t\t\t}\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.originalEvent);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._disposers.push(plotContainer.events.on(\"pointerdown\", (event) => {\n\t\t\tthis._handleCursorDown(event.originalEvent);\n\t\t}));\n\n\t\tthis._disposers.push(plotContainer.events.on(\"globalpointerup\", (event) => {\n\t\t\tthis._handleCursorUp(event.originalEvent);\n\t\t\tif (!event.native && !this.isHidden()) {\n\t\t\t\tthis._handleMove(event.originalEvent);\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.originalEvent);\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: IPointerEvent) {\n\t\t// TODO: handle multitouch\n\t\tconst rootPoint = this._root.documentPointToRoot({ x: event.clientX, y: event.clientY });\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 });\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: IPointerEvent) {\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\tlet userPositionX = this.get(\"positionX\");\n\t\t\t\tlet positionX = this.getPrivate(\"positionX\", 0);\n\n\t\t\t\tif ($type.isNumber(userPositionX)) {\n\t\t\t\t\tpositionX = userPositionX;\n\t\t\t\t}\n\n\t\t\t\tlet userPositionY = this.get(\"positionY\");\n\t\t\t\tlet positionY = this.getPrivate(\"positionY\", 0);\n\n\t\t\t\tif ($type.isNumber(userPositionY)) {\n\t\t\t\t\tpositionY = userPositionY;\n\t\t\t\t}\n\n\t\t\t\tlet dispatch = false;\n\t\t\t\tif (behavior === \"zoomX\" || behavior === \"zoomXY\" || behavior === \"selectX\" || behavior === \"selectXY\") {\n\t\t\t\t\tif (Math.abs(positionX - this.getPrivate(\"downPositionX\", 0)) > 0.003) {\n\t\t\t\t\t\tdispatch = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (behavior === \"zoomY\" || behavior === \"zoomXY\" || behavior === \"selectY\" || behavior === \"selectXY\") {\n\t\t\t\t\tif (Math.abs(positionY - this.getPrivate(\"downPositionY\", 0)) > 0.003) {\n\t\t\t\t\t\tdispatch = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (dispatch) {\n\t\t\t\t\tconst type = \"selectended\";\n\t\t\t\t\tif (this.events.isEnabled(type)) {\n\t\t\t\t\t\tthis.events.dispatch(type, { type: type, target: this });\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: IPointerEvent) {\n\t\tif (this.getPrivate(\"visible\")) {\n\t\t\t// TODO: handle multitouch\n\t\t\tconst rootPoint = this._root.documentPointToRoot({ x: event.clientX, y: event.clientY });\n\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\n\t\t\tthis.handleMove({ x: rootPoint.x, y: rootPoint.y });\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) {\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)) {\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\tconst snapToSeries = this.get(\"snapToSeries\");\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 });\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 { 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\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 } 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\";\nimport type { IPointerEvent } from \"../../../core/render/backend/Renderer\";\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 * 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\nexport interface IAxisRendererPrivate extends IGraphicsPrivate {\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 = 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 = 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 = 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\tif (this.get(\"opposite\" as any)) {\n\t\t\tthemeTags.push(\"opposite\");\n\t\t}\n\t\tif (this.get(\"inside\" as any)) {\n\t\t\tthemeTags.push(\"inside\");\n\t\t}\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 = 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\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.originalEvent);\n\t\t\t}));\n\n\t\t\tthis._disposers.push(thumb.events.on(\"globalpointerup\", (event) => {\n\t\t\t\tthis._handleThumbUp(event.originalEvent);\n\t\t\t}));\n\n\t\t\tthis._disposers.push(thumb.events.on(\"globalpointermove\", (event) => {\n\t\t\t\tthis._handleThumbMove(event.originalEvent);\n\t\t\t}));\n\t\t}\n\t}\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: IPointerEvent) {\n\t\tthis._thumbDownPoint = this.toLocal(this._root.documentPointToRoot({ x: event.clientX, y: event.clientY }));\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: IPointerEvent) {\n\t\tthis._thumbDownPoint = undefined;\n\t}\n\n\tprotected _handleThumbMove(event: IPointerEvent) {\n\t\tconst downPoint = this._thumbDownPoint;\n\t\tif (downPoint) {\n\t\t\tconst point = this.toLocal(this._root.documentPointToRoot({ x: event.clientX, y: event.clientY }));\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;\n\t\t\tthis.axis.setAll({ start: downStart - extra, end: downEnd + extra });\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\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 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\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\tif (chart.inPlot(point)) {\n\t\t\t\ttooltip.set(\"pointTo\", this._display.toGlobal(point));\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttooltip.hide();\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic processAxis() { }\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 { 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 { 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 { 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}\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}\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(\"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}\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\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\n\t\tsuper._updateChildren();\n\t}\n\n\tprotected _createGraphics(dataItem: DataItem) {\n\t\tlet graphics = dataItem.get(\"graphics\");\n\t\tif (!graphics) {\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\tmarkerRectangle.setAll({ fill: graphics.get(\"fill\"), stroke: graphics.get(\"stroke\") });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.axisRanges.each((axisRange) => {\n\t\t\t\tconst container = axisRange.container!;\n\t\t\t\tconst graphicsArray: Array = dataItem.get(\"rangeGraphics\", []);\n\t\t\t\tdataItem.set(\"rangeGraphics\", graphicsArray);\n\n\t\t\t\tconst rangeGraphics = this._makeGraphics(axisRange.columns, dataItem);\n\t\t\t\tgraphicsArray.push(rangeGraphics);\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\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)) {\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}\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\tprotected _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\tconst legendDataItem = this.get(\"legendDataItem\");\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\t$array.each(visualSettings, (setting: any) => {\n\t\t\t\t\t\tmarkerRectangle.set(setting, graphics.get(setting, this.get(setting)));\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t}\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 { XYSeries, IXYSeriesPrivate, IXYSeriesSettings, IXYSeriesDataItem, IXYSeriesAxisRange } from \"./XYSeries\";\nimport { Graphics } from \"../../../core/render/Graphics\";\nimport * as $type from \"../../../core/util/Type\";\nimport * as $array from \"../../../core/util/Array\";\nimport { CurveFactory, line, area } from \"d3-shape\";\nimport { Template } from \"../../../core/util/Template\";\nimport { ListTemplate } from \"../../../core/util/List\";\nimport { DataItem } from \"../../../core/render/Component\";\nimport type { Axis } from \"../axes/Axis\";\nimport type { AxisRenderer } from \"../axes/AxisRenderer\";\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\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 = 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 = 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\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(\"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\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\n\t\t\t\tthis._endIndex = endIndex;\n\n\t\t\t\tthis._clearGraphics();\n\n\t\t\t\tthis._startSegment(0, startIndex);\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\t}\n\n\tprotected _startSegment(segmentIndex: number, 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\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\n\t\t}\n\n\n\t\tfor (i = dataItemIndex; i < currentEndIndex; 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\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\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\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\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\n\t\tif (currentEndIndex < endIndex) {\n\t\t\tthis._startSegment(segmentIndex + 1, currentEndIndex);\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 }) {\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\tpoints.push(point);\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\")) {\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\")) {\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\tconst legendStroke = marker.children.push(Graphics._new(marker._root, {\n\t\t\t\tthemeTags: [\"line\", \"series\", \"legend\", \"marker\", \"stroke\"]\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, {}, {}));\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\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\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 { DataItem } from \"../../../core/render/Component\";\nimport { Series, ISeriesSettings, ISeriesDataItem, ISeriesPrivate, ISeriesEvents } from \"../../../core/render/Series\";\nimport type { Axis, IAxisPrivate, IAxisDataItem } from \"../axes/Axis\";\nimport type { AxisRenderer } from \"../axes/AxisRenderer\";\nimport * as $array from \"../../../core/util/Array\";\nimport * as $utils from \"../../../core/util/Utils\";\nimport { List } from \"../../../core/util/List\";\nimport * as $type from \"../../../core/util/Type\";\nimport * as $object from \"../../../core/util/Object\";\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\";\nimport { Container } from \"../../../core/render/Container\";\nimport { Graphics } from \"../../../core/render/Graphics\";\n\nimport type { CategoryAxis } from \"../axes/CategoryAxis\";\nimport type { DateAxis } from \"../axes/DateAxis\";\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\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\txAxis: IXYAxis;\n\n\t/**\n\t * Y axis series uses.\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 * @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}\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\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\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\tprotected __valueXShowFields!: Array;\n\tprotected __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\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._settings.xAxis.series.push(this);\n\t\tthis._settings.yAxis.series.push(this);\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\tif (!this.get(\"baseAxis\")) {\n\t\t\tconst xAxis = this.get(\"xAxis\");\n\t\t\tconst yAxis = this.get(\"yAxis\");\n\n\t\t\tif (yAxis.isType>(\"CategoryAxis\") || yAxis.isType>(\"DateAxis\")) {\n\t\t\t\tthis.set(\"baseAxis\", yAxis);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.set(\"baseAxis\", xAxis);\n\t\t\t}\n\t\t}\n\n\t\tthis.states.create(\"hidden\", { opacity: 1, visible: false });\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._valueYShowFields.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\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\t\tif (!this.get(\"xAxis\").inited || !this.get(\"yAxis\").inited) {\n\t\t\treturn false\n\t\t}\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\n\tpublic _prepareChildren() {\n\t\tsuper._prepareChildren();\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\t\tif (xAxis === baseAxis) {\n\t\t\tthis.set(\"y\", yAxis.y() - $utils.relativeToValue(yAxis.get(\"centerY\", 0), yAxis.height()) - yAxis.parent!.get(\"paddingTop\", 0));\n\t\t\tthis.bulletsContainer.set(\"y\", this.y());\n\t\t}\n\t\telse if (yAxis === baseAxis) {\n\t\t\tthis.set(\"x\", xAxis.x() - $utils.relativeToValue(xAxis.get(\"centerX\", 0), xAxis.width()) - xAxis.parent!.get(\"paddingLeft\", 0));\n\t\t\tthis.bulletsContainer.set(\"x\", this.x());\n\t\t}\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\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\tthis.updateLegendValue(undefined);\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(\"endIndex\") || this.isDirty(\"vcx\") || this.isDirty(\"vcy\") || this._stackDirty)) {\n\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._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\n\t\t\t\tif (baseAxis === xAxis) {\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\tfor (let i = startIndex; i < endIndex; i++) {\n\t\t\t\t\t\tthis.processYSelectionDataItem(this.dataItems[i], vcy, stacked);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (baseAxis === yAxis) {\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\tfor (let i = startIndex; i < endIndex; i++) {\n\t\t\t\t\t\tthis.processXSelectionDataItem(this.dataItems[i], vcx, stacked);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (baseAxis === xAxis) {\n\t\t\t\t\tif (this.get(\"valueYShow\") !== \"valueYWorking\") {\n\t\t\t\t\t\tthis.setPrivateRaw(\"minY\", this.getPrivate(\"selectionMinY\"));\n\t\t\t\t\t\tthis.setPrivateRaw(\"maxY\", this.getPrivate(\"selectionMaxY\"));\n\t\t\t\t\t\tyAxis.markDirtyExtremes();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (baseAxis === yAxis) {\n\t\t\t\t\tif (this.get(\"valueXShow\") !== \"valueXWorking\") {\n\t\t\t\t\t\tthis.setPrivateRaw(\"minX\", this.getPrivate(\"selectionMinX\"));\n\t\t\t\t\t\tthis.setPrivateRaw(\"maxX\", this.getPrivate(\"selectionMaxX\"));\n\t\t\t\t\t\txAxis.markDirtyExtremes();\n\t\t\t\t\t}\n\t\t\t\t}\n\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\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\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\n\t\t\tthis._stackDataItems();\n\t\t}\n\t}\n\n\tprotected _unstack() {\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\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\tconst positionX = xAxis.getDataItemPositionX(dataItem, this._xField, locationX, this.get(\"vcx\", 1));\n\t\t\tconst 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\tif (this._shouldShowBullet(positionX, positionY)) {\n\t\t\t\tif (!bullet.getPrivate(\"hidden\")) {\n\t\t\t\t\tsprite.setPrivate(\"visible\", true);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tsprite.setPrivate(\"visible\", false);\n\t\t\t\t}\n\n\t\t\t\tlet w = right - left;\n\t\t\t\tlet h = bottom - top;\n\n\t\t\t\tif (sprite.isType(\"Label\")) {\n\t\t\t\t\tsprite.set(\"maxWidth\", Math.abs(w));\n\t\t\t\t\tsprite.set(\"maxHeight\", Math.abs(h));\n\t\t\t\t}\n\n\t\t\t\tlet x = left + w * locationX;\n\t\t\t\tlet y = bottom - h * locationY;\n\n\t\t\t\tsprite.set(\"x\", x);\n\t\t\t\tsprite.set(\"y\", 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\tprotected _handleDataSetChange() {\n\t\tif (this.bullets.length > 0) {\n\t\t\t$array.each(this._dataItems, (dataItem) => {\n\t\t\t\tlet bullets = dataItem.bullets;\n\t\t\t\tif (bullets) {\n\t\t\t\t\t$array.each(bullets, (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\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\t\t\t\tpromises.push(dataItem.animate({ key: key + \"Working\" as any, to: baseValue, duration: duration!, easing: easing }).waitForStop());\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\tpromises.push(dataItem.animate({ key: key + \"Working\" as any, to: baseValue, duration: duration!, easing: easing }).waitForStop());\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\tthis.updateLegendMarker(dataItem);\n\t\tthis.updateLegendValue(dataItem);\n\n\t\tif (this.get(\"tooltip\")) {\n\t\t\tif (!this.isHidden()) {\n\t\t\t\tconst tooltip = this.get(\"tooltip\")!;\n\t\t\t\tif (tooltip) {\n\t\t\t\t\ttooltip._setDataItem(dataItem);\n\n\t\t\t\t\tif (dataItem) {\n\t\t\t\t\t\tlet locationX = this.get(\"locationX\", 0);\n\t\t\t\t\t\tlet locationY = this.get(\"locationY\", 1);\n\n\t\t\t\t\t\tlet itemLocationX = dataItem.get(\"locationX\", locationX);\n\t\t\t\t\t\tlet itemLocationY = dataItem.get(\"locationY\", locationY);\n\n\t\t\t\t\t\tconst xAxis = this.get(\"xAxis\");\n\t\t\t\t\t\tconst yAxis = this.get(\"yAxis\");\n\n\t\t\t\t\t\tconst vcx = this.get(\"vcx\", 1);\n\t\t\t\t\t\tconst vcy = this.get(\"vcy\", 1);\n\n\t\t\t\t\t\tconst xPos = xAxis.getDataItemPositionX(dataItem, this._tooltipFieldX!, this._aLocationX0 + (this._aLocationX1 - this._aLocationX0) * itemLocationX, vcx);\n\t\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\t\tconst point = this.getPoint(xPos, yPos);\n\n\t\t\t\t\t\tlet show = true;\n\t\t\t\t\t\t$array.each(this._valueFields, (field) => {\n\t\t\t\t\t\t\tif (dataItem.get(field as any) == null) {\n\t\t\t\t\t\t\t\tshow = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\n\t\t\t\t\t\tif (show) {\n\t\t\t\t\t\t\tconst chart = this.chart;\n\t\t\t\t\t\t\tif (chart && chart.inPlot(point)) {\n\t\t\t\t\t\t\t\ttooltip.label.text.markDirtyText();\n\t\t\t\t\t\t\t\ttooltip.set(\"tooltipTarget\", this._getTooltipTarget(dataItem));\n\t\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\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\ttooltip._setDataItem(undefined);\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\ttooltip._setDataItem(undefined);\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\tthis.hideTooltip();\n\t\t\t}\n\t\t}\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\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\tpublic _afterDataChange() {\n\t\tsuper._afterDataChange();\n\t\tthis.resetExtremes();\n\t}\n\n\n\t// todo description\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}\n","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; // proceed\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","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 { 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;\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 * 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}\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;\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 * 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\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\tpublic ghostLabel!: AxisLabel;\n\n\tprotected _cursorPosition: number = -1;\n\n\tprotected _snapToSeries?: Array;\n\n\tpublic _seriesValuesDirty = 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\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.set(\"opacity\", 0);\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\n\t\tif (this.get(\"start\") !== start || this.get(\"end\") != end) {\n\n\t\t\tlet sAnimation = this._sAnimation;\n\t\t\tlet eAnimation = this._eAnimation;\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\tstart = -maxDeviation;\n\t\t\t}\n\n\t\t\tif (end > 1 + maxDeviation) {\n\t\t\t\tend = 1 + maxDeviation;\n\t\t\t}\n\n\t\t\tif (start > end) {\n\t\t\t\t[start, end] = [end, start];\n\t\t\t}\n\n\t\t\tif (!$type.isNumber(duration)) {\n\t\t\t\tduration = this.get(\"interpolationDuration\", 0);\n\t\t\t}\n\n\t\t\tif (!priority) {\n\t\t\t\tpriority = \"end\";\n\t\t\t}\n\n\t\t\tlet maxZoomFactor = this.getPrivate(\"maxZoomFactor\", this.get(\"maxZoomFactor\", 100));\n\t\t\tlet maxZoomFactorReal = maxZoomFactor;\n\n\t\t\tif (end === 1 && start !== 0) {\n\t\t\t\tif (start < this.get(\"start\")) {\n\t\t\t\t\tpriority = \"start\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tpriority = \"end\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (start === 0 && end !== 1) {\n\t\t\t\tif (end > this.get(\"end\")) {\n\t\t\t\t\tpriority = \"end\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tpriority = \"start\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet minZoomCount = this.get(\"minZoomCount\");\n\t\t\tlet maxZoomCount = this.get(\"maxZoomCount\");\n\n\t\t\tif ($type.isNumber(minZoomCount)) {\n\t\t\t\tmaxZoomFactor = maxZoomFactorReal / minZoomCount;\n\t\t\t}\n\n\t\t\tlet minZoomFactor: number = 1;\n\n\t\t\tif ($type.isNumber(maxZoomCount)) {\n\t\t\t\tminZoomFactor = maxZoomFactorReal / maxZoomCount;\n\t\t\t}\n\n\t\t\t// most likely we are dragging left scrollbar grip here, so we tend to modify end\n\t\t\tif (priority === \"start\") {\n\t\t\t\tif (maxZoomCount > 0) {\n\t\t\t\t\t// add to the end\n\t\t\t\t\tif (1 / (end - start) < minZoomFactor) {\n\t\t\t\t\t\tend = start + 1 / minZoomFactor;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// add to the end\n\t\t\t\tif (1 / (end - start) > maxZoomFactor) {\n\t\t\t\t\tend = start + 1 / maxZoomFactor;\n\t\t\t\t}\n\t\t\t\t//unless end is > 0\n\t\t\t\tif (end > 1 && end - start < 1 / maxZoomFactor) {\n\t\t\t\t\t//end = 1;\n\t\t\t\t\tstart = end - 1 / maxZoomFactor;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// most likely we are dragging right, so we modify left\n\t\t\telse {\n\t\t\t\tif (maxZoomCount > 0) {\n\t\t\t\t\t// add to the end\n\t\t\t\t\tif (1 / (end - start) < minZoomFactor) {\n\t\t\t\t\t\tstart = end - 1 / minZoomFactor;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// remove from start\n\t\t\t\tif (1 / (end - start) > maxZoomFactor) {\n\t\t\t\t\tstart = end - 1 / maxZoomFactor;\n\t\t\t\t}\n\t\t\t\tif (start < 0 && end - start < 1 / maxZoomFactor) {\n\t\t\t\t\t//start = 0;\n\t\t\t\t\tend = start + 1 / maxZoomFactor;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (1 / (end - start) > maxZoomFactor) {\n\t\t\t\tend = start + 1 / maxZoomFactor;\n\t\t\t}\n\n\t\t\tif (1 / (end - start) > maxZoomFactor) {\n\t\t\t\tstart = end - 1 / maxZoomFactor;\n\t\t\t}\n\n\t\t\tif (maxZoomCount != null && minZoomCount != null && (start == this.get(\"start\") && end == this.get(\"end\"))) {\n\t\t\t\tconst chart = this.chart;\n\t\t\t\tif (chart) {\n\t\t\t\t\tchart._handleAxisSelection(this, true);\n\t\t\t\t}\n\t\t\t}\n\n\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\treturn;\n\t\t\t}\n\n\n\t\t\tif (duration > 0) {\n\t\t\t\tlet easing = this.get(\"interpolationEasing\");\n\t\t\t\tlet sAnimation, eAnimation;\n\t\t\t\tif (this.get(\"start\") != start) {\n\t\t\t\t\tsAnimation = this.animate({ key: \"start\", to: start, duration: duration, easing: easing });\n\t\t\t\t}\n\t\t\t\tif (this.get(\"end\") != end) {\n\t\t\t\t\teAnimation = this.animate({ key: \"end\", to: end, duration: duration, easing: easing });\n\t\t\t\t}\n\n\t\t\t\tthis._sAnimation = sAnimation;\n\t\t\t\tthis._eAnimation = eAnimation;\n\n\t\t\t\tif (sAnimation) {\n\t\t\t\t\treturn sAnimation;\n\t\t\t\t}\n\t\t\t\telse if (eAnimation) {\n\t\t\t\t\treturn eAnimation;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.set(\"start\", start);\n\t\t\t\tthis.set(\"end\", end);\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.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\tthis.chart!._updateCursor();\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._toggleDataItem(dataItem, false);\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._toggleDataItem(dataItem, true);\n\t\treturn super.showDataItem(dataItem);\n\t}\n\n\n\tpublic _toggleDataItem(dataItem: DataItem, visible: boolean) {\n\t\tconst label = dataItem.get(\"label\");\n\t\tif (label) {\n\t\t\tlabel.setPrivate(\"visible\", visible);\n\t\t}\n\t\tconst grid = dataItem.get(\"grid\");\n\t\tif (grid) {\n\t\t\tgrid.setPrivate(\"visible\", visible);\n\t\t}\n\t\tconst tick = dataItem.get(\"tick\");\n\t\tif (tick) {\n\t\t\ttick.setPrivate(\"visible\", visible);\n\t\t}\n\t\tconst axisFill = dataItem.get(\"axisFill\");\n\t\tif (axisFill) {\n\t\t\taxisFill.setPrivate(\"visible\", 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(\"visible\", 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) {\n\t\tconst renderer = this.get(\"renderer\");\n\n\t\tif (!dataItem.get(\"label\")) {\n\t\t\trenderer.makeLabel(dataItem, tags);\n\t\t}\n\n\t\tif (!dataItem.get(\"grid\")) {\n\t\t\trenderer.makeGrid(dataItem, tags);\n\t\t}\n\n\t\tif (!dataItem.get(\"tick\")) {\n\t\t\trenderer.makeTick(dataItem, tags);\n\t\t}\n\n\t\tif (!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\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}\n\n\tprotected _updateGhost() {\n\t\tconst ghostLabel = this.ghostLabel;\n\t\tif (!ghostLabel.isHidden()) {\n\t\t\tconst bounds = ghostLabel.localBounds();\n\t\t\tconst gWidth = bounds.right - bounds.left;\n\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 = bounds.right - bounds.left;\n\n\t\t\t\t\tif (w > gWidth) {\n\t\t\t\t\t\tghostLabel.set(\"text\", label.text._getText());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\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\tghostLabel.setPrivate(\"visible\", true);\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!);\n\t\t\t\t\tseries.setRaw(\"tooltipDataItem\", dataItem);\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}\n\t\t\t\t\telse {\n\t\t\t\t\t\tseries.showDataItemTooltip(dataItem);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\n\t\t\tif (tooltip) {\n\t\t\t\trenderer.updateTooltipBounds(tooltip);\n\n\t\t\t\tif (this.get(\"snapTooltip\")) {\n\t\t\t\t\tposition = this.roundAxisPosition(position, this.get(\"tooltipLocation\", 0.5));\n\t\t\t\t}\n\t\t\t\tif (!$type.isNaN(position)) {\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\") || position > this.get(\"end\")) {\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 * @return Tooltip text\n\t */\n\tpublic abstract getTooltipText(position: number): 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 * 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): 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","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\";\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\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));\t\t\n\t\tthis.setPrivateRaw(\"endIndex\", Math.min(Math.round(this.get(\"end\", 1) * len), len));\t\t\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}\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.className == \"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\tif (startDataItem) {\n\t\t\t\t\t\t\tseries.setPrivate(\"startIndex\", 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\tseries.setPrivate(\"endIndex\", series.dataItems.indexOf(endDataItem) + 1);\n\t\t\t\t\t\t}\t\t\t\t\t\t\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\tlet maxCount = renderer.axisLength() / Math.max(renderer.get(\"minGridDistance\")!, 1 / Number.MAX_SAFE_INTEGER);\n\n\t\tlet frequency = Math.max(1, 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.dataItems[j].hide();\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\n\t\t\tif (dataItem.isHidden()) {\n\t\t\t\tdataItem.show();\n\t\t\t}\n\n\t\t\tthis._prepareDataItem(dataItem, f, frequency);\n\t\t\tf++;\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\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): 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}\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","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.dataItems[j].hide();\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\tif (dataItem.isHidden()) {\n\t\t\t\t\tdataItem.show();\n\t\t\t\t}\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): 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 { 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 $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\";\nimport { MultiDisposer } from \"../../../core/util/Disposer\";\n//import * as $order from \"../../../core/util/Order\";\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 * @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 * 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 fooltip 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}\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 * 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\tmin?: number;\n\tmax?: number;\n\tminFinal?: number;\n\tmaxFinal?: number;\n\tselectionMin?: number;\n\tselectionMax?: number;\n\tselectionMinFinal?: number;\n\tselectionMaxFinal?: number;\n\tselectionStepFinal?: number;\n\tstep?: number;\n\tstepDecimalPlaces?: number;\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 _deltaMinMax: number = 1;\n\tprotected _minReal: number | undefined;\n\tprotected _maxReal: number | undefined;\n\n\tprotected _baseValue: number = 0;\n\tprotected _syncDp?: MultiDisposer;\n\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\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 || 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\") || this.isDirty(\"numberFormat\")) {\n\t\t\tthis._getMinMax();\n\t\t\tthis._dirtyExtremes = false;\n\t\t}\n\n\t\tif (this._dirtySelectionExtremes && !this._isPanning) {\n\t\t\tthis._getSelectionMinMax();\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 _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 i = 0;\n\n\t\t\tif (logarithmic) {\n\t\t\t\tvalue = selectionMin;\n\t\t\t}\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\n\t\t\t\tif (dataItem.isHidden()) {\n\t\t\t\t\tdataItem.show();\n\t\t\t\t}\n\n\t\t\t\tdataItem.setRaw(\"value\", 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._formatText(value));\n\t\t\t\t}\n\n\t\t\t\tthis._prepareDataItem(dataItem);\n\n\t\t\t\tif (!logarithmic) {\n\t\t\t\t\tvalue += step;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tlet differencePower = Math.log(max) * Math.LOG10E - Math.log(min) * Math.LOG10E;\n\t\t\t\t\tif (differencePower > 1) {\n\t\t\t\t\t\tvalue = Math.pow(10, Math.log(min) * Math.LOG10E + i);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tvalue += step;\n\t\t\t\t\t}\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) {\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\t\t\t}\n\n\t\t\tfor (let j = i; j < this.dataItems.length; j++) {\n\t\t\t\tthis.dataItems[j].hide();\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\trenderer.updateLabel(dataItem.get(\"label\"), position, endPosition, 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, 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\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\tthis.setPrivateRaw(\"selectionMin\", selectionMin);\n\t\t\tthis.setPrivateRaw(\"selectionMax\", selectionMax);\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\tconst extraMin = this.get(\"extraMin\", 0);\n\t\tconst extraMax = this.get(\"extraMax\", 0);\n\n\t\tconst gridCount = this.get(\"renderer\").gridCount();\n\n\t\tconst strictMinMax = this.get(\"strictMinMax\", false);\n\n\t\tif ($type.isNumber(min) && $type.isNumber(max)) {\n\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\tif (series.get(\"xAxis\") === this) {\n\t\t\t\t\t\tseriesMin = series.getPrivate(\"selectionMinX\", series.getPrivate(\"minX\"));\n\t\t\t\t\t\tseriesMax = series.getPrivate(\"selectionMaxX\", series.getPrivate(\"maxX\"));\n\t\t\t\t\t}\n\t\t\t\t\telse if (series.get(\"yAxis\") === this) {\n\t\t\t\t\t\tseriesMin = series.getPrivate(\"selectionMinY\", series.getPrivate(\"minY\"));\n\t\t\t\t\t\tseriesMax = series.getPrivate(\"selectionMaxY\", series.getPrivate(\"maxY\"));\n\t\t\t\t\t}\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\tselectionMin -= this._deltaMinMax;\n\t\t\t\tselectionMax += this._deltaMinMax;\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 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 -= (selectionMax - selectionMin) * extraMin;\n\t\t\tselectionMax += (selectionMax - selectionMin) * extraMax;\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\tselectionMin = minMaxStep.min;\n\t\t\t\tselectionMax = minMaxStep.max;\n\t\t\t}\n\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\t\t\t\tif ($type.isNumber(maxDefined)) {\n\t\t\t\t\tselectionMax = Math.min(selectionMax, maxDefined);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet start = this.valueToFinalPosition(selectionMin);\n\t\t\tlet end = this.valueToFinalPosition(selectionMax);\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\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\treturn;\n\t\t}\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\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\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\t// the number by which we need to raise 10 to get difference\n\t\t\t\tlet exponent: number = Math.log(Math.abs(max)) * Math.LOG10E;\n\n\t\t\t\t// here we find a number which is power of 10 and has the same count of numbers as difference has\n\t\t\t\tlet power = Math.pow(10, Math.floor(exponent));\n\n\t\t\t\t// reduce this number by 10 times\n\t\t\t\tpower = power / 10;\n\n\t\t\t\tthis._deltaMinMax = power;\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\tthis._minReal = min;\n\t\tthis._maxReal = max;\n\n\t\tlet strict = this.get(\"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 (this.get(\"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\tmin -= (max - min) * extraMin;\n\t\t\tmax += (max - min) * 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\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\t\tthis.setPrivateRaw(\"maxZoomFactor\", (max - min) / minDiff * this.get(\"maxZoomFactor\", 100));\n\n\t\tif ($type.isNumber(min) && $type.isNumber(max)) {\n\t\t\tif (this.getPrivate(\"minFinal\") !== min || this.getPrivate(\"maxFinal\") !== max) {\n\t\t\t\tthis.setPrivate(\"minFinal\", min);\n\t\t\t\tthis.setPrivate(\"maxFinal\", 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\n\tprotected _adjustMinMax(min: number, max: number, gridCount: number, strictMode?: boolean): IMinMaxStep {\n\t\tconst logarithmic = this.get(\"logarithmic\");\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\tif (!logarithmic) {\n\t\t\t// round down min\n\t\t\tif (strictMode) {\n\t\t\t\tmin = Math.floor(min / power) * power;\n\t\t\t\t// round up max\n\t\t\t\tmax = Math.ceil(max / power) * power;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmin = Math.ceil(min / power) * power - extra;\n\t\t\t\t// round up max\n\t\t\t\tmax = Math.floor(max / power) * power + extra;\n\t\t\t}\n\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\t\t// logarithmic\n\t\telse {\n\t\t\tif (min <= 0) {\n\t\t\t\t//throw Error(\"Logarithmic value axis can not have values <= 0.\");\n\t\t\t\tmin = this.get(\"baseValue\", 0);\n\t\t\t}\n\n\t\t\tif (min === Infinity) {\n\t\t\t\tmin = 1;\n\t\t\t}\n\n\t\t\tif (max === -Infinity) {\n\t\t\t\tmax = 10;\n\t\t\t}\n\n\t\t\tmin = Math.pow(10, Math.floor(Math.log(Math.abs(min)) * Math.LOG10E));\n\t\t\tmax = Math.pow(10, Math.ceil(Math.log(Math.abs(max)) * Math.LOG10E));\n\n\t\t\tif (this.get(\"strictMinMax\")) {\n\t\t\t\tlet minDefined = this.get(\"min\");\n\t\t\t\tlet maxDefined = this.get(\"max\");\n\t\t\t\tif ($type.isNumber(minDefined) && minDefined > 0) {\n\t\t\t\t\tmin = minDefined;\n\t\t\t\t}\n\t\t\t\tif ($type.isNumber(maxDefined) && maxDefined > 0) {\n\t\t\t\t\tmax = maxDefined;\n\t\t\t\t}\n\t\t\t}\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\t\tlet maxPrecision = this.get(\"maxPrecision\");\n\t\tif ($type.isNumber(maxPrecision)) {\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}\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\t\tif (!logarithmic) {\n\t\t\t// final min and max\n\t\t\tlet minCount = Math.floor(min / step);\n\n\t\t\tmin = $math.round(step * minCount, decCount);\n\n\t\t\tlet maxCount: number;\n\n\t\t\tif (!strictMode) {\n\t\t\t\tmaxCount = Math.ceil(max / step);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmaxCount = Math.floor(max / step);\n\t\t\t}\n\n\t\t\tif (maxCount === minCount) {\n\t\t\t\tmaxCount++;\n\t\t\t}\n\n\t\t\tmax = $math.round(step * maxCount, decCount);\n\n\t\t\tif (max < initialMax) {\n\t\t\t\tmax = max + step;\n\t\t\t}\n\n\t\t\tif (min > initialMin) {\n\t\t\t\tmin = min - step;\n\t\t\t}\n\t\t}\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): 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\t//label.set(\"text\", this.getNumberFormatter().format(value, undefined, this.getPrivate(\"stepDecimalPlaces\")));\n\t\t}\n\n\t\t// //@todo number formatter + tag\n\t\t// return $math.round(this.positionToValue(position), this.getPrivate(\"stepDecimalPlaces\")).toString();\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\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","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 $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\";\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 * @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\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.\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 \"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 `0` (zero) to `1` (one), meaning start and end of the cell.\n\t *\n\t * If not set, it will use cell's start tiemstamp.\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}\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}\n\nexport interface IDateAxisEvents extends IValueAxisEvents {\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 _groupingCalculated: boolean = false;\n\tprotected _intervalDuration: number = 1;\n\tprotected _baseDuration: number = 1;\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\tthis.setPrivateRaw(\"maxZoomFactor\", Math.round((this.getPrivate(\"max\", 0) - this.getPrivate(\"min\", 0)) / this.baseMainDuration()));\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}\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})\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\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\t$array.eachContinue(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\t$array.each(dataItems, (dataItem) => {\n\t\t\t\t\tlet time = dataItem.get(key as any);\n\t\t\t\t\tlet roundedTime = $time.round(new Date(time), interval.timeUnit, interval.count, this._root.locale.firstDayOfWeek, this._root.utc, undefined, this._root.timezone).getTime();\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]++;\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})\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 !== undefined) {\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\t\t\t\t\t}\n\t\t\t\t\tpreviousTime = roundedTime;\n\t\t\t\t})\n\n\t\t\t\tif (series._dataSets[dataSetId].length < this.get(\"groupCount\", Infinity)) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t})\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}\n\t}\n\n\tpublic _clearDirty() {\n\t\tsuper._clearDirty();\n\t\tthis._groupingCalculated = false;\n\t\tthis._dataGrouped = false;\n\t}\n\n\tprotected _handleRangeChange() {\n\t\tsuper._handleRangeChange();\n\n\t\tconst selectionMin = this.getPrivate(\"selectionMin\");\n\t\tconst selectionMax = this.getPrivate(\"selectionMax\");\n\n\t\tif ($type.isNumber(selectionMin) && $type.isNumber(selectionMax)) {\n\n\t\t\tif (this.get(\"groupData\") && !this._groupingCalculated) {\n\t\t\t\tthis._groupingCalculated = true;\n\t\t\t\tlet baseInterval = this.get(\"baseInterval\");\n\n\t\t\t\tlet modifiedDifference = (selectionMax - selectionMin) + (this.get(\"startLocation\", 0) + (1 - this.get(\"endLocation\", 1)) * this.baseDuration());\n\t\t\t\tlet groupInterval = this.get(\"groupInterval\");\n\n\t\t\t\tif (!groupInterval) {\n\t\t\t\t\tconst groupIntervals = this.get(\"groupIntervals\")!;\n\t\t\t\t\tif (groupIntervals) {\n\t\t\t\t\t\tgroupInterval = $time.chooseInterval(0, modifiedDifference, this.get(\"groupCount\", Infinity), groupIntervals);\n\t\t\t\t\t\tif ($time.getIntervalDuration(groupInterval) < $time.getIntervalDuration(baseInterval)) {\n\t\t\t\t\t\t\tgroupInterval = { ...baseInterval };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet current = this.getPrivate(\"groupInterval\");\n\n\t\t\t\tif (groupInterval && (!current || (current.timeUnit !== groupInterval.timeUnit || current.count !== groupInterval.count))) {\n\t\t\t\t\tthis.setPrivateRaw(\"groupInterval\", groupInterval);\n\t\t\t\t\tthis._setBaseInterval(groupInterval)\n\n\t\t\t\t\tif (groupInterval) {\n\t\t\t\t\t\tlet newId = groupInterval.timeUnit + groupInterval.count;\n\t\t\t\t\t\t$array.each(this.series, (series) => {\n\t\t\t\t\t\t\tif (series.get(\"baseAxis\") === this) {\n\t\t\t\t\t\t\t\tseries.setDataSet(newId);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t\tthis.markDirtyExtremes();\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.getSortedIndex(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\tif (start.index > 0) {\n\t\t\t\t\t\tstart.index -= 1;\n\t\t\t\t\t}\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\tseries.setPrivate(\"startIndex\", start.index);\n\t\t\t\t\tseries.setPrivate(\"endIndex\", end.index);\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 _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 selectionMin = this.getPrivate(\"selectionMin\")! as number;\n\t\t\tconst selectionMax = 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\n\t\t\tvalue = $time.round(new Date(selectionMin - intervalDuration), gridInterval.timeUnit, gridInterval.count, this._root.locale.firstDayOfWeek, this._root.utc, new Date(min), this._root.timezone).getTime();\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\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\tif (dataItem.isHidden()) {\n\t\t\t\t\tdataItem.show();\n\t\t\t\t}\n\n\t\t\t\tdataItem.setRaw(\"value\", value);\n\t\t\t\tdataItem.setRaw(\"endValue\", $time.add(new Date(value), gridInterval.timeUnit, gridInterval.count, this._root.utc).getTime()) //$time.round(new Date(value + intervalDuration * 1.1), gridInterval.timeUnit, gridInterval.count).getTime());\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, this._root.utc, this._root.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\", this._root.dateFormatter.format(date, format!));\n\t\t\t\t}\n\n\t\t\t\tthis._prepareDataItem(dataItem, gridInterval.count);\n\n\t\t\t\tpreviousValue = value;\n\n\t\t\t\tvalue = $time.add(new Date(value), gridInterval.timeUnit, gridInterval.count, this._root.utc).getTime();\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.dataItems[j].hide();\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 _fixMin(min: number) {\n\t\tlet baseInterval = this.getPrivate(\"baseInterval\");\n\t\tlet startTime = $time.round(new Date(min), baseInterval.timeUnit, baseInterval.count, this._root.locale.firstDayOfWeek, this._root.utc, undefined, this._root.timezone).getTime();\n\t\tlet endTime = $time.add(new Date(startTime), baseInterval.timeUnit, baseInterval.count, this._root.utc).getTime();\n\n\t\treturn startTime + (endTime - startTime) * this.get(\"startLocation\", 0);\n\t}\n\t/* goes up to the year\n\tprotected _getFormat(timeUnit: TimeUnit, value: number, previousValue: number) {\n\t\tconst formats = this.get(\"dateFormats\")!;\n\t\tlet format = formats[timeUnit];\n\n\t\tif (this.get(\"markUnitChange\")) {\n\t\t\tlet nextGridUnit = $time.getNextUnit(timeUnit);\n\n\t\t\twhile (nextGridUnit != undefined) {\n\n\t\t\t\tif (nextGridUnit) {\n\t\t\t\t\tif (timeUnit != \"year\") {\n\t\t\t\t\t\tif ($time.checkChange(value, previousValue, nextGridUnit, this._root.utc, this._root.timezone)) {\n\t\t\t\t\t\t\tformat = this.get(\"periodChangeDateFormats\")![timeUnit];\n\t\t\t\t\t\t\ttimeUnit = nextGridUnit;\n\t\t\t\t\t\t\tnextGridUnit = $time.getNextUnit(nextGridUnit);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tnextGridUnit = 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\tnextGridUnit = undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn format;\n\t}\n\t*/\n\tprotected _fixMax(max: number) {\n\t\tlet baseInterval = this.getPrivate(\"baseInterval\");\n\t\tlet startTime = $time.round(new Date(max), baseInterval.timeUnit, baseInterval.count, this._root.locale.firstDayOfWeek, this._root.utc, undefined, this._root.timezone).getTime();\n\t\tlet endTime = $time.add(new Date(startTime), baseInterval.timeUnit, baseInterval.count, this._root.utc).getTime();\n\n\t\treturn startTime + (endTime - startTime) * this.get(\"endLocation\", 1);\n\t}\n\n\tprotected _updateDates(_date: number) {\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\tdataItem.open = {};\n\t\tdataItem.close = {};\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 = $time.round(new Date(value), baseInterval.timeUnit, baseInterval.count, this._root.locale.firstDayOfWeek, this._root.utc, undefined, this._root.timezone).getTime();\n\t\t\t\tlet endTime = $time.add(new Date(startTime), baseInterval.timeUnit, baseInterval.count, this._root.utc).getTime();\n\t\t\t\tdataItem.open![field] = startTime;\n\t\t\t\tdataItem.close![field] = endTime;\n\n\t\t\t\tthis._updateDates(startTime);\n\t\t\t}\n\t\t})\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\tlet baseInterval = this.getPrivate(\"baseInterval\");\n\t\tvalue = $time.round(new Date(value), baseInterval.timeUnit, baseInterval.count, this._root.locale.firstDayOfWeek, this._root.utc, undefined, this._root.timezone).getTime();\n\t\tlet endValue = value;\n\t\tif (location > 0) {\n\t\t\tendValue = $time.add(new Date(value), baseInterval.timeUnit, baseInterval.count, this._root.utc).getTime();\n\t\t}\n\t\treturn this.valueToPosition(value + (endValue - value) * location);\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): string | undefined {\n\t\t//@todo number formatter + tag\n\n\t\tlet format = this.get(\"tooltipDateFormats\")![this.getPrivate(\"baseInterval\").timeUnit];\n\t\treturn this._root.dateFormatter.format(new Date(this.positionToValue(position) + this.get(\"tooltipIntervalOffset\", -this.get(\"tooltipLocation\", 0.5)) * this.baseDuration()), this.get(\"tooltipDateFormat\", format));\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\t\tconst result = $array.getSortedIndex(series.dataItems, (dataItem) => {\n\t\t\tvar 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 (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\t\t\treturn first;\n\t\t}\n\t\telse {\n\t\t\t// @todo check if is in range\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 * 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","import type { AxisRenderer } from \"./AxisRenderer\";\r\n\r\nimport { DateAxis, IDateAxisSettings, IDateAxisPrivate, IDateAxisDataItem, IDateAxisEvents } from \"./DateAxis\";\r\nimport { DataItem } from \"../../../core/render/Component\";\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\n\r\nexport interface IGaplessDateAxisSettings extends IDateAxisSettings {\r\n\r\n}\r\n\r\nexport interface IGaplessDateAxisDataItem extends IDateAxisDataItem {\r\n\tindex?: number\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\r\n\tpublic _afterNew() {\r\n\t\tthis.valueFields.push(\"date\");\r\n\t\tsuper._afterNew();\r\n\t}\r\n\r\n\tprotected _dates: Array = [];\r\n\r\n\tprotected _updateDates(date: number) {\r\n\t\tconst dates = this._dates;\r\n\t\tconst result = $array.getSortedIndex(dates, (x) => $order.compare(x, date));\r\n\t\tif (!result.found) {\r\n\t\t\t$array.insertIndex(dates, result.index, date);\r\n\t\t}\r\n\t}\r\n\r\n\tpublic _updateAllDates() {\r\n\t\tthis._dates.length = 0;\r\n\r\n\t\t$array.each(this.series, (series) => {\r\n\t\t\tlet field = \"valueX\";\r\n\t\t\tif (series.get(\"yAxis\") == this) {\r\n\t\t\t\tfield = \"valueY\"\r\n\t\t\t}\r\n\t\t\t$array.each(series.dataItems, (dataItem) => {\r\n\t\t\t\tlet value = dataItem.get(field as any);\r\n\t\t\t\tif ($type.isNumber(value)) {\r\n\t\t\t\t\tif (dataItem.open) {\r\n\t\t\t\t\t\tthis._updateDates(dataItem.open![field]);\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._dates;\r\n\t\tconst len = dates.length;\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 / 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\r\n\t\t\tlet d = 0;\r\n\t\t\tif (itemValue > value) {\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\r\n\t\t\treturn index / 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._dates;\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\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\r\n\t\tlet len = this._dates.length;\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 this._dates[findex] + (index - findex) * this.baseDuration();\r\n\t}\r\n\r\n\tprotected _fixZoomFactor() {\r\n\t\tthis.setPrivateRaw(\"maxZoomFactor\", this._dates.length);\r\n\t}\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 dates = this._dates;\r\n\t\t\tconst renderer = this.get(\"renderer\");\r\n\t\t\tconst len = dates.length;\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\r\n\t\t\tstartIndex = Math.floor(startIndex / frequency) * frequency;\r\n\t\t\tthis._frequency = frequency;\r\n\r\n\t\t\tfor (let j = 0, length = this.dataItems.length; j < length; j++) {\r\n\t\t\t\tthis.dataItems[j].hide();\r\n\t\t\t}\r\n\r\n\t\t\tlet realDuration = (endTime - startTime) - ((endTime - startTime) / this.baseDuration() - (endIndex - startIndex)) * this.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 < this.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\r\n\t\t\tthis._intervalDuration = intervalDuration;\r\n\r\n\t\t\tconst formats = this.get(\"dateFormats\")!;\r\n\r\n\t\t\tlet selectedItems: Array = [];\r\n\r\n\t\t\tlet value = $time.round(new Date(this.getPrivate(\"min\", 0)), gridInterval.timeUnit, gridInterval.count, this._root.locale.firstDayOfWeek, this._root.utc, undefined, this._root.timezone).getTime() - intervalDuration;\r\n\t\t\tlet selectionMax = this.getPrivate(\"selectionMax\")\r\n\r\n\t\t\tlet previousPosition = -Infinity;\r\n\t\t\tlet minDifference = (this.get(\"end\", 1) - this.get(\"start\", 0)) / maxCount;\r\n\r\n\t\t\twhile (value <= selectionMax) {\r\n\t\t\t\tlet index = this.valueToIndex(value);\r\n\t\t\t\tlet realValue = this._dates[index];\r\n\t\t\t\tlet position = this.valueToPosition(realValue);\r\n\t\t\t\tif (position - previousPosition >= minDifference * 0.95) {\r\n\t\t\t\t\t$array.move(selectedItems, index);\r\n\t\t\t\t\tpreviousPosition = position;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvalue = $time.add(new Date(value), gridInterval.timeUnit, gridInterval.count, this._root.utc).getTime();\r\n\t\t\t}\r\n\r\n\t\t\tif (selectedItems.length > 0) {\r\n\t\t\t\tlet i = 0;\r\n\t\t\t\tlet previousValue = -Infinity;\r\n\t\t\t\tconst nextGridUnit = $time.getNextUnit(gridInterval.timeUnit);\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\r\n\t\t\t\t\tif (index > startIndex - 100 && index < endIndex + 100) {\r\n\r\n\t\t\t\t\t\tlet format = formats[gridInterval.timeUnit];\r\n\r\n\t\t\t\t\t\tformat = formats[gridInterval.timeUnit];\r\n\t\t\t\t\t\tif (nextGridUnit && this.get(\"markUnitChange\") && $type.isNumber(previousValue)) {\r\n\t\t\t\t\t\t\tif (gridInterval.timeUnit != \"year\") {\r\n\t\t\t\t\t\t\t\tif ($time.checkChange(value, previousValue, nextGridUnit, this._root.utc, this._root.timezone)) {\r\n\t\t\t\t\t\t\t\t\tformat = this.get(\"periodChangeDateFormats\")![gridInterval.timeUnit];\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\tthis._createAssets(dataItem, []);\r\n\r\n\t\t\t\t\t\tconst label = dataItem.get(\"label\");\r\n\t\t\t\t\t\tif (label) {\r\n\t\t\t\t\t\t\tlabel.set(\"text\", this._root.dateFormatter.format(date, format!));\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (dataItem.isHidden()) {\r\n\t\t\t\t\t\t\tdataItem.show();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis._prepareDataItem(dataItem, gridInterval.count);\r\n\t\t\t\t\t}\r\n\t\t\t\t\ti++;\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\t}\r\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\tdurationFormat: string;\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.setPrivate(\"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): 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}\t\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\";\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\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","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, 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\tif (this.isDirty(\"inside\")) {\n\t\t\taxis.markDirtySize();\n\t\t}\n\t\t\n\t\tconst opposite = \"opposite\"\n\n\t\tif (this.isDirty(opposite)) {\n\t\t\tconst chart = this.chart;\n\n\t\t\tif (chart) {\n\t\t\t\tconst axisChildren = axis.children;\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\taxisChildren.moveValue(this);\n\t\t\t\t\taxis.addTag(opposite);\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\taxisChildren.moveValue(this, 0);\n\t\t\t\t\taxis.removeTag(opposite);\n\t\t\t\t}\n\t\t\t\taxis.markDirtySize();\n\t\t\t}\n\t\t\taxis.ghostLabel._applyThemes();\n\t\t}\t\n\n\t\tthis.thumb.setPrivate(\"height\", axis.labelsContainer.height());\t\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\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\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\tpublic _updatePositions() {\n\t\tconst axis = this.axis;\n\t\taxis.gridContainer.set(\"x\", axis.x() - $utils.relativeToValue(axis.get(\"centerX\", 0), axis.width()) - axis.parent!.get(\"paddingLeft\", 0));\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);\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\taxis.set(\"width\", p100);\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\", Math.round(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\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\tx0 = Math.max(0, x0);\n\t\t\tx1 = Math.min(w, x1);\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, 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\n\t\tif (this.isDirty(\"inside\")) {\n\t\t\taxis.markDirtySize();\n\t\t}\n\n\t\tconst thumb = this.thumb;\n\t\tconst opposite = \"opposite\"\n\t\tif (this.isDirty(opposite)) {\n\t\t\tconst chart = this.chart;\n\t\t\tconst axisChildren = axis.children;\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}\t\t\t\t\t\n\t\t\t\t\taxis.addTag(opposite);\t\t\t\t\t\n\t\t\t\t\taxisChildren.moveValue(this, 0);\n\t\t\t\t\tthumb.set(\"centerX\", 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\tthumb.set(\"centerX\", p100);\n\t\t\t\t}\n\t\t\t\taxis.markDirtySize();\n\t\t\t}\t\t\t\n\t\t\taxis.ghostLabel._applyThemes();\n\t\t}\n\t\tthumb.setPrivate(\"width\", axis.labelsContainer.width());\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\taxis.gridContainer.set(\"y\", axis.y() - $utils.relativeToValue(axis.get(\"centerY\", 0), axis.height()));\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);\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\tlet y = this.positionToCoordinate(position);\n\n\t\t\tgrid.set(\"y\", y);\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 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\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\ty0 = Math.max(0, y0);\n\t\t\ty1 = 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\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 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 { RoundedRectangle, IRoundedRectangleSettings, IRoundedRectanglePrivate } from \"../../../core/render/RoundedRectangle\";\n\n\nexport interface ICandlestickSettings extends IRoundedRectangleSettings {\n\tlowX0?: number;\n\tlowY0?: number;\n\tlowX1?: number;\n\tlowY1?: number;\n\n\thighX0?: number;\n\thighY0?: number;\n\thighX1?: number;\n\thighY1?: number;\n\n\torientation?: \"horizontal\" | \"vertical\"\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 { BaseColumnSeries, IBaseColumnSeriesPrivate, IBaseColumnSeriesSettings, IBaseColumnSeriesDataItem, IBaseColumnSeriesAxisRange } from \"./BaseColumnSeries\";\r\nimport type { DataItem } from \"../../../core/render/Component\";\r\nimport { Template } from \"../../../core/util/Template\";\r\nimport { ListTemplate } from \"../../../core/util/List\";\r\nimport { RoundedRectangle } from \"../../../core/render/RoundedRectangle\";\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\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 = 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 { ColumnSeries, IColumnSeriesPrivate, IColumnSeriesSettings, IColumnSeriesDataItem, IColumnSeriesAxisRange } from \"./ColumnSeries\";\nimport type { DataItem } from \"../../../core/render/Component\";\nimport { Candlestick } from \"./Candlestick\";\nimport { Template } from \"../../../core/util/Template\";\nimport { ListTemplate } from \"../../../core/util/List\";\nimport * as $utils from \"../../../core/util/Utils\";\nimport * as $array from \"../../../core/util/Array\";\n\nexport interface ICandlestickSeriesDataItem extends IColumnSeriesDataItem {\n\n}\n\nexport interface ICandlestickSeriesSettings extends IColumnSeriesSettings {\n\n\n}\n\nexport interface ICandlestickSeriesPrivate extends IColumnSeriesPrivate {\n\n}\n\nexport interface ICandlestickSeriesAxisRange extends IColumnSeriesAxisRange {\n\tcolumns: ListTemplate\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 = 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 { 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 { CandlestickSeries, ICandlestickSeriesPrivate, ICandlestickSeriesSettings, ICandlestickSeriesDataItem, ICandlestickSeriesAxisRange } from \"./CandlestickSeries\";\nimport { OHLC } from \"./OHLC\";\nimport { Template } from \"../../../core/util/Template\";\nimport { ListTemplate } from \"../../../core/util/List\";\nimport type { DataItem } from \"../../../core/render/Component\";\nimport * as $utils from \"../../../core/util/Utils\";\n\nexport interface IOHLCSeriesDataItem extends ICandlestickSeriesDataItem {\n\n}\n\nexport interface IOHLCSeriesSettings extends ICandlestickSeriesSettings {\n}\n\nexport interface IOHLCSeriesPrivate extends ICandlestickSeriesPrivate {\n}\n\nexport interface IOHLCSeriesAxisRange extends ICandlestickSeriesAxisRange {\n\tcolumns: ListTemplate\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 = 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; // proceed\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;"],"sourceRoot":""}