counterpart, and avoid\n // triggering mouseenter/mouseleave when hovering from one to the\n // other (#17440).\n if (useHTML) {\n label.text.css({ pointerEvents: 'none' });\n }\n }\n return label\n .on('touchstart', (e) => e.stopPropagation())\n .on('click', function (e) {\n if (curState !== 3) {\n callback.call(label, e);\n }\n });\n }\n /**\n * Make a straight line crisper by not spilling out to neighbour pixels.\n *\n * @function Highcharts.SVGRenderer#crispLine\n *\n * @param {Highcharts.SVGPathArray} points\n * The original points on the format `[['M', 0, 0], ['L', 100, 0]]`.\n *\n * @param {number} width\n * The width of the line.\n *\n * @param {string} [roundingFunction=round]\n * The rounding function name on the `Math` object, can be one of\n * `round`, `floor` or `ceil`.\n *\n * @return {Highcharts.SVGPathArray}\n * The original points array, but modified to render crisply.\n */\n crispLine(points, width, roundingFunction = 'round') {\n const start = points[0];\n const end = points[1];\n // Normalize to a crisp line\n if (defined(start[1]) && start[1] === end[1]) {\n // Subtract due to #1129. Now bottom and left axis gridlines behave\n // the same.\n start[1] = end[1] =\n Math[roundingFunction](start[1]) - (width % 2 / 2);\n }\n if (defined(start[2]) && start[2] === end[2]) {\n start[2] = end[2] =\n Math[roundingFunction](start[2]) + (width % 2 / 2);\n }\n return points;\n }\n /**\n * Draw a path, wraps the SVG `path` element.\n *\n * @sample highcharts/members/renderer-path-on-chart/\n * Draw a path in a chart\n * @sample highcharts/members/renderer-path/\n * Draw a path independent from a chart\n *\n * @example\n * let path = renderer.path(['M', 10, 10, 'L', 30, 30, 'z'])\n * .attr({ stroke: '#ff00ff' })\n * .add();\n *\n * @function Highcharts.SVGRenderer#path\n *\n * @param {Highcharts.SVGPathArray} [path]\n * An SVG path definition in array form.\n *\n * @return {Highcharts.SVGElement}\n * The generated wrapper element.\n *\n */ /**\n * Draw a path, wraps the SVG `path` element.\n *\n * @function Highcharts.SVGRenderer#path\n *\n * @param {Highcharts.SVGAttributes} [attribs]\n * The initial attributes.\n *\n * @return {Highcharts.SVGElement}\n * The generated wrapper element.\n */\n path(path) {\n const attribs = (this.styledMode ? {} : {\n fill: 'none'\n });\n if (isArray(path)) {\n attribs.d = path;\n }\n else if (isObject(path)) { // attributes\n extend(attribs, path);\n }\n return this.createElement('path').attr(attribs);\n }\n /**\n * Draw a circle, wraps the SVG `circle` element.\n *\n * @sample highcharts/members/renderer-circle/\n * Drawing a circle\n *\n * @function Highcharts.SVGRenderer#circle\n *\n * @param {number} [x]\n * The center x position.\n *\n * @param {number} [y]\n * The center y position.\n *\n * @param {number} [r]\n * The radius.\n *\n * @return {Highcharts.SVGElement}\n * The generated wrapper element.\n */ /**\n * Draw a circle, wraps the SVG `circle` element.\n *\n * @function Highcharts.SVGRenderer#circle\n *\n * @param {Highcharts.SVGAttributes} [attribs]\n * The initial attributes.\n *\n * @return {Highcharts.SVGElement}\n * The generated wrapper element.\n */\n circle(x, y, r) {\n const attribs = (isObject(x) ?\n x :\n typeof x === 'undefined' ? {} : { x: x, y: y, r: r }), wrapper = this.createElement('circle');\n // Setting x or y translates to cx and cy\n wrapper.xSetter = wrapper.ySetter = function (value, key, element) {\n element.setAttribute('c' + key, value);\n };\n return wrapper.attr(attribs);\n }\n /**\n * Draw and return an arc.\n *\n * @sample highcharts/members/renderer-arc/\n * Drawing an arc\n *\n * @function Highcharts.SVGRenderer#arc\n *\n * @param {number} [x=0]\n * Center X position.\n *\n * @param {number} [y=0]\n * Center Y position.\n *\n * @param {number} [r=0]\n * The outer radius' of the arc.\n *\n * @param {number} [innerR=0]\n * Inner radius like used in donut charts.\n *\n * @param {number} [start=0]\n * The starting angle of the arc in radians, where 0 is to the right and\n * `-Math.PI/2` is up.\n *\n * @param {number} [end=0]\n * The ending angle of the arc in radians, where 0 is to the right and\n * `-Math.PI/2` is up.\n *\n * @return {Highcharts.SVGElement}\n * The generated wrapper element.\n */ /**\n * Draw and return an arc. Overloaded function that takes arguments object.\n *\n * @function Highcharts.SVGRenderer#arc\n *\n * @param {Highcharts.SVGAttributes} attribs\n * Initial SVG attributes.\n *\n * @return {Highcharts.SVGElement}\n * The generated wrapper element.\n */\n arc(x, y, r, innerR, start, end) {\n let options;\n if (isObject(x)) {\n options = x;\n y = options.y;\n r = options.r;\n innerR = options.innerR;\n start = options.start;\n end = options.end;\n x = options.x;\n }\n else {\n options = { innerR, start, end };\n }\n // Arcs are defined as symbols for the ability to set\n // attributes in attr and animate\n const arc = this.symbol('arc', x, y, r, r, options);\n arc.r = r; // #959\n return arc;\n }\n /**\n * Draw and return a rectangle.\n *\n * @function Highcharts.SVGRenderer#rect\n *\n * @param {number} [x]\n * Left position.\n *\n * @param {number} [y]\n * Top position.\n *\n * @param {number} [width]\n * Width of the rectangle.\n *\n * @param {number} [height]\n * Height of the rectangle.\n *\n * @param {number} [r]\n * Border corner radius.\n *\n * @param {number} [strokeWidth]\n * A stroke width can be supplied to allow crisp drawing.\n *\n * @return {Highcharts.SVGElement}\n * The generated wrapper element.\n */ /**\n * Draw and return a rectangle.\n *\n * @sample highcharts/members/renderer-rect-on-chart/\n * Draw a rectangle in a chart\n * @sample highcharts/members/renderer-rect/\n * Draw a rectangle independent from a chart\n *\n * @function Highcharts.SVGRenderer#rect\n *\n * @param {Highcharts.SVGAttributes} [attributes]\n * General SVG attributes for the rectangle.\n *\n * @return {Highcharts.SVGElement}\n * The generated wrapper element.\n */\n rect(x, y, width, height, r, strokeWidth) {\n const attribs = (isObject(x) ?\n x :\n typeof x === 'undefined' ?\n {} :\n {\n x,\n y,\n r,\n width: Math.max(width || 0, 0),\n height: Math.max(height || 0, 0)\n }), wrapper = this.createElement('rect');\n if (!this.styledMode) {\n if (typeof strokeWidth !== 'undefined') {\n attribs['stroke-width'] = strokeWidth;\n extend(attribs, wrapper.crisp(attribs));\n }\n attribs.fill = 'none';\n }\n wrapper.rSetter = function (value, _key, element) {\n wrapper.r = value;\n attr(element, {\n rx: value,\n ry: value\n });\n };\n wrapper.rGetter = function () {\n return wrapper.r || 0;\n };\n return wrapper.attr(attribs);\n }\n /**\n * Draw and return a rectangle with advanced corner rounding options.\n *\n * @function Highcharts.SVGRenderer#roundedRect\n *\n * @param {Highcharts.SVGAttributes} attribs\n * Attributes\n * @return {Highcharts.SVGElement}\n * The generated wrapper element.\n */\n roundedRect(attribs) {\n return this.symbol('roundedRect').attr(attribs);\n }\n /**\n * Resize the {@link SVGRenderer#box} and re-align all aligned child\n * elements.\n *\n * @sample highcharts/members/renderer-g/\n * Show and hide grouped objects\n *\n * @function Highcharts.SVGRenderer#setSize\n *\n * @param {number} width\n * The new pixel width.\n *\n * @param {number} height\n * The new pixel height.\n *\n * @param {boolean|Partial
} [animate=true]\n * Whether and how to animate.\n */\n setSize(width, height, animate) {\n const renderer = this;\n renderer.width = width;\n renderer.height = height;\n renderer.boxWrapper.animate({\n width: width,\n height: height\n }, {\n step: function () {\n this.attr({\n viewBox: '0 0 ' + this.attr('width') + ' ' +\n this.attr('height')\n });\n },\n duration: pick(animate, true) ? void 0 : 0\n });\n renderer.alignElements();\n }\n /**\n * Create and return an svg group element. Child\n * {@link Highcharts.SVGElement} objects are added to the group by using the\n * group as the first parameter in {@link Highcharts.SVGElement#add|add()}.\n *\n * @function Highcharts.SVGRenderer#g\n *\n * @param {string} [name]\n * The group will be given a class name of `highcharts-{name}`. This\n * can be used for styling and scripting.\n *\n * @return {Highcharts.SVGElement}\n * The generated wrapper element.\n */\n g(name) {\n const elem = this.createElement('g');\n return name ?\n elem.attr({ 'class': 'highcharts-' + name }) :\n elem;\n }\n /**\n * Display an image.\n *\n * @sample highcharts/members/renderer-image-on-chart/\n * Add an image in a chart\n * @sample highcharts/members/renderer-image/\n * Add an image independent of a chart\n *\n * @function Highcharts.SVGRenderer#image\n *\n * @param {string} href\n * The image source.\n *\n * @param {number} [x]\n * The X position.\n *\n * @param {number} [y]\n * The Y position.\n *\n * @param {number} [width]\n * The image width. If omitted, it defaults to the image file width.\n *\n * @param {number} [height]\n * The image height. If omitted it defaults to the image file\n * height.\n *\n * @param {Function} [onload]\n * Event handler for image load.\n *\n * @return {Highcharts.SVGElement}\n * The generated wrapper element.\n */\n image(href, x, y, width, height, onload) {\n const attribs = { preserveAspectRatio: 'none' };\n // Optional properties (#11756)\n if (isNumber(x)) {\n attribs.x = x;\n }\n if (isNumber(y)) {\n attribs.y = y;\n }\n if (isNumber(width)) {\n attribs.width = width;\n }\n if (isNumber(height)) {\n attribs.height = height;\n }\n const elemWrapper = this.createElement('image').attr(attribs), onDummyLoad = function (e) {\n elemWrapper.attr({ href });\n onload.call(elemWrapper, e);\n };\n // Add load event if supplied\n if (onload) {\n // We have to use a dummy HTML image since IE support for SVG image\n // load events is very buggy. First set a transparent src, wait for\n // dummy to load, and then add the real src to the SVG image.\n elemWrapper.attr({\n /* eslint-disable-next-line max-len */\n href: 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=='\n });\n const dummy = new win.Image();\n addEvent(dummy, 'load', onDummyLoad);\n dummy.src = href;\n if (dummy.complete) {\n onDummyLoad({});\n }\n }\n else {\n elemWrapper.attr({ href });\n }\n return elemWrapper;\n }\n /**\n * Draw a symbol out of pre-defined shape paths from\n * {@link SVGRenderer#symbols}.\n * It is used in Highcharts for point makers, which cake a `symbol` option,\n * and label and button backgrounds like in the tooltip and stock flags.\n *\n * @function Highcharts.SVGRenderer#symbol\n *\n * @param {string} symbol\n * The symbol name.\n *\n * @param {number} [x]\n * The X coordinate for the top left position.\n *\n * @param {number} [y]\n * The Y coordinate for the top left position.\n *\n * @param {number} [width]\n * The pixel width.\n *\n * @param {number} [height]\n * The pixel height.\n *\n * @param {Highcharts.SymbolOptionsObject} [options]\n * Additional options, depending on the actual symbol drawn.\n *\n * @return {Highcharts.SVGElement}\n * SVG symbol.\n */\n symbol(symbol, x, y, width, height, options) {\n const ren = this, imageRegex = /^url\\((.*?)\\)$/, isImage = imageRegex.test(symbol), sym = (!isImage && (this.symbols[symbol] ? symbol : 'circle')), \n // get the symbol definition function\n symbolFn = (sym && this.symbols[sym]);\n let obj, path, imageSrc, centerImage;\n if (symbolFn) {\n // Check if there's a path defined for this symbol\n if (typeof x === 'number') {\n path = symbolFn.call(this.symbols, Math.round(x || 0), Math.round(y || 0), width || 0, height || 0, options);\n }\n obj = this.path(path);\n if (!ren.styledMode) {\n obj.attr('fill', 'none');\n }\n // expando properties for use in animate and attr\n extend(obj, {\n symbolName: (sym || void 0),\n x: x,\n y: y,\n width: width,\n height: height\n });\n if (options) {\n extend(obj, options);\n }\n // Image symbols\n }\n else if (isImage) {\n imageSrc = symbol.match(imageRegex)[1];\n // Create the image synchronously, add attribs async\n const img = obj = this.image(imageSrc);\n // The image width is not always the same as the symbol width. The\n // image may be centered within the symbol, as is the case when\n // image shapes are used as label backgrounds, for example in flags.\n img.imgwidth = pick(options && options.width, symbolSizes[imageSrc] && symbolSizes[imageSrc].width);\n img.imgheight = pick(options && options.height, symbolSizes[imageSrc] && symbolSizes[imageSrc].height);\n /**\n * Set the size and position\n */\n centerImage = (obj) => obj.attr({\n width: obj.width,\n height: obj.height\n });\n /**\n * Width and height setters that take both the image's physical size\n * and the label size into consideration, and translates the image\n * to center within the label.\n */\n ['width', 'height'].forEach((key) => {\n img[`${key}Setter`] = function (value, key) {\n this[key] = value;\n const { alignByTranslate, element, width, height, imgwidth, imgheight } = this, imgSize = key === 'width' ? imgwidth : imgheight;\n let scale = 1;\n // Scale and center the image within its container. The name\n // `backgroundSize` is taken from the CSS spec, but the\n // value `within` is made up. Other possible values in the\n // spec, `cover` and `contain`, can be implemented if\n // needed.\n if (options &&\n options.backgroundSize === 'within' &&\n width &&\n height &&\n imgwidth &&\n imgheight) {\n scale = Math.min(width / imgwidth, height / imgheight);\n // Update both width and height to keep the ratio\n // correct (#17315)\n attr(element, {\n width: Math.round(imgwidth * scale),\n height: Math.round(imgheight * scale)\n });\n }\n else if (element && imgSize) {\n element.setAttribute(key, imgSize);\n }\n if (!alignByTranslate && imgwidth && imgheight) {\n this.translate(((width || 0) - (imgwidth * scale)) / 2, ((height || 0) - (imgheight * scale)) / 2);\n }\n };\n });\n if (defined(x)) {\n img.attr({\n x: x,\n y: y\n });\n }\n img.isImg = true;\n if (defined(img.imgwidth) && defined(img.imgheight)) {\n centerImage(img);\n }\n else {\n // Initialize image to be 0 size so export will still function\n // if there's no cached sizes.\n img.attr({ width: 0, height: 0 });\n // Create a dummy JavaScript image to get the width and height.\n createElement('img', {\n onload: function () {\n const chart = charts[ren.chartIndex];\n // Special case for SVGs on IE11, the width is not\n // accessible until the image is part of the DOM\n // (#2854).\n if (this.width === 0) {\n css(this, {\n position: 'absolute',\n top: '-999em'\n });\n doc.body.appendChild(this);\n }\n // Center the image\n symbolSizes[imageSrc] = {\n width: this.width,\n height: this.height\n };\n img.imgwidth = this.width;\n img.imgheight = this.height;\n if (img.element) {\n centerImage(img);\n }\n // Clean up after #2854 workaround.\n if (this.parentNode) {\n this.parentNode.removeChild(this);\n }\n // Fire the load event when all external images are\n // loaded\n ren.imgCount--;\n if (!ren.imgCount && chart && !chart.hasLoaded) {\n chart.onload();\n }\n },\n src: imageSrc\n });\n this.imgCount++;\n }\n }\n return obj;\n }\n /**\n * Define a clipping rectangle. The clipping rectangle is later applied\n * to {@link SVGElement} objects through the {@link SVGElement#clip}\n * function.\n *\n * This function is deprecated as of v11.2. Instead, use a regular shape\n * (`rect`, `path` etc), and the `SVGElement.clipTo` function.\n *\n * @example\n * let circle = renderer.circle(100, 100, 100)\n * .attr({ fill: 'red' })\n * .add();\n * let clipRect = renderer.clipRect(100, 100, 100, 100);\n *\n * // Leave only the lower right quarter visible\n * circle.clip(clipRect);\n *\n * @deprecated\n *\n * @function Highcharts.SVGRenderer#clipRect\n *\n * @param {number} [x]\n *\n * @param {number} [y]\n *\n * @param {number} [width]\n *\n * @param {number} [height]\n *\n * @return {Highcharts.ClipRectElement}\n * A clipping rectangle.\n */\n clipRect(x, y, width, height) {\n return this.rect(x, y, width, height, 0);\n }\n /**\n * Draw text. The text can contain a subset of HTML, like spans and anchors\n * and some basic text styling of these. For more advanced features like\n * border and background, use {@link Highcharts.SVGRenderer#label} instead.\n * To update the text after render, run `text.attr({ text: 'New text' })`.\n *\n * @sample highcharts/members/renderer-text-on-chart/\n * Annotate the chart freely\n * @sample highcharts/members/renderer-on-chart/\n * Annotate with a border and in response to the data\n * @sample highcharts/members/renderer-text/\n * Formatted text\n *\n * @function Highcharts.SVGRenderer#text\n *\n * @param {string} [str]\n * The text of (subset) HTML to draw.\n *\n * @param {number} [x]\n * The x position of the text's lower left corner.\n *\n * @param {number} [y]\n * The y position of the text's lower left corner.\n *\n * @param {boolean} [useHTML=false]\n * Use HTML to render the text.\n *\n * @return {Highcharts.SVGElement}\n * The text object.\n */\n text(str, x, y, useHTML) {\n const renderer = this, attribs = {};\n if (useHTML && (renderer.allowHTML || !renderer.forExport)) {\n return renderer.html(str, x, y);\n }\n attribs.x = Math.round(x || 0); // X always needed for line-wrap logic\n if (y) {\n attribs.y = Math.round(y);\n }\n if (defined(str)) {\n attribs.text = str;\n }\n const wrapper = renderer.createElement('text').attr(attribs);\n if (!useHTML || (renderer.forExport && !renderer.allowHTML)) {\n wrapper.xSetter = function (value, key, element) {\n const tspans = element.getElementsByTagName('tspan'), parentVal = element.getAttribute(key);\n for (let i = 0, tspan; i < tspans.length; i++) {\n tspan = tspans[i];\n // If the x values are equal, the tspan represents a line\n // break\n if (tspan.getAttribute(key) === parentVal) {\n tspan.setAttribute(key, value);\n }\n }\n element.setAttribute(key, value);\n };\n }\n return wrapper;\n }\n /**\n * Utility to return the baseline offset and total line height from the font\n * size.\n *\n * @function Highcharts.SVGRenderer#fontMetrics\n *\n * @param {Highcharts.SVGElement|Highcharts.SVGDOMElement|number} [element]\n * The element to inspect for a current font size. If a number is\n * given, it's used as a fall back for direct font size in pixels.\n *\n * @return {Highcharts.FontMetricsObject}\n * The font metrics.\n */\n fontMetrics(element) {\n const f = pInt(SVGElement.prototype.getStyle.call(element, 'font-size') || 0);\n // Empirical values found by comparing font size and bounding box\n // height. Applies to the default font family.\n // https://jsfiddle.net/highcharts/7xvn7/\n const h = f < 24 ? f + 3 : Math.round(f * 1.2), b = Math.round(h * 0.8);\n return {\n // Line height\n h,\n // Baseline\n b,\n // Font size\n f\n };\n }\n /**\n * Correct X and Y positioning of a label for rotation (#1764).\n *\n * @private\n * @function Highcharts.SVGRenderer#rotCorr\n */\n rotCorr(baseline, rotation, alterY) {\n let y = baseline;\n if (rotation && alterY) {\n y = Math.max(y * Math.cos(rotation * deg2rad), 4);\n }\n return {\n x: (-baseline / 3) * Math.sin(rotation * deg2rad),\n y: y\n };\n }\n /**\n * Compatibility function to convert the legacy one-dimensional path array\n * into an array of segments.\n *\n * It is used in maps to parse the `path` option, and in SVGRenderer.dSetter\n * to support legacy paths from demos.\n *\n * @private\n * @function Highcharts.SVGRenderer#pathToSegments\n */\n pathToSegments(path) {\n const ret = [];\n const segment = [];\n const commandLength = {\n A: 8,\n C: 7,\n H: 2,\n L: 3,\n M: 3,\n Q: 5,\n S: 5,\n T: 3,\n V: 2\n };\n // Short, non-typesafe parsing of the one-dimensional array. It splits\n // the path on any string. This is not type checked against the tuple\n // types, but is shorter, and doesn't require specific checks for any\n // command type in SVG.\n for (let i = 0; i < path.length; i++) {\n // Command skipped, repeat previous or insert L/l for M/m\n if (isString(segment[0]) &&\n isNumber(path[i]) &&\n segment.length === commandLength[(segment[0].toUpperCase())]) {\n path.splice(i, 0, segment[0].replace('M', 'L').replace('m', 'l'));\n }\n // Split on string\n if (typeof path[i] === 'string') {\n if (segment.length) {\n ret.push(segment.slice(0));\n }\n segment.length = 0;\n }\n segment.push(path[i]);\n }\n ret.push(segment.slice(0));\n return ret;\n /*\n // Fully type-safe version where each tuple type is checked. The\n // downside is filesize and a lack of flexibility for unsupported\n // commands\n const ret: SVGPath = [],\n commands = {\n A: 7,\n C: 6,\n H: 1,\n L: 2,\n M: 2,\n Q: 4,\n S: 4,\n T: 2,\n V: 1,\n Z: 0\n };\n\n let i = 0,\n lastI = 0,\n lastCommand;\n\n while (i < path.length) {\n const item = path[i];\n\n let command;\n\n if (typeof item === 'string') {\n command = item;\n i += 1;\n } else {\n command = lastCommand || 'M';\n }\n\n // Upper case\n const commandUC = command.toUpperCase();\n\n if (commandUC in commands) {\n\n // No numeric parameters\n if (command === 'Z' || command === 'z') {\n ret.push([command]);\n\n // One numeric parameter\n } else {\n const val0 = path[i];\n if (typeof val0 === 'number') {\n\n // Horizontal line to\n if (command === 'H' || command === 'h') {\n ret.push([command, val0]);\n i += 1;\n\n // Vertical line to\n } else if (command === 'V' || command === 'v') {\n ret.push([command, val0]);\n i += 1;\n\n // Two numeric parameters\n } else {\n const val1 = path[i + 1];\n if (typeof val1 === 'number') {\n // lineTo\n if (command === 'L' || command === 'l') {\n ret.push([command, val0, val1]);\n i += 2;\n\n // moveTo\n } else if (command === 'M' || command === 'm') {\n ret.push([command, val0, val1]);\n i += 2;\n\n // Smooth quadratic bezier\n } else if (command === 'T' || command === 't') {\n ret.push([command, val0, val1]);\n i += 2;\n\n // Four numeric parameters\n } else {\n const val2 = path[i + 2],\n val3 = path[i + 3];\n if (\n typeof val2 === 'number' &&\n typeof val3 === 'number'\n ) {\n // Quadratic bezier to\n if (\n command === 'Q' ||\n command === 'q'\n ) {\n ret.push([\n command,\n val0,\n val1,\n val2,\n val3\n ]);\n i += 4;\n\n // Smooth cubic bezier to\n } else if (\n command === 'S' ||\n command === 's'\n ) {\n ret.push([\n command,\n val0,\n val1,\n val2,\n val3\n ]);\n i += 4;\n\n // Six numeric parameters\n } else {\n const val4 = path[i + 4],\n val5 = path[i + 5];\n\n if (\n typeof val4 === 'number' &&\n typeof val5 === 'number'\n ) {\n // Curve to\n if (\n command === 'C' ||\n command === 'c'\n ) {\n ret.push([\n command,\n val0,\n val1,\n val2,\n val3,\n val4,\n val5\n ]);\n i += 6;\n\n // Seven numeric parameters\n } else {\n const val6 = path[i + 6];\n\n // Arc to\n if (\n typeof val6 ===\n 'number' &&\n (\n command === 'A' ||\n command === 'a'\n )\n ) {\n ret.push([\n command,\n val0,\n val1,\n val2,\n val3,\n val4,\n val5,\n val6\n ]);\n i += 7;\n\n }\n\n }\n }\n }\n }\n }\n }\n\n }\n }\n }\n }\n\n // An unmarked command following a moveTo is a lineTo\n lastCommand = command === 'M' ? 'L' : command;\n\n if (i === lastI) {\n break;\n }\n lastI = i;\n }\n return ret;\n */\n }\n /**\n * Draw a label, which is an extended text element with support for border\n * and background. Highcharts creates a `g` element with a text and a `path`\n * or `rect` inside, to make it behave somewhat like a HTML div. Border and\n * background are set through `stroke`, `stroke-width` and `fill` attributes\n * using the {@link Highcharts.SVGElement#attr|attr} method. To update the\n * text after render, run `label.attr({ text: 'New text' })`.\n *\n * @sample highcharts/members/renderer-label-on-chart/\n * A label on the chart\n *\n * @function Highcharts.SVGRenderer#label\n *\n * @param {string} str\n * The initial text string or (subset) HTML to render.\n *\n * @param {number} x\n * The x position of the label's left side.\n *\n * @param {number} [y]\n * The y position of the label's top side or baseline, depending on\n * the `baseline` parameter.\n *\n * @param {string} [shape='rect']\n * The shape of the label's border/background, if any. Defaults to\n * `rect`. Other possible values are `callout` or other shapes\n * defined in {@link Highcharts.SVGRenderer#symbols}.\n *\n * @param {number} [anchorX]\n * In case the `shape` has a pointer, like a flag, this is the\n * coordinates it should be pinned to.\n *\n * @param {number} [anchorY]\n * In case the `shape` has a pointer, like a flag, this is the\n * coordinates it should be pinned to.\n *\n * @param {boolean} [useHTML=false]\n * Whether to use HTML to render the label.\n *\n * @param {boolean} [baseline=false]\n * Whether to position the label relative to the text baseline,\n * like {@link Highcharts.SVGRenderer#text|renderer.text}, or to the\n * upper border of the rectangle.\n *\n * @param {string} [className]\n * Class name for the group.\n *\n * @return {Highcharts.SVGElement}\n * The generated label.\n */\n label(str, x, y, shape, anchorX, anchorY, useHTML, baseline, className) {\n return new SVGLabel(this, str, x, y, shape, anchorX, anchorY, useHTML, baseline, className);\n }\n /**\n * Re-align all aligned elements.\n *\n * @private\n * @function Highcharts.SVGRenderer#alignElements\n */\n alignElements() {\n this.alignedObjects.forEach((el) => el.align());\n }\n}\nextend(SVGRenderer.prototype, {\n /**\n * A pointer to the renderer's associated Element class.\n *\n * @name Highcharts.SVGRenderer#Element\n * @type {Highcharts.SVGElement}\n */\n Element: SVGElement,\n SVG_NS,\n /**\n * A collection of characters mapped to HTML entities. When `useHTML` on an\n * element is true, these entities will be rendered correctly by HTML. In\n * the SVG pseudo-HTML, they need to be unescaped back to simple characters,\n * so for example `<` will render as `<`.\n *\n * @example\n * // Add support for unescaping quotes\n * Highcharts.SVGRenderer.prototype.escapes['\"'] = '"';\n *\n * @name Highcharts.SVGRenderer#escapes\n * @type {Highcharts.Dictionary}\n */\n escapes: {\n '&': '&',\n '<': '<',\n '>': '>',\n \"'\": ''',\n '\"': '"'\n },\n /**\n * An extendable collection of functions for defining symbol paths.\n *\n * @name Highcharts.SVGRenderer#symbols\n * @type {Highcharts.SymbolDictionary}\n */\n symbols: Symbols,\n /**\n * Dummy function for plugins, called every time the renderer is updated.\n * Prior to Highcharts 5, this was used for the canvg renderer.\n *\n * @deprecated\n * @function Highcharts.SVGRenderer#draw\n */\n draw: noop\n});\n/* *\n *\n * Registry\n *\n * */\nRendererRegistry.registerRendererType('svg', SVGRenderer, true);\n/* *\n *\n * Export Default\n *\n * */\nexport default SVGRenderer;\n/* *\n *\n * API Declarations\n *\n * */\n/**\n * A clipping rectangle that can be applied to one or more {@link SVGElement}\n * instances. It is instantiated with the {@link SVGRenderer#clipRect} function\n * and applied with the {@link SVGElement#clip} function.\n *\n * @example\n * let circle = renderer.circle(100, 100, 100)\n * .attr({ fill: 'red' })\n * .add();\n * let clipRect = renderer.clipRect(100, 100, 100, 100);\n *\n * // Leave only the lower right quarter visible\n * circle.clip(clipRect);\n *\n * @typedef {Highcharts.SVGElement} Highcharts.ClipRectElement\n */\n/**\n * The font metrics.\n *\n * @interface Highcharts.FontMetricsObject\n */ /**\n* The baseline relative to the top of the box.\n*\n* @name Highcharts.FontMetricsObject#b\n* @type {number}\n*/ /**\n* The font size.\n*\n* @name Highcharts.FontMetricsObject#f\n* @type {number}\n*/ /**\n* The line height.\n*\n* @name Highcharts.FontMetricsObject#h\n* @type {number}\n*/\n/**\n * An object containing `x` and `y` properties for the position of an element.\n *\n * @interface Highcharts.PositionObject\n */ /**\n* X position of the element.\n* @name Highcharts.PositionObject#x\n* @type {number}\n*/ /**\n* Y position of the element.\n* @name Highcharts.PositionObject#y\n* @type {number}\n*/\n/**\n * A rectangle.\n *\n * @interface Highcharts.RectangleObject\n */ /**\n* Height of the rectangle.\n* @name Highcharts.RectangleObject#height\n* @type {number}\n*/ /**\n* Width of the rectangle.\n* @name Highcharts.RectangleObject#width\n* @type {number}\n*/ /**\n* Horizontal position of the rectangle.\n* @name Highcharts.RectangleObject#x\n* @type {number}\n*/ /**\n* Vertical position of the rectangle.\n* @name Highcharts.RectangleObject#y\n* @type {number}\n*/\n/**\n * The shadow options.\n *\n * @interface Highcharts.ShadowOptionsObject\n */ /**\n* The shadow color.\n* @name Highcharts.ShadowOptionsObject#color\n* @type {Highcharts.ColorString|undefined}\n* @default ${palette.neutralColor100}\n*/ /**\n* The horizontal offset from the element.\n*\n* @name Highcharts.ShadowOptionsObject#offsetX\n* @type {number|undefined}\n* @default 1\n*/ /**\n* The vertical offset from the element.\n* @name Highcharts.ShadowOptionsObject#offsetY\n* @type {number|undefined}\n* @default 1\n*/ /**\n* The shadow opacity.\n*\n* @name Highcharts.ShadowOptionsObject#opacity\n* @type {number|undefined}\n* @default 0.15\n*/ /**\n* The shadow width or distance from the element.\n* @name Highcharts.ShadowOptionsObject#width\n* @type {number|undefined}\n* @default 3\n*/\n/**\n * @interface Highcharts.SizeObject\n */ /**\n* @name Highcharts.SizeObject#height\n* @type {number}\n*/ /**\n* @name Highcharts.SizeObject#width\n* @type {number}\n*/\n/**\n * Array of path commands, that will go into the `d` attribute of an SVG\n * element.\n *\n * @typedef {Array<(Array|Array|Array|Array|Array|Array)>} Highcharts.SVGPathArray\n */\n/**\n * Possible path commands in an SVG path array. Valid values are `A`, `C`, `H`,\n * `L`, `M`, `Q`, `S`, `T`, `V`, `Z`.\n *\n * @typedef {string} Highcharts.SVGPathCommand\n * @validvalue [\"a\",\"c\",\"h\",\"l\",\"m\",\"q\",\"s\",\"t\",\"v\",\"z\",\"A\",\"C\",\"H\",\"L\",\"M\",\"Q\",\"S\",\"T\",\"V\",\"Z\"]\n */\n/**\n * An extendable collection of functions for defining symbol paths. Symbols are\n * used internally for point markers, button and label borders and backgrounds,\n * or custom shapes. Extendable by adding to {@link SVGRenderer#symbols}.\n *\n * @interface Highcharts.SymbolDictionary\n */ /**\n* @name Highcharts.SymbolDictionary#[key:string]\n* @type {Function|undefined}\n*/ /**\n* @name Highcharts.SymbolDictionary#arc\n* @type {Function|undefined}\n*/ /**\n* @name Highcharts.SymbolDictionary#callout\n* @type {Function|undefined}\n*/ /**\n* @name Highcharts.SymbolDictionary#circle\n* @type {Function|undefined}\n*/ /**\n* @name Highcharts.SymbolDictionary#diamond\n* @type {Function|undefined}\n*/ /**\n* @name Highcharts.SymbolDictionary#square\n* @type {Function|undefined}\n*/ /**\n* @name Highcharts.SymbolDictionary#triangle\n* @type {Function|undefined}\n*/\n/**\n * Can be one of `arc`, `callout`, `circle`, `diamond`, `square`, `triangle`,\n * and `triangle-down`. Symbols are used internally for point markers, button\n * and label borders and backgrounds, or custom shapes. Extendable by adding to\n * {@link SVGRenderer#symbols}.\n *\n * @typedef {\"arc\"|\"callout\"|\"circle\"|\"diamond\"|\"square\"|\"triangle\"|\"triangle-down\"} Highcharts.SymbolKeyValue\n */\n/**\n * Additional options, depending on the actual symbol drawn.\n *\n * @interface Highcharts.SymbolOptionsObject\n */ /**\n* The anchor X position for the `callout` symbol. This is where the chevron\n* points to.\n*\n* @name Highcharts.SymbolOptionsObject#anchorX\n* @type {number|undefined}\n*/ /**\n* The anchor Y position for the `callout` symbol. This is where the chevron\n* points to.\n*\n* @name Highcharts.SymbolOptionsObject#anchorY\n* @type {number|undefined}\n*/ /**\n* The end angle of an `arc` symbol.\n*\n* @name Highcharts.SymbolOptionsObject#end\n* @type {number|undefined}\n*/ /**\n* Whether to draw `arc` symbol open or closed.\n*\n* @name Highcharts.SymbolOptionsObject#open\n* @type {boolean|undefined}\n*/ /**\n* The radius of an `arc` symbol, or the border radius for the `callout` symbol.\n*\n* @name Highcharts.SymbolOptionsObject#r\n* @type {number|undefined}\n*/ /**\n* The start angle of an `arc` symbol.\n*\n* @name Highcharts.SymbolOptionsObject#start\n* @type {number|undefined}\n*/\n(''); // keeps doclets above in transpiled file\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport AST from './AST.js';\nimport H from '../../Globals.js';\nconst { composed } = H;\nimport SVGElement from '../SVG/SVGElement.js';\nimport U from '../../Utilities.js';\nconst { attr, css, createElement, defined, extend, pInt, pushUnique } = U;\n/**\n * The opacity and visibility properties are set as attributes on the main\n * element and SVG groups, and as identical CSS properties on the HTML element\n * and the ancestry divs. (#3542)\n *\n * @private\n */\nfunction commonSetter(value, key, elem) {\n const style = this.div?.style || elem.style;\n SVGElement.prototype[`${key}Setter`].call(this, value, key, elem);\n if (style) {\n style[key] = value;\n }\n}\n/**\n * Decorate each SVG group in the ancestry line. Each SVG `g` element that\n * contains children with useHTML, will receive a `div` element counterpart to\n * contain the HTML span. These div elements are translated and styled like\n * original `g` counterparts.\n *\n * @private\n */\nconst decorateSVGGroup = (g, container) => {\n if (!g.div) {\n const className = attr(g.element, 'class'), cssProto = g.css;\n // Create the parallel HTML group\n const div = createElement('div', className ? { className } : void 0, {\n // Add HTML specific styles\n position: 'absolute',\n left: `${g.translateX || 0}px`,\n top: `${g.translateY || 0}px`,\n // Add pre-existing styles\n ...g.styles,\n // Add g attributes that correspond to CSS\n display: g.display,\n opacity: g.opacity,\n visibility: g.visibility\n }, \n // The top group is appended to container\n g.parentGroup?.div || container);\n g.classSetter = (value, key, element) => {\n element.setAttribute('class', value);\n div.className = value;\n };\n /**\n * Common translate setter for X and Y on the HTML group.\n *\n * Reverted the fix for #6957 due to positioning problems and offline\n * export (#7254, #7280, #7529)\n * @private\n */\n g.translateXSetter = g.translateYSetter = (value, key) => {\n g[key] = value;\n div.style[key === 'translateX' ? 'left' : 'top'] = `${value}px`;\n g.doTransform = true;\n };\n g.opacitySetter = g.visibilitySetter = commonSetter;\n // Extend the parent group's css function by updating the parallel div\n // counterpart with the same style.\n g.css = (styles) => {\n // Call the base css method. The `parentGroup` can be either an\n // SVGElement or an SVGLabel, in which the css method is extended\n // (#19200).\n cssProto.call(g, styles);\n // #6794\n if (styles.cursor) {\n div.style.cursor = styles.cursor;\n }\n // #18821\n if (styles.pointerEvents) {\n div.style.pointerEvents = styles.pointerEvents;\n }\n return g;\n };\n // Event handling\n g.on = function () {\n SVGElement.prototype.on.apply({\n element: div,\n onEvents: g.onEvents\n }, arguments);\n return g;\n };\n g.div = div;\n }\n return g.div;\n};\n/* *\n *\n * Class\n *\n * */\nclass HTMLElement extends SVGElement {\n /* *\n *\n * Static Functions\n *\n * */\n /**\n * Compose\n * @private\n */\n static compose(SVGRendererClass) {\n if (pushUnique(composed, this.compose)) {\n /**\n * Create a HTML text node. This is used by the SVG renderer `text`\n * and `label` functions through the `useHTML` parameter.\n *\n * @private\n */\n SVGRendererClass.prototype.html = function (str, x, y) {\n return new HTMLElement(this, 'span')\n // Set the default attributes\n .attr({\n text: str,\n x: Math.round(x),\n y: Math.round(y)\n });\n };\n }\n }\n /* *\n *\n * Functions\n *\n * */\n constructor(renderer, nodeName) {\n super(renderer, nodeName);\n this.css({\n position: 'absolute',\n ...(renderer.styledMode ? {} : {\n fontFamily: renderer.style.fontFamily,\n fontSize: renderer.style.fontSize\n })\n });\n // Keep the whiteSpace style outside the `HTMLElement.styles` collection\n this.element.style.whiteSpace = 'nowrap';\n }\n /**\n * Get the correction in X and Y positioning as the element is rotated.\n * @private\n */\n getSpanCorrection(width, baseline, alignCorrection) {\n this.xCorr = -width * alignCorrection;\n this.yCorr = -baseline;\n }\n /**\n * Apply CSS to HTML elements. This is used in text within SVG rendering.\n * @private\n */\n css(styles) {\n const { element } = this, \n // When setting or unsetting the width style, we need to update\n // transform (#8809)\n isSettingWidth = (element.tagName === 'SPAN' &&\n styles &&\n 'width' in styles), textWidth = isSettingWidth && styles.width;\n let doTransform;\n if (isSettingWidth) {\n delete styles.width;\n this.textWidth = pInt(textWidth) || void 0;\n doTransform = true;\n }\n if (styles?.textOverflow === 'ellipsis') {\n styles.whiteSpace = 'nowrap';\n styles.overflow = 'hidden';\n }\n extend(this.styles, styles);\n css(element, styles);\n // Now that all styles are applied, to the transform\n if (doTransform) {\n this.updateTransform();\n }\n return this;\n }\n /**\n * The useHTML method for calculating the bounding box based on offsets.\n * Called internally from the `SVGElement.getBBox` function and subsequently\n * rotated.\n *\n * @private\n */\n htmlGetBBox() {\n const { element } = this;\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: element.offsetWidth,\n height: element.offsetHeight\n };\n }\n /**\n * Batch update styles and attributes related to transform\n *\n * @private\n */\n updateTransform() {\n // Aligning non added elements is expensive\n if (!this.added) {\n this.alignOnAdd = true;\n return;\n }\n const { element, renderer, rotation, rotationOriginX, rotationOriginY, styles, textAlign = 'left', textWidth, translateX = 0, translateY = 0, x = 0, y = 0 } = this, alignCorrection = {\n left: 0, center: 0.5, right: 1\n }[textAlign], whiteSpace = styles.whiteSpace;\n // Get the pixel length of the text\n const getTextPxLength = () => {\n if (this.textPxLength) {\n return this.textPxLength;\n }\n // Reset multiline/ellipsis in order to read width (#4928,\n // #5417)\n css(element, {\n width: '',\n whiteSpace: whiteSpace || 'nowrap'\n });\n return element.offsetWidth;\n };\n // Apply translate\n css(element, {\n marginLeft: `${translateX}px`,\n marginTop: `${translateY}px`\n });\n if (element.tagName === 'SPAN') {\n const currentTextTransform = [\n rotation,\n textAlign,\n element.innerHTML,\n textWidth,\n this.textAlign\n ].join(','), parentPadding = (this.parentGroup?.padding * -1) || 0;\n let baseline, hasBoxWidthChanged = false;\n // Update textWidth. Use the memoized textPxLength if possible, to\n // avoid the getTextPxLength function using elem.offsetWidth.\n // Calling offsetWidth affects rendering time as it forces layout\n // (#7656).\n if (textWidth !== this.oldTextWidth) { // #983, #1254\n const textPxLength = getTextPxLength(), textWidthNum = textWidth || 0;\n if (((textWidthNum > this.oldTextWidth) ||\n textPxLength > textWidthNum) && (\n // Only set the width if the text is able to word-wrap,\n // or text-overflow is ellipsis (#9537)\n /[ \\-]/.test(element.textContent || element.innerText) ||\n element.style.textOverflow === 'ellipsis')) {\n css(element, {\n width: (textPxLength > textWidthNum) || rotation ?\n textWidth + 'px' :\n 'auto',\n display: 'block',\n whiteSpace: whiteSpace || 'normal' // #3331\n });\n this.oldTextWidth = textWidth;\n hasBoxWidthChanged = true; // #8159\n }\n }\n this.hasBoxWidthChanged = hasBoxWidthChanged; // #8159\n // Do the calculations and DOM access only if properties changed\n if (currentTextTransform !== this.cTT) {\n baseline = renderer.fontMetrics(element).b;\n // Renderer specific handling of span rotation, but only if we\n // have something to update.\n if (defined(rotation) &&\n ((rotation !== (this.oldRotation || 0)) ||\n (textAlign !== this.oldAlign))) {\n this.setSpanRotation(rotation, parentPadding, parentPadding);\n }\n this.getSpanCorrection(\n // Avoid elem.offsetWidth if we can, it affects rendering\n // time heavily (#7656)\n ((!defined(rotation) && this.textPxLength) || // #7920\n element.offsetWidth), baseline, alignCorrection);\n }\n // Apply position with correction and rotation origin\n const { xCorr = 0, yCorr = 0 } = this, rotOriginX = (rotationOriginX ?? x) - xCorr - x - parentPadding, rotOriginY = (rotationOriginY ?? y) - yCorr - y - parentPadding, styles = {\n left: `${x + xCorr}px`,\n top: `${y + yCorr}px`,\n transformOrigin: `${rotOriginX}px ${rotOriginY}px`\n };\n css(element, styles);\n // Record current text transform\n this.cTT = currentTextTransform;\n this.oldRotation = rotation;\n this.oldAlign = textAlign;\n }\n }\n /**\n * Set the rotation of an individual HTML span.\n * @private\n */\n setSpanRotation(rotation, originX, originY) {\n // CSS transform and transform-origin both supported without prefix\n // since Firefox 16 (2012), IE 10 (2012), Chrome 36 (2014), Safari 9\n // (2015).;\n css(this.element, {\n transform: `rotate(${rotation}deg)`,\n transformOrigin: `${originX}% ${originY}px`\n });\n }\n /**\n * Add the element to a group wrapper. For HTML elements, a parallel div\n * will be created for each ancenstor SVG `g` element.\n *\n * @private\n */\n add(parentGroup) {\n const container = this.renderer.box\n .parentNode, parents = [];\n let div;\n this.parentGroup = parentGroup;\n // Create a parallel divs to hold the HTML elements\n if (parentGroup) {\n div = parentGroup.div;\n if (!div) {\n // Read the parent chain into an array and read from top\n // down\n let svgGroup = parentGroup;\n while (svgGroup) {\n parents.push(svgGroup);\n // Move up to the next parent group\n svgGroup = svgGroup.parentGroup;\n }\n // Decorate each of the ancestor group elements with a parallel\n // div that reflects translation and styling\n for (const parentGroup of parents.reverse()) {\n div = decorateSVGGroup(parentGroup, container);\n }\n }\n }\n (div || container).appendChild(this.element);\n this.added = true;\n if (this.alignOnAdd) {\n this.updateTransform();\n }\n return this;\n }\n /**\n * Text setter\n * @private\n */\n textSetter(value) {\n if (value !== this.textStr) {\n delete this.bBox;\n delete this.oldTextWidth;\n AST.setElementHTML(this.element, value ?? '');\n this.textStr = value;\n this.doTransform = true;\n }\n }\n /**\n * Align setter\n *\n * @private\n */\n alignSetter(value) {\n this.alignValue = this.textAlign = value;\n this.doTransform = true;\n }\n /**\n * Various setters which rely on update transform\n * @private\n */\n xSetter(value, key) {\n this[key] = value;\n this.doTransform = true;\n }\n}\n// Some shared setters\nconst proto = HTMLElement.prototype;\nproto.visibilitySetter = proto.opacitySetter = commonSetter;\nproto.ySetter =\n proto.rotationSetter =\n proto.rotationOriginXSetter =\n proto.rotationOriginYSetter = proto.xSetter;\n/* *\n *\n * Default Export\n *\n * */\nexport default HTMLElement;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\n/* *\n *\n * Namespace\n *\n * */\nvar AxisDefaults;\n(function (AxisDefaults) {\n /* *\n *\n * Constants\n *\n * */\n /**\n * The X axis or category axis. Normally this is the horizontal axis,\n * though if the chart is inverted this is the vertical axis. In case of\n * multiple axes, the xAxis node is an array of configuration objects.\n *\n * See the [Axis class](/class-reference/Highcharts.Axis) for programmatic\n * access to the axis.\n *\n * @productdesc {highmaps}\n * In Highmaps, the axis is hidden, but it is used behind the scenes to\n * control features like zooming and panning. Zooming is in effect the same\n * as setting the extremes of one of the exes.\n *\n * @type {*|Array<*>}\n * @optionparent xAxis\n */\n AxisDefaults.xAxis = {\n /**\n * When using multiple axis, the ticks of two or more opposite axes\n * will automatically be aligned by adding ticks to the axis or axes\n * with the least ticks, as if `tickAmount` were specified.\n *\n * This can be prevented by setting `alignTicks` to false. If the grid\n * lines look messy, it's a good idea to hide them for the secondary\n * axis by setting `gridLineWidth` to 0.\n *\n * If `startOnTick` or `endOnTick` in an Axis options are set to false,\n * then the `alignTicks ` will be disabled for the Axis.\n *\n * Disabled for logarithmic axes.\n *\n * @product highcharts highstock gantt\n */\n alignTicks: true,\n /**\n * Whether to allow decimals in this axis' ticks. When counting\n * integers, like persons or hits on a web page, decimals should\n * be avoided in the labels. By default, decimals are allowed on small\n * scale axes.\n *\n * @see [minTickInterval](#xAxis.minTickInterval)\n *\n * @sample {highcharts|highstock} highcharts/yaxis/allowdecimals-true/\n * True by default\n * @sample {highcharts|highstock} highcharts/yaxis/allowdecimals-false/\n * False\n *\n * @type {boolean|undefined}\n * @default undefined\n * @since 2.0\n */\n allowDecimals: void 0,\n /**\n * When using an alternate grid color, a band is painted across the\n * plot area between every other grid line.\n *\n * @sample {highcharts} highcharts/yaxis/alternategridcolor/\n * Alternate grid color on the Y axis\n * @sample {highstock} stock/xaxis/alternategridcolor/\n * Alternate grid color on the Y axis\n *\n * @type {Highcharts.ColorType}\n * @apioption xAxis.alternateGridColor\n */\n /**\n * An array defining breaks in the axis, the sections defined will be\n * left out and all the points shifted closer to each other.\n *\n * @productdesc {highcharts}\n * Requires that the broken-axis.js module is loaded.\n *\n * @sample {highcharts} highcharts/axisbreak/break-simple/\n * Simple break\n * @sample {highcharts|highstock} highcharts/axisbreak/break-visualized/\n * Advanced with callback\n * @sample {highstock} stock/demo/intraday-breaks/\n * Break on nights and weekends\n *\n * @type {Array<*>}\n * @since 4.1.0\n * @product highcharts highstock gantt\n * @apioption xAxis.breaks\n */\n /**\n * A number indicating how much space should be left between the start\n * and the end of the break. The break size is given in axis units,\n * so for instance on a `datetime` axis, a break size of 3600000 would\n * indicate the equivalent of an hour.\n *\n * @type {number}\n * @default 0\n * @since 4.1.0\n * @product highcharts highstock gantt\n * @apioption xAxis.breaks.breakSize\n */\n /**\n * The point where the break starts.\n *\n * @type {number}\n * @since 4.1.0\n * @product highcharts highstock gantt\n * @apioption xAxis.breaks.from\n */\n /**\n * Defines an interval after which the break appears again. By default\n * the breaks do not repeat.\n *\n * @type {number}\n * @default 0\n * @since 4.1.0\n * @product highcharts highstock gantt\n * @apioption xAxis.breaks.repeat\n */\n /**\n * The point where the break ends.\n *\n * @type {number}\n * @since 4.1.0\n * @product highcharts highstock gantt\n * @apioption xAxis.breaks.to\n */\n /**\n * If categories are present for the xAxis, names are used instead of\n * numbers for that axis.\n *\n * Since Highcharts 3.0, categories can also\n * be extracted by giving each point a [name](#series.data) and setting\n * axis [type](#xAxis.type) to `category`. However, if you have multiple\n * series, best practice remains defining the `categories` array.\n *\n * Example: `categories: ['Apples', 'Bananas', 'Oranges']`\n *\n * @sample {highcharts} highcharts/demo/line-labels/\n * With\n * @sample {highcharts} highcharts/xaxis/categories/\n * Without\n *\n * @type {Array}\n * @product highcharts gantt\n * @apioption xAxis.categories\n */\n /**\n * The highest allowed value for automatically computed axis extremes.\n *\n * @see [floor](#xAxis.floor)\n *\n * @sample {highcharts|highstock} highcharts/yaxis/floor-ceiling/\n * Floor and ceiling\n *\n * @type {number}\n * @since 4.0\n * @product highcharts highstock gantt\n * @apioption xAxis.ceiling\n */\n /**\n * A class name that opens for styling the axis by CSS, especially in\n * Highcharts styled mode. The class name is applied to group elements\n * for the grid, axis elements and labels.\n *\n * @sample {highcharts|highstock|highmaps} highcharts/css/axis/\n * Multiple axes with separate styling\n *\n * @type {string}\n * @since 5.0.0\n * @apioption xAxis.className\n */\n /**\n * Configure a crosshair that follows either the mouse pointer or the\n * hovered point.\n *\n * In styled mode, the crosshairs are styled in the\n * `.highcharts-crosshair`, `.highcharts-crosshair-thin` or\n * `.highcharts-xaxis-category` classes.\n *\n * @productdesc {highstock}\n * In Highcharts stock, by default, the crosshair is enabled on the\n * X axis and disabled on the Y axis.\n *\n * @sample {highcharts} highcharts/xaxis/crosshair-both/\n * Crosshair on both axes\n * @sample {highstock} stock/xaxis/crosshairs-xy/\n * Crosshair on both axes, with y axis label\n * @sample {highmaps} highcharts/xaxis/crosshair-both/\n * Crosshair on both axes\n *\n * @declare Highcharts.AxisCrosshairOptions\n * @type {boolean|*}\n * @default false\n * @since 4.1\n * @apioption xAxis.crosshair\n */\n /**\n * The value on a perpendicular axis where this axis should cross. This\n * is typically used on mathematical plots where the axes cross at 0.\n * When `crossing` is set, space will not be reserved at the sides of\n * the chart for axis labels and title, so those may be clipped. In this\n * case it is better to place the axes without the `crossing` option.\n *\n * @type {number}\n * @sample highcharts/xaxis/crossing\n * Function plot with axes crossing at 0\n * @since 11.0.1\n * @apioption xAxis.crossing\n */\n /**\n * A class name for the crosshair, especially as a hook for styling.\n *\n * @type {string}\n * @since 5.0.0\n * @apioption xAxis.crosshair.className\n */\n /**\n * The color of the crosshair. Defaults to `#cccccc` for numeric and\n * datetime axes, and `rgba(204,214,235,0.25)` for category axes, where\n * the crosshair by default highlights the whole category.\n *\n * @sample {highcharts|highstock|highmaps} highcharts/xaxis/crosshair-customized/\n * Customized crosshairs\n *\n * @type {Highcharts.ColorType}\n * @default #cccccc\n * @since 4.1\n * @apioption xAxis.crosshair.color\n */\n /**\n * The dash style for the crosshair. See\n * [plotOptions.series.dashStyle](#plotOptions.series.dashStyle)\n * for possible values.\n *\n * @sample {highcharts|highmaps} highcharts/xaxis/crosshair-dotted/\n * Dotted crosshair\n * @sample {highstock} stock/xaxis/crosshair-dashed/\n * Dashed X axis crosshair\n *\n * @type {Highcharts.DashStyleValue}\n * @default Solid\n * @since 4.1\n * @apioption xAxis.crosshair.dashStyle\n */\n /**\n * A label on the axis next to the crosshair.\n *\n * In styled mode, the label is styled with the\n * `.highcharts-crosshair-label` class.\n *\n * @sample {highstock} stock/xaxis/crosshair-label/\n * Crosshair labels\n * @sample {highstock} highcharts/css/crosshair-label/\n * Style mode\n *\n * @declare Highcharts.AxisCrosshairLabelOptions\n * @since 2.1\n * @product highstock\n * @apioption xAxis.crosshair.label\n */\n /**\n * Alignment of the label compared to the axis. Defaults to `\"left\"` for\n * right-side axes, `\"right\"` for left-side axes and `\"center\"` for\n * horizontal axes.\n *\n * @type {Highcharts.AlignValue}\n * @since 2.1\n * @product highstock\n * @apioption xAxis.crosshair.label.align\n */\n /**\n * The background color for the label. Defaults to the related series\n * color, or `#666666` if that is not available.\n *\n * @type {Highcharts.ColorType}\n * @since 2.1\n * @product highstock\n * @apioption xAxis.crosshair.label.backgroundColor\n */\n /**\n * The border color for the crosshair label\n *\n * @type {Highcharts.ColorType}\n * @since 2.1\n * @product highstock\n * @apioption xAxis.crosshair.label.borderColor\n */\n /**\n * The border corner radius of the crosshair label.\n *\n * @type {number}\n * @default 3\n * @since 2.1.10\n * @product highstock\n * @apioption xAxis.crosshair.label.borderRadius\n */\n /**\n * The border width for the crosshair label.\n *\n * @type {number}\n * @default 0\n * @since 2.1\n * @product highstock\n * @apioption xAxis.crosshair.label.borderWidth\n */\n /**\n * Flag to enable crosshair's label.\n *\n * @sample {highstock} stock/xaxis/crosshairs-xy/\n * Enabled label for yAxis' crosshair\n *\n * @type {boolean}\n * @default false\n * @since 2.1\n * @product highstock\n * @apioption xAxis.crosshair.label.enabled\n */\n /**\n * A format string for the crosshair label. Defaults to `{value}` for\n * numeric axes and `{value:%b %d, %Y}` for datetime axes.\n *\n * @type {string}\n * @since 2.1\n * @product highstock\n * @apioption xAxis.crosshair.label.format\n */\n /**\n * Formatter function for the label text.\n *\n * @type {Highcharts.XAxisCrosshairLabelFormatterCallbackFunction}\n * @since 2.1\n * @product highstock\n * @apioption xAxis.crosshair.label.formatter\n */\n /**\n * Padding inside the crosshair label.\n *\n * @type {number}\n * @default 8\n * @since 2.1\n * @product highstock\n * @apioption xAxis.crosshair.label.padding\n */\n /**\n * The shape to use for the label box.\n *\n * @type {string}\n * @default callout\n * @since 2.1\n * @product highstock\n * @apioption xAxis.crosshair.label.shape\n */\n /**\n * Text styles for the crosshair label.\n *\n * @type {Highcharts.CSSObject}\n * @default {\"color\": \"white\", \"fontWeight\": \"normal\", \"fontSize\": \"11px\", \"textAlign\": \"center\"}\n * @since 2.1\n * @product highstock\n * @apioption xAxis.crosshair.label.style\n */\n /**\n * Whether the crosshair should snap to the point or follow the pointer\n * independent of points.\n *\n * @sample {highcharts|highstock} highcharts/xaxis/crosshair-snap-false/\n * True by default\n * @sample {highmaps} maps/demo/latlon-advanced/\n * Snap is false\n *\n * @type {boolean}\n * @default true\n * @since 4.1\n * @apioption xAxis.crosshair.snap\n */\n /**\n * The pixel width of the crosshair. Defaults to 1 for numeric or\n * datetime axes, and for one category width for category axes.\n *\n * @sample {highcharts} highcharts/xaxis/crosshair-customized/\n * Customized crosshairs\n * @sample {highstock} highcharts/xaxis/crosshair-customized/\n * Customized crosshairs\n * @sample {highmaps} highcharts/xaxis/crosshair-customized/\n * Customized crosshairs\n *\n * @type {number}\n * @default 1\n * @since 4.1\n * @apioption xAxis.crosshair.width\n */\n /**\n * The Z index of the crosshair. Higher Z indices allow drawing the\n * crosshair on top of the series or behind the grid lines.\n *\n * @type {number}\n * @default 2\n * @since 4.1\n * @apioption xAxis.crosshair.zIndex\n */\n /**\n * Whether to pan axis. If `chart.panning` is enabled, the option\n * allows to disable panning on an individual axis.\n */\n panningEnabled: true,\n /**\n * The Z index for the axis group.\n *\n * @see [axis.gridZIndex](#xAxis.gridZIndex)\n * @see [axis.labels.zIndex](#xAxis.labels.zIndex)\n */\n zIndex: 2,\n /**\n * Whether to zoom axis. If `chart.zoomType` is set, the option allows\n * to disable zooming on an individual axis.\n *\n * @sample {highcharts} highcharts/xaxis/zoomenabled/\n * Zoom enabled is false\n */\n zoomEnabled: true,\n /**\n * For a datetime axis, the scale will automatically adjust to the\n * appropriate unit. This member gives the default string\n * representations used for each unit. For intermediate values,\n * different units may be used, for example the `day` unit can be used\n * on midnight and `hour` unit be used for intermediate values on the\n * same axis.\n *\n * For an overview of the replacement codes, see\n * [dateFormat](/class-reference/Highcharts.Time#dateFormat).\n *\n * Defaults to:\n * ```js\n * {\n * millisecond: '%H:%M:%S.%L',\n * second: '%H:%M:%S',\n * minute: '%H:%M',\n * hour: '%H:%M',\n * day: '%e. %b',\n * week: '%e. %b',\n * month: '%b \\'%y',\n * year: '%Y'\n * }\n * ```\n *\n * @sample {highcharts} highcharts/xaxis/datetimelabelformats/\n * Different day format on X axis\n * @sample {highstock} stock/xaxis/datetimelabelformats/\n * More information in x axis labels\n *\n * @declare Highcharts.AxisDateTimeLabelFormatsOptions\n * @product highcharts highstock gantt\n */\n dateTimeLabelFormats: {\n /**\n * @declare Highcharts.AxisDateTimeLabelFormatsOptionsObject\n * @type {string|*}\n */\n millisecond: {\n /**\n * @type {Array}\n * @default undefined\n * @apioption xAxis.dateTimeLabelFormats.millisecond.list\n */\n /**\n * @apioption xAxis.dateTimeLabelFormats.millisecond.main\n */\n main: '%H:%M:%S.%L',\n range: false\n },\n /**\n * @declare Highcharts.AxisDateTimeLabelFormatsOptionsObject\n * @type {string|*}\n */\n second: {\n /**\n * @type {Array}\n * @default undefined\n * @apioption xAxis.dateTimeLabelFormats.second.list\n */\n /**\n * @apioption xAxis.dateTimeLabelFormats.second.main\n */\n main: '%H:%M:%S',\n range: false\n },\n /**\n * @declare Highcharts.AxisDateTimeLabelFormatsOptionsObject\n * @type {string|*}\n */\n minute: {\n /**\n * @type {Array}\n * @default undefined\n * @apioption xAxis.dateTimeLabelFormats.minute.list\n */\n /**\n * @apioption xAxis.dateTimeLabelFormats.minute.main\n */\n main: '%H:%M',\n range: false\n },\n /**\n * @declare Highcharts.AxisDateTimeLabelFormatsOptionsObject\n * @type {string|*}\n */\n hour: {\n /**\n * @type {Array}\n * @default undefined\n * @apioption xAxis.dateTimeLabelFormats.hour.list\n */\n /**\n * @apioption xAxis.dateTimeLabelFormats.hour.main\n */\n main: '%H:%M',\n range: false\n },\n /**\n * @declare Highcharts.AxisDateTimeLabelFormatsOptionsObject\n * @type {string|*}\n */\n day: {\n /**\n * @type {Array}\n * @default undefined\n * @apioption xAxis.dateTimeLabelFormats.day.list\n */\n /**\n * @apioption xAxis.dateTimeLabelFormats.day.main\n */\n main: '%e %b'\n },\n /**\n * @declare Highcharts.AxisDateTimeLabelFormatsOptionsObject\n * @type {string|*}\n */\n week: {\n /**\n * @type {Array}\n * @default undefined\n * @apioption xAxis.dateTimeLabelFormats.week.list\n */\n /**\n * @apioption xAxis.dateTimeLabelFormats.week.main\n */\n main: '%e %b'\n },\n /**\n * @declare Highcharts.AxisDateTimeLabelFormatsOptionsObject\n * @type {string|*}\n */\n month: {\n /**\n * @type {Array}\n * @default undefined\n * @apioption xAxis.dateTimeLabelFormats.month.list\n */\n /**\n * @apioption xAxis.dateTimeLabelFormats.month.main\n */\n main: '%b \\'%y'\n },\n /**\n * @declare Highcharts.AxisDateTimeLabelFormatsOptionsObject\n * @type {string|*}\n */\n year: {\n /**\n * @type {Array}\n * @default undefined\n * @apioption xAxis.dateTimeLabelFormats.year.list\n */\n /**\n * @apioption xAxis.dateTimeLabelFormats.year.main\n */\n main: '%Y'\n }\n },\n /**\n * Whether to force the axis to end on a tick. Use this option with\n * the `maxPadding` option to control the axis end.\n *\n * @productdesc {highstock}\n * In Highcharts Stock, `endOnTick` is always `false` when the navigator\n * is enabled, to prevent jumpy scrolling. With disabled navigator\n * enabling `endOnTick` may lead to extending the xAxis to show the last\n * tick, therefore range selector buttons may not have an active state\n * if the axis gets extended.\n *\n * @sample {highcharts} highcharts/yaxis/endontick/\n * True by default\n * @sample {highcharts} highcharts/yaxis/endontick-false/\n * False\n * @sample {highstock} stock/demo/basic-line/\n * True by default\n * @sample {highstock} stock/xaxis/endontick/\n * False\n *\n * @since 1.2.0\n */\n endOnTick: false,\n /**\n * Event handlers for the axis.\n *\n * @type {*}\n * @apioption xAxis.events\n */\n /**\n * An event fired after the breaks have rendered.\n *\n * @see [breaks](#xAxis.breaks)\n *\n * @sample {highcharts} highcharts/axisbreak/break-event/\n * AfterBreak Event\n *\n * @type {Highcharts.AxisEventCallbackFunction}\n * @since 4.1.0\n * @product highcharts gantt\n * @apioption xAxis.events.afterBreaks\n */\n /**\n * As opposed to the `setExtremes` event, this event fires after the\n * final min and max values are computed and corrected for `minRange`.\n *\n * Fires when the minimum and maximum is set for the axis, either by\n * calling the `.setExtremes()` method or by selecting an area in the\n * chart. One parameter, `event`, is passed to the function, containing\n * common event information.\n *\n * The new user set minimum and maximum values can be found by\n * `event.min` and `event.max`. These reflect the axis minimum and\n * maximum in axis values. The actual data extremes are found in\n * `event.dataMin` and `event.dataMax`.\n *\n * @type {Highcharts.AxisSetExtremesEventCallbackFunction}\n * @since 2.3\n * @context Highcharts.Axis\n * @apioption xAxis.events.afterSetExtremes\n */\n /**\n * An event fired when a break from this axis occurs on a point.\n *\n * @see [breaks](#xAxis.breaks)\n *\n * @sample {highcharts} highcharts/axisbreak/break-visualized/\n * Visualization of a Break\n *\n * @type {Highcharts.AxisPointBreakEventCallbackFunction}\n * @since 4.1.0\n * @product highcharts gantt\n * @context Highcharts.Axis\n * @apioption xAxis.events.pointBreak\n */\n /**\n * An event fired when a point falls inside a break from this axis.\n *\n * @type {Highcharts.AxisPointBreakEventCallbackFunction}\n * @product highcharts highstock gantt\n * @context Highcharts.Axis\n * @apioption xAxis.events.pointInBreak\n */\n /**\n * An event fired when a point is outside a break after zoom.\n *\n * @type {Highcharts.AxisPointBreakEventCallbackFunction}\n * @product highcharts highstock gantt\n * @context Highcharts.Axis\n * @apioption xAxis.events.pointBreakOut\n */\n /**\n * Fires when the minimum and maximum is set for the axis, either by\n * calling the `.setExtremes()` method or by selecting an area in the\n * chart. One parameter, `event`, is passed to the function,\n * containing common event information.\n *\n * The new user set minimum and maximum values can be found by\n * `event.min` and `event.max`. These reflect the axis minimum and\n * maximum in data values. When an axis is zoomed all the way out from\n * the \"Reset zoom\" button, `event.min` and `event.max` are null, and\n * the new extremes are set based on `this.dataMin` and `this.dataMax`.\n *\n * @sample {highstock} stock/xaxis/events-setextremes/\n * Log new extremes on x axis\n *\n * @type {Highcharts.AxisSetExtremesEventCallbackFunction}\n * @since 1.2.0\n * @context Highcharts.Axis\n * @apioption xAxis.events.setExtremes\n */\n /**\n * The lowest allowed value for automatically computed axis extremes.\n *\n * @see [ceiling](#yAxis.ceiling)\n *\n * @sample {highcharts} highcharts/yaxis/floor-ceiling/\n * Floor and ceiling\n * @sample {highstock} stock/demo/lazy-loading/\n * Prevent negative stock price on Y axis\n *\n * @type {number}\n * @since 4.0\n * @product highcharts highstock gantt\n * @apioption xAxis.floor\n */\n /**\n * The dash or dot style of the grid lines. For possible values, see\n * [this demonstration](https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-dashstyle-all/).\n *\n * @sample {highcharts} highcharts/yaxis/gridlinedashstyle/\n * Long dashes\n * @sample {highstock} stock/xaxis/gridlinedashstyle/\n * Long dashes\n *\n * @type {Highcharts.DashStyleValue}\n * @since 1.2\n */\n gridLineDashStyle: 'Solid',\n /**\n * The Z index of the grid lines.\n *\n * @sample {highcharts|highstock} highcharts/xaxis/gridzindex/\n * A Z index of 4 renders the grid above the graph\n *\n * @product highcharts highstock gantt\n *\n * @see [axis.zIndex](#xAxis.zIndex)\n * @see [axis.labels.zIndex](#xAxis.labels.zIndex)\n */\n gridZIndex: 1,\n /**\n * An id for the axis. This can be used after render time to get\n * a pointer to the axis object through `chart.get()`.\n *\n * @sample {highcharts} highcharts/xaxis/id/\n * Get the object\n * @sample {highstock} stock/xaxis/id/\n * Get the object\n *\n * @type {string}\n * @since 1.2.0\n * @apioption xAxis.id\n */\n /**\n * The axis labels show the number or category for each tick.\n *\n * Since v8.0.0: Labels are animated in categorized x-axis with\n * updating data if `tickInterval` and `step` is set to 1.\n *\n * @productdesc {highmaps}\n * X and Y axis labels are by default disabled in Highmaps, but the\n * functionality is inherited from Highcharts and used on `colorAxis`,\n * and can be enabled on X and Y axes too.\n */\n labels: {\n /**\n * What part of the string the given position is anchored to.\n * If `left`, the left side of the string is at the axis position.\n * Can be one of `\"left\"`, `\"center\"` or `\"right\"`. Defaults to\n * an intelligent guess based on which side of the chart the axis\n * is on and the rotation of the label.\n *\n * @see [reserveSpace](#xAxis.labels.reserveSpace)\n *\n * @sample {highcharts} highcharts/xaxis/labels-align-left/\n * Left\n * @sample {highcharts} highcharts/xaxis/labels-align-right/\n * Right\n * @sample {highcharts} highcharts/xaxis/labels-reservespace-true/\n * Left-aligned labels on a vertical category axis\n *\n * @type {Highcharts.AlignValue}\n * @apioption xAxis.labels.align\n */\n /**\n * Whether to allow the axis labels to overlap. When false,\n * overlapping labels are hidden.\n *\n * @sample {highcharts} highcharts/xaxis/labels-allowoverlap-true/\n * X axis labels overlap enabled\n *\n * @type {boolean}\n * @default false\n * @apioption xAxis.labels.allowOverlap\n */\n /**\n * For horizontal axes, the allowed degrees of label rotation\n * to prevent overlapping labels. If there is enough space,\n * labels are not rotated. As the chart gets narrower, it\n * will start rotating the labels -45 degrees, then remove\n * every second label and try again with rotations 0 and -45 etc.\n * Set it to `undefined` to disable rotation, which will\n * cause the labels to word-wrap if possible. Defaults to `[-45]``\n * on bottom and top axes, `undefined` on left and right axes.\n *\n * @sample {highcharts|highstock} highcharts/xaxis/labels-autorotation-default/\n * Default auto rotation of 0 or -45\n * @sample {highcharts|highstock} highcharts/xaxis/labels-autorotation-0-90/\n * Custom graded auto rotation\n *\n * @type {Array}\n * @default undefined\n * @since 4.1.0\n * @product highcharts highstock gantt\n * @apioption xAxis.labels.autoRotation\n */\n /**\n * When each category width is more than this many pixels, we don't\n * apply auto rotation. Instead, we lay out the axis label with word\n * wrap. A lower limit makes sense when the label contains multiple\n * short words that don't extend the available horizontal space for\n * each label.\n *\n * @sample {highcharts} highcharts/xaxis/labels-autorotationlimit/\n * Lower limit\n *\n * @since 4.1.5\n * @product highcharts gantt\n */\n autoRotationLimit: 80,\n /**\n * The label's pixel distance from the perimeter of the plot area.\n * On cartesian charts, this is overridden if the `labels.y` setting\n * is set.\n *\n * @sample {highcharts} highcharts/yaxis/labels-distance/\n * Polar chart, labels centered under the arc\n *\n * @type {number}\n * @product highcharts gantt\n */\n distance: 15,\n /**\n * Enable or disable the axis labels.\n *\n * @sample {highcharts} highcharts/xaxis/labels-enabled/\n * X axis labels disabled\n * @sample {highstock} stock/xaxis/labels-enabled/\n * X axis labels disabled\n *\n */\n enabled: true,\n /**\n * A format string for the axis label. The context is available as\n * format string variables. For example, you can use `{text}` to\n * insert the default formatted text. The recommended way of adding\n * units for the label is using `text`, for example `{text} km`.\n *\n * To add custom numeric or datetime formatting, use `{value}` with\n * formatting, for example `{value:.1f}` or `{value:%Y-%m-%d}`.\n *\n * See\n * [format string](https://www.highcharts.com/docs/chart-concepts/labels-and-string-formatting)\n * for more examples of formatting.\n *\n * The default value is not specified due to the dynamic\n * nature of the default implementation.\n *\n * @sample {highcharts|highstock} highcharts/yaxis/labels-format/\n * Add units to Y axis label\n * @sample {highcharts} highcharts/xaxis/labels-format-linked/\n * Linked category names\n * @sample {highcharts} highcharts/xaxis/labels-format-custom/\n * Custom number format\n *\n * @type {string}\n * @since 3.0\n * @apioption xAxis.labels.format\n */\n /**\n * Callback JavaScript function to format the label. The value\n * is given by `this.value`. Additional properties for `this` are\n * `axis`, `chart`, `isFirst`, `isLast` and `text` which holds the\n * value of the default formatter.\n *\n * Defaults to a built in function returning a formatted string\n * depending on whether the axis is `category`, `datetime`,\n * `numeric` or other.\n *\n * @sample {highcharts} highcharts/xaxis/labels-formatter-linked/\n * Linked category names\n * @sample {highcharts} highcharts/xaxis/labels-formatter-extended/\n * Modified numeric labels\n * @sample {highstock} stock/xaxis/labels-formatter/\n * Added units on Y axis\n *\n * @type {Highcharts.AxisLabelsFormatterCallbackFunction}\n * @apioption xAxis.labels.formatter\n */\n /**\n * The number of pixels to indent the labels per level in a treegrid\n * axis.\n *\n * @sample gantt/treegrid-axis/demo\n * Indentation 10px by default.\n * @sample gantt/treegrid-axis/indentation-0px\n * Indentation set to 0px.\n *\n * @product gantt\n */\n indentation: 10,\n /**\n * Horizontal axis only. When `staggerLines` is not set,\n * `maxStaggerLines` defines how many lines the axis is allowed to\n * add to automatically avoid overlapping X labels. Set to `1` to\n * disable overlap detection.\n *\n * @deprecated\n * @type {number}\n * @default 5\n * @since 1.3.3\n * @apioption xAxis.labels.maxStaggerLines\n */\n /**\n * How to handle overflowing labels on horizontal axis. If set to\n * `\"allow\"`, it will not be aligned at all. By default it\n * `\"justify\"` labels inside the chart area. If there is room to\n * move it, it will be aligned to the edge, else it will be removed.\n *\n * @since 2.2.5\n * @validvalue [\"allow\", \"justify\"]\n */\n overflow: 'justify',\n /**\n * The pixel padding for axis labels, to ensure white space between\n * them.\n *\n * @product highcharts gantt\n */\n padding: 5,\n /**\n * Whether to reserve space for the labels. By default, space is\n * reserved for the labels in these cases:\n *\n * * On all horizontal axes.\n * * On vertical axes if `label.align` is `right` on a left-side\n * axis or `left` on a right-side axis.\n * * On vertical axes if `label.align` is `center`.\n *\n * This can be turned off when for example the labels are rendered\n * inside the plot area instead of outside.\n *\n * @see [labels.align](#xAxis.labels.align)\n *\n * @sample {highcharts} highcharts/xaxis/labels-reservespace/\n * No reserved space, labels inside plot\n * @sample {highcharts} highcharts/xaxis/labels-reservespace-true/\n * Left-aligned labels on a vertical category axis\n *\n * @type {boolean}\n * @since 4.1.10\n * @product highcharts highstock gantt\n * @apioption xAxis.labels.reserveSpace\n */\n reserveSpace: void 0,\n /**\n * Rotation of the labels in degrees. When `undefined`, the\n * `autoRotation` option takes precedence.\n *\n * @sample {highcharts} highcharts/xaxis/labels-rotation/\n * X axis labels rotated 90\u00B0\n *\n * @type {number}\n * @default 0\n * @apioption xAxis.labels.rotation\n */\n rotation: void 0,\n /**\n * Horizontal axes only. The number of lines to spread the labels\n * over to make room or tighter labels. 0 disables staggering.\n *\n * @sample {highcharts} highcharts/xaxis/labels-staggerlines/\n * Show labels over two lines\n * @sample {highstock} stock/xaxis/labels-staggerlines/\n * Show labels over two lines\n *\n * @since 2.1\n */\n staggerLines: 0,\n /**\n * To show only every _n_'th label on the axis, set the step to _n_.\n * Setting the step to 2 shows every other label.\n *\n * By default, when 0, the step is calculated automatically to avoid\n * overlap. To prevent this, set it to 1\\. This usually only\n * happens on a category axis, and is often a sign that you have\n * chosen the wrong axis type.\n *\n * Read more at\n * [Axis docs](https://www.highcharts.com/docs/chart-concepts/axes)\n * => What axis should I use?\n *\n * @sample {highcharts} highcharts/xaxis/labels-step/\n * Showing only every other axis label on a categorized\n * x-axis\n * @sample {highcharts} highcharts/xaxis/labels-step-auto/\n * Auto steps on a category axis\n *\n * @since 2.1\n */\n step: 0,\n /**\n * Whether to [use HTML](https://www.highcharts.com/docs/chart-concepts/labels-and-string-formatting#html)\n * to render the labels.\n */\n useHTML: false,\n /**\n * The x position offset of all labels relative to the tick\n * positions on the axis. Overrides the `labels.distance` option.\n *\n * @type {number}\n * @apioption xAxis.labels.x\n */\n /**\n * The y position offset of all labels relative to the tick\n * positions on the axis. Overrides the `labels.distance` option.\n *\n * @sample {highcharts} highcharts/xaxis/labels-x/\n * X axis labels placed on grid lines\n *\n * @type {number}\n * @apioption xAxis.labels.y\n */\n /**\n * The Z index for the axis labels.\n *\n * @see [axis.zIndex](#xAxis.zIndex)\n * @see [axis.gridZIndex](#xAxis.gridZIndex)\n */\n zIndex: 7,\n /**\n * CSS styles for the label. Use `whiteSpace: 'nowrap'` to prevent\n * wrapping of category labels. Use `textOverflow: 'none'` to\n * prevent ellipsis (dots).\n *\n * In styled mode, the labels are styled with the\n * `.highcharts-axis-labels` class.\n *\n * @sample {highcharts} highcharts/xaxis/labels-style/\n * Red X axis labels\n *\n * @type {Highcharts.CSSObject}\n */\n style: {\n /** @internal */\n color: \"#333333\" /* Palette.neutralColor80 */,\n /** @internal */\n cursor: 'default',\n /** @internal */\n fontSize: '0.8em'\n }\n },\n /**\n * The left position as the horizontal axis. If it's a number, it is\n * interpreted as pixel position relative to the chart.\n *\n * Since Highcharts v5.0.13: If it's a percentage string, it is\n * interpreted as percentages of the plot width, offset from plot area\n * left.\n *\n * @sample {highcharts} highcharts/xaxis/axis-position-properties\n * Different axis position properties\n *\n * @type {number|string}\n * @product highcharts highstock\n * @apioption xAxis.left\n */\n /**\n * The top position as the vertical axis. If it's a number, it is\n * interpreted as pixel position relative to the chart.\n *\n * Since Highcharts 2: If it's a percentage string, it is interpreted\n * as percentages of the plot height, offset from plot area top.\n *\n * @sample {highcharts} highcharts/xaxis/axis-position-properties\n * Different axis position properties\n *\n * @type {number|string}\n * @product highcharts highstock\n * @apioption xAxis.top\n */\n /**\n * Index of another axis that this axis is linked to. When an axis is\n * linked to a master axis, it will take the same extremes as\n * the master, but as assigned by min or max or by setExtremes.\n * It can be used to show additional info, or to ease reading the\n * chart by duplicating the scales.\n *\n * @sample {highcharts} highcharts/xaxis/linkedto/\n * Different string formats of the same date\n * @sample {highcharts} highcharts/yaxis/linkedto/\n * Y values on both sides\n *\n * @type {number}\n * @since 2.0.2\n * @product highcharts highstock gantt\n * @apioption xAxis.linkedTo\n */\n /**\n * The maximum value of the axis. If `null`, the max value is\n * automatically calculated.\n *\n * If the [endOnTick](#yAxis.endOnTick) option is true, the `max` value\n * might be rounded up.\n *\n * If a [tickAmount](#yAxis.tickAmount) is set, the axis may be extended\n * beyond the set max in order to reach the given number of ticks. The\n * same may happen in a chart with multiple axes, determined by [chart.\n * alignTicks](#chart), where a `tickAmount` is applied internally.\n *\n * @sample {highcharts} highcharts/yaxis/max-200/\n * Y axis max of 200\n * @sample {highcharts} highcharts/yaxis/max-logarithmic/\n * Y axis max on logarithmic axis\n * @sample {highstock} stock/xaxis/min-max/\n * Fixed min and max on X axis\n *\n * @type {number|null}\n * @apioption xAxis.max\n */\n /**\n * Padding of the max value relative to the length of the axis. A\n * padding of 0.05 will make a 100px axis 5px longer. This is useful\n * when you don't want the highest data value to appear on the edge\n * of the plot area. When the axis' `max` option is set or a max extreme\n * is set using `axis.setExtremes()`, the maxPadding will be ignored.\n *\n * @productdesc {highstock}\n * For an [ordinal](#xAxis.ordinal) axis, `minPadding` and `maxPadding`\n * are ignored. Use [overscroll](#xAxis.overscroll) instead.\n *\n * @sample {highcharts} highcharts/yaxis/maxpadding/\n * Max padding of 0.25 on y axis\n * @sample {highstock} stock/xaxis/minpadding-maxpadding/\n * Greater min- and maxPadding\n * @sample {highmaps} maps/chart/plotbackgroundcolor-gradient/\n * Add some padding\n *\n * @default {highcharts} 0.01\n * @default {highstock|highmaps} 0\n * @since 1.2.0\n */\n maxPadding: 0.01,\n /**\n * Deprecated. Use `minRange` instead.\n *\n * @deprecated\n * @type {number}\n * @product highcharts highstock\n * @apioption xAxis.maxZoom\n */\n /**\n * The minimum value of the axis. If `null` the min value is\n * automatically calculated.\n *\n * If the [startOnTick](#yAxis.startOnTick) option is true (default),\n * the `min` value might be rounded down.\n *\n * The automatically calculated minimum value is also affected by\n * [floor](#yAxis.floor), [softMin](#yAxis.softMin),\n * [minPadding](#yAxis.minPadding), [minRange](#yAxis.minRange)\n * as well as [series.threshold](#plotOptions.series.threshold)\n * and [series.softThreshold](#plotOptions.series.softThreshold).\n *\n * @sample {highcharts} highcharts/yaxis/min-startontick-false/\n * -50 with startOnTick to false\n * @sample {highcharts} highcharts/yaxis/min-startontick-true/\n * -50 with startOnTick true by default\n * @sample {highstock} stock/xaxis/min-max/\n * Set min and max on X axis\n *\n * @type {number|null}\n * @apioption xAxis.min\n */\n /**\n * The dash or dot style of the minor grid lines. For possible values,\n * see [this demonstration](https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-dashstyle-all/).\n *\n * @sample {highcharts} highcharts/yaxis/minorgridlinedashstyle/\n * Long dashes on minor grid lines\n * @sample {highstock} stock/xaxis/minorgridlinedashstyle/\n * Long dashes on minor grid lines\n *\n * @type {Highcharts.DashStyleValue}\n * @since 1.2\n */\n minorGridLineDashStyle: 'Solid',\n /**\n * Specific tick interval in axis units for the minor ticks. On a linear\n * axis, if `\"auto\"`, the minor tick interval is calculated as a fifth\n * of the tickInterval. If `undefined`, minor ticks are not shown.\n *\n * On logarithmic axes, the unit is the power of the value. For example,\n * setting the minorTickInterval to 1 puts one tick on each of 0.1, 1,\n * 10, 100 etc. Setting the minorTickInterval to 0.1 produces 9 ticks\n * between 1 and 10, 10 and 100 etc.\n *\n * If user settings dictate minor ticks to become too dense, they don't\n * make sense, and will be ignored to prevent performance problems.\n *\n * @sample {highcharts} highcharts/yaxis/minortickinterval-null/\n * Undefined by default\n * @sample {highcharts} highcharts/yaxis/minortickinterval-5/ 5 units\n * @sample {highcharts} highcharts/yaxis/minortickinterval-log-auto/\n * \"auto\"\n * @sample {highcharts} highcharts/yaxis/minortickinterval-log/ 0.1\n * @sample {highstock} stock/demo/basic-line/ Null by default\n * @sample {highstock} stock/xaxis/minortickinterval-auto/ \"auto\"\n *\n * @type {number|'auto'}\n * @apioption xAxis.minorTickInterval\n */\n /**\n * The pixel length of the minor tick marks.\n *\n * @sample {highcharts} highcharts/yaxis/minorticklength/\n * 10px on Y axis\n * @sample {highstock} stock/xaxis/minorticks/\n * 10px on Y axis\n */\n minorTickLength: 2,\n /**\n * The position of the minor tick marks relative to the axis line.\n * Can be one of `inside` and `outside`.\n *\n * @sample {highcharts} highcharts/yaxis/minortickposition-outside/\n * Outside by default\n * @sample {highcharts} highcharts/yaxis/minortickposition-inside/\n * Inside\n * @sample {highstock} stock/xaxis/minorticks/\n * Inside\n *\n * @validvalue [\"inside\", \"outside\"]\n */\n minorTickPosition: 'outside',\n /**\n * Enable or disable minor ticks. The interval between the minor ticks\n * can be controlled either by the\n * [minorTicksPerMajor](#xAxis.minorTicksPerMajor) setting, or as an\n * absolute [minorTickInterval](#xAxis.minorTickInterval) value.\n *\n * On a logarithmic axis, minor ticks are laid out based on a best\n * guess, attempting to enter an approximate number of minor ticks\n * between each major tick based on\n * [minorTicksPerMajor](#xAxis.minorTicksPerMajor).\n *\n * Prior to v6.0.0, ticks were enabled in auto layout by setting\n * `minorTickInterval` to `\"auto\"`.\n *\n * @productdesc {highcharts} On axes using\n * [categories](#xAxis.categories), minor ticks are not supported.\n *\n * @sample {highcharts} highcharts/yaxis/minorticks-true/ Enabled on\n * linear Y axis\n *\n * @type {boolean}\n * @default false\n * @since 6.0.0\n * @apioption xAxis.minorTicks\n */\n /**\n * The number of minor ticks per major tick. Works for `linear`,\n * `logarithmic` and `datetime` axes.\n *\n * @sample {highcharts} highcharts/yaxis/minortickspermajor/\n * 2 minor ticks per major tick on Y axis\n *\n * @since 11.0.0\n *\n * @type {number}\n */\n minorTicksPerMajor: 5,\n /**\n * The pixel width of the minor tick mark.\n *\n * @sample {highcharts} highcharts/yaxis/minortickwidth/\n * 3px width\n * @sample {highstock} stock/xaxis/minorticks/\n * 1px width\n *\n * @type {number}\n * @default 0\n * @apioption xAxis.minorTickWidth\n */\n /**\n * Padding of the min value relative to the length of the axis. A\n * padding of 0.05 will make a 100px axis 5px longer. This is useful\n * when you don't want the lowest data value to appear on the edge\n * of the plot area. When the axis' `min` option is set or a min extreme\n * is set using `axis.setExtremes()`, the minPadding will be ignored.\n *\n * @productdesc {highstock}\n * For an [ordinal](#xAxis.ordinal) axis, `minPadding` and `maxPadding`\n * are ignored. Use [overscroll](#xAxis.overscroll) instead.\n *\n * @sample {highcharts} highcharts/yaxis/minpadding/\n * Min padding of 0.2\n * @sample {highstock} stock/xaxis/minpadding-maxpadding/\n * Greater min- and maxPadding\n * @sample {highmaps} maps/chart/plotbackgroundcolor-gradient/\n * Add some padding\n *\n * @default {highcharts} 0.01\n * @default {highstock|highmaps} 0\n * @since 1.2.0\n * @product highcharts highstock gantt\n */\n minPadding: 0.01,\n /**\n * The minimum range to display on this axis. The entire axis will not\n * be allowed to span over a smaller interval than this. For example,\n * for a datetime axis the main unit is milliseconds. If minRange is\n * set to 3600000, you can't zoom in more than to one hour.\n *\n * The default minRange for the x axis is five times the smallest\n * interval between any of the data points.\n *\n * On a logarithmic axis, the unit for the minimum range is the power.\n * So a minRange of 1 means that the axis can be zoomed to 10-100,\n * 100-1000, 1000-10000 etc.\n *\n * **Note**: The `minPadding`, `maxPadding`, `startOnTick` and\n * `endOnTick` settings also affect how the extremes of the axis\n * are computed.\n *\n * @sample {highcharts} highcharts/xaxis/minrange/\n * Minimum range of 5\n * @sample {highstock} stock/xaxis/minrange/\n * Max zoom of 6 months overrides user selections\n *\n * @type {number}\n * @apioption xAxis.minRange\n */\n /**\n * The minimum tick interval allowed in axis values. For example on\n * zooming in on an axis with daily data, this can be used to prevent\n * the axis from showing hours. Defaults to the closest distance between\n * two points on the axis.\n *\n * @type {number}\n * @since 2.3.0\n * @apioption xAxis.minTickInterval\n */\n /**\n * The distance in pixels from the plot area to the axis line.\n * A positive offset moves the axis with it's line, labels and ticks\n * away from the plot area. This is typically used when two or more\n * axes are displayed on the same side of the plot. With multiple\n * axes the offset is dynamically adjusted to avoid collision, this\n * can be overridden by setting offset explicitly.\n *\n * @sample {highcharts} highcharts/yaxis/offset/\n * Y axis offset of 70\n * @sample {highcharts} highcharts/yaxis/offset-centered/\n * Axes positioned in the center of the plot\n * @sample {highstock} stock/xaxis/offset/\n * Y axis offset by 70 px\n *\n * @type {number}\n */\n offset: void 0,\n /**\n * Whether to display the axis on the opposite side of the normal. The\n * normal is on the left side for vertical axes and bottom for\n * horizontal, so the opposite sides will be right and top respectively.\n * This is typically used with dual or multiple axes.\n *\n * @sample {highcharts} highcharts/yaxis/opposite/\n * Secondary Y axis opposite\n * @sample {highstock} stock/xaxis/opposite/\n * Y axis on left side\n *\n * @default {highcharts|highstock|highmaps} false\n * @default {gantt} true\n * @type Boolean\n * @apioption xAxis.opposite\n */\n /**\n * In an ordinal axis, the points are equally spaced in the chart\n * regardless of the actual time or x distance between them. This means\n * that missing data periods (e.g. nights or weekends for a stock chart)\n * will not take up space in the chart.\n * Having `ordinal: false` will show any gaps created by the `gapSize`\n * setting proportionate to their duration.\n *\n * In stock charts the X axis is ordinal by default, unless\n * the boost module is used and at least one of the series' data length\n * exceeds the [boostThreshold](#series.line.boostThreshold).\n *\n * For an ordinal axis, `minPadding` and `maxPadding` are ignored. Use\n * [overscroll](#xAxis.overscroll) instead.\n *\n * @sample {highstock} stock/xaxis/ordinal-true/\n * True by default\n * @sample {highstock} stock/xaxis/ordinal-false/\n * False\n *\n * @see [overscroll](#xAxis.overscroll)\n *\n * @type {boolean}\n * @default true\n * @since 1.1\n * @product highstock\n * @apioption xAxis.ordinal\n */\n /**\n * Additional range on the right side of the xAxis. Works similar to\n * `xAxis.maxPadding`, but the value is set in terms of axis values,\n * percentage or pixels.\n *\n * If it's a number, it is interpreted as axis values, which in a\n * datetime axis equals milliseconds.\n *\n * If it's a percentage string, is interpreted as percentages of axis\n * length. An overscroll of 50% will make a 100px axis 50px longer.\n *\n * If it's a pixel string, it is interpreted as a fixed pixel value, but\n * limited to 90% of the axis length.\n *\n * @sample {highstock} stock/xaxis/overscroll/ One minute overscroll\n * with live data\n * @sample {highstock} stock/xaxis/overscroll-percent/ Overscroll set in\n * percentage\n * @sample {highstock} stock/xaxis/overscroll-pixel/ Overscroll set in\n * pixels\n *\n * @type {number | string}\n * @default 0\n * @since 6.0.0\n * @product highstock\n * @apioption xAxis.overscroll\n */\n /**\n * Refers to the index in the [panes](#panes) array. Used for circular\n * gauges and polar charts. When the option is not set then first pane\n * will be used.\n *\n * @sample highcharts/demo/gauge-vu-meter\n * Two gauges with different center\n *\n * @type {number}\n * @product highcharts\n * @apioption xAxis.pane\n */\n /**\n * The zoomed range to display when only defining one or none of `min`\n * or `max`. For example, to show the latest month, a range of one month\n * can be set.\n *\n * @sample {highstock} stock/xaxis/range/\n * Setting a zoomed range when the rangeSelector is disabled\n *\n * @type {number}\n * @product highstock\n * @apioption xAxis.range\n */\n /**\n * Whether to reverse the axis so that the highest number is closest\n * to the origin. If the chart is inverted, the x axis is reversed by\n * default.\n *\n * @sample {highcharts} highcharts/yaxis/reversed/\n * Reversed Y axis\n * @sample {highstock} stock/xaxis/reversed/\n * Reversed Y axis\n *\n * @type {boolean}\n * @default undefined\n * @apioption xAxis.reversed\n */\n reversed: void 0,\n /**\n * This option determines how stacks should be ordered within a group.\n * For example reversed xAxis also reverses stacks, so first series\n * comes last in a group. To keep order like for non-reversed xAxis\n * enable this option.\n *\n * @sample {highcharts} highcharts/xaxis/reversedstacks/\n * Reversed stacks comparison\n * @sample {highstock} highcharts/xaxis/reversedstacks/\n * Reversed stacks comparison\n *\n * @since 6.1.1\n * @product highcharts highstock\n */\n reversedStacks: false,\n /**\n * An optional scrollbar to display on the X axis in response to\n * limiting the minimum and maximum of the axis values.\n *\n * In styled mode, all the presentational options for the scrollbar are\n * replaced by the classes `.highcharts-scrollbar-thumb`,\n * `.highcharts-scrollbar-arrow`, `.highcharts-scrollbar-button`,\n * `.highcharts-scrollbar-rifles` and `.highcharts-scrollbar-track`.\n *\n * @sample {highstock} stock/yaxis/heatmap-scrollbars/\n * Heatmap with both scrollbars\n *\n * @extends scrollbar\n * @since 4.2.6\n * @product highstock\n * @apioption xAxis.scrollbar\n */\n /**\n * Whether to show the axis line and title when the axis has no data.\n *\n * @sample {highcharts} highcharts/yaxis/showempty/\n * When clicking the legend to hide series, one axis preserves\n * line and title, the other doesn't\n * @sample {highstock} highcharts/yaxis/showempty/\n * When clicking the legend to hide series, one axis preserves\n * line and title, the other doesn't\n *\n * @since 1.1\n */\n showEmpty: true,\n /**\n * Whether to show the first tick label.\n *\n * @sample {highcharts} highcharts/xaxis/showfirstlabel-false/\n * Set to false on X axis\n * @sample {highstock} stock/xaxis/showfirstlabel/\n * Labels below plot lines on Y axis\n */\n showFirstLabel: true,\n /**\n * Whether to show the last tick label. Defaults to `true` on cartesian\n * charts, and `false` on polar charts.\n *\n * @sample {highcharts} highcharts/xaxis/showlastlabel-true/\n * Set to true on X axis\n * @sample {highstock} stock/xaxis/showfirstlabel/\n * Labels below plot lines on Y axis\n *\n * @type {boolean}\n * @default undefined\n * @product highcharts highstock gantt\n */\n showLastLabel: true,\n /**\n * A soft maximum for the axis. If the series data maximum is less than\n * this, the axis will stay at this maximum, but if the series data\n * maximum is higher, the axis will flex to show all data.\n *\n * @sample highcharts/yaxis/softmin-softmax/\n * Soft min and max\n *\n * @type {number}\n * @since 5.0.1\n * @product highcharts highstock gantt\n * @apioption xAxis.softMax\n */\n /**\n * A soft minimum for the axis. If the series data minimum is greater\n * than this, the axis will stay at this minimum, but if the series\n * data minimum is lower, the axis will flex to show all data.\n *\n * @sample highcharts/yaxis/softmin-softmax/\n * Soft min and max\n *\n * @type {number}\n * @since 5.0.1\n * @product highcharts highstock gantt\n * @apioption xAxis.softMin\n */\n /**\n * For datetime axes, this decides where to put the tick between weeks.\n * 0 = Sunday, 1 = Monday.\n *\n * @sample {highcharts} highcharts/xaxis/startofweek-monday/\n * Monday by default\n * @sample {highcharts} highcharts/xaxis/startofweek-sunday/\n * Sunday\n * @sample {highstock} stock/xaxis/startofweek-1\n * Monday by default\n * @sample {highstock} stock/xaxis/startofweek-0\n * Sunday\n *\n * @product highcharts highstock gantt\n */\n startOfWeek: 1,\n /**\n * Whether to force the axis to start on a tick. Use this option with\n * the `minPadding` option to control the axis start.\n *\n * @productdesc {highstock}\n * In Highcharts Stock, `startOnTick` is always `false` when\n * the navigator is enabled, to prevent jumpy scrolling.\n *\n * @sample {highcharts} highcharts/xaxis/startontick-false/\n * False by default\n * @sample {highcharts} highcharts/xaxis/startontick-true/\n * True\n *\n * @since 1.2.0\n */\n startOnTick: false,\n /**\n * The amount of ticks to draw on the axis. This opens up for aligning\n * the ticks of multiple charts or panes within a chart. This option\n * overrides the `tickPixelInterval` option.\n *\n * This option only has an effect on linear axes. Datetime, logarithmic\n * or category axes are not affected.\n *\n * @sample {highcharts} highcharts/yaxis/tickamount/\n * 8 ticks on Y axis\n * @sample {highstock} highcharts/yaxis/tickamount/\n * 8 ticks on Y axis\n *\n * @type {number}\n * @since 4.1.0\n * @product highcharts highstock gantt\n * @apioption xAxis.tickAmount\n */\n /**\n * The interval of the tick marks in axis units. When `undefined`, the\n * tick interval is computed to approximately follow the\n * [tickPixelInterval](#xAxis.tickPixelInterval) on linear and datetime\n * axes. On categorized axes, a `undefined` tickInterval will default to\n * 1, one category. Note that datetime axes are based on milliseconds,\n * so for example an interval of one day is expressed as\n * `24 * 3600 * 1000`.\n *\n * On logarithmic axes, the tickInterval is based on powers, so a\n * tickInterval of 1 means one tick on each of 0.1, 1, 10, 100 etc. A\n * tickInterval of 2 means a tick of 0.1, 10, 1000 etc. A tickInterval\n * of 0.2 puts a tick on 0.1, 0.2, 0.4, 0.6, 0.8, 1, 2, 4, 6, 8, 10, 20,\n * 40 etc.\n *\n *\n * If the tickInterval is too dense for labels to be drawn, Highcharts\n * may remove ticks.\n *\n * If the chart has multiple axes, the [alignTicks](#chart.alignTicks)\n * option may interfere with the `tickInterval` setting.\n *\n * @see [tickPixelInterval](#xAxis.tickPixelInterval)\n * @see [tickPositions](#xAxis.tickPositions)\n * @see [tickPositioner](#xAxis.tickPositioner)\n *\n * @sample {highcharts} highcharts/xaxis/tickinterval-5/\n * Tick interval of 5 on a linear axis\n * @sample {highstock} stock/xaxis/tickinterval/\n * Tick interval of 0.01 on Y axis\n *\n * @type {number}\n * @apioption xAxis.tickInterval\n */\n /**\n * The pixel length of the main tick marks.\n *\n * @sample {highcharts} highcharts/xaxis/ticklength/\n * 20 px tick length on the X axis\n * @sample {highstock} stock/xaxis/ticks/\n * Formatted ticks on X axis\n */\n tickLength: 10,\n /**\n * If tickInterval is `null` this option sets the approximate pixel\n * interval of the tick marks. Not applicable to categorized axis.\n *\n * The tick interval is also influenced by the [minTickInterval](\n * #xAxis.minTickInterval) option, that, by default prevents ticks from\n * being denser than the data points.\n *\n * @see [tickInterval](#xAxis.tickInterval)\n * @see [tickPositioner](#xAxis.tickPositioner)\n * @see [tickPositions](#xAxis.tickPositions)\n *\n * @sample {highcharts} highcharts/xaxis/tickpixelinterval-50/\n * 50 px on X axis\n * @sample {highstock} stock/xaxis/tickpixelinterval/\n * 200 px on X axis\n */\n tickPixelInterval: 100,\n /**\n * For categorized axes only. If `on` the tick mark is placed in the\n * center of the category, if `between` the tick mark is placed between\n * categories. The default is `between` if the `tickInterval` is 1, else\n * `on`. In order to render tick marks on a category axis it is necessary\n * to provide a [tickWidth](#xAxis.tickWidth).\n *\n * @sample {highcharts} highcharts/xaxis/tickmarkplacement-between/\n * \"between\" by default\n * @sample {highcharts} highcharts/xaxis/tickmarkplacement-on/\n * \"on\"\n *\n * @product highcharts gantt\n * @validvalue [\"on\", \"between\"]\n */\n tickmarkPlacement: 'between',\n /**\n * The position of the major tick marks relative to the axis line.\n * Can be one of `inside` and `outside`.\n *\n * @sample {highcharts} highcharts/xaxis/tickposition-outside/\n * \"outside\" by default\n * @sample {highcharts} highcharts/xaxis/tickposition-inside/\n * \"inside\"\n * @sample {highstock} stock/xaxis/ticks/\n * Formatted ticks on X axis\n *\n * @validvalue [\"inside\", \"outside\"]\n */\n tickPosition: 'outside',\n /**\n * A callback function returning array defining where the ticks are\n * laid out on the axis. This overrides the default behaviour of\n * [tickPixelInterval](#xAxis.tickPixelInterval) and [tickInterval](\n * #xAxis.tickInterval). The automatic tick positions are accessible\n * through `this.tickPositions` and can be modified by the callback.\n *\n * @see [tickPositions](#xAxis.tickPositions)\n *\n * @sample {highcharts} highcharts/xaxis/tickpositions-tickpositioner/\n * Demo of tickPositions and tickPositioner\n * @sample {highstock} highcharts/xaxis/tickpositions-tickpositioner/\n * Demo of tickPositions and tickPositioner\n *\n * @type {Highcharts.AxisTickPositionerCallbackFunction}\n * @apioption xAxis.tickPositioner\n */\n /**\n * An array defining where the ticks are laid out on the axis. This\n * overrides the default behaviour of [tickPixelInterval](\n * #xAxis.tickPixelInterval) and [tickInterval](#xAxis.tickInterval).\n *\n * @see [tickPositioner](#xAxis.tickPositioner)\n *\n * @sample {highcharts} highcharts/xaxis/tickpositions-tickpositioner/\n * Demo of tickPositions and tickPositioner\n * @sample {highstock} highcharts/xaxis/tickpositions-tickpositioner/\n * Demo of tickPositions and tickPositioner\n *\n * @type {Array}\n * @apioption xAxis.tickPositions\n */\n /**\n * The pixel width of the major tick marks. Defaults to 0 on category\n * axes, otherwise 1.\n *\n * In styled mode, the stroke width is given in the `.highcharts-tick`\n * class, but in order for the element to be generated on category axes,\n * the option must be explicitly set to 1.\n *\n * @sample {highcharts} highcharts/xaxis/tickwidth/\n * 10 px width\n * @sample {highcharts} highcharts/css/axis-grid/\n * Styled mode\n * @sample {highstock} stock/xaxis/ticks/\n * Formatted ticks on X axis\n * @sample {highstock} highcharts/css/axis-grid/\n * Styled mode\n *\n * @type {undefined|number}\n * @default {highstock} 1\n * @default {highmaps} 0\n * @apioption xAxis.tickWidth\n */\n /**\n * The axis title, showing next to the axis line.\n *\n * @productdesc {highmaps}\n * In Highmaps, the axis is hidden by default, but adding an axis title\n * is still possible. X axis and Y axis titles will appear at the bottom\n * and left by default.\n */\n title: {\n /**\n * Alignment of the title relative to the axis values. Possible\n * values are \"low\", \"middle\" or \"high\".\n *\n * @sample {highcharts} highcharts/xaxis/title-align-low/\n * \"low\"\n * @sample {highcharts} highcharts/xaxis/title-align-center/\n * \"middle\" by default\n * @sample {highcharts} highcharts/xaxis/title-align-high/\n * \"high\"\n * @sample {highcharts} highcharts/yaxis/title-offset/\n * Place the Y axis title on top of the axis\n * @sample {highstock} stock/xaxis/title-align/\n * Aligned to \"high\" value\n *\n * @type {Highcharts.AxisTitleAlignValue}\n */\n align: 'middle',\n /**\n * Deprecated. Set the `text` to `undefined` to disable the title.\n *\n * @deprecated\n * @type {boolean}\n * @product highcharts\n * @apioption xAxis.title.enabled\n */\n /**\n * The pixel distance between the axis labels or line and the title.\n * Defaults to 0 for horizontal axes, 10 for vertical\n *\n * @sample {highcharts} highcharts/xaxis/title-margin/\n * Y axis title margin of 60\n *\n * @type {number}\n * @apioption xAxis.title.margin\n */\n /**\n * The distance of the axis title from the axis line. By default,\n * this distance is computed from the offset width of the labels,\n * the labels' distance from the axis and the title's margin.\n * However when the offset option is set, it overrides all this.\n *\n * @sample {highcharts} highcharts/yaxis/title-offset/\n * Place the axis title on top of the axis\n * @sample {highstock} highcharts/yaxis/title-offset/\n * Place the axis title on top of the Y axis\n *\n * @type {number}\n * @since 2.2.0\n * @apioption xAxis.title.offset\n */\n /**\n * Whether to reserve space for the title when laying out the axis.\n *\n * @type {boolean}\n * @default true\n * @since 5.0.11\n * @product highcharts highstock gantt\n * @apioption xAxis.title.reserveSpace\n */\n /**\n * The rotation of the text in degrees. 0 is horizontal, 270 is\n * vertical reading from bottom to top. Defaults to 0 for horizontal\n * axes, 270 for left-side axes and 90 for right-side axes.\n *\n * @sample {highcharts} highcharts/yaxis/title-offset/\n * Horizontal\n *\n * @type {number}\n * @default undefined\n * @apioption xAxis.title.rotation\n */\n /**\n * The actual text of the axis title. It can contain basic HTML tags\n * like `b`, `i` and `span` with style.\n *\n * @sample {highcharts} highcharts/xaxis/title-text/\n * Custom HTML\n * @sample {highstock} stock/xaxis/title-text/\n * Titles for both axes\n *\n * @type {string|null}\n * @apioption xAxis.title.text\n */\n /**\n * Alignment of the text, can be `\"left\"`, `\"right\"` or `\"center\"`.\n * Default alignment depends on the\n * [title.align](xAxis.title.align):\n *\n * Horizontal axes:\n * - for `align` = `\"low\"`, `textAlign` is set to `left`\n * - for `align` = `\"middle\"`, `textAlign` is set to `center`\n * - for `align` = `\"high\"`, `textAlign` is set to `right`\n *\n * Vertical axes:\n * - for `align` = `\"low\"` and `opposite` = `true`, `textAlign` is\n * set to `right`\n * - for `align` = `\"low\"` and `opposite` = `false`, `textAlign` is\n * set to `left`\n * - for `align` = `\"middle\"`, `textAlign` is set to `center`\n * - for `align` = `\"high\"` and `opposite` = `true` `textAlign` is\n * set to `left`\n * - for `align` = `\"high\"` and `opposite` = `false` `textAlign` is\n * set to `right`\n *\n * @type {Highcharts.AlignValue}\n * @apioption xAxis.title.textAlign\n */\n /**\n * Whether to [use HTML](https://www.highcharts.com/docs/chart-concepts/labels-and-string-formatting#html)\n * to render the axis title.\n *\n * @product highcharts highstock gantt\n */\n useHTML: false,\n /**\n * Horizontal pixel offset of the title position.\n *\n * @since 4.1.6\n * @product highcharts highstock gantt\n */\n x: 0,\n /**\n * Vertical pixel offset of the title position.\n *\n * @product highcharts highstock gantt\n */\n y: 0,\n /**\n * CSS styles for the title. If the title text is longer than the\n * axis length, it will wrap to multiple lines by default. This can\n * be customized by setting `textOverflow: 'ellipsis'`, by\n * setting a specific `width` or by setting `whiteSpace: 'nowrap'`.\n *\n * In styled mode, the stroke width is given in the\n * `.highcharts-axis-title` class.\n *\n * @sample {highcharts} highcharts/xaxis/title-style/\n * Red\n * @sample {highcharts} highcharts/css/axis/\n * Styled mode\n *\n * @type {Highcharts.CSSObject}\n */\n style: {\n /** @internal */\n color: \"#666666\" /* Palette.neutralColor60 */,\n /** @internal */\n fontSize: '0.8em'\n }\n },\n /**\n * The type of axis. Can be one of `linear`, `logarithmic`, `datetime`\n * or `category`. In a datetime axis, the numbers are given in\n * milliseconds, and tick marks are placed on appropriate values like\n * full hours or days. In a category axis, the\n * [point names](#series.line.data.name) of the chart's series are used\n * for categories, if not a [categories](#xAxis.categories) array is\n * defined.\n *\n * @sample {highcharts} highcharts/xaxis/type-linear/\n * Linear\n * @sample {highcharts} highcharts/yaxis/type-log/\n * Logarithmic\n * @sample {highcharts} highcharts/yaxis/type-log-minorgrid/\n * Logarithmic with minor grid lines\n * @sample {highcharts} highcharts/xaxis/type-log-both/\n * Logarithmic on two axes\n * @sample {highcharts} highcharts/yaxis/type-log-negative/\n * Logarithmic with extension to emulate negative values\n *\n * @type {Highcharts.AxisTypeValue}\n * @product highcharts gantt\n */\n type: 'linear',\n /**\n * If there are multiple axes on the same side of the chart, the pixel\n * margin between the axes. Defaults to 0 on vertical axes, 15 on\n * horizontal axes.\n *\n * @type {number}\n * @since 7.0.3\n * @apioption xAxis.margin\n */\n /**\n * Applies only when the axis `type` is `category`. When `uniqueNames`\n * is true, points are placed on the X axis according to their names.\n * If the same point name is repeated in the same or another series,\n * the point is placed on the same X position as other points of the\n * same name. When `uniqueNames` is false, the points are laid out in\n * increasing X positions regardless of their names, and the X axis\n * category will take the name of the last point in each position.\n *\n * @sample {highcharts} highcharts/xaxis/uniquenames-true/\n * True by default\n * @sample {highcharts} highcharts/xaxis/uniquenames-false/\n * False\n *\n * @since 4.2.7\n * @product highcharts gantt\n */\n uniqueNames: true,\n /**\n * Datetime axis only. An array determining what time intervals the\n * ticks are allowed to fall on. Each array item is an array where the\n * first value is the time unit and the second value another array of\n * allowed multiples.\n *\n * Defaults to:\n * ```js\n * units: [[\n * 'millisecond', // unit name\n * [1, 2, 5, 10, 20, 25, 50, 100, 200, 500] // allowed multiples\n * ], [\n * 'second',\n * [1, 2, 5, 10, 15, 30]\n * ], [\n * 'minute',\n * [1, 2, 5, 10, 15, 30]\n * ], [\n * 'hour',\n * [1, 2, 3, 4, 6, 8, 12]\n * ], [\n * 'day',\n * [1, 2]\n * ], [\n * 'week',\n * [1, 2]\n * ], [\n * 'month',\n * [1, 2, 3, 4, 6]\n * ], [\n * 'year',\n * null\n * ]]\n * ```\n *\n * @sample {highcharts} highcharts/xaxis/units/\n * Axis units demonstrated\n *\n * @type {Array|null)>>}\n * @product highcharts highstock gantt\n * @apioption xAxis.units\n */\n /**\n * Whether axis, including axis title, line, ticks and labels, should\n * be visible.\n *\n * @since 4.1.9\n * @product highcharts highstock gantt\n */\n visible: true,\n /**\n * Color of the minor, secondary grid lines.\n *\n * In styled mode, the stroke width is given in the\n * `.highcharts-minor-grid-line` class.\n *\n * @sample {highcharts} highcharts/yaxis/minorgridlinecolor/\n * Bright grey lines from Y axis\n * @sample {highcharts|highstock} highcharts/css/axis-grid/\n * Styled mode\n * @sample {highstock} stock/xaxis/minorgridlinecolor/\n * Bright grey lines from Y axis\n *\n * @type {Highcharts.ColorType}\n * @default #f2f2f2\n */\n minorGridLineColor: \"#f2f2f2\" /* Palette.neutralColor5 */,\n /**\n * Width of the minor, secondary grid lines.\n *\n * In styled mode, the stroke width is given in the\n * `.highcharts-grid-line` class.\n *\n * @sample {highcharts} highcharts/yaxis/minorgridlinewidth/\n * 2px lines from Y axis\n * @sample {highcharts|highstock} highcharts/css/axis-grid/\n * Styled mode\n * @sample {highstock} stock/xaxis/minorgridlinewidth/\n * 2px lines from Y axis\n */\n minorGridLineWidth: 1,\n /**\n * Color for the minor tick marks.\n *\n * @sample {highcharts} highcharts/yaxis/minortickcolor/\n * Black tick marks on Y axis\n * @sample {highstock} stock/xaxis/minorticks/\n * Black tick marks on Y axis\n *\n * @type {Highcharts.ColorType}\n * @default #999999\n */\n minorTickColor: \"#999999\" /* Palette.neutralColor40 */,\n /**\n * The color of the line marking the axis itself.\n *\n * In styled mode, the line stroke is given in the\n * `.highcharts-axis-line` or `.highcharts-xaxis-line` class.\n *\n * @sample {highcharts} highcharts/yaxis/linecolor/\n * A red line on Y axis\n * @sample {highcharts|highstock} highcharts/css/axis/\n * Axes in styled mode\n * @sample {highstock} stock/xaxis/linecolor/\n * A red line on X axis\n *\n * @type {Highcharts.ColorType}\n */\n lineColor: \"#333333\" /* Palette.neutralColor80 */,\n /**\n * The width of the line marking the axis itself.\n *\n * In styled mode, the stroke width is given in the\n * `.highcharts-axis-line` or `.highcharts-xaxis-line` class.\n *\n * @sample {highcharts} highcharts/yaxis/linecolor/\n * A 1px line on Y axis\n * @sample {highcharts|highstock} highcharts/css/axis/\n * Axes in styled mode\n * @sample {highstock} stock/xaxis/linewidth/\n * A 2px line on X axis\n *\n * @default {highcharts|highstock} 1\n * @default {highmaps} 0\n */\n lineWidth: 1,\n /**\n * Color of the grid lines extending the ticks across the plot area.\n *\n * In styled mode, the stroke is given in the `.highcharts-grid-line`\n * class.\n *\n * @productdesc {highmaps}\n * In Highmaps, the grid lines are hidden by default.\n *\n * @sample {highcharts} highcharts/yaxis/gridlinecolor/\n * Green lines\n * @sample {highcharts|highstock} highcharts/css/axis-grid/\n * Styled mode\n * @sample {highstock} stock/xaxis/gridlinecolor/\n * Green lines\n *\n * @type {Highcharts.ColorType}\n * @default #e6e6e6\n */\n gridLineColor: \"#e6e6e6\" /* Palette.neutralColor10 */,\n /**\n * The width of the grid lines extending the ticks across the plot area.\n * Defaults to 1 on the Y axis and 0 on the X axis, except for 3d\n * charts.\n *\n * In styled mode, the stroke width is given in the\n * `.highcharts-grid-line` class.\n *\n * @sample {highcharts} highcharts/yaxis/gridlinewidth/\n * 2px lines\n * @sample {highcharts|highstock} highcharts/css/axis-grid/\n * Styled mode\n * @sample {highstock} stock/xaxis/gridlinewidth/\n * 2px lines\n *\n * @type {number}\n * @apioption xAxis.gridLineWidth\n */\n gridLineWidth: void 0,\n /**\n * The height as the vertical axis. If it's a number, it is\n * interpreted as pixels.\n *\n * Since Highcharts 2: If it's a percentage string, it is interpreted\n * as percentages of the total plot height.\n *\n * @sample {highcharts} highcharts/xaxis/axis-position-properties\n * Different axis position properties\n *\n * @type {number|string}\n * @product highcharts highstock\n * @apioption xAxis.height\n */\n /**\n * The width as the horizontal axis. If it's a number, it is interpreted\n * as pixels.\n *\n * Since Highcharts v5.0.13: If it's a percentage string, it is\n * interpreted as percentages of the total plot width.\n *\n * @sample {highcharts} highcharts/xaxis/axis-position-properties\n * Different axis position properties\n *\n * @type {number|string}\n * @product highcharts highstock\n * @apioption xAxis.width\n */\n /**\n * Color for the main tick marks.\n *\n * In styled mode, the stroke is given in the `.highcharts-tick`\n * class.\n *\n * @sample {highcharts} highcharts/xaxis/tickcolor/\n * Red ticks on X axis\n * @sample {highcharts|highstock} highcharts/css/axis-grid/\n * Styled mode\n * @sample {highstock} stock/xaxis/ticks/\n * Formatted ticks on X axis\n *\n * @type {Highcharts.ColorType}\n */\n tickColor: \"#333333\" /* Palette.neutralColor80 */\n // tickWidth: 1\n };\n /**\n * The Z axis or depth axis for 3D plots.\n *\n * See the [Axis class](/class-reference/Highcharts.Axis) for programmatic\n * access to the axis.\n *\n * @sample {highcharts} highcharts/3d/scatter-zaxis-categories/\n * Z-Axis with Categories\n * @sample {highcharts} highcharts/3d/scatter-zaxis-grid/\n * Z-Axis with styling\n *\n * @type {*|Array<*>}\n * @extends xAxis\n * @since 5.0.0\n * @product highcharts\n * @excluding breaks, crosshair, height, left, lineColor, lineWidth,\n * nameToX, showEmpty, top, width\n * @apioption zAxis\n */\n /**\n * The Y axis or value axis. Normally this is the vertical axis,\n * though if the chart is inverted this is the horizontal axis.\n * In case of multiple axes, the yAxis node is an array of\n * configuration objects.\n *\n * See [the Axis object](/class-reference/Highcharts.Axis) for programmatic\n * access to the axis.\n *\n * @type {*|Array<*>}\n * @extends xAxis\n * @excluding currentDateIndicator,ordinal,overscroll\n * @optionparent yAxis\n */\n AxisDefaults.yAxis = {\n /**\n * The type of axis. Can be one of `linear`, `logarithmic`, `datetime`,\n * `category` or `treegrid`. Defaults to `treegrid` for Gantt charts,\n * `linear` for other chart types.\n *\n * In a datetime axis, the numbers are given in milliseconds, and tick\n * marks are placed on appropriate values, like full hours or days. In a\n * category or treegrid axis, the [point names](#series.line.data.name)\n * of the chart's series are used for categories, if a\n * [categories](#xAxis.categories) array is not defined.\n *\n * @sample {highcharts} highcharts/yaxis/type-log-minorgrid/\n * Logarithmic with minor grid lines\n * @sample {highcharts} highcharts/yaxis/type-log-negative/\n * Logarithmic with extension to emulate negative values\n * @sample {gantt} gantt/treegrid-axis/demo\n * Treegrid axis\n *\n * @type {Highcharts.AxisTypeValue}\n * @default {highcharts} linear\n * @default {gantt} treegrid\n * @product highcharts gantt\n * @apioption yAxis.type\n */\n /**\n * The height of the Y axis. If it's a number, it is interpreted as\n * pixels.\n *\n * Since Highcharts 2: If it's a percentage string, it is interpreted as\n * percentages of the total plot height.\n *\n * @see [yAxis.top](#yAxis.top)\n *\n * @sample {highstock} stock/demo/candlestick-and-volume/\n * Percentage height panes\n *\n * @type {number|string}\n * @product highcharts highstock\n * @apioption yAxis.height\n */\n /**\n * Solid gauge only. Unless [stops](#yAxis.stops) are set, the color\n * to represent the maximum value of the Y axis.\n *\n * @sample {highcharts} highcharts/yaxis/mincolor-maxcolor/\n * Min and max colors\n *\n * @type {Highcharts.ColorType}\n * @default #003399\n * @since 4.0\n * @product highcharts\n * @apioption yAxis.maxColor\n */\n /**\n * Solid gauge only. Unless [stops](#yAxis.stops) are set, the color\n * to represent the minimum value of the Y axis.\n *\n * @sample {highcharts} highcharts/yaxis/mincolor-maxcolor/\n * Min and max color\n *\n * @type {Highcharts.ColorType}\n * @default #e6ebf5\n * @since 4.0\n * @product highcharts\n * @apioption yAxis.minColor\n */\n /**\n * Whether to reverse the axis so that the highest number is closest\n * to the origin.\n *\n * @sample {highcharts} highcharts/yaxis/reversed/\n * Reversed Y axis\n * @sample {highstock} stock/xaxis/reversed/\n * Reversed Y axis\n *\n * @type {boolean}\n * @default {highcharts} false\n * @default {highstock} false\n * @default {highmaps} true\n * @default {gantt} true\n * @apioption yAxis.reversed\n */\n /**\n * If `true`, the first series in a stack will be drawn on top in a\n * positive, non-reversed Y axis. If `false`, the first series is in\n * the base of the stack.\n *\n * @sample {highcharts} highcharts/yaxis/reversedstacks-false/\n * Non-reversed stacks\n * @sample {highstock} highcharts/yaxis/reversedstacks-false/\n * Non-reversed stacks\n *\n * @type {boolean}\n * @default true\n * @since 3.0.10\n * @product highcharts highstock\n * @apioption yAxis.reversedStacks\n */\n reversedStacks: true,\n /**\n * Solid gauge series only. Color stops for the solid gauge. Use this\n * in cases where a linear gradient between a `minColor` and `maxColor`\n * is not sufficient. The stops is an array of tuples, where the first\n * item is a float between 0 and 1 assigning the relative position in\n * the gradient, and the second item is the color.\n *\n * For solid gauges, the Y axis also inherits the concept of\n * [data classes](https://api.highcharts.com/highmaps#colorAxis.dataClasses)\n * from the Highmaps color axis.\n *\n * @sample {highcharts} highcharts/demo/gauge-solid/\n * Gauge with stops\n *\n * @see [minColor](#yAxis.minColor)\n * @see [maxColor](#yAxis.maxColor)\n *\n * @type {Array>}\n * @since 4.0\n * @product highcharts\n * @apioption yAxis.stops\n */\n /**\n * The pixel width of the major tick marks.\n *\n * @sample {highcharts} highcharts/xaxis/tickwidth/ 10 px width\n * @sample {highstock} stock/xaxis/ticks/ Formatted ticks on X axis\n *\n * @type {number}\n * @default 0\n * @product highcharts highstock gantt\n * @apioption yAxis.tickWidth\n */\n /**\n * Whether to force the axis to end on a tick. Use this option with\n * the `maxPadding` option to control the axis end.\n *\n * This option is always disabled, when panning type is\n * either `y` or `xy`.\n *\n * @see [type](#chart.panning.type)\n *\n *\n * @sample {highcharts} highcharts/yaxis/endontick/\n * True by default\n * @sample {highcharts} highcharts/yaxis/endontick-false/\n * False\n * @sample {highstock} stock/demo/basic-line/\n * True by default\n * @sample {highstock} stock/xaxis/endontick/\n * False for Y axis\n *\n * @since 1.2.0\n */\n endOnTick: true,\n /**\n * Padding of the max value relative to the length of the axis. A\n * padding of 0.05 will make a 100px axis 5px longer. This is useful\n * when you don't want the highest data value to appear on the edge\n * of the plot area. When the axis' `max` option is set or a max extreme\n * is set using `axis.setExtremes()`, the maxPadding will be ignored.\n *\n * Also the `softThreshold` option takes precedence over `maxPadding`,\n * so if the data is tangent to the threshold, `maxPadding` may not\n * apply unless `softThreshold` is set to false.\n *\n * @sample {highcharts} highcharts/yaxis/maxpadding-02/\n * Max padding of 0.2\n * @sample {highstock} stock/xaxis/minpadding-maxpadding/\n * Greater min- and maxPadding\n *\n * @since 1.2.0\n * @product highcharts highstock gantt\n */\n maxPadding: 0.05,\n /**\n * Padding of the min value relative to the length of the axis. A\n * padding of 0.05 will make a 100px axis 5px longer. This is useful\n * when you don't want the lowest data value to appear on the edge\n * of the plot area. When the axis' `min` option is set or a max extreme\n * is set using `axis.setExtremes()`, the maxPadding will be ignored.\n *\n * Also the `softThreshold` option takes precedence over `minPadding`,\n * so if the data is tangent to the threshold, `minPadding` may not\n * apply unless `softThreshold` is set to false.\n *\n * @sample {highcharts} highcharts/yaxis/minpadding/\n * Min padding of 0.2\n * @sample {highstock} stock/xaxis/minpadding-maxpadding/\n * Greater min- and maxPadding\n *\n * @since 1.2.0\n * @product highcharts highstock gantt\n */\n minPadding: 0.05,\n /**\n * @productdesc {highstock}\n * In Highcharts Stock 1.x, the Y axis was placed\n * on the left side by default.\n *\n * @sample {highcharts} highcharts/yaxis/opposite/\n * Secondary Y axis opposite\n * @sample {highstock} stock/xaxis/opposite/\n * Y axis on left side\n *\n * @type {boolean}\n * @default {highstock} true\n * @default {highcharts} false\n * @product highstock highcharts gantt\n * @apioption yAxis.opposite\n */\n /**\n * @see [tickInterval](#xAxis.tickInterval)\n * @see [tickPositioner](#xAxis.tickPositioner)\n * @see [tickPositions](#xAxis.tickPositions)\n */\n tickPixelInterval: 72,\n /**\n * Whether to show the last tick label.\n *\n * @productdesc {highcharts|gantt}\n * Defaults to `true` on cartesian charts, and `false` on polar charts.\n *\n * @productdesc {highstock}\n * Defaults to `true` for categorized yAxis and `false` for other types\n * of yAxis.\n *\n * @default undefined\n */\n showLastLabel: true,\n /**\n * @extends xAxis.labels\n */\n labels: {\n /**\n * The label's pixel distance from the perimeter of the plot area.\n * On cartesian charts, this is overridden if the `labels.y` setting\n * is set.\n *\n * On polar charts, if it's a percentage string, it is interpreted\n * the same as [series.radius](#plotOptions.gauge.radius), so the\n * label can be aligned under the gauge's shape.\n *\n * @sample {highcharts} highcharts/yaxis/labels-distance/\n * Polar chart, labels centered under the arc\n *\n * @type {number|string}\n * @product highcharts\n * @apioption yAxis.labels.distance\n */\n /**\n * The y position offset of all labels relative to the tick\n * positions on the axis. For polar and radial axis consider the use\n * of the [distance](#yAxis.labels.distance) option.\n *\n * @sample {highcharts} highcharts/xaxis/labels-x/\n * Y axis labels placed on grid lines\n *\n * @type {number}\n * @default {highcharts} 3\n * @default {highstock} -2\n * @default {highmaps} 3\n * @apioption yAxis.labels.y\n */\n /**\n * What part of the string the given position is anchored to. Can\n * be one of `\"left\"`, `\"center\"` or `\"right\"`. The exact position\n * also depends on the `labels.x` setting.\n *\n * Angular gauges and solid gauges defaults to `\"center\"`.\n * Solid gauges with two labels have additional option `\"auto\"`\n * for automatic horizontal and vertical alignment.\n *\n * @sample {highcharts} highcharts/yaxis/labels-align-left/\n * Left\n * @sample {highcharts} highcharts/series-solidgauge/labels-auto-aligned/\n * Solid gauge labels auto aligned\n *\n * @type {Highcharts.AlignValue}\n * @default {highstock} right\n * @apioption yAxis.labels.align\n */\n /**\n * The x position offset of all labels relative to the tick\n * positions on the axis. Defaults to -15 for left axis, 15 for\n * right axis.\n *\n * @sample {highcharts} highcharts/xaxis/labels-x/\n * Y axis labels placed on grid lines\n *\n * @type {number}\n */\n x: void 0\n },\n /**\n * @sample {highcharts} highcharts/yaxis/max-200/\n * Y axis max of 200\n * @sample {highcharts} highcharts/yaxis/max-logarithmic/\n * Y axis max on logarithmic axis\n * @sample {highstock} stock/yaxis/min-max/\n * Fixed min and max on Y axis\n *\n * @apioption yAxis.max\n */\n /**\n * @sample {highcharts} highcharts/yaxis/min-startontick-false/\n * -50 with startOnTick to false\n * @sample {highcharts} highcharts/yaxis/min-startontick-true/\n * -50 with startOnTick true by default\n * @sample {highstock} stock/yaxis/min-max/\n * Fixed min and max on Y axis\n *\n * @apioption yAxis.min\n */\n /**\n * An optional scrollbar to display on the Y axis in response to\n * limiting the minimum an maximum of the axis values.\n *\n * In styled mode, all the presentational options for the scrollbar\n * are replaced by the classes `.highcharts-scrollbar-thumb`,\n * `.highcharts-scrollbar-arrow`, `.highcharts-scrollbar-button`,\n * `.highcharts-scrollbar-rifles` and `.highcharts-scrollbar-track`.\n *\n * @sample {highstock} stock/yaxis/scrollbar/\n * Scrollbar on the Y axis\n *\n * @extends scrollbar\n * @since 4.2.6\n * @product highstock\n * @excluding height\n * @apioption yAxis.scrollbar\n */\n /**\n * Enable the scrollbar on the Y axis.\n *\n * @sample {highstock} stock/yaxis/scrollbar/\n * Enabled on Y axis\n *\n * @type {boolean}\n * @default false\n * @since 4.2.6\n * @product highstock\n * @apioption yAxis.scrollbar.enabled\n */\n /**\n * Pixel margin between the scrollbar and the axis elements.\n *\n * @type {number}\n * @default 10\n * @since 4.2.6\n * @product highstock\n * @apioption yAxis.scrollbar.margin\n */\n /* eslint-disable highcharts/doclet-apioption-last */\n /**\n * Defines the position of the scrollbar. By default, it is positioned\n * on the opposite of the main axis (right side of the chart).\n * However, in the case of RTL languages could be set to `false`\n * which positions the scrollbar on the left.\n *\n * Works only for vertical axes.\n * This means yAxis in a non-inverted chart and xAxis in the inverted.\n *\n * @sample stock/yaxis/scrollbar-opposite/\n * A scrollbar not on the opposite side\n *\n * @type {boolean}\n * @default true\n * @since 9.3.0\n *\n * @apioption yAxis.scrollbar.opposite\n * @apioption xAxis.scrollbar.opposite\n *\n */\n /* eslint-enable highcharts/doclet-apioption-last */\n /**\n * Whether to show the scrollbar when it is fully zoomed out at max\n * range. Setting it to `false` on the Y axis makes the scrollbar stay\n * hidden until the user zooms in, like common in browsers.\n *\n * @type {boolean}\n * @default true\n * @since 4.2.6\n * @product highstock\n * @apioption yAxis.scrollbar.showFull\n */\n /**\n * The width of a vertical scrollbar or height of a horizontal\n * scrollbar. Defaults to 20 on touch devices.\n *\n * @type {number}\n * @default 14\n * @since 4.2.6\n * @product highstock\n * @apioption yAxis.scrollbar.size\n */\n /**\n * Z index of the scrollbar elements.\n *\n * @type {number}\n * @default 3\n * @since 4.2.6\n * @product highstock\n * @apioption yAxis.scrollbar.zIndex\n */\n /**\n * A soft maximum for the axis. If the series data maximum is less\n * than this, the axis will stay at this maximum, but if the series\n * data maximum is higher, the axis will flex to show all data.\n *\n * **Note**: The [series.softThreshold](\n * #plotOptions.series.softThreshold) option takes precedence over this\n * option.\n *\n * @sample highcharts/yaxis/softmin-softmax/\n * Soft min and max\n *\n * @type {number}\n * @since 5.0.1\n * @product highcharts highstock gantt\n * @apioption yAxis.softMax\n */\n /**\n * A soft minimum for the axis. If the series data minimum is greater\n * than this, the axis will stay at this minimum, but if the series\n * data minimum is lower, the axis will flex to show all data.\n *\n * **Note**: The [series.softThreshold](\n * #plotOptions.series.softThreshold) option takes precedence over this\n * option.\n *\n * @sample highcharts/yaxis/softmin-softmax/\n * Soft min and max\n *\n * @type {number}\n * @since 5.0.1\n * @product highcharts highstock gantt\n * @apioption yAxis.softMin\n */\n /**\n * Defines the horizontal alignment of the stack total label. Can be one\n * of `\"left\"`, `\"center\"` or `\"right\"`. The default value is calculated\n * at runtime and depends on orientation and whether the stack is\n * positive or negative.\n *\n * @sample {highcharts} highcharts/yaxis/stacklabels-align-left/\n * Aligned to the left\n * @sample {highcharts} highcharts/yaxis/stacklabels-align-center/\n * Aligned in center\n * @sample {highcharts} highcharts/yaxis/stacklabels-align-right/\n * Aligned to the right\n *\n * @type {Highcharts.AlignValue}\n * @since 2.1.5\n * @product highcharts\n * @apioption yAxis.stackLabels.align\n */\n /**\n * A format string for the data label. Available variables are the same\n * as for `formatter`.\n *\n * @type {string}\n * @default {total}\n * @since 3.0.2\n * @product highcharts highstock\n * @apioption yAxis.stackLabels.format\n */\n /**\n * Rotation of the labels in degrees.\n *\n * @sample {highcharts} highcharts/yaxis/stacklabels-rotation/\n * Labels rotated 45\u00B0\n *\n * @type {number}\n * @default 0\n * @since 2.1.5\n * @product highcharts\n * @apioption yAxis.stackLabels.rotation\n */\n /**\n * The text alignment for the label. While `align` determines where the\n * texts anchor point is placed with regards to the stack, `textAlign`\n * determines how the text is aligned against its anchor point. Possible\n * values are `\"left\"`, `\"center\"` and `\"right\"`. The default value is\n * calculated at runtime and depends on orientation and whether the\n * stack is positive or negative.\n *\n * @sample {highcharts} highcharts/yaxis/stacklabels-textalign-left/\n * Label in center position but text-aligned left\n *\n * @type {Highcharts.AlignValue}\n * @since 2.1.5\n * @product highcharts\n * @apioption yAxis.stackLabels.textAlign\n */\n /**\n * Whether to [use HTML](https://www.highcharts.com/docs/chart-concepts/labels-and-string-formatting#html)\n * to render the labels.\n *\n * @type {boolean}\n * @default false\n * @since 3.0\n * @product highcharts highstock\n * @apioption yAxis.stackLabels.useHTML\n */\n /**\n * Defines the vertical alignment of the stack total label. Can be one\n * of `\"top\"`, `\"middle\"` or `\"bottom\"`. The default value is calculated\n * at runtime and depends on orientation and whether the stack is\n * positive or negative.\n *\n * @sample {highcharts} highcharts/yaxis/stacklabels-verticalalign-top/\n * Vertically aligned top\n * @sample {highcharts} highcharts/yaxis/stacklabels-verticalalign-middle/\n * Vertically aligned middle\n * @sample {highcharts} highcharts/yaxis/stacklabels-verticalalign-bottom/\n * Vertically aligned bottom\n *\n * @type {Highcharts.VerticalAlignValue}\n * @since 2.1.5\n * @product highcharts\n * @apioption yAxis.stackLabels.verticalAlign\n */\n /**\n * The x position offset of the label relative to the left of the\n * stacked bar. The default value is calculated at runtime and depends\n * on orientation and whether the stack is positive or negative.\n *\n * @sample {highcharts} highcharts/yaxis/stacklabels-x/\n * Stack total labels with x offset\n *\n * @type {number}\n * @since 2.1.5\n * @product highcharts\n * @apioption yAxis.stackLabels.x\n */\n /**\n * The y position offset of the label relative to the tick position\n * on the axis. The default value is calculated at runtime and depends\n * on orientation and whether the stack is positive or negative.\n *\n * @sample {highcharts} highcharts/yaxis/stacklabels-y/\n * Stack total labels with y offset\n *\n * @type {number}\n * @since 2.1.5\n * @product highcharts\n * @apioption yAxis.stackLabels.y\n */\n /**\n * Whether to force the axis to start on a tick. Use this option with\n * the `maxPadding` option to control the axis start.\n *\n * This option is always disabled, when panning type is\n * either `y` or `xy`.\n *\n * @see [type](#chart.panning.type)\n *\n * @sample {highcharts} highcharts/xaxis/startontick-false/\n * False by default\n * @sample {highcharts} highcharts/xaxis/startontick-true/\n * True\n * @sample {highstock} stock/xaxis/endontick/\n * False for Y axis\n *\n * @since 1.2.0\n * @product highcharts highstock gantt\n */\n startOnTick: true,\n title: {\n /**\n * The pixel distance between the axis labels and the title.\n * Positive values are outside the axis line, negative are inside.\n *\n * @sample {highcharts} highcharts/xaxis/title-margin/\n * Y axis title margin of 60\n *\n * @type {number}\n * @default 40\n * @apioption yAxis.title.margin\n */\n /**\n * The actual text of the axis title. Horizontal texts can contain\n * HTML, but rotated texts are painted using vector techniques and\n * must be clean text. The Y axis title is disabled by setting the\n * `text` option to `undefined`.\n *\n * @sample {highcharts} highcharts/xaxis/title-text/\n * Custom HTML\n *\n * @type {string|null}\n * @default {highcharts} Values\n * @default {highstock} undefined\n * @product highcharts highstock gantt\n */\n text: 'Values'\n },\n /**\n * The top position of the Y axis. If it's a number, it is interpreted\n * as pixel position relative to the chart.\n *\n * Since Highcharts 2: If it's a percentage string, it is interpreted as\n * percentages of the plot height, offset from plot area top.\n *\n * @see [yAxis.height](#yAxis.height)\n *\n * @sample {highstock} stock/demo/candlestick-and-volume/\n * Percentage height panes\n *\n * @type {number|string}\n * @product highcharts highstock\n * @apioption yAxis.top\n */\n /**\n * The stack labels show the total value for each bar in a stacked\n * column or bar chart. The label will be placed on top of positive\n * columns and below negative columns. In case of an inverted column\n * chart or a bar chart the label is placed to the right of positive\n * bars and to the left of negative bars.\n *\n * @product highcharts\n */\n stackLabels: {\n /**\n * Enable or disable the initial animation when a series is\n * displayed for the `stackLabels`. The animation can also be set as\n * a configuration object. Please note that this option only\n * applies to the initial animation.\n * For other animations, see [chart.animation](#chart.animation)\n * and the animation parameter under the API methods.\n * The following properties are supported:\n *\n * - `defer`: The animation delay time in milliseconds.\n *\n * @sample {highcharts} highcharts/plotoptions/animation-defer/\n * Animation defer settings\n * @type {boolean|Partial}\n * @since 8.2.0\n * @apioption yAxis.stackLabels.animation\n */\n animation: {},\n /**\n * The animation delay time in milliseconds.\n * Set to `0` renders stackLabel immediately.\n * As `undefined` inherits defer time from the [series.animation.defer](#plotOptions.series.animation.defer).\n *\n * @type {number}\n * @since 8.2.0\n * @apioption yAxis.stackLabels.animation.defer\n */\n /**\n * Allow the stack labels to overlap.\n *\n * @sample {highcharts} highcharts/yaxis/stacklabels-allowoverlap-false/\n * Default false\n *\n * @since 5.0.13\n * @product highcharts\n */\n allowOverlap: false,\n /**\n * The background color or gradient for the stack label.\n *\n * @sample {highcharts} highcharts/yaxis/stacklabels-box/\n * Stack labels box options\n * @type {Highcharts.ColorType}\n * @since 8.1.0\n * @apioption yAxis.stackLabels.backgroundColor\n */\n /**\n * The border color for the stack label. Defaults to `undefined`.\n *\n * @sample {highcharts} highcharts/yaxis/stacklabels-box/\n * Stack labels box options\n * @type {Highcharts.ColorType}\n * @since 8.1.0\n * @apioption yAxis.stackLabels.borderColor\n */\n /**\n * The border radius in pixels for the stack label.\n *\n * @sample {highcharts} highcharts/yaxis/stacklabels-box/\n * Stack labels box options\n * @type {number}\n * @default 0\n * @since 8.1.0\n * @apioption yAxis.stackLabels.borderRadius\n */\n /**\n * The border width in pixels for the stack label.\n *\n * @sample {highcharts} highcharts/yaxis/stacklabels-box/\n * Stack labels box options\n * @type {number}\n * @default 0\n * @since 8.1.0\n * @apioption yAxis.stackLabels.borderWidth\n */\n /**\n * Enable or disable the stack total labels.\n *\n * @sample {highcharts} highcharts/yaxis/stacklabels-enabled/\n * Enabled stack total labels\n * @sample {highcharts} highcharts/yaxis/stacklabels-enabled-waterfall/\n * Enabled stack labels in waterfall chart\n *\n * @since 2.1.5\n * @product highcharts\n */\n enabled: false,\n /**\n * Whether to hide stack labels that are outside the plot area.\n * By default, the stack label is moved\n * inside the plot area according to the\n * [overflow](/highcharts/#yAxis/stackLabels/overflow)\n * option.\n *\n * @type {boolean}\n * @since 7.1.3\n */\n crop: true,\n /**\n * How to handle stack total labels that flow outside the plot area.\n * The default is set to `\"justify\"`,\n * which aligns them inside the plot area.\n * For columns and bars, this means it will be moved inside the bar.\n * To display stack labels outside the plot area,\n * set `crop` to `false` and `overflow` to `\"allow\"`.\n *\n * @sample highcharts/yaxis/stacklabels-overflow/\n * Stack labels flows outside the plot area.\n *\n * @type {Highcharts.DataLabelsOverflowValue}\n * @since 7.1.3\n */\n overflow: 'justify',\n /* eslint-disable valid-jsdoc */\n /**\n * Callback JavaScript function to format the label. The value is\n * given by `this.total`.\n *\n * @sample {highcharts} highcharts/yaxis/stacklabels-formatter/\n * Added units to stack total value\n *\n * @type {Highcharts.FormatterCallbackFunction}\n * @since 2.1.5\n * @product highcharts\n */\n formatter: function () {\n const { numberFormatter } = this.axis.chart;\n /* eslint-enable valid-jsdoc */\n return numberFormatter(this.total || 0, -1);\n },\n /**\n * CSS styles for the label.\n *\n * In styled mode, the styles are set in the\n * `.highcharts-stack-label` class.\n *\n * @sample {highcharts} highcharts/yaxis/stacklabels-style/\n * Red stack total labels\n *\n * @type {Highcharts.CSSObject}\n * @since 2.1.5\n * @product highcharts\n */\n style: {\n /** @internal */\n color: \"#000000\" /* Palette.neutralColor100 */,\n /** @internal */\n fontSize: '0.7em',\n /** @internal */\n fontWeight: 'bold',\n /** @internal */\n textOutline: '1px contrast'\n }\n },\n gridLineWidth: 1,\n lineWidth: 0\n };\n})(AxisDefaults || (AxisDefaults = {}));\n/* *\n *\n * Default Export\n *\n * */\nexport default AxisDefaults;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport U from './Utilities.js';\nconst { addEvent, isFunction, objectEach, removeEvent } = U;\n/* *\n *\n * Class Namespace\n *\n * */\nvar Foundation;\n(function (Foundation) {\n /* *\n *\n * Functions\n *\n * */\n /* eslint-disable valid-jsdoc */\n /**\n * Register event options. If an event handler is set on the options, it\n * should be subject to Chart.update, Axis.update and Series.update. This is\n * contrary to general handlers that are set directly using addEvent either\n * on the class or on the instance. #6538, #6943, #10861.\n * @private\n */\n function registerEventOptions(component, options) {\n // A lookup over those events that are added by _options_ (not\n // programmatically). These are updated through .update()\n component.eventOptions = component.eventOptions || {};\n // Register event listeners\n objectEach(options.events, function (event, eventType) {\n // If event does not exist, or is changed by the .update()\n // function\n if (component.eventOptions[eventType] !== event) {\n // Remove existing if set by option\n if (component.eventOptions[eventType]) {\n removeEvent(component, eventType, component.eventOptions[eventType]);\n delete component.eventOptions[eventType];\n }\n if (isFunction(event)) {\n component.eventOptions[eventType] = event;\n addEvent(component, eventType, event, {\n order: 0 // #14080 fire those events as firsts\n });\n }\n }\n });\n }\n Foundation.registerEventOptions = registerEventOptions;\n})(Foundation || (Foundation = {}));\n/* *\n *\n * Default Export\n *\n * */\nexport default Foundation;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport F from '../Templating.js';\nimport H from '../Globals.js';\nconst { deg2rad } = H;\nimport U from '../Utilities.js';\nconst { clamp, correctFloat, defined, destroyObjectProperties, extend, fireEvent, isNumber, merge, objectEach, pick } = U;\n/* *\n *\n * Class\n *\n * */\n/* eslint-disable no-invalid-this, valid-jsdoc */\n/**\n * The Tick class.\n *\n * @class\n * @name Highcharts.Tick\n *\n * @param {Highcharts.Axis} axis\n * The axis of the tick.\n *\n * @param {number} pos\n * The position of the tick on the axis in terms of axis values.\n *\n * @param {string} [type]\n * The type of tick, either 'minor' or an empty string\n *\n * @param {boolean} [noLabel=false]\n * Whether to disable the label or not. Defaults to false.\n *\n * @param {Object} [parameters]\n * Optional parameters for the tick.\n */\nclass Tick {\n /* *\n *\n * Constructors\n *\n * */\n constructor(axis, pos, type, noLabel, parameters) {\n this.isNew = true;\n this.isNewLabel = true;\n /**\n * The related axis of the tick.\n * @name Highcharts.Tick#axis\n * @type {Highcharts.Axis}\n */\n this.axis = axis;\n /**\n * The logical position of the tick on the axis in terms of axis values.\n * @name Highcharts.Tick#pos\n * @type {number}\n */\n this.pos = pos;\n /**\n * The tick type, which can be `\"minor\"`, or an empty string.\n * @name Highcharts.Tick#type\n * @type {string}\n */\n this.type = type || '';\n this.parameters = parameters || {};\n /**\n * The mark offset of the tick on the axis. Usually `undefined`, numeric\n * for grid axes.\n * @name Highcharts.Tick#tickmarkOffset\n * @type {number|undefined}\n */\n this.tickmarkOffset = this.parameters.tickmarkOffset;\n this.options = this.parameters.options;\n fireEvent(this, 'init');\n if (!type && !noLabel) {\n this.addLabel();\n }\n }\n /* *\n *\n * Functions\n *\n * */\n /**\n * Write the tick label.\n *\n * @private\n * @function Highcharts.Tick#addLabel\n */\n addLabel() {\n const tick = this, axis = tick.axis, options = axis.options, chart = axis.chart, categories = axis.categories, log = axis.logarithmic, names = axis.names, pos = tick.pos, labelOptions = pick(tick.options && tick.options.labels, options.labels), tickPositions = axis.tickPositions, isFirst = pos === tickPositions[0], isLast = pos === tickPositions[tickPositions.length - 1], animateLabels = (!labelOptions.step || labelOptions.step === 1) &&\n axis.tickInterval === 1, tickPositionInfo = tickPositions.info;\n let label = tick.label, dateTimeLabelFormat, dateTimeLabelFormats, i;\n // The context value\n let value = this.parameters.category || (categories ?\n pick(categories[pos], names[pos], pos) :\n pos);\n if (log && isNumber(value)) {\n value = correctFloat(log.lin2log(value));\n }\n // Set the datetime label format. If a higher rank is set for this\n // position, use that. If not, use the general format.\n if (axis.dateTime) {\n if (tickPositionInfo) {\n dateTimeLabelFormats = chart.time.resolveDTLFormat(options.dateTimeLabelFormats[(!options.grid &&\n tickPositionInfo.higherRanks[pos]) ||\n tickPositionInfo.unitName]);\n dateTimeLabelFormat = dateTimeLabelFormats.main;\n }\n else if (isNumber(value)) { // #1441\n dateTimeLabelFormat = axis.dateTime.getXDateFormat(value, options.dateTimeLabelFormats ||\n {});\n }\n }\n // set properties for access in render method\n /**\n * True if the tick is the first one on the axis.\n * @name Highcharts.Tick#isFirst\n * @readonly\n * @type {boolean|undefined}\n */\n tick.isFirst = isFirst;\n /**\n * True if the tick is the last one on the axis.\n * @name Highcharts.Tick#isLast\n * @readonly\n * @type {boolean|undefined}\n */\n tick.isLast = isLast;\n // Get the string\n const ctx = {\n axis,\n chart,\n dateTimeLabelFormat: dateTimeLabelFormat,\n isFirst,\n isLast,\n pos,\n tick: tick,\n tickPositionInfo,\n value\n };\n // Fire an event that allows modifying the context for use in\n // `labels.format` and `labels.formatter`.\n fireEvent(this, 'labelFormat', ctx);\n // Label formatting. When `labels.format` is given, we first run the\n // defaultFormatter and append the result to the context as `text`.\n // Handy for adding prefix or suffix while keeping default number\n // formatting.\n const labelFormatter = (ctx) => {\n if (labelOptions.formatter) {\n return labelOptions.formatter.call(ctx, ctx);\n }\n if (labelOptions.format) {\n ctx.text = axis.defaultLabelFormatter.call(ctx);\n return F.format(labelOptions.format, ctx, chart);\n }\n return axis.defaultLabelFormatter.call(ctx);\n };\n const str = labelFormatter.call(ctx, ctx);\n // Set up conditional formatting based on the format list if existing.\n const list = dateTimeLabelFormats && dateTimeLabelFormats.list;\n if (list) {\n tick.shortenLabel = function () {\n for (i = 0; i < list.length; i++) {\n extend(ctx, { dateTimeLabelFormat: list[i] });\n label.attr({\n text: labelFormatter.call(ctx, ctx)\n });\n if (label.getBBox().width <\n axis.getSlotWidth(tick) - 2 *\n labelOptions.padding) {\n return;\n }\n }\n label.attr({\n text: ''\n });\n };\n }\n else {\n // #15692\n tick.shortenLabel = void 0;\n }\n // Call only after first render\n if (animateLabels && axis._addedPlotLB) {\n tick.moveLabel(str, labelOptions);\n }\n // First call\n if (!defined(label) && !tick.movedLabel) {\n /**\n * The rendered text label of the tick.\n * @name Highcharts.Tick#label\n * @type {Highcharts.SVGElement|undefined}\n */\n tick.label = label = tick.createLabel(str, labelOptions);\n // Base value to detect change for new calls to getBBox\n tick.rotation = 0;\n // update\n }\n else if (label && label.textStr !== str && !animateLabels) {\n // When resetting text, also reset the width if dynamically set\n // (#8809)\n if (label.textWidth &&\n !labelOptions.style.width &&\n !label.styles.width) {\n label.css({ width: null });\n }\n label.attr({ text: str });\n label.textPxLength = label.getBBox().width;\n }\n }\n /**\n * Render and return the label of the tick.\n *\n * @private\n * @function Highcharts.Tick#createLabel\n */\n createLabel(str, labelOptions, xy) {\n const axis = this.axis, chart = axis.chart, label = defined(str) && labelOptions.enabled ?\n chart.renderer\n .text(str, xy?.x, xy?.y, labelOptions.useHTML)\n .add(axis.labelGroup) :\n void 0;\n // Un-rotated length\n if (label) {\n // Without position absolute, IE export sometimes is wrong\n if (!chart.styledMode) {\n label.css(merge(labelOptions.style));\n }\n label.textPxLength = label.getBBox().width;\n }\n return label;\n }\n /**\n * Destructor for the tick prototype\n *\n * @private\n * @function Highcharts.Tick#destroy\n */\n destroy() {\n destroyObjectProperties(this, this.axis);\n }\n /**\n * Gets the x and y positions for ticks in terms of pixels.\n *\n * @private\n * @function Highcharts.Tick#getPosition\n *\n * @param {boolean} horiz\n * Whether the tick is on an horizontal axis or not.\n *\n * @param {number} tickPos\n * Position of the tick.\n *\n * @param {number} tickmarkOffset\n * Tickmark offset for all ticks.\n *\n * @param {boolean} [old]\n * Whether the axis has changed or not.\n *\n * @return {Highcharts.PositionObject}\n * The tick position.\n *\n * @emits Highcharts.Tick#event:afterGetPosition\n */\n getPosition(horiz, tickPos, tickmarkOffset, old) {\n const axis = this.axis, chart = axis.chart, cHeight = (old && chart.oldChartHeight) || chart.chartHeight, pos = {\n x: horiz ?\n correctFloat(axis.translate(tickPos + tickmarkOffset, void 0, void 0, old) +\n axis.transB) :\n (axis.left +\n axis.offset +\n (axis.opposite ?\n (((old && chart.oldChartWidth) ||\n chart.chartWidth) -\n axis.right -\n axis.left) :\n 0)),\n y: horiz ?\n (cHeight -\n axis.bottom +\n axis.offset -\n (axis.opposite ? axis.height : 0)) :\n correctFloat(cHeight -\n axis.translate(tickPos + tickmarkOffset, void 0, void 0, old) -\n axis.transB)\n };\n // Chrome workaround for #10516\n pos.y = clamp(pos.y, -1e5, 1e5);\n fireEvent(this, 'afterGetPosition', { pos: pos });\n return pos;\n }\n /**\n * Get the x, y position of the tick label\n * @private\n */\n getLabelPosition(x, y, label, horiz, labelOptions, tickmarkOffset, index, step) {\n const axis = this.axis, transA = axis.transA, reversed = ( // #7911\n axis.isLinked && axis.linkedParent ?\n axis.linkedParent.reversed :\n axis.reversed), staggerLines = axis.staggerLines, rotCorr = axis.tickRotCorr || { x: 0, y: 0 }, \n // Adjust for label alignment if we use reserveSpace: true (#5286)\n labelOffsetCorrection = (!horiz && !axis.reserveSpaceDefault ?\n -axis.labelOffset * (axis.labelAlign === 'center' ? 0.5 : 1) :\n 0), distance = labelOptions.distance, pos = {};\n let yOffset, line;\n if (axis.side === 0) {\n yOffset = label.rotation ? -distance : -label.getBBox().height;\n }\n else if (axis.side === 2) {\n yOffset = rotCorr.y + distance;\n }\n else {\n // #3140, #3140\n yOffset = Math.cos(label.rotation * deg2rad) *\n (rotCorr.y - label.getBBox(false, 0).height / 2);\n }\n if (defined(labelOptions.y)) {\n yOffset = axis.side === 0 && axis.horiz ?\n labelOptions.y + yOffset :\n labelOptions.y;\n }\n x = x +\n pick(labelOptions.x, [0, 1, 0, -1][axis.side] * distance) +\n labelOffsetCorrection +\n rotCorr.x -\n (tickmarkOffset && horiz ?\n tickmarkOffset * transA * (reversed ? -1 : 1) :\n 0);\n y = y + yOffset - (tickmarkOffset && !horiz ?\n tickmarkOffset * transA * (reversed ? 1 : -1) : 0);\n // Correct for staggered labels\n if (staggerLines) {\n line = (index / (step || 1) % staggerLines);\n if (axis.opposite) {\n line = staggerLines - line - 1;\n }\n y += line * (axis.labelOffset / staggerLines);\n }\n pos.x = x;\n pos.y = Math.round(y);\n fireEvent(this, 'afterGetLabelPosition', { pos: pos, tickmarkOffset: tickmarkOffset, index: index });\n return pos;\n }\n /**\n * Get the offset height or width of the label\n *\n * @private\n * @function Highcharts.Tick#getLabelSize\n */\n getLabelSize() {\n return this.label ?\n this.label.getBBox()[this.axis.horiz ? 'height' : 'width'] :\n 0;\n }\n /**\n * Extendible method to return the path of the marker\n * @private\n */\n getMarkPath(x, y, tickLength, tickWidth, horiz, renderer) {\n return renderer.crispLine([[\n 'M',\n x,\n y\n ], [\n 'L',\n x + (horiz ? 0 : -tickLength),\n y + (horiz ? tickLength : 0)\n ]], tickWidth);\n }\n /**\n * Handle the label overflow by adjusting the labels to the left and right\n * edge, or hide them if they collide into the neighbour label.\n *\n * @private\n * @function Highcharts.Tick#handleOverflow\n */\n handleOverflow(xy) {\n const tick = this, axis = this.axis, labelOptions = axis.options.labels, pxPos = xy.x, chartWidth = axis.chart.chartWidth, spacing = axis.chart.spacing, leftBound = pick(axis.labelLeft, Math.min(axis.pos, spacing[3])), rightBound = pick(axis.labelRight, Math.max(!axis.isRadial ? axis.pos + axis.len : 0, chartWidth - spacing[1])), label = this.label, rotation = this.rotation, factor = {\n left: 0,\n center: 0.5,\n right: 1\n }[axis.labelAlign || label.attr('align')], labelWidth = label.getBBox().width, slotWidth = axis.getSlotWidth(tick), xCorrection = factor, css = {};\n let modifiedSlotWidth = slotWidth, goRight = 1, leftPos, rightPos, textWidth;\n // Check if the label overshoots the chart spacing box. If it does, move\n // it. If it now overshoots the slotWidth, add ellipsis.\n if (!rotation && labelOptions.overflow === 'justify') {\n leftPos = pxPos - factor * labelWidth;\n rightPos = pxPos + (1 - factor) * labelWidth;\n if (leftPos < leftBound) {\n modifiedSlotWidth =\n xy.x + modifiedSlotWidth * (1 - factor) - leftBound;\n }\n else if (rightPos > rightBound) {\n modifiedSlotWidth =\n rightBound - xy.x + modifiedSlotWidth * factor;\n goRight = -1;\n }\n modifiedSlotWidth = Math.min(slotWidth, modifiedSlotWidth); // #4177\n if (modifiedSlotWidth < slotWidth && axis.labelAlign === 'center') {\n xy.x += (goRight *\n (slotWidth -\n modifiedSlotWidth -\n xCorrection * (slotWidth - Math.min(labelWidth, modifiedSlotWidth))));\n }\n // If the label width exceeds the available space, set a text width\n // to be picked up below. Also, if a width has been set before, we\n // need to set a new one because the reported labelWidth will be\n // limited by the box (#3938).\n if (labelWidth > modifiedSlotWidth ||\n (axis.autoRotation && (label.styles || {}).width)) {\n textWidth = modifiedSlotWidth;\n }\n // Add ellipsis to prevent rotated labels to be clipped against the edge\n // of the chart\n }\n else if (rotation < 0 &&\n pxPos - factor * labelWidth < leftBound) {\n textWidth = Math.round(pxPos / Math.cos(rotation * deg2rad) - leftBound);\n }\n else if (rotation > 0 &&\n pxPos + factor * labelWidth > rightBound) {\n textWidth = Math.round((chartWidth - pxPos) /\n Math.cos(rotation * deg2rad));\n }\n if (textWidth) {\n if (tick.shortenLabel) {\n tick.shortenLabel();\n }\n else {\n css.width = Math.floor(textWidth) + 'px';\n if (!(labelOptions.style || {}).textOverflow) {\n css.textOverflow = 'ellipsis';\n }\n label.css(css);\n }\n }\n }\n /**\n * Try to replace the label if the same one already exists.\n *\n * @private\n * @function Highcharts.Tick#moveLabel\n */\n moveLabel(str, labelOptions) {\n const tick = this, label = tick.label, axis = tick.axis;\n let moved = false, labelPos;\n if (label && label.textStr === str) {\n tick.movedLabel = label;\n moved = true;\n delete tick.label;\n }\n else { // Find a label with the same string\n objectEach(axis.ticks, function (currentTick) {\n if (!moved &&\n !currentTick.isNew &&\n currentTick !== tick &&\n currentTick.label &&\n currentTick.label.textStr === str) {\n tick.movedLabel = currentTick.label;\n moved = true;\n currentTick.labelPos = tick.movedLabel.xy;\n delete currentTick.label;\n }\n });\n }\n // Create new label if the actual one is moved\n if (!moved && (tick.labelPos || label)) {\n labelPos = tick.labelPos || label.xy;\n tick.movedLabel = tick.createLabel(str, labelOptions, labelPos);\n if (tick.movedLabel) {\n tick.movedLabel.attr({ opacity: 0 });\n }\n }\n }\n /**\n * Put everything in place\n *\n * @private\n * @param {number} index\n *\n * @param {boolean} [old]\n * Use old coordinates to prepare an animation into new position\n *\n * @param {number} [opacity]\n */\n render(index, old, opacity) {\n const tick = this, axis = tick.axis, horiz = axis.horiz, pos = tick.pos, tickmarkOffset = pick(tick.tickmarkOffset, axis.tickmarkOffset), xy = tick.getPosition(horiz, pos, tickmarkOffset, old), x = xy.x, y = xy.y, axisStart = axis.pos, axisEnd = axisStart + axis.len, reverseCrisp = ((horiz && x === axisEnd) ||\n (!horiz && y === axisStart)) ? -1 : 1, // #1480, #1687\n pxPos = horiz ? x : y;\n // Anything that is not between `axis.pos` and `axis.pos + axis.length`\n // should not be visible (#20166). The `correctFloat` is for reversed\n // axes in Safari.\n if (!axis.chart.polar &&\n tick.isNew &&\n (correctFloat(pxPos) < axisStart || pxPos > axisEnd)) {\n opacity = 0;\n }\n const labelOpacity = pick(opacity, tick.label && tick.label.newOpacity, // #15528\n 1);\n opacity = pick(opacity, 1);\n this.isActive = true;\n // Create the grid line\n this.renderGridLine(old, opacity, reverseCrisp);\n // Create the tick mark\n this.renderMark(xy, opacity, reverseCrisp);\n // The label is created on init - now move it into place\n this.renderLabel(xy, old, labelOpacity, index);\n tick.isNew = false;\n fireEvent(this, 'afterRender');\n }\n /**\n * Renders the gridLine.\n *\n * @private\n * @function Highcharts.Tick#renderGridLine\n * @param {boolean} old Whether or not the tick is old\n * @param {number} opacity The opacity of the grid line\n * @param {number} reverseCrisp Modifier for avoiding overlapping 1 or -1\n */\n renderGridLine(old, opacity, reverseCrisp) {\n const tick = this, axis = tick.axis, options = axis.options, attribs = {}, pos = tick.pos, type = tick.type, tickmarkOffset = pick(tick.tickmarkOffset, axis.tickmarkOffset), renderer = axis.chart.renderer;\n let gridLine = tick.gridLine, gridLinePath, gridLineWidth = options.gridLineWidth, gridLineColor = options.gridLineColor, dashStyle = options.gridLineDashStyle;\n if (tick.type === 'minor') {\n gridLineWidth = options.minorGridLineWidth;\n gridLineColor = options.minorGridLineColor;\n dashStyle = options.minorGridLineDashStyle;\n }\n if (!gridLine) {\n if (!axis.chart.styledMode) {\n attribs.stroke = gridLineColor;\n attribs['stroke-width'] = gridLineWidth || 0;\n attribs.dashstyle = dashStyle;\n }\n if (!type) {\n attribs.zIndex = 1;\n }\n if (old) {\n opacity = 0;\n }\n /**\n * The rendered grid line of the tick.\n * @name Highcharts.Tick#gridLine\n * @type {Highcharts.SVGElement|undefined}\n */\n tick.gridLine = gridLine = renderer.path()\n .attr(attribs)\n .addClass('highcharts-' + (type ? type + '-' : '') + 'grid-line')\n .add(axis.gridGroup);\n }\n if (gridLine) {\n gridLinePath = axis.getPlotLinePath({\n value: pos + tickmarkOffset,\n lineWidth: gridLine.strokeWidth() * reverseCrisp,\n force: 'pass',\n old: old,\n acrossPanes: false // #18025\n });\n // If the parameter 'old' is set, the current call will be followed\n // by another call, therefore do not do any animations this time\n if (gridLinePath) {\n gridLine[old || tick.isNew ? 'attr' : 'animate']({\n d: gridLinePath,\n opacity: opacity\n });\n }\n }\n }\n /**\n * Renders the tick mark.\n *\n * @private\n * @function Highcharts.Tick#renderMark\n * @param {Highcharts.PositionObject} xy The position vector of the mark\n * @param {number} opacity The opacity of the mark\n * @param {number} reverseCrisp Modifier for avoiding overlapping 1 or -1\n */\n renderMark(xy, opacity, reverseCrisp) {\n const tick = this, axis = tick.axis, options = axis.options, renderer = axis.chart.renderer, type = tick.type, tickSize = axis.tickSize(type ? type + 'Tick' : 'tick'), x = xy.x, y = xy.y, tickWidth = pick(options[type !== 'minor' ? 'tickWidth' : 'minorTickWidth'], !type && axis.isXAxis ? 1 : 0), // X axis defaults to 1\n tickColor = options[type !== 'minor' ? 'tickColor' : 'minorTickColor'];\n let mark = tick.mark;\n const isNewMark = !mark;\n if (tickSize) {\n // negate the length\n if (axis.opposite) {\n tickSize[0] = -tickSize[0];\n }\n // First time, create it\n if (!mark) {\n /**\n * The rendered mark of the tick.\n * @name Highcharts.Tick#mark\n * @type {Highcharts.SVGElement|undefined}\n */\n tick.mark = mark = renderer.path()\n .addClass('highcharts-' + (type ? type + '-' : '') + 'tick')\n .add(axis.axisGroup);\n if (!axis.chart.styledMode) {\n mark.attr({\n stroke: tickColor,\n 'stroke-width': tickWidth\n });\n }\n }\n mark[isNewMark ? 'attr' : 'animate']({\n d: tick.getMarkPath(x, y, tickSize[0], mark.strokeWidth() * reverseCrisp, axis.horiz, renderer),\n opacity: opacity\n });\n }\n }\n /**\n * Renders the tick label.\n * Note: The label should already be created in init(), so it should only\n * have to be moved into place.\n *\n * @private\n * @function Highcharts.Tick#renderLabel\n * @param {Highcharts.PositionObject} xy The position vector of the label\n * @param {boolean} old Whether or not the tick is old\n * @param {number} opacity The opacity of the label\n * @param {number} index The index of the tick\n */\n renderLabel(xy, old, opacity, index) {\n const tick = this, axis = tick.axis, horiz = axis.horiz, options = axis.options, label = tick.label, labelOptions = options.labels, step = labelOptions.step, tickmarkOffset = pick(tick.tickmarkOffset, axis.tickmarkOffset), x = xy.x, y = xy.y;\n let show = true;\n if (label && isNumber(x)) {\n label.xy = xy = tick.getLabelPosition(x, y, label, horiz, labelOptions, tickmarkOffset, index, step);\n // Apply show first and show last. If the tick is both first and\n // last, it is a single centered tick, in which case we show the\n // label anyway (#2100).\n if ((tick.isFirst &&\n !tick.isLast &&\n !options.showFirstLabel) ||\n (tick.isLast &&\n !tick.isFirst &&\n !options.showLastLabel)) {\n show = false;\n // Handle label overflow and show or hide accordingly\n }\n else if (horiz &&\n !labelOptions.step &&\n !labelOptions.rotation &&\n !old &&\n opacity !== 0) {\n tick.handleOverflow(xy);\n }\n // apply step\n if (step && index % step) {\n // show those indices dividable by step\n show = false;\n }\n // Set the new position, and show or hide\n if (show && isNumber(xy.y)) {\n xy.opacity = opacity;\n label[tick.isNewLabel ? 'attr' : 'animate'](xy).show(true);\n tick.isNewLabel = false;\n }\n else {\n label.hide(); // #1338, #15863\n tick.isNewLabel = true;\n }\n }\n }\n /**\n * Replace labels with the moved ones to perform animation. Additionally\n * destroy unused labels.\n *\n * @private\n * @function Highcharts.Tick#replaceMovedLabel\n */\n replaceMovedLabel() {\n const tick = this, label = tick.label, axis = tick.axis;\n // Animate and destroy\n if (label && !tick.isNew) {\n label.animate({ opacity: 0 }, void 0, label.destroy);\n delete tick.label;\n }\n axis.isDirty = true;\n tick.label = tick.movedLabel;\n delete tick.movedLabel;\n }\n}\n/* *\n *\n * Default Export\n *\n * */\nexport default Tick;\n/* *\n *\n * API Declarations\n *\n * */\n/**\n * Optional parameters for the tick.\n * @private\n * @interface Highcharts.TickParametersObject\n */ /**\n* Set category for the tick.\n* @name Highcharts.TickParametersObject#category\n* @type {string|undefined}\n*/ /**\n* @name Highcharts.TickParametersObject#options\n* @type {Highcharts.Dictionary|undefined}\n*/ /**\n* Set tickmarkOffset for the tick.\n* @name Highcharts.TickParametersObject#tickmarkOffset\n* @type {number|undefined}\n*/\n/**\n * Additional time tick information.\n *\n * @interface Highcharts.TimeTicksInfoObject\n * @extends Highcharts.TimeNormalizedObject\n */ /**\n* @name Highcharts.TimeTicksInfoObject#higherRanks\n* @type {Array}\n*/ /**\n* @name Highcharts.TimeTicksInfoObject#totalRange\n* @type {number}\n*/\n(''); // keeps doclets above in JS file\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport A from '../Animation/AnimationUtilities.js';\nconst { animObject } = A;\nimport AxisDefaults from './AxisDefaults.js';\nconst { xAxis, yAxis } = AxisDefaults;\nimport Color from '../Color/Color.js';\nimport D from '../Defaults.js';\nconst { defaultOptions } = D;\nimport F from '../Foundation.js';\nconst { registerEventOptions } = F;\nimport H from '../Globals.js';\nconst { deg2rad } = H;\nimport Tick from './Tick.js';\nimport U from '../Utilities.js';\nconst { arrayMax, arrayMin, clamp, correctFloat, defined, destroyObjectProperties, erase, error, extend, fireEvent, getClosestDistance, insertItem, isArray, isNumber, isString, merge, normalizeTickInterval, objectEach, pick, relativeLength, removeEvent, splat, syncTimeout } = U;\nconst getNormalizedTickInterval = (axis, tickInterval) => normalizeTickInterval(tickInterval, void 0, void 0, pick(axis.options.allowDecimals, \n// If the tick interval is greater than 0.5, avoid decimals, as\n// linear axes are often used to render discrete values (#3363). If\n// a tick amount is set, allow decimals by default, as it increases\n// the chances for a good fit.\ntickInterval < 0.5 || axis.tickAmount !== void 0), !!axis.tickAmount);\nextend(defaultOptions, { xAxis, yAxis: merge(xAxis, yAxis) });\n/* *\n *\n * Class\n *\n * */\n/**\n * Create a new axis object. Called internally when instantiating a new chart or\n * adding axes by {@link Highcharts.Chart#addAxis}.\n *\n * A chart can have from 0 axes (pie chart) to multiples. In a normal, single\n * series cartesian chart, there is one X axis and one Y axis.\n *\n * The X axis or axes are referenced by {@link Highcharts.Chart.xAxis}, which is\n * an array of Axis objects. If there is only one axis, it can be referenced\n * through `chart.xAxis[0]`, and multiple axes have increasing indices. The same\n * pattern goes for Y axes.\n *\n * If you need to get the axes from a series object, use the `series.xAxis` and\n * `series.yAxis` properties. These are not arrays, as one series can only be\n * associated to one X and one Y axis.\n *\n * A third way to reference the axis programmatically is by `id`. Add an `id` in\n * the axis configuration options, and get the axis by\n * {@link Highcharts.Chart#get}.\n *\n * Configuration options for the axes are given in options.xAxis and\n * options.yAxis.\n *\n * @class\n * @name Highcharts.Axis\n *\n * @param {Highcharts.Chart} chart\n * The Chart instance to apply the axis on.\n *\n * @param {Highcharts.AxisOptions} userOptions\n * Axis options\n */\nclass Axis {\n /* *\n *\n * Constructors\n *\n * */\n constructor(chart, userOptions, coll) {\n this.init(chart, userOptions, coll);\n }\n /* *\n *\n * Functions\n *\n * */\n /**\n * Overrideable function to initialize the axis.\n *\n * @see {@link Axis}\n *\n * @function Highcharts.Axis#init\n *\n * @param {Highcharts.Chart} chart\n * The Chart instance to apply the axis on.\n *\n * @param {AxisOptions} userOptions\n * Axis options.\n *\n * @emits Highcharts.Axis#event:afterInit\n * @emits Highcharts.Axis#event:init\n */\n init(chart, userOptions, coll = this.coll) {\n const isXAxis = coll === 'xAxis', axis = this, horiz = axis.isZAxis || (chart.inverted ? !isXAxis : isXAxis);\n /**\n * The Chart that the axis belongs to.\n *\n * @name Highcharts.Axis#chart\n * @type {Highcharts.Chart}\n */\n axis.chart = chart;\n /**\n * Whether the axis is horizontal.\n *\n * @name Highcharts.Axis#horiz\n * @type {boolean|undefined}\n */\n axis.horiz = horiz;\n /**\n * Whether the axis is the x-axis.\n *\n * @name Highcharts.Axis#isXAxis\n * @type {boolean|undefined}\n */\n axis.isXAxis = isXAxis;\n /**\n * The collection where the axis belongs, for example `xAxis`, `yAxis`\n * or `colorAxis`. Corresponds to properties on Chart, for example\n * {@link Chart.xAxis}.\n *\n * @name Highcharts.Axis#coll\n * @type {string}\n */\n axis.coll = coll;\n fireEvent(this, 'init', { userOptions: userOptions });\n // Needed in setOptions\n axis.opposite = pick(userOptions.opposite, axis.opposite);\n /**\n * The side on which the axis is rendered. 0 is top, 1 is right, 2\n * is bottom and 3 is left.\n *\n * @name Highcharts.Axis#side\n * @type {number}\n */\n axis.side = pick(userOptions.side, axis.side, (horiz ?\n (axis.opposite ? 0 : 2) : // top : bottom\n (axis.opposite ? 1 : 3)) // right : left\n );\n /**\n * Current options for the axis after merge of defaults and user's\n * options.\n *\n * @name Highcharts.Axis#options\n * @type {Highcharts.AxisOptions}\n */\n axis.setOptions(userOptions);\n const options = this.options, labelsOptions = options.labels, type = options.type;\n /**\n * User's options for this axis without defaults.\n *\n * @name Highcharts.Axis#userOptions\n * @type {Highcharts.AxisOptions}\n */\n axis.userOptions = userOptions;\n axis.minPixelPadding = 0;\n /**\n * Whether the axis is reversed. Based on the `axis.reversed`,\n * option, but inverted charts have reversed xAxis by default.\n *\n * @name Highcharts.Axis#reversed\n * @type {boolean}\n */\n axis.reversed = pick(options.reversed, axis.reversed);\n axis.visible = options.visible;\n axis.zoomEnabled = options.zoomEnabled;\n // Initial categories\n axis.hasNames = type === 'category' || options.categories === true;\n /**\n * If categories are present for the axis, names are used instead of\n * numbers for that axis.\n *\n * Since Highcharts 3.0, categories can also be extracted by giving each\n * point a name and setting axis type to `category`. However, if you\n * have multiple series, best practice remains defining the `categories`\n * array.\n *\n * @see [xAxis.categories](/highcharts/xAxis.categories)\n *\n * @name Highcharts.Axis#categories\n * @type {Array}\n * @readonly\n */\n axis.categories = (isArray(options.categories) && options.categories) ||\n (axis.hasNames ? [] : void 0);\n if (!axis.names) { // Preserve on update (#3830)\n axis.names = [];\n axis.names.keys = {};\n }\n // Placeholder for plotlines and plotbands groups\n axis.plotLinesAndBandsGroups = {};\n // Shorthand types\n axis.positiveValuesOnly = !!axis.logarithmic;\n // Flag, if axis is linked to another axis\n axis.isLinked = defined(options.linkedTo);\n /**\n * List of major ticks mapped by position on axis.\n *\n * @see {@link Highcharts.Tick}\n *\n * @name Highcharts.Axis#ticks\n * @type {Highcharts.Dictionary}\n */\n axis.ticks = {};\n axis.labelEdge = [];\n /**\n * List of minor ticks mapped by position on the axis.\n *\n * @see {@link Highcharts.Tick}\n *\n * @name Highcharts.Axis#minorTicks\n * @type {Highcharts.Dictionary}\n */\n axis.minorTicks = {};\n // List of plotLines/Bands\n axis.plotLinesAndBands = [];\n // Alternate bands\n axis.alternateBands = {};\n /**\n * The length of the axis in terms of pixels.\n *\n * @name Highcharts.Axis#len\n * @type {number}\n */\n axis.len = 0;\n axis.minRange = axis.userMinRange = options.minRange || options.maxZoom;\n axis.range = options.range;\n axis.offset = options.offset || 0;\n /**\n * The maximum value of the axis. In a logarithmic axis, this is the\n * logarithm of the real value, and the real value can be obtained from\n * {@link Axis#getExtremes}.\n *\n * @name Highcharts.Axis#max\n * @type {number|undefined}\n */\n axis.max = void 0;\n /**\n * The minimum value of the axis. In a logarithmic axis, this is the\n * logarithm of the real value, and the real value can be obtained from\n * {@link Axis#getExtremes}.\n *\n * @name Highcharts.Axis#min\n * @type {number|undefined}\n */\n axis.min = void 0;\n /**\n * The processed crosshair options.\n *\n * @name Highcharts.Axis#crosshair\n * @type {boolean|Highcharts.AxisCrosshairOptions}\n */\n const crosshair = pick(options.crosshair, splat(chart.options.tooltip.crosshairs)[isXAxis ? 0 : 1]);\n axis.crosshair = crosshair === true ? {} : crosshair;\n // Register. Don't add it again on Axis.update().\n if (chart.axes.indexOf(axis) === -1) { //\n if (isXAxis) { // #2713\n chart.axes.splice(chart.xAxis.length, 0, axis);\n }\n else {\n chart.axes.push(axis);\n }\n insertItem(this, chart[this.coll]);\n }\n chart.orderItems(axis.coll);\n /**\n * All series associated to the axis.\n *\n * @name Highcharts.Axis#series\n * @type {Array}\n */\n axis.series = axis.series || []; // Populated by Series\n // Reversed axis\n if (chart.inverted &&\n !axis.isZAxis &&\n isXAxis &&\n !defined(axis.reversed)) {\n axis.reversed = true;\n }\n axis.labelRotation = isNumber(labelsOptions.rotation) ?\n labelsOptions.rotation :\n void 0;\n // Register event listeners\n registerEventOptions(axis, options);\n fireEvent(this, 'afterInit');\n }\n /**\n * Merge and set options.\n *\n * @private\n * @function Highcharts.Axis#setOptions\n *\n * @param {Highcharts.AxisOptions} userOptions\n * Axis options.\n *\n * @emits Highcharts.Axis#event:afterSetOptions\n */\n setOptions(userOptions) {\n const sideSpecific = this.horiz ?\n // Top and bottom axis defaults\n {\n labels: {\n autoRotation: [-45]\n },\n margin: 15\n } :\n // Left and right axis, title rotated 90 or 270 degrees\n // respectively\n {\n title: {\n rotation: 90 * this.side\n }\n };\n this.options = merge(sideSpecific, defaultOptions[this.coll], userOptions);\n fireEvent(this, 'afterSetOptions', { userOptions });\n }\n /**\n * The default label formatter. The context is a special config object for\n * the label. In apps, use the\n * [labels.formatter](https://api.highcharts.com/highcharts/xAxis.labels.formatter)\n * instead, except when a modification is needed.\n *\n * @function Highcharts.Axis#defaultLabelFormatter\n *\n * @param {Highcharts.AxisLabelsFormatterContextObject} this\n * Formatter context of axis label.\n *\n * @param {Highcharts.AxisLabelsFormatterContextObject} [ctx]\n * Formatter context of axis label.\n *\n * @return {string}\n * The formatted label content.\n */\n defaultLabelFormatter() {\n const axis = this.axis, chart = this.chart, { numberFormatter } = chart, value = isNumber(this.value) ? this.value : NaN, time = axis.chart.time, categories = axis.categories, dateTimeLabelFormat = this.dateTimeLabelFormat, lang = defaultOptions.lang, numericSymbols = lang.numericSymbols, numSymMagnitude = lang.numericSymbolMagnitude || 1000, \n // Make sure the same symbol is added for all labels on a linear\n // axis\n numericSymbolDetector = axis.logarithmic ?\n Math.abs(value) :\n axis.tickInterval;\n let i = numericSymbols && numericSymbols.length, multi, ret;\n if (categories) {\n ret = `${this.value}`;\n }\n else if (dateTimeLabelFormat) { // Datetime axis\n ret = time.dateFormat(dateTimeLabelFormat, value);\n }\n else if (i &&\n numericSymbols &&\n numericSymbolDetector >= 1000) {\n // Decide whether we should add a numeric symbol like k (thousands)\n // or M (millions). If we are to enable this in tooltip or other\n // places as well, we can move this logic to the numberFormatter and\n // enable it by a parameter.\n while (i-- && typeof ret === 'undefined') {\n multi = Math.pow(numSymMagnitude, i + 1);\n if (\n // Only accept a numeric symbol when the distance is more\n // than a full unit. So for example if the symbol is k, we\n // don't accept numbers like 0.5k.\n numericSymbolDetector >= multi &&\n // Accept one decimal before the symbol. Accepts 0.5k but\n // not 0.25k. How does this work with the previous?\n (value * 10) % multi === 0 &&\n numericSymbols[i] !== null &&\n value !== 0) { // #5480\n ret = numberFormatter(value / multi, -1) + numericSymbols[i];\n }\n }\n }\n if (typeof ret === 'undefined') {\n if (Math.abs(value) >= 10000) { // Add thousands separators\n ret = numberFormatter(value, -1);\n }\n else { // Small numbers\n ret = numberFormatter(value, -1, void 0, ''); // #2466\n }\n }\n return ret;\n }\n /**\n * Get the minimum and maximum for the series of each axis. The function\n * analyzes the axis series and updates `this.dataMin` and `this.dataMax`.\n *\n * @private\n * @function Highcharts.Axis#getSeriesExtremes\n *\n * @emits Highcharts.Axis#event:afterGetSeriesExtremes\n * @emits Highcharts.Axis#event:getSeriesExtremes\n */\n getSeriesExtremes() {\n const axis = this;\n let xExtremes;\n fireEvent(this, 'getSeriesExtremes', null, function () {\n axis.hasVisibleSeries = false;\n // Reset properties in case we're redrawing (#3353)\n axis.dataMin = axis.dataMax = axis.threshold = void 0;\n axis.softThreshold = !axis.isXAxis;\n // Loop through this axis' series\n axis.series.forEach((series) => {\n if (series.reserveSpace()) {\n const seriesOptions = series.options;\n let xData, threshold = seriesOptions.threshold, seriesDataMin, seriesDataMax;\n axis.hasVisibleSeries = true;\n // Validate threshold in logarithmic axes\n if (axis.positiveValuesOnly && (threshold || 0) <= 0) {\n threshold = void 0;\n }\n // Get dataMin and dataMax for X axes\n if (axis.isXAxis) {\n xData = series.xData;\n if (xData && xData.length) {\n xData = axis.logarithmic ?\n xData.filter((x) => x > 0) :\n xData;\n xExtremes = series.getXExtremes(xData);\n // If xData contains values which is not numbers,\n // then filter them out. To prevent performance hit,\n // we only do this after we have already found\n // seriesDataMin because in most cases all data is\n // valid. #5234.\n seriesDataMin = xExtremes.min;\n seriesDataMax = xExtremes.max;\n if (!isNumber(seriesDataMin) &&\n // #5010:\n !(seriesDataMin instanceof Date)) {\n xData = xData.filter(isNumber);\n xExtremes = series.getXExtremes(xData);\n // Do it again with valid data\n seriesDataMin = xExtremes.min;\n seriesDataMax = xExtremes.max;\n }\n if (xData.length) {\n axis.dataMin = Math.min(pick(axis.dataMin, seriesDataMin), seriesDataMin);\n axis.dataMax = Math.max(pick(axis.dataMax, seriesDataMax), seriesDataMax);\n }\n }\n // Get dataMin and dataMax for Y axes, as well as handle\n // stacking and processed data\n }\n else {\n // Get this particular series extremes\n const dataExtremes = series.applyExtremes();\n // Get the dataMin and dataMax so far. If percentage is\n // used, the min and max are always 0 and 100. If\n // seriesDataMin and seriesDataMax is null, then series\n // doesn't have active y data, we continue with nulls\n if (isNumber(dataExtremes.dataMin)) {\n seriesDataMin = dataExtremes.dataMin;\n axis.dataMin = Math.min(pick(axis.dataMin, seriesDataMin), seriesDataMin);\n }\n if (isNumber(dataExtremes.dataMax)) {\n seriesDataMax = dataExtremes.dataMax;\n axis.dataMax = Math.max(pick(axis.dataMax, seriesDataMax), seriesDataMax);\n }\n // Adjust to threshold\n if (defined(threshold)) {\n axis.threshold = threshold;\n }\n // If any series has a hard threshold, it takes\n // precedence\n if (!seriesOptions.softThreshold ||\n axis.positiveValuesOnly) {\n axis.softThreshold = false;\n }\n }\n }\n });\n });\n fireEvent(this, 'afterGetSeriesExtremes');\n }\n /**\n * Translate from axis value to pixel position on the chart, or back. Use\n * the `toPixels` and `toValue` functions in applications.\n *\n * @private\n * @function Highcharts.Axis#translate\n */\n translate(val, backwards, cvsCoord, old, handleLog, pointPlacement) {\n const axis = (this.linkedParent || this), // #1417\n localMin = (old && axis.old ? axis.old.min : axis.min);\n if (!isNumber(localMin)) {\n return NaN;\n }\n const minPixelPadding = axis.minPixelPadding, doPostTranslate = (axis.isOrdinal ||\n axis.brokenAxis?.hasBreaks ||\n (axis.logarithmic && handleLog)) && axis.lin2val;\n let sign = 1, cvsOffset = 0, localA = old && axis.old ? axis.old.transA : axis.transA, returnValue = 0;\n if (!localA) {\n localA = axis.transA;\n }\n // In vertical axes, the canvas coordinates start from 0 at the top like\n // in SVG.\n if (cvsCoord) {\n sign *= -1; // Canvas coordinates inverts the value\n cvsOffset = axis.len;\n }\n // Handle reversed axis\n if (axis.reversed) {\n sign *= -1;\n cvsOffset -= sign * (axis.sector || axis.len);\n }\n // From pixels to value\n if (backwards) { // Reverse translation\n val = val * sign + cvsOffset;\n val -= minPixelPadding;\n // From chart pixel to value:\n returnValue = val / localA + localMin;\n if (doPostTranslate) { // Log, ordinal and broken axis\n returnValue = axis.lin2val(returnValue);\n }\n // From value to pixels\n }\n else {\n if (doPostTranslate) { // Log, ordinal and broken axis\n val = axis.val2lin(val);\n }\n const value = sign * (val - localMin) * localA;\n returnValue = (!axis.isRadial ? correctFloat(value) : value) +\n cvsOffset +\n (sign * minPixelPadding) +\n (isNumber(pointPlacement) ? localA * pointPlacement : 0);\n }\n return returnValue;\n }\n /**\n * Translate a value in terms of axis units into pixels within the chart.\n *\n * @function Highcharts.Axis#toPixels\n *\n * @param {number} value\n * A value in terms of axis units.\n *\n * @param {boolean} paneCoordinates\n * Whether to return the pixel coordinate relative to the chart or just the\n * axis/pane itself.\n *\n * @return {number}\n * Pixel position of the value on the chart or axis.\n */\n toPixels(value, paneCoordinates) {\n return this.translate(value, false, !this.horiz, void 0, true) +\n (paneCoordinates ? 0 : this.pos);\n }\n /**\n * Translate a pixel position along the axis to a value in terms of axis\n * units.\n *\n * @function Highcharts.Axis#toValue\n *\n * @param {number} pixel\n * The pixel value coordinate.\n *\n * @param {boolean} [paneCoordinates=false]\n * Whether the input pixel is relative to the chart or just the axis/pane\n * itself.\n *\n * @return {number}\n * The axis value.\n */\n toValue(pixel, paneCoordinates) {\n return this.translate(pixel - (paneCoordinates ? 0 : this.pos), true, !this.horiz, void 0, true);\n }\n /**\n * Create the path for a plot line that goes from the given value on\n * this axis, across the plot to the opposite side. Also used internally for\n * grid lines and crosshairs.\n *\n * @function Highcharts.Axis#getPlotLinePath\n *\n * @param {Highcharts.AxisPlotLinePathOptionsObject} options\n * Options for the path.\n *\n * @return {Highcharts.SVGPathArray|null}\n * The SVG path definition for the plot line.\n */\n getPlotLinePath(options) {\n const axis = this, chart = axis.chart, axisLeft = axis.left, axisTop = axis.top, old = options.old, value = options.value, lineWidth = options.lineWidth, cHeight = (old && chart.oldChartHeight) || chart.chartHeight, cWidth = (old && chart.oldChartWidth) || chart.chartWidth, transB = axis.transB;\n let translatedValue = options.translatedValue, force = options.force, x1, y1, x2, y2, skip;\n // eslint-disable-next-line valid-jsdoc\n /**\n * Check if x is between a and b. If not, either move to a/b\n * or skip, depending on the force parameter.\n * @private\n */\n function between(x, a, b) {\n if (force !== 'pass' && (x < a || x > b)) {\n if (force) {\n x = clamp(x, a, b);\n }\n else {\n skip = true;\n }\n }\n return x;\n }\n const evt = {\n value,\n lineWidth,\n old,\n force,\n acrossPanes: options.acrossPanes,\n translatedValue\n };\n fireEvent(this, 'getPlotLinePath', evt, function (e) {\n translatedValue = pick(translatedValue, axis.translate(value, void 0, void 0, old));\n // Keep the translated value within sane bounds, and avoid Infinity\n // to fail the isNumber test (#7709).\n translatedValue = clamp(translatedValue, -1e5, 1e5);\n x1 = x2 = Math.round(translatedValue + transB);\n y1 = y2 = Math.round(cHeight - translatedValue - transB);\n if (!isNumber(translatedValue)) { // No min or max\n skip = true;\n force = false; // #7175, don't force it when path is invalid\n }\n else if (axis.horiz) {\n y1 = axisTop;\n y2 = cHeight - axis.bottom + (chart.scrollablePixelsY || 0);\n x1 = x2 = between(x1, axisLeft, axisLeft + axis.width);\n }\n else {\n x1 = axisLeft;\n x2 = cWidth - axis.right + (chart.scrollablePixelsX || 0);\n y1 = y2 = between(y1, axisTop, axisTop + axis.height);\n }\n e.path = skip && !force ?\n void 0 :\n chart.renderer.crispLine([['M', x1, y1], ['L', x2, y2]], lineWidth || 1);\n });\n return evt.path;\n }\n /**\n * Internal function to get the tick positions of a linear axis to round\n * values like whole tens or every five.\n *\n * @function Highcharts.Axis#getLinearTickPositions\n *\n * @param {number} tickInterval\n * The normalized tick interval.\n *\n * @param {number} min\n * Axis minimum.\n *\n * @param {number} max\n * Axis maximum.\n *\n * @return {Array}\n * An array of axis values where ticks should be placed.\n */\n getLinearTickPositions(tickInterval, min, max) {\n const roundedMin = correctFloat(Math.floor(min / tickInterval) * tickInterval), roundedMax = correctFloat(Math.ceil(max / tickInterval) * tickInterval), tickPositions = [];\n let pos, lastPos, precision;\n // When the precision is higher than what we filter out in\n // correctFloat, skip it (#6183).\n if (correctFloat(roundedMin + tickInterval) === roundedMin) {\n precision = 20;\n }\n // For single points, add a tick regardless of the relative position\n // (#2662, #6274)\n if (this.single) {\n return [min];\n }\n // Populate the intermediate values\n pos = roundedMin;\n while (pos <= roundedMax) {\n // Place the tick on the rounded value\n tickPositions.push(pos);\n // Always add the raw tickInterval, not the corrected one.\n pos = correctFloat(pos + tickInterval, precision);\n // If the interval is not big enough in the current min - max range\n // to actually increase the loop variable, we need to break out to\n // prevent endless loop. Issue #619\n if (pos === lastPos) {\n break;\n }\n // Record the last value\n lastPos = pos;\n }\n return tickPositions;\n }\n /**\n * Resolve the new minorTicks/minorTickInterval options into the legacy\n * loosely typed minorTickInterval option.\n *\n * @function Highcharts.Axis#getMinorTickInterval\n *\n * @return {number|\"auto\"|null}\n * Legacy option\n */\n getMinorTickInterval() {\n const { minorTicks, minorTickInterval } = this.options;\n if (minorTicks === true) {\n return pick(minorTickInterval, 'auto');\n }\n if (minorTicks === false) {\n return;\n }\n return minorTickInterval;\n }\n /**\n * Internal function to return the minor tick positions. For logarithmic\n * axes, the same logic as for major ticks is reused.\n *\n * @function Highcharts.Axis#getMinorTickPositions\n *\n * @return {Array}\n * An array of axis values where ticks should be placed.\n */\n getMinorTickPositions() {\n const axis = this, options = axis.options, tickPositions = axis.tickPositions, minorTickInterval = axis.minorTickInterval, pointRangePadding = axis.pointRangePadding || 0, min = (axis.min || 0) - pointRangePadding, // #1498\n max = (axis.max || 0) + pointRangePadding, // #1498\n range = max - min;\n let minorTickPositions = [], pos;\n // If minor ticks get too dense, they are hard to read, and may cause\n // long running script. So we don't draw them.\n if (range && range / minorTickInterval < axis.len / 3) { // #3875\n const logarithmic = axis.logarithmic;\n if (logarithmic) {\n // For each interval in the major ticks, compute the minor ticks\n // separately.\n this.paddedTicks.forEach(function (_pos, i, paddedTicks) {\n if (i) {\n minorTickPositions.push.apply(minorTickPositions, logarithmic.getLogTickPositions(minorTickInterval, paddedTicks[i - 1], paddedTicks[i], true));\n }\n });\n }\n else if (axis.dateTime &&\n this.getMinorTickInterval() === 'auto') { // #1314\n minorTickPositions = minorTickPositions.concat(axis.getTimeTicks(axis.dateTime.normalizeTimeTickInterval(minorTickInterval), min, max, options.startOfWeek));\n }\n else {\n for (pos = min + (tickPositions[0] - min) % minorTickInterval; pos <= max; pos += minorTickInterval) {\n // Very, very, tight grid lines (#5771)\n if (pos === minorTickPositions[0]) {\n break;\n }\n minorTickPositions.push(pos);\n }\n }\n }\n if (minorTickPositions.length !== 0) {\n axis.trimTicks(minorTickPositions); // #3652 #3743 #1498 #6330\n }\n return minorTickPositions;\n }\n /**\n * Adjust the min and max for the minimum range. Keep in mind that the\n * series data is not yet processed, so we don't have information on data\n * cropping and grouping, or updated `axis.pointRange` or\n * `series.pointRange`. The data can't be processed until we have finally\n * established min and max.\n *\n * @private\n * @function Highcharts.Axis#adjustForMinRange\n */\n adjustForMinRange() {\n const axis = this, options = axis.options, logarithmic = axis.logarithmic;\n let { max, min, minRange } = axis, zoomOffset, spaceAvailable, closestDataRange, minArgs, maxArgs;\n // Set the automatic minimum range based on the closest point distance\n if (axis.isXAxis &&\n typeof minRange === 'undefined' &&\n !logarithmic) {\n if (defined(options.min) ||\n defined(options.max) ||\n defined(options.floor) ||\n defined(options.ceiling)) {\n // Setting it to null, as opposed to undefined, signals we don't\n // run this block again as per the condition above.\n minRange = null;\n }\n else {\n // Find the closest distance between raw data points, as opposed\n // to closestPointRange that applies to processed points\n // (cropped and grouped)\n closestDataRange = getClosestDistance(axis.series.map((s) => \n // If xIncrement, we only need to measure the two first\n // points to get the distance. Saves processing time.\n (s.xIncrement ? s.xData?.slice(0, 2) : s.xData) || [])) || 0;\n minRange = Math.min(closestDataRange * 5, axis.dataMax - axis.dataMin);\n }\n }\n // If minRange is exceeded, adjust\n if (isNumber(max) &&\n isNumber(min) &&\n isNumber(minRange) &&\n max - min < minRange) {\n spaceAvailable =\n axis.dataMax - axis.dataMin >=\n minRange;\n zoomOffset = (minRange - max + min) / 2;\n // If min and max options have been set, don't go beyond it\n minArgs = [\n min - zoomOffset,\n pick(options.min, min - zoomOffset)\n ];\n // If space is available, stay within the data range\n if (spaceAvailable) {\n minArgs[2] = logarithmic ?\n logarithmic.log2lin(axis.dataMin) :\n axis.dataMin;\n }\n min = arrayMax(minArgs);\n maxArgs = [\n min + minRange,\n pick(options.max, min + minRange)\n ];\n // If space is available, stay within the data range\n if (spaceAvailable) {\n maxArgs[2] = logarithmic ?\n logarithmic.log2lin(axis.dataMax) :\n axis.dataMax;\n }\n max = arrayMin(maxArgs);\n // Now if the max is adjusted, adjust the min back\n if (max - min < minRange) {\n minArgs[0] = max - minRange;\n minArgs[1] = pick(options.min, max - minRange);\n min = arrayMax(minArgs);\n }\n }\n // Record modified extremes\n axis.minRange = minRange;\n axis.min = min;\n axis.max = max;\n }\n /**\n * Find the closestPointRange across all series, including the single data\n * series.\n *\n * @private\n * @function Highcharts.Axis#getClosest\n */\n getClosest() {\n let closestSingleDistance, closestDistance;\n if (this.categories) {\n closestDistance = 1;\n }\n else {\n const singleXs = [];\n this.series.forEach(function (series) {\n const seriesClosest = series.closestPointRange;\n if (series.xData?.length === 1) {\n singleXs.push(series.xData[0]);\n }\n else if (!series.noSharedTooltip &&\n defined(seriesClosest) &&\n series.reserveSpace()) {\n closestDistance = defined(closestDistance) ?\n Math.min(closestDistance, seriesClosest) :\n seriesClosest;\n }\n });\n if (singleXs.length) {\n singleXs.sort((a, b) => a - b);\n closestSingleDistance = getClosestDistance([singleXs]);\n }\n }\n if (closestSingleDistance && closestDistance) {\n return Math.min(closestSingleDistance, closestDistance);\n }\n return closestSingleDistance || closestDistance;\n }\n /**\n * When a point name is given and no x, search for the name in the existing\n * categories, or if categories aren't provided, search names or create a\n * new category (#2522).\n *\n * @private\n * @function Highcharts.Axis#nameToX\n *\n * @param {Highcharts.Point} point\n * The point to inspect.\n *\n * @return {number}\n * The X value that the point is given.\n */\n nameToX(point) {\n const explicitCategories = isArray(this.options.categories), names = explicitCategories ? this.categories : this.names;\n let nameX = point.options.x, x;\n point.series.requireSorting = false;\n if (!defined(nameX)) {\n nameX = this.options.uniqueNames && names ?\n (explicitCategories ?\n names.indexOf(point.name) :\n pick(names.keys[point.name], -1)) :\n point.series.autoIncrement();\n }\n if (nameX === -1) { // Not found in current categories\n if (!explicitCategories && names) {\n x = names.length;\n }\n }\n else {\n x = nameX;\n }\n // Write the last point's name to the names array\n if (typeof x !== 'undefined') {\n this.names[x] = point.name;\n // Backwards mapping is much faster than array searching (#7725)\n this.names.keys[point.name] = x;\n }\n else if (point.x) {\n x = point.x; // #17438\n }\n return x;\n }\n /**\n * When changes have been done to series data, update the axis.names.\n *\n * @private\n * @function Highcharts.Axis#updateNames\n */\n updateNames() {\n const axis = this, names = this.names, i = names.length;\n if (i > 0) {\n Object.keys(names.keys).forEach(function (key) {\n delete (names.keys)[key];\n });\n names.length = 0;\n this.minRange = this.userMinRange; // Reset\n (this.series || []).forEach((series) => {\n // Reset incrementer (#5928)\n series.xIncrement = null;\n // When adding a series, points are not yet generated\n if (!series.points || series.isDirtyData) {\n // When we're updating the series with data that is longer\n // than it was, and cropThreshold is passed, we need to make\n // sure that the axis.max is increased _before_ running the\n // premature processData. Otherwise this early iteration of\n // processData will crop the points to axis.max, and the\n // names array will be too short (#5857).\n axis.max = Math.max(axis.max, series.xData.length - 1);\n series.processData();\n series.generatePoints();\n }\n series.data.forEach(function (point, i) {\n let x;\n if (point?.options &&\n typeof point.name !== 'undefined' // #9562\n ) {\n x = axis.nameToX(point);\n if (typeof x !== 'undefined' && x !== point.x) {\n point.x = x;\n series.xData[i] = x;\n }\n }\n });\n });\n }\n }\n /**\n * Update translation information.\n *\n * @private\n * @function Highcharts.Axis#setAxisTranslation\n *\n * @emits Highcharts.Axis#event:afterSetAxisTranslation\n */\n setAxisTranslation() {\n const axis = this, range = axis.max - axis.min, linkedParent = axis.linkedParent, hasCategories = !!axis.categories, isXAxis = axis.isXAxis;\n let pointRange = axis.axisPointRange || 0, closestPointRange, minPointOffset = 0, pointRangePadding = 0, ordinalCorrection, transA = axis.transA;\n // Adjust translation for padding. Y axis with categories need to go\n // through the same (#1784).\n if (isXAxis || hasCategories || pointRange) {\n // Get the closest points\n closestPointRange = axis.getClosest();\n if (linkedParent) {\n minPointOffset = linkedParent.minPointOffset;\n pointRangePadding = linkedParent.pointRangePadding;\n }\n else {\n axis.series.forEach(function (series) {\n const seriesPointRange = hasCategories ?\n 1 :\n (isXAxis ?\n pick(series.options.pointRange, closestPointRange, 0) :\n (axis.axisPointRange || 0)), // #2806\n pointPlacement = series.options.pointPlacement;\n pointRange = Math.max(pointRange, seriesPointRange);\n if (!axis.single || hasCategories) {\n // TODO: series should internally set x- and y-\n // pointPlacement to simplify this logic.\n const isPointPlacementAxis = series.is('xrange') ?\n !isXAxis :\n isXAxis;\n // The `minPointOffset` is the value padding to the left\n // of the axis in order to make room for points with a\n // pointRange, typically columns. When the\n // pointPlacement option is 'between' or 'on', this\n // padding does not apply.\n minPointOffset = Math.max(minPointOffset, isPointPlacementAxis && isString(pointPlacement) ?\n 0 :\n seriesPointRange / 2);\n // Determine the total padding needed to the length of\n // the axis to make room for the pointRange. If the\n // series' pointPlacement is 'on', no padding is added.\n pointRangePadding = Math.max(pointRangePadding, isPointPlacementAxis && pointPlacement === 'on' ?\n 0 :\n seriesPointRange);\n }\n });\n }\n // Record minPointOffset and pointRangePadding\n ordinalCorrection = (axis.ordinal && axis.ordinal.slope && closestPointRange) ?\n axis.ordinal.slope / closestPointRange :\n 1; // #988, #1853\n axis.minPointOffset = minPointOffset =\n minPointOffset * ordinalCorrection;\n axis.pointRangePadding =\n pointRangePadding = pointRangePadding * ordinalCorrection;\n // The `pointRange` is the width reserved for each point, like in a\n // column chart\n axis.pointRange = Math.min(pointRange, axis.single && hasCategories ? 1 : range);\n // The `closestPointRange` is the closest distance between points.\n // In columns it is mostly equal to pointRange, but in lines\n // pointRange is 0 while closestPointRange is some other value\n if (isXAxis && closestPointRange) {\n axis.closestPointRange = closestPointRange;\n }\n }\n // Secondary values\n axis.translationSlope = axis.transA = transA =\n axis.staticScale ||\n axis.len / ((range + pointRangePadding) || 1);\n // Translation addend\n axis.transB = axis.horiz ? axis.left : axis.bottom;\n axis.minPixelPadding = transA * minPointOffset;\n fireEvent(this, 'afterSetAxisTranslation');\n }\n /**\n * @private\n * @function Highcharts.Axis#minFromRange\n */\n minFromRange() {\n const { max, min } = this;\n return isNumber(max) && isNumber(min) && max - min || void 0;\n }\n /**\n * Set the tick positions to round values and optionally extend the extremes\n * to the nearest tick.\n *\n * @private\n * @function Highcharts.Axis#setTickInterval\n *\n * @param {boolean} secondPass\n * TO-DO: parameter description\n *\n * @emits Highcharts.Axis#event:foundExtremes\n */\n setTickInterval(secondPass) {\n const axis = this, { categories, chart, dataMax, dataMin, dateTime, isXAxis, logarithmic, options, softThreshold } = axis, threshold = isNumber(axis.threshold) ? axis.threshold : void 0, minRange = axis.minRange || 0, { ceiling, floor, linkedTo, softMax, softMin } = options, linkedParent = isNumber(linkedTo) && chart[axis.coll]?.[linkedTo], tickPixelIntervalOption = options.tickPixelInterval;\n let maxPadding = options.maxPadding, minPadding = options.minPadding, range = 0, linkedParentExtremes, \n // Only non-negative tickInterval is valid, #12961\n tickIntervalOption = isNumber(options.tickInterval) && options.tickInterval >= 0 ?\n options.tickInterval : void 0, thresholdMin, thresholdMax, hardMin, hardMax;\n if (!dateTime && !categories && !linkedParent) {\n this.getTickAmount();\n }\n // Min or max set either by zooming/setExtremes or initial options\n hardMin = pick(axis.userMin, options.min);\n hardMax = pick(axis.userMax, options.max);\n // Linked axis gets the extremes from the parent axis\n if (linkedParent) {\n axis.linkedParent = linkedParent;\n linkedParentExtremes = linkedParent.getExtremes();\n axis.min = pick(linkedParentExtremes.min, linkedParentExtremes.dataMin);\n axis.max = pick(linkedParentExtremes.max, linkedParentExtremes.dataMax);\n if (options.type !== linkedParent.options.type) {\n // Can't link axes of different type\n error(11, true, chart);\n }\n // Initial min and max from the extreme data values\n }\n else {\n // Adjust to hard threshold\n if (softThreshold &&\n defined(threshold) &&\n isNumber(dataMax) &&\n isNumber(dataMin)) {\n if (dataMin >= threshold) {\n thresholdMin = threshold;\n minPadding = 0;\n }\n else if (dataMax <= threshold) {\n thresholdMax = threshold;\n maxPadding = 0;\n }\n }\n axis.min = pick(hardMin, thresholdMin, dataMin);\n axis.max = pick(hardMax, thresholdMax, dataMax);\n }\n if (isNumber(axis.max) && isNumber(axis.min)) {\n if (logarithmic) {\n if (axis.positiveValuesOnly &&\n !secondPass &&\n Math.min(axis.min, pick(dataMin, axis.min)) <= 0) { // #978\n // Can't plot negative values on log axis\n error(10, true, chart);\n }\n // The correctFloat cures #934, float errors on full tens. But\n // it was too aggressive for #4360 because of conversion back to\n // lin, therefore use precision 15.\n axis.min = correctFloat(logarithmic.log2lin(axis.min), 16);\n axis.max = correctFloat(logarithmic.log2lin(axis.max), 16);\n }\n // Handle zoomed range\n if (axis.range && isNumber(dataMin)) {\n // #618, #6773:\n axis.userMin = axis.min = hardMin = Math.max(dataMin, axis.minFromRange() || 0);\n axis.userMax = hardMax = axis.max;\n axis.range = void 0; // Don't use it when running setExtremes\n }\n }\n // Hook for Highcharts Stock Scroller and bubble axis padding\n fireEvent(axis, 'foundExtremes');\n // Adjust min and max for the minimum range\n axis.adjustForMinRange();\n if (isNumber(axis.min) && isNumber(axis.max)) {\n // Handle options for floor, ceiling, softMin and softMax (#6359)\n if (!isNumber(axis.userMin) &&\n isNumber(softMin) &&\n softMin < axis.min) {\n axis.min = hardMin = softMin; // #6894\n }\n if (!isNumber(axis.userMax) &&\n isNumber(softMax) &&\n softMax > axis.max) {\n axis.max = hardMax = softMax; // #6894\n }\n // Pad the values to get clear of the chart's edges. To avoid\n // tickInterval taking the padding into account, we do this after\n // computing tick interval (#1337).\n if (!categories &&\n !axis.axisPointRange &&\n !axis.stacking?.usePercentage &&\n !linkedParent) {\n range = axis.max - axis.min;\n if (range) {\n if (!defined(hardMin) && minPadding) {\n axis.min -= range * minPadding;\n }\n if (!defined(hardMax) && maxPadding) {\n axis.max += range * maxPadding;\n }\n }\n }\n if (!isNumber(axis.userMin) && isNumber(floor)) {\n axis.min = Math.max(axis.min, floor);\n }\n if (!isNumber(axis.userMax) && isNumber(ceiling)) {\n axis.max = Math.min(axis.max, ceiling);\n }\n // When the threshold is soft, adjust the extreme value only if the\n // data extreme and the padded extreme land on either side of the\n // threshold. For example, a series of [0, 1, 2, 3] would make the\n // yAxis add a tick for -1 because of the default `minPadding` and\n // `startOnTick` options. This is prevented by the `softThreshold`\n // option.\n if (softThreshold &&\n isNumber(dataMin) &&\n isNumber(dataMax)) {\n const numThreshold = threshold || 0;\n if (!defined(hardMin) &&\n axis.min < numThreshold &&\n dataMin >= numThreshold) {\n axis.min = options.minRange ?\n Math.min(numThreshold, axis.max - minRange) :\n numThreshold;\n }\n else if (!defined(hardMax) &&\n axis.max > numThreshold &&\n dataMax <= numThreshold) {\n axis.max = options.minRange ?\n Math.max(numThreshold, axis.min + minRange) :\n numThreshold;\n }\n }\n // If min is bigger than highest, or if max less than lowest value,\n // the chart should not render points. (#14417)\n if (!chart.polar && axis.min > axis.max) {\n if (defined(options.min)) {\n axis.max = axis.min;\n }\n else if (defined(options.max)) {\n axis.min = axis.max;\n }\n }\n range = axis.max - axis.min;\n }\n // Get tickInterval\n if (axis.min === axis.max ||\n !isNumber(axis.min) ||\n !isNumber(axis.max)) {\n axis.tickInterval = 1;\n }\n else if (linkedParent &&\n !tickIntervalOption &&\n tickPixelIntervalOption === linkedParent.options.tickPixelInterval) {\n axis.tickInterval = tickIntervalOption = linkedParent.tickInterval;\n }\n else {\n axis.tickInterval = pick(tickIntervalOption, this.tickAmount ?\n range / Math.max(this.tickAmount - 1, 1) :\n void 0, \n // For categorized axis, 1 is default, for linear axis use\n // tickPix\n categories ?\n 1 :\n // Don't let it be more than the data range\n range * tickPixelIntervalOption /\n Math.max(axis.len, tickPixelIntervalOption));\n }\n // Now we're finished detecting min and max, crop and group series data.\n // This is in turn needed in order to find tick positions in ordinal\n // axes.\n if (isXAxis && !secondPass) {\n const hasExtremesChanged = axis.min !== axis.old?.min ||\n axis.max !== axis.old?.max;\n // First process all series assigned to that axis.\n axis.series.forEach(function (series) {\n // Allows filtering out points outside the plot area.\n series.forceCrop = series.forceCropping?.();\n series.processData(hasExtremesChanged);\n });\n // Then apply grouping if needed. The hasExtremesChanged helps to\n // decide if the data grouping should be skipped in the further\n // calculations #16319.\n fireEvent(this, 'postProcessData', { hasExtremesChanged });\n }\n // Set the translation factor used in translate function\n axis.setAxisTranslation();\n // Hook for ordinal axes and radial axes\n fireEvent(this, 'initialAxisTranslation');\n // In column-like charts, don't cramp in more ticks than there are\n // points (#1943, #4184)\n if (axis.pointRange && !tickIntervalOption) {\n axis.tickInterval = Math.max(axis.pointRange, axis.tickInterval);\n }\n // Before normalizing the tick interval, handle minimum tick interval.\n // This applies only if tickInterval is not defined.\n const minTickInterval = pick(options.minTickInterval, \n // In datetime axes, don't go below the data interval, except when\n // there are scatter-like series involved (#13369).\n dateTime &&\n !axis.series.some((s) => s.noSharedTooltip) ?\n axis.closestPointRange : 0);\n if (!tickIntervalOption && axis.tickInterval < minTickInterval) {\n axis.tickInterval = minTickInterval;\n }\n // For linear axes, normalize the interval\n if (!dateTime && !logarithmic && !tickIntervalOption) {\n axis.tickInterval = getNormalizedTickInterval(axis, axis.tickInterval);\n }\n // Prevent ticks from getting so close that we can't draw the labels\n if (!this.tickAmount) {\n axis.tickInterval = axis.unsquish();\n }\n this.setTickPositions();\n }\n /**\n * Now we have computed the normalized tickInterval, get the tick positions.\n *\n * @private\n * @function Highcharts.Axis#setTickPositions\n *\n * @emits Highcharts.Axis#event:afterSetTickPositions\n */\n setTickPositions() {\n const axis = this, options = this.options, tickPositionsOption = options.tickPositions, tickPositioner = options.tickPositioner, minorTickIntervalOption = this.getMinorTickInterval(), allowEndOnTick = !this.isPanning, startOnTick = allowEndOnTick && options.startOnTick, endOnTick = allowEndOnTick && options.endOnTick;\n let tickPositions = [], tickPositionerResult;\n // Set the tickmarkOffset\n this.tickmarkOffset = (this.categories &&\n options.tickmarkPlacement === 'between' &&\n this.tickInterval === 1) ? 0.5 : 0; // #3202\n // Get minorTickInterval\n this.minorTickInterval =\n minorTickIntervalOption === 'auto' &&\n this.tickInterval ?\n this.tickInterval / options.minorTicksPerMajor :\n minorTickIntervalOption;\n // When there is only one point, or all points have the same value on\n // this axis, then min and max are equal and tickPositions.length is 0\n // or 1. In this case, add some padding in order to center the point,\n // but leave it with one tick. #1337.\n this.single =\n this.min === this.max &&\n defined(this.min) &&\n !this.tickAmount &&\n (\n // Data is on integer (#6563)\n this.min % 1 === 0 ||\n // Between integers and decimals are not allowed (#6274)\n options.allowDecimals !== false);\n /**\n * Contains the current positions that are laid out on the axis. The\n * positions are numbers in terms of axis values. In a category axis\n * they are integers, in a datetime axis they are also integers, but\n * designating milliseconds.\n *\n * This property is read only - for modifying the tick positions, use\n * the `tickPositioner` callback or [axis.tickPositions(\n * https://api.highcharts.com/highcharts/xAxis.tickPositions) option\n * instead.\n *\n * @name Highcharts.Axis#tickPositions\n * @type {Highcharts.AxisTickPositionsArray|undefined}\n */\n if (tickPositionsOption) {\n // Find the tick positions. Work on a copy (#1565)\n tickPositions = tickPositionsOption.slice();\n }\n else if (isNumber(this.min) && isNumber(this.max)) {\n // Too many ticks (#6405). Create a friendly warning and provide two\n // ticks so at least we can show the data series.\n if (!axis.ordinal?.positions &&\n ((this.max - this.min) /\n this.tickInterval >\n Math.max(2 * this.len, 200))) {\n tickPositions = [this.min, this.max];\n error(19, false, this.chart);\n }\n else if (axis.dateTime) {\n tickPositions = axis.getTimeTicks(axis.dateTime.normalizeTimeTickInterval(this.tickInterval, options.units), this.min, this.max, options.startOfWeek, axis.ordinal?.positions, this.closestPointRange, true);\n }\n else if (axis.logarithmic) {\n tickPositions = axis.logarithmic.getLogTickPositions(this.tickInterval, this.min, this.max);\n }\n else {\n const startingTickInterval = this.tickInterval;\n let adjustedTickInterval = startingTickInterval;\n while (adjustedTickInterval <= startingTickInterval * 2) {\n tickPositions = this.getLinearTickPositions(this.tickInterval, this.min, this.max);\n // If there are more tick positions than the set tickAmount,\n // increase the tickInterval and continue until it fits.\n // (#17100)\n if (this.tickAmount &&\n tickPositions.length > this.tickAmount) {\n this.tickInterval = getNormalizedTickInterval(this, adjustedTickInterval *= 1.1);\n }\n else {\n break;\n }\n }\n }\n // Too dense ticks, keep only the first and last (#4477)\n if (tickPositions.length > this.len) {\n tickPositions = [\n tickPositions[0],\n tickPositions[tickPositions.length - 1]\n ];\n // Reduce doubled value (#7339)\n if (tickPositions[0] === tickPositions[1]) {\n tickPositions.length = 1;\n }\n }\n // Run the tick positioner callback, that allows modifying auto tick\n // positions.\n if (tickPositioner) {\n // Make it available to the positioner\n this.tickPositions = tickPositions;\n tickPositionerResult = tickPositioner.apply(axis, [this.min, this.max]);\n if (tickPositionerResult) {\n tickPositions = tickPositionerResult;\n }\n }\n }\n this.tickPositions = tickPositions;\n // Reset min/max or remove extremes based on start/end on tick\n this.paddedTicks = tickPositions.slice(0); // Used for logarithmic minor\n this.trimTicks(tickPositions, startOnTick, endOnTick);\n if (!this.isLinked && isNumber(this.min) && isNumber(this.max)) {\n // Substract half a unit (#2619, #2846, #2515, #3390), but not in\n // case of multiple ticks (#6897)\n if (this.single &&\n tickPositions.length < 2 &&\n !this.categories &&\n !this.series.some((s) => (s.is('heatmap') && s.options.pointPlacement === 'between'))) {\n this.min -= 0.5;\n this.max += 0.5;\n }\n if (!tickPositionsOption && !tickPositionerResult) {\n this.adjustTickAmount();\n }\n }\n fireEvent(this, 'afterSetTickPositions');\n }\n /**\n * Handle startOnTick and endOnTick by either adapting to padding min/max or\n * rounded min/max. Also handle single data points.\n *\n * @private\n * @function Highcharts.Axis#trimTicks\n *\n * @param {Array} tickPositions\n * TO-DO: parameter description\n *\n * @param {boolean} [startOnTick]\n * TO-DO: parameter description\n *\n * @param {boolean} [endOnTick]\n * TO-DO: parameter description\n */\n trimTicks(tickPositions, startOnTick, endOnTick) {\n const roundedMin = tickPositions[0], roundedMax = tickPositions[tickPositions.length - 1], minPointOffset = (!this.isOrdinal && this.minPointOffset) || 0; // (#12716)\n fireEvent(this, 'trimTicks');\n if (!this.isLinked) {\n if (startOnTick && roundedMin !== -Infinity) { // #6502\n this.min = roundedMin;\n }\n else {\n while (this.min - minPointOffset > tickPositions[0]) {\n tickPositions.shift();\n }\n }\n if (endOnTick) {\n this.max = roundedMax;\n }\n else {\n while (this.max + minPointOffset <\n tickPositions[tickPositions.length - 1]) {\n tickPositions.pop();\n }\n }\n // If no tick are left, set one tick in the middle (#3195)\n if (tickPositions.length === 0 &&\n defined(roundedMin) &&\n !this.options.tickPositions) {\n tickPositions.push((roundedMax + roundedMin) / 2);\n }\n }\n }\n /**\n * Check if there are multiple axes in the same pane.\n *\n * @private\n * @function Highcharts.Axis#alignToOthers\n *\n * @return {boolean|undefined}\n * True if there are other axes.\n */\n alignToOthers() {\n const axis = this, chart = axis.chart, alignedAxes = [this], options = axis.options, chartOptions = chart.options.chart, alignThresholds = (this.coll === 'yAxis' &&\n chartOptions.alignThresholds), thresholdAlignments = [];\n let hasOther;\n axis.thresholdAlignment = void 0;\n if ((\n // Only if alignTicks or alignThresholds is true\n (chartOptions.alignTicks !== false && options.alignTicks) ||\n alignThresholds) &&\n // Disabled when startOnTick or endOnTick are false (#7604)\n options.startOnTick !== false &&\n options.endOnTick !== false &&\n // Don't try to align ticks on a log axis, they are not evenly\n // spaced (#6021)\n !axis.logarithmic) {\n // Get a key identifying which pane the axis belongs to\n const getKey = (axis) => {\n const { horiz, options } = axis;\n return [\n horiz ? options.left : options.top,\n options.width,\n options.height,\n options.pane\n ].join(',');\n };\n const thisKey = getKey(this);\n chart[this.coll].forEach(function (otherAxis) {\n const { series } = otherAxis;\n if (\n // #4442\n series.length &&\n series.some((s) => s.visible) &&\n otherAxis !== axis &&\n getKey(otherAxis) === thisKey) {\n hasOther = true; // #4201\n alignedAxes.push(otherAxis);\n }\n });\n }\n if (hasOther && alignThresholds) {\n // Handle alignThresholds. The `thresholdAlignments` array keeps\n // records of where each axis in the group wants its threshold, from\n // 0 which is on `axis.min`, to 1 which is on `axis.max`.\n alignedAxes.forEach((otherAxis) => {\n const threshAlign = otherAxis.getThresholdAlignment(axis);\n if (isNumber(threshAlign)) {\n thresholdAlignments.push(threshAlign);\n }\n });\n // For each of the axes in the group, record the average\n // `thresholdAlignment`.\n const thresholdAlignment = thresholdAlignments.length > 1 ?\n thresholdAlignments.reduce((sum, n) => (sum += n), 0) / thresholdAlignments.length :\n void 0;\n alignedAxes.forEach((axis) => {\n axis.thresholdAlignment = thresholdAlignment;\n });\n }\n return hasOther;\n }\n /**\n * Where the axis wants its threshold, from 0 which is on `axis.min`, to 1 which\n * is on `axis.max`.\n *\n * @private\n * @function Highcharts.Axis#getThresholdAlignment\n */\n getThresholdAlignment(callerAxis) {\n if (!isNumber(this.dataMin) ||\n (this !== callerAxis &&\n this.series.some((s) => (s.isDirty || s.isDirtyData)))) {\n this.getSeriesExtremes();\n }\n if (isNumber(this.threshold)) {\n let thresholdAlignment = clamp(((this.threshold - (this.dataMin || 0)) /\n ((this.dataMax || 0) - (this.dataMin || 0))), 0, 1);\n if (this.options.reversed) {\n thresholdAlignment = 1 - thresholdAlignment;\n }\n return thresholdAlignment;\n }\n }\n /**\n * Find the max ticks of either the x and y axis collection, and record it\n * in `this.tickAmount`.\n *\n * @private\n * @function Highcharts.Axis#getTickAmount\n */\n getTickAmount() {\n const axis = this, options = this.options, tickPixelInterval = options.tickPixelInterval;\n let tickAmount = options.tickAmount;\n if (!defined(options.tickInterval) &&\n !tickAmount &&\n this.len < tickPixelInterval &&\n !this.isRadial &&\n !axis.logarithmic &&\n options.startOnTick &&\n options.endOnTick) {\n tickAmount = 2;\n }\n if (!tickAmount && this.alignToOthers()) {\n // Add 1 because 4 tick intervals require 5 ticks (including first\n // and last)\n tickAmount = Math.ceil(this.len / tickPixelInterval) + 1;\n }\n // For tick amounts of 2 and 3, compute five ticks and remove the\n // intermediate ones. This prevents the axis from adding ticks that are\n // too far away from the data extremes.\n if (tickAmount < 4) {\n this.finalTickAmt = tickAmount;\n tickAmount = 5;\n }\n this.tickAmount = tickAmount;\n }\n /**\n * When using multiple axes, adjust the number of ticks to match the highest\n * number of ticks in that group.\n *\n * @private\n * @function Highcharts.Axis#adjustTickAmount\n */\n adjustTickAmount() {\n const axis = this, { finalTickAmt, max, min, options, tickPositions, tickAmount, thresholdAlignment } = axis, currentTickAmount = tickPositions?.length, threshold = pick(axis.threshold, axis.softThreshold ? 0 : null);\n let len, i, tickInterval = axis.tickInterval, thresholdTickIndex;\n const \n // Extend the tickPositions by appending a position\n append = () => tickPositions.push(correctFloat(tickPositions[tickPositions.length - 1] +\n tickInterval)), \n // Extend the tickPositions by prepending a position\n prepend = () => tickPositions.unshift(correctFloat(tickPositions[0] - tickInterval));\n // If `thresholdAlignment` is a number, it means the `alignThresholds`\n // option is true. The `thresholdAlignment` is a scalar value between 0\n // and 1 for where the threshold should be relative to `axis.min` and\n // `axis.max`. Now that we know the tick amount, convert this to the\n // tick index. Unless `thresholdAlignment` is exactly 0 or 1, avoid the\n // first or last tick because that would lead to series being clipped.\n if (isNumber(thresholdAlignment)) {\n thresholdTickIndex = thresholdAlignment < 0.5 ?\n Math.ceil(thresholdAlignment * (tickAmount - 1)) :\n Math.floor(thresholdAlignment * (tickAmount - 1));\n if (options.reversed) {\n thresholdTickIndex = tickAmount - 1 - thresholdTickIndex;\n }\n }\n if (axis.hasData() && isNumber(min) && isNumber(max)) { // #14769\n // Adjust extremes and translation to the modified tick positions\n const adjustExtremes = () => {\n axis.transA *= (currentTickAmount - 1) / (tickAmount - 1);\n // Do not crop when ticks are not extremes (#9841)\n axis.min = options.startOnTick ?\n tickPositions[0] :\n Math.min(min, tickPositions[0]);\n axis.max = options.endOnTick ?\n tickPositions[tickPositions.length - 1] :\n Math.max(max, tickPositions[tickPositions.length - 1]);\n };\n // When the axis is subject to the alignThresholds option. Use\n // axis.threshold because the local threshold includes the\n // `softThreshold`.\n if (isNumber(thresholdTickIndex) && isNumber(axis.threshold)) {\n // Throw away the previously computed tickPositions and start\n // from scratch with only the threshold itself, then add ticks\n // below the threshold first, then fill up above the threshold.\n // If we are not able to fill up to axis.max, double the\n // tickInterval and run again.\n while (tickPositions[thresholdTickIndex] !== threshold ||\n tickPositions.length !== tickAmount ||\n tickPositions[0] > min ||\n tickPositions[tickPositions.length - 1] < max) {\n tickPositions.length = 0;\n tickPositions.push(axis.threshold);\n while (tickPositions.length < tickAmount) {\n if (\n // Start by prepending positions until the threshold\n // is at the required index...\n tickPositions[thresholdTickIndex] === void 0 ||\n tickPositions[thresholdTickIndex] > axis.threshold) {\n prepend();\n }\n else {\n // ... then append positions until we have the\n // required length\n append();\n }\n }\n // Safety vent\n if (tickInterval > axis.tickInterval * 8) {\n break;\n }\n tickInterval *= 2;\n }\n adjustExtremes();\n }\n else if (currentTickAmount < tickAmount) {\n while (tickPositions.length < tickAmount) {\n // Extend evenly for both sides unless we're on the\n // threshold (#3965)\n if (tickPositions.length % 2 || min === threshold) {\n append();\n }\n else {\n prepend();\n }\n }\n adjustExtremes();\n }\n // The finalTickAmt property is set in getTickAmount\n if (defined(finalTickAmt)) {\n i = len = tickPositions.length;\n while (i--) {\n if (\n // Remove every other tick\n (finalTickAmt === 3 && i % 2 === 1) ||\n // Remove all but first and last\n (finalTickAmt <= 2 && i > 0 && i < len - 1)) {\n tickPositions.splice(i, 1);\n }\n }\n axis.finalTickAmt = void 0;\n }\n }\n }\n /**\n * Set the scale based on data min and max, user set min and max or options.\n *\n * @private\n * @function Highcharts.Axis#setScale\n *\n * @emits Highcharts.Axis#event:afterSetScale\n */\n setScale() {\n const axis = this, { coll, stacking } = axis;\n let isDirtyData = false, isXAxisDirty = false;\n axis.series.forEach((series) => {\n isDirtyData = isDirtyData || series.isDirtyData || series.isDirty;\n // When x axis is dirty, we need new data extremes for y as\n // well:\n isXAxisDirty = (isXAxisDirty ||\n (series.xAxis && series.xAxis.isDirty) ||\n false);\n });\n // Set the new axisLength\n axis.setAxisSize();\n const isDirtyAxisLength = axis.len !== (axis.old && axis.old.len);\n // Do we really need to go through all this?\n if (isDirtyAxisLength ||\n isDirtyData ||\n isXAxisDirty ||\n axis.isLinked ||\n axis.forceRedraw ||\n axis.userMin !== (axis.old && axis.old.userMin) ||\n axis.userMax !== (axis.old && axis.old.userMax) ||\n axis.alignToOthers()) {\n if (stacking && coll === 'yAxis') {\n stacking.buildStacks();\n }\n axis.forceRedraw = false;\n // #18066 delete minRange property to ensure that it will be\n // calculated again after dirty data in series\n if (!axis.userMinRange) {\n axis.minRange = void 0;\n }\n // Get data extremes if needed\n axis.getSeriesExtremes();\n // Get fixed positions based on tickInterval\n axis.setTickInterval();\n if (stacking && coll === 'xAxis') {\n stacking.buildStacks();\n }\n // Mark as dirty if it is not already set to dirty and extremes have\n // changed. #595.\n if (!axis.isDirty) {\n axis.isDirty =\n isDirtyAxisLength ||\n axis.min !== axis.old?.min ||\n axis.max !== axis.old?.max;\n }\n }\n else if (stacking) {\n stacking.cleanStacks();\n }\n // Recalculate all extremes object when the data has changed. It is\n // required when vertical panning is enabled.\n if (isDirtyData) {\n delete axis.allExtremes;\n }\n fireEvent(this, 'afterSetScale');\n }\n /**\n * Set the minimum and maximum of the axes after render time. If the\n * `startOnTick` and `endOnTick` options are true, the minimum and maximum\n * values are rounded off to the nearest tick. To prevent this, these\n * options can be set to false before calling setExtremes. Also, setExtremes\n * will not allow a range lower than the `minRange` option, which by default\n * is the range of five points.\n *\n * @sample highcharts/members/axis-setextremes/\n * Set extremes from a button\n * @sample highcharts/members/axis-setextremes-datetime/\n * Set extremes on a datetime axis\n * @sample highcharts/members/axis-setextremes-off-ticks/\n * Set extremes off ticks\n * @sample stock/members/axis-setextremes/\n * Set extremes in Highcharts Stock\n *\n * @function Highcharts.Axis#setExtremes\n *\n * @param {number} [newMin]\n * The new minimum value.\n *\n * @param {number} [newMax]\n * The new maximum value.\n *\n * @param {boolean} [redraw=true]\n * Whether to redraw the chart or wait for an explicit call to\n * {@link Highcharts.Chart#redraw}\n *\n * @param {boolean|Partial} [animation=true]\n * Enable or modify animations.\n *\n * @param {*} [eventArguments]\n * Arguments to be accessed in event handler.\n *\n * @emits Highcharts.Axis#event:setExtremes\n */\n setExtremes(min, max, redraw = true, animation, eventArguments) {\n this.series.forEach((serie) => {\n delete serie.kdTree;\n });\n // Extend the arguments with min and max\n eventArguments = extend(eventArguments, { min, max });\n // Fire the event\n fireEvent(this, 'setExtremes', eventArguments, (e) => {\n this.userMin = e.min;\n this.userMax = e.max;\n this.eventArgs = e;\n if (redraw) {\n this.chart.redraw(animation);\n }\n });\n }\n /**\n * Update the axis metrics.\n *\n * @private\n * @function Highcharts.Axis#setAxisSize\n */\n setAxisSize() {\n const chart = this.chart, options = this.options, \n // [top, right, bottom, left]\n offsets = options.offsets || [0, 0, 0, 0], horiz = this.horiz, \n // Check for percentage based input values. Rounding fixes problems\n // with column overflow and plot line filtering (#4898, #4899)\n width = this.width = Math.round(relativeLength(pick(options.width, chart.plotWidth - offsets[3] + offsets[1]), chart.plotWidth)), height = this.height = Math.round(relativeLength(pick(options.height, chart.plotHeight - offsets[0] + offsets[2]), chart.plotHeight)), top = this.top = Math.round(relativeLength(pick(options.top, chart.plotTop + offsets[0]), chart.plotHeight, chart.plotTop)), left = this.left = Math.round(relativeLength(pick(options.left, chart.plotLeft + offsets[3]), chart.plotWidth, chart.plotLeft));\n // Expose basic values to use in Series object and navigator\n this.bottom = chart.chartHeight - height - top;\n this.right = chart.chartWidth - width - left;\n // Direction agnostic properties\n this.len = Math.max(horiz ? width : height, 0); // Math.max fixes #905\n /**\n * The position of the axis in terms of pixels, compared to the chart\n * edge. In a horizontal axis it is the same as `chart.plotLeft` unless\n * the axis is explicitly positioned, and in a default vertical axis it\n * is the same as `chart.plotTop`.\n *\n * @name Highcharts.Axis#pos\n * @type {number}\n */\n this.pos = horiz ? left : top; // Distance from SVG origin\n }\n /**\n * Get the current extremes for the axis.\n *\n * @sample highcharts/members/axis-getextremes/\n * Report extremes by click on a button\n *\n * @function Highcharts.Axis#getExtremes\n *\n * @return {Highcharts.ExtremesObject}\n * An object containing extremes information.\n */\n getExtremes() {\n const axis = this, log = axis.logarithmic;\n return {\n min: log ?\n correctFloat(log.lin2log(axis.min)) :\n axis.min,\n max: log ?\n correctFloat(log.lin2log(axis.max)) :\n axis.max,\n dataMin: axis.dataMin,\n dataMax: axis.dataMax,\n userMin: axis.userMin,\n userMax: axis.userMax\n };\n }\n /**\n * Get the zero plane either based on zero or on the min or max value.\n * Used in bar and area plots.\n *\n * @function Highcharts.Axis#getThreshold\n *\n * @param {number} threshold\n * The threshold in axis values.\n *\n * @return {number}\n * The translated threshold position in terms of pixels, and corrected to\n * stay within the axis bounds.\n */\n getThreshold(threshold) {\n const axis = this, log = axis.logarithmic, realMin = log ? log.lin2log(axis.min) : axis.min, realMax = log ? log.lin2log(axis.max) : axis.max;\n if (threshold === null || threshold === -Infinity) {\n threshold = realMin;\n }\n else if (threshold === Infinity) {\n threshold = realMax;\n }\n else if (realMin > threshold) {\n threshold = realMin;\n }\n else if (realMax < threshold) {\n threshold = realMax;\n }\n return axis.translate(threshold, 0, 1, 0, 1);\n }\n /**\n * Compute auto alignment for the axis label based on which side the axis is\n * on and the given rotation for the label.\n *\n * @private\n * @function Highcharts.Axis#autoLabelAlign\n *\n * @param {number} rotation\n * The rotation in degrees as set by either the `rotation` or `autoRotation`\n * options.\n *\n * @return {Highcharts.AlignValue}\n * Can be `\"center\"`, `\"left\"` or `\"right\"`.\n */\n autoLabelAlign(rotation) {\n const angle = (pick(rotation, 0) - (this.side * 90) + 720) % 360, evt = { align: 'center' };\n fireEvent(this, 'autoLabelAlign', evt, function (e) {\n if (angle > 15 && angle < 165) {\n e.align = 'right';\n }\n else if (angle > 195 && angle < 345) {\n e.align = 'left';\n }\n });\n return evt.align;\n }\n /**\n * Get the tick length and width for the axis based on axis options.\n *\n * @private\n * @function Highcharts.Axis#tickSize\n *\n * @param {string} [prefix]\n * 'tick' or 'minorTick'\n *\n * @return {Array|undefined}\n * An array of tickLength and tickWidth\n */\n tickSize(prefix) {\n const options = this.options, tickWidth = pick(options[prefix === 'tick' ? 'tickWidth' : 'minorTickWidth'], \n // Default to 1 on linear and datetime X axes\n prefix === 'tick' && this.isXAxis && !this.categories ? 1 : 0);\n let tickLength = options[prefix === 'tick' ? 'tickLength' : 'minorTickLength'], tickSize;\n if (tickWidth && tickLength) {\n // Negate the length\n if (options[prefix + 'Position'] === 'inside') {\n tickLength = -tickLength;\n }\n tickSize = [tickLength, tickWidth];\n }\n const e = { tickSize };\n fireEvent(this, 'afterTickSize', e);\n return e.tickSize;\n }\n /**\n * Return the size of the labels.\n *\n * @private\n * @function Highcharts.Axis#labelMetrics\n */\n labelMetrics() {\n const renderer = this.chart.renderer, ticks = this.ticks, tick = ticks[Object.keys(ticks)[0]] || {};\n return this.chart.renderer.fontMetrics(tick.label ||\n tick.movedLabel ||\n renderer.box);\n }\n /**\n * Prevent the ticks from getting so close we can't draw the labels. On a\n * horizontal axis, this is handled by rotating the labels, removing ticks\n * and adding ellipsis. On a vertical axis remove ticks and add ellipsis.\n *\n * @private\n * @function Highcharts.Axis#unsquish\n */\n unsquish() {\n const labelOptions = this.options.labels, horiz = this.horiz, tickInterval = this.tickInterval, slotSize = this.len / (((this.categories ? 1 : 0) +\n this.max -\n this.min) /\n tickInterval), rotationOption = labelOptions.rotation, \n // We don't know the actual rendered line height at this point, but\n // it defaults to 0.75em\n lineHeight = this.labelMetrics().h, range = Math.max(this.max - this.min, 0), \n // Return the multiple of tickInterval that is needed to avoid\n // collision\n getStep = function (spaceNeeded) {\n let step = spaceNeeded / (slotSize || 1);\n step = step > 1 ? Math.ceil(step) : 1;\n // Guard for very small or negative angles (#9835)\n if (step * tickInterval > range &&\n spaceNeeded !== Infinity &&\n slotSize !== Infinity &&\n range) {\n step = Math.ceil(range / tickInterval);\n }\n return correctFloat(step * tickInterval);\n };\n let newTickInterval = tickInterval, rotation, bestScore = Number.MAX_VALUE, autoRotation;\n if (horiz) {\n if (!labelOptions.staggerLines) {\n if (isNumber(rotationOption)) {\n autoRotation = [rotationOption];\n }\n else if (slotSize < labelOptions.autoRotationLimit) {\n autoRotation = labelOptions.autoRotation;\n }\n }\n if (autoRotation) {\n let step, score;\n // Loop over the given autoRotation options, and determine which\n // gives the best score. The best score is that with the lowest\n // number of steps and a rotation closest to horizontal.\n for (const rot of autoRotation) {\n if (rot === rotationOption ||\n (rot && rot >= -90 && rot <= 90)) { // #3891\n step = getStep(Math.abs(lineHeight / Math.sin(deg2rad * rot)));\n score = step + Math.abs(rot / 360);\n if (score < bestScore) {\n bestScore = score;\n rotation = rot;\n newTickInterval = step;\n }\n }\n }\n }\n }\n else { // #4411\n newTickInterval = getStep(lineHeight * 0.75);\n }\n this.autoRotation = autoRotation;\n this.labelRotation = pick(rotation, isNumber(rotationOption) ? rotationOption : 0);\n return labelOptions.step ? tickInterval : newTickInterval;\n }\n /**\n * Get the general slot width for labels/categories on this axis. This may\n * change between the pre-render (from Axis.getOffset) and the final tick\n * rendering and placement.\n *\n * @private\n * @function Highcharts.Axis#getSlotWidth\n *\n * @param {Highcharts.Tick} [tick] Optionally, calculate the slot width\n * basing on tick label. It is used in highcharts-3d module, where the slots\n * has different widths depending on perspective angles.\n *\n * @return {number}\n * The pixel width allocated to each axis label.\n */\n getSlotWidth(tick) {\n // #5086, #1580, #1931\n const chart = this.chart, horiz = this.horiz, labelOptions = this.options.labels, slotCount = Math.max(this.tickPositions.length - (this.categories ? 0 : 1), 1), marginLeft = chart.margin[3];\n // Used by grid axis\n if (tick && isNumber(tick.slotWidth)) { // #13221, can be 0\n return tick.slotWidth;\n }\n if (horiz && labelOptions.step < 2) {\n if (labelOptions.rotation) { // #4415\n return 0;\n }\n return ((this.staggerLines || 1) * this.len) / slotCount;\n }\n if (!horiz) {\n // #7028\n const cssWidth = labelOptions.style.width;\n if (cssWidth !== void 0) {\n return parseInt(String(cssWidth), 10);\n }\n if (marginLeft) {\n return marginLeft - chart.spacing[3];\n }\n }\n // Last resort, a fraction of the available size\n return chart.chartWidth * 0.33;\n }\n /**\n * Render the axis labels and determine whether ellipsis or rotation need to\n * be applied.\n *\n * @private\n * @function Highcharts.Axis#renderUnsquish\n */\n renderUnsquish() {\n const chart = this.chart, renderer = chart.renderer, tickPositions = this.tickPositions, ticks = this.ticks, labelOptions = this.options.labels, labelStyleOptions = labelOptions.style, horiz = this.horiz, slotWidth = this.getSlotWidth(), innerWidth = Math.max(1, Math.round(slotWidth - 2 * labelOptions.padding)), attr = {}, labelMetrics = this.labelMetrics(), textOverflowOption = labelStyleOptions.textOverflow;\n let commonWidth, commonTextOverflow, maxLabelLength = 0, label, i, pos;\n // Set rotation option unless it is \"auto\", like in gauges\n if (!isString(labelOptions.rotation)) {\n // #4443\n attr.rotation = labelOptions.rotation || 0;\n }\n // Get the longest label length\n tickPositions.forEach(function (tickPosition) {\n const tick = ticks[tickPosition];\n // Replace label - sorting animation\n if (tick.movedLabel) {\n tick.replaceMovedLabel();\n }\n if (tick &&\n tick.label &&\n tick.label.textPxLength > maxLabelLength) {\n maxLabelLength = tick.label.textPxLength;\n }\n });\n this.maxLabelLength = maxLabelLength;\n // Handle auto rotation on horizontal axis\n if (this.autoRotation) {\n // Apply rotation only if the label is too wide for the slot, and\n // the label is wider than its height.\n if (maxLabelLength > innerWidth &&\n maxLabelLength > labelMetrics.h) {\n attr.rotation = this.labelRotation;\n }\n else {\n this.labelRotation = 0;\n }\n // Handle word-wrap or ellipsis on vertical axis\n }\n else if (slotWidth) {\n // For word-wrap or ellipsis\n commonWidth = innerWidth;\n if (!textOverflowOption) {\n commonTextOverflow = 'clip';\n // On vertical axis, only allow word wrap if there is room\n // for more lines.\n i = tickPositions.length;\n while (!horiz && i--) {\n pos = tickPositions[i];\n label = ticks[pos].label;\n if (label) {\n // Reset ellipsis in order to get the correct\n // bounding box (#4070)\n if (label.styles.textOverflow === 'ellipsis') {\n label.css({ textOverflow: 'clip' });\n // Set the correct width in order to read\n // the bounding box height (#4678, #5034)\n }\n else if (label.textPxLength > slotWidth) {\n label.css({ width: slotWidth + 'px' });\n }\n if (label.getBBox().height > (this.len / tickPositions.length -\n (labelMetrics.h - labelMetrics.f))) {\n label.specificTextOverflow = 'ellipsis';\n }\n }\n }\n }\n }\n // Add ellipsis if the label length is significantly longer than ideal\n if (attr.rotation) {\n commonWidth = (maxLabelLength > chart.chartHeight * 0.5 ?\n chart.chartHeight * 0.33 :\n maxLabelLength);\n if (!textOverflowOption) {\n commonTextOverflow = 'ellipsis';\n }\n }\n // Set the explicit or automatic label alignment\n this.labelAlign = labelOptions.align ||\n this.autoLabelAlign(this.labelRotation);\n if (this.labelAlign) {\n attr.align = this.labelAlign;\n }\n // Apply general and specific CSS\n tickPositions.forEach(function (pos) {\n const tick = ticks[pos], label = tick && tick.label, widthOption = labelStyleOptions.width, css = {};\n if (label) {\n // This needs to go before the CSS in old IE (#4502)\n label.attr(attr);\n if (tick.shortenLabel) {\n tick.shortenLabel();\n }\n else if (commonWidth &&\n !widthOption &&\n // Setting width in this case messes with the bounding box\n // (#7975)\n labelStyleOptions.whiteSpace !== 'nowrap' &&\n (\n // Speed optimizing, #7656\n commonWidth < label.textPxLength ||\n // Resetting CSS, #4928\n label.element.tagName === 'SPAN')) {\n css.width = commonWidth + 'px';\n if (!textOverflowOption) {\n css.textOverflow = (label.specificTextOverflow ||\n commonTextOverflow);\n }\n label.css(css);\n // Reset previously shortened label (#8210)\n }\n else if (label.styles.width && !css.width && !widthOption) {\n label.css({ width: null });\n }\n delete label.specificTextOverflow;\n tick.rotation = attr.rotation;\n }\n }, this);\n // Note: Why is this not part of getLabelPosition?\n this.tickRotCorr = renderer.rotCorr(labelMetrics.b, this.labelRotation || 0, this.side !== 0);\n }\n /**\n * Return true if the axis has associated data.\n *\n * @function Highcharts.Axis#hasData\n *\n * @return {boolean}\n * True if the axis has associated visible series and those series have\n * either valid data points or explicit `min` and `max` settings.\n */\n hasData() {\n return this.series.some(function (s) {\n return s.hasData();\n }) ||\n (this.options.showEmpty &&\n defined(this.min) &&\n defined(this.max));\n }\n /**\n * Adds the title defined in axis.options.title.\n *\n * @function Highcharts.Axis#addTitle\n *\n * @param {boolean} [display]\n * Whether or not to display the title.\n */\n addTitle(display) {\n const axis = this, renderer = axis.chart.renderer, horiz = axis.horiz, opposite = axis.opposite, options = axis.options, axisTitleOptions = options.title, styledMode = axis.chart.styledMode;\n let textAlign;\n if (!axis.axisTitle) {\n textAlign = axisTitleOptions.textAlign;\n if (!textAlign) {\n textAlign = (horiz ? {\n low: 'left',\n middle: 'center',\n high: 'right'\n } : {\n low: opposite ? 'right' : 'left',\n middle: 'center',\n high: opposite ? 'left' : 'right'\n })[axisTitleOptions.align];\n }\n axis.axisTitle = renderer\n .text(axisTitleOptions.text || '', 0, 0, axisTitleOptions.useHTML)\n .attr({\n zIndex: 7,\n rotation: axisTitleOptions.rotation || 0,\n align: textAlign\n })\n .addClass('highcharts-axis-title');\n // #7814, don't mutate style option\n if (!styledMode) {\n axis.axisTitle.css(merge(axisTitleOptions.style));\n }\n axis.axisTitle.add(axis.axisGroup);\n axis.axisTitle.isNew = true;\n }\n // Max width defaults to the length of the axis\n if (!styledMode &&\n !axisTitleOptions.style.width &&\n !axis.isRadial) {\n axis.axisTitle.css({\n width: axis.len + 'px'\n });\n }\n // hide or show the title depending on whether showEmpty is set\n axis.axisTitle[display ? 'show' : 'hide'](display);\n }\n /**\n * Generates a tick for initial positioning.\n *\n * @private\n * @function Highcharts.Axis#generateTick\n *\n * @param {number} pos\n * The tick position in axis values.\n *\n * @param {number} [i]\n * The index of the tick in {@link Axis.tickPositions}.\n */\n generateTick(pos) {\n const axis = this, ticks = axis.ticks;\n if (!ticks[pos]) {\n ticks[pos] = new Tick(axis, pos);\n }\n else {\n ticks[pos].addLabel(); // update labels depending on tick interval\n }\n }\n /**\n * Create the axisGroup and gridGroup elements on first iteration.\n *\n * @private\n * @function Highcharts.Axis#getOffset\n *\n * @emits Highcharts.Axis#event:afterGetOffset\n */\n createGroups() {\n const { axisParent, // Used in color axis\n chart, coll, options } = this, renderer = chart.renderer;\n const createGroup = (name, suffix, zIndex) => renderer.g(name)\n .attr({ zIndex })\n .addClass(`highcharts-${coll.toLowerCase()}${suffix} ` +\n (this.isRadial ? `highcharts-radial-axis${suffix} ` : '') +\n (options.className || ''))\n .add(axisParent);\n if (!this.axisGroup) {\n this.gridGroup = createGroup('grid', '-grid', options.gridZIndex);\n this.axisGroup = createGroup('axis', '', options.zIndex);\n this.labelGroup = createGroup('axis-labels', '-labels', options.labels.zIndex);\n }\n }\n /**\n * Render the tick labels to a preliminary position to get their sizes\n *\n * @private\n * @function Highcharts.Axis#getOffset\n *\n * @emits Highcharts.Axis#event:afterGetOffset\n */\n getOffset() {\n const axis = this, { chart, horiz, options, side, ticks, tickPositions, coll } = axis, invertedSide = (chart.inverted && !axis.isZAxis ?\n [1, 0, 3, 2][side] :\n side), hasData = axis.hasData(), axisTitleOptions = options.title, labelOptions = options.labels, hasCrossing = isNumber(options.crossing), axisOffset = chart.axisOffset, clipOffset = chart.clipOffset, directionFactor = [-1, 1, 1, -1][side];\n let showAxis, titleOffset = 0, titleOffsetOption, titleMargin = 0, labelOffset = 0, // reset\n labelOffsetPadded, lineHeightCorrection;\n // For reuse in Axis.render\n axis.showAxis = showAxis = hasData || options.showEmpty;\n // Set/reset staggerLines\n axis.staggerLines = (axis.horiz && labelOptions.staggerLines) || void 0;\n axis.createGroups();\n if (hasData || axis.isLinked) {\n // Generate ticks\n tickPositions.forEach(function (pos) {\n // i is not used here, but may be used in overrides\n axis.generateTick(pos);\n });\n axis.renderUnsquish();\n // Left side must be align: right and right side must\n // have align: left for labels\n axis.reserveSpaceDefault = (side === 0 ||\n side === 2 ||\n { 1: 'left', 3: 'right' }[side] === axis.labelAlign);\n if (pick(labelOptions.reserveSpace, hasCrossing ? false : null, axis.labelAlign === 'center' ? true : null, axis.reserveSpaceDefault)) {\n tickPositions.forEach(function (pos) {\n // get the highest offset\n labelOffset = Math.max(ticks[pos].getLabelSize(), labelOffset);\n });\n }\n if (axis.staggerLines) {\n labelOffset *= axis.staggerLines;\n }\n axis.labelOffset = labelOffset * (axis.opposite ? -1 : 1);\n }\n else { // doesn't have data\n objectEach(ticks, function (tick, n) {\n tick.destroy();\n delete ticks[n];\n });\n }\n if (axisTitleOptions?.text &&\n axisTitleOptions.enabled !== false) {\n axis.addTitle(showAxis);\n if (showAxis &&\n !hasCrossing &&\n axisTitleOptions.reserveSpace !== false) {\n axis.titleOffset = titleOffset =\n axis.axisTitle.getBBox()[horiz ? 'height' : 'width'];\n titleOffsetOption = axisTitleOptions.offset;\n titleMargin = defined(titleOffsetOption) ?\n 0 :\n pick(axisTitleOptions.margin, horiz ? 5 : 10);\n }\n }\n // Render the axis line\n axis.renderLine();\n // handle automatic or user set offset\n axis.offset = directionFactor * pick(options.offset, axisOffset[side] ? axisOffset[side] + (options.margin || 0) : 0);\n axis.tickRotCorr = axis.tickRotCorr || { x: 0, y: 0 }; // polar\n if (side === 0) {\n lineHeightCorrection = -axis.labelMetrics().h;\n }\n else if (side === 2) {\n lineHeightCorrection = axis.tickRotCorr.y;\n }\n else {\n lineHeightCorrection = 0;\n }\n // Find the padded label offset\n labelOffsetPadded = Math.abs(labelOffset) + titleMargin;\n if (labelOffset) {\n labelOffsetPadded -= lineHeightCorrection;\n labelOffsetPadded += directionFactor * (horiz ?\n pick(labelOptions.y, axis.tickRotCorr.y +\n directionFactor * labelOptions.distance) :\n pick(labelOptions.x, directionFactor * labelOptions.distance));\n }\n axis.axisTitleMargin = pick(titleOffsetOption, labelOffsetPadded);\n if (axis.getMaxLabelDimensions) {\n axis.maxLabelDimensions = axis.getMaxLabelDimensions(ticks, tickPositions);\n }\n // Due to GridAxis.tickSize, tickSize should be calculated after ticks\n // has rendered.\n if (coll !== 'colorAxis') {\n const tickSize = this.tickSize('tick');\n axisOffset[side] = Math.max(axisOffset[side], (axis.axisTitleMargin || 0) + titleOffset +\n directionFactor * axis.offset, labelOffsetPadded, // #3027\n tickPositions && tickPositions.length && tickSize ?\n tickSize[0] + directionFactor * axis.offset :\n 0 // #4866\n );\n // Decide the clipping needed to keep the graph inside\n // the plot area and axis lines\n const clip = !axis.axisLine || options.offset ?\n 0 :\n // #4308, #4371:\n Math.floor(axis.axisLine.strokeWidth() / 2) * 2;\n clipOffset[invertedSide] =\n Math.max(clipOffset[invertedSide], clip);\n }\n fireEvent(this, 'afterGetOffset');\n }\n /**\n * Internal function to get the path for the axis line. Extended for polar\n * charts.\n *\n * @function Highcharts.Axis#getLinePath\n *\n * @param {number} lineWidth\n * The line width in pixels.\n *\n * @return {Highcharts.SVGPathArray}\n * The SVG path definition in array form.\n */\n getLinePath(lineWidth) {\n const chart = this.chart, opposite = this.opposite, offset = this.offset, horiz = this.horiz, lineLeft = this.left + (opposite ? this.width : 0) + offset, lineTop = chart.chartHeight - this.bottom -\n (opposite ? this.height : 0) + offset;\n if (opposite) {\n lineWidth *= -1; // crispify the other way - #1480, #1687\n }\n return chart.renderer\n .crispLine([\n [\n 'M',\n horiz ?\n this.left :\n lineLeft,\n horiz ?\n lineTop :\n this.top\n ],\n [\n 'L',\n horiz ?\n chart.chartWidth - this.right :\n lineLeft,\n horiz ?\n lineTop :\n chart.chartHeight - this.bottom\n ]\n ], lineWidth);\n }\n /**\n * Render the axis line. Called internally when rendering and redrawing the\n * axis.\n *\n * @function Highcharts.Axis#renderLine\n */\n renderLine() {\n if (!this.axisLine) {\n this.axisLine = this.chart.renderer.path()\n .addClass('highcharts-axis-line')\n .add(this.axisGroup);\n if (!this.chart.styledMode) {\n this.axisLine.attr({\n stroke: this.options.lineColor,\n 'stroke-width': this.options.lineWidth,\n zIndex: 7\n });\n }\n }\n }\n /**\n * Position the axis title.\n *\n * @private\n * @function Highcharts.Axis#getTitlePosition\n *\n * @return {Highcharts.PositionObject}\n * X and Y positions for the title.\n */\n getTitlePosition(axisTitle) {\n // compute anchor points for each of the title align options\n const horiz = this.horiz, axisLeft = this.left, axisTop = this.top, axisLength = this.len, axisTitleOptions = this.options.title, margin = horiz ? axisLeft : axisTop, opposite = this.opposite, offset = this.offset, xOption = axisTitleOptions.x, yOption = axisTitleOptions.y, fontMetrics = this.chart.renderer.fontMetrics(axisTitle), \n // The part of a multiline text that is below the baseline of the\n // first line. Subtract 1 to preserve pixel-perfectness from the\n // old behaviour (v5.0.12), where only one line was allowed.\n textHeightOvershoot = axisTitle ? Math.max(axisTitle.getBBox(false, 0).height - fontMetrics.h - 1, 0) : 0, \n // the position in the length direction of the axis\n alongAxis = ({\n low: margin + (horiz ? 0 : axisLength),\n middle: margin + axisLength / 2,\n high: margin + (horiz ? axisLength : 0)\n })[axisTitleOptions.align], \n // the position in the perpendicular direction of the axis\n offAxis = (horiz ? axisTop + this.height : axisLeft) +\n (horiz ? 1 : -1) * // horizontal axis reverses the margin\n (opposite ? -1 : 1) * // so does opposite axes\n (this.axisTitleMargin || 0) +\n [\n -textHeightOvershoot,\n textHeightOvershoot,\n fontMetrics.f,\n -textHeightOvershoot // left\n ][this.side], titlePosition = {\n x: horiz ?\n alongAxis + xOption :\n offAxis + (opposite ? this.width : 0) + offset + xOption,\n y: horiz ?\n offAxis + yOption - (opposite ? this.height : 0) + offset :\n alongAxis + yOption\n };\n fireEvent(this, 'afterGetTitlePosition', { titlePosition: titlePosition });\n return titlePosition;\n }\n /**\n * Render a minor tick into the given position. If a minor tick already\n * exists in this position, move it.\n *\n * @function Highcharts.Axis#renderMinorTick\n *\n * @param {number} pos\n * The position in axis values.\n *\n * @param {boolean} slideIn\n * Whether the tick should animate in from last computed position\n */\n renderMinorTick(pos, slideIn) {\n const axis = this;\n const minorTicks = axis.minorTicks;\n if (!minorTicks[pos]) {\n minorTicks[pos] = new Tick(axis, pos, 'minor');\n }\n // Render new ticks in old position\n if (slideIn && minorTicks[pos].isNew) {\n minorTicks[pos].render(null, true);\n }\n minorTicks[pos].render(null, false, 1);\n }\n /**\n * Render a major tick into the given position. If a tick already exists\n * in this position, move it.\n *\n * @function Highcharts.Axis#renderTick\n *\n * @param {number} pos\n * The position in axis values.\n *\n * @param {number} i\n * The tick index.\n *\n * @param {boolean} slideIn\n * Whether the tick should animate in from last computed position\n */\n renderTick(pos, i, slideIn) {\n const axis = this, isLinked = axis.isLinked, ticks = axis.ticks;\n // Linked axes need an extra check to find out if\n if (!isLinked ||\n (pos >= axis.min && pos <= axis.max) ||\n (axis.grid && axis.grid.isColumn)) {\n if (!ticks[pos]) {\n ticks[pos] = new Tick(axis, pos);\n }\n // NOTE this seems like overkill. Could be handled in tick.render by\n // setting old position in attr, then set new position in animate.\n // render new ticks in old position\n if (slideIn && ticks[pos].isNew) {\n // Start with negative opacity so that it is visible from\n // halfway into the animation\n ticks[pos].render(i, true, -1);\n }\n ticks[pos].render(i);\n }\n }\n /**\n * Render the axis.\n *\n * @private\n * @function Highcharts.Axis#render\n *\n * @emits Highcharts.Axis#event:afterRender\n */\n render() {\n const axis = this, chart = axis.chart, log = axis.logarithmic, renderer = chart.renderer, options = axis.options, isLinked = axis.isLinked, tickPositions = axis.tickPositions, axisTitle = axis.axisTitle, ticks = axis.ticks, minorTicks = axis.minorTicks, alternateBands = axis.alternateBands, stackLabelOptions = options.stackLabels, alternateGridColor = options.alternateGridColor, crossing = options.crossing, tickmarkOffset = axis.tickmarkOffset, axisLine = axis.axisLine, showAxis = axis.showAxis, animation = animObject(renderer.globalAnimation);\n let from, to;\n // Reset\n axis.labelEdge.length = 0;\n axis.overlap = false;\n // Mark all elements inActive before we go over and mark the active ones\n [ticks, minorTicks, alternateBands].forEach(function (coll) {\n objectEach(coll, function (tick) {\n tick.isActive = false;\n });\n });\n // Crossing\n if (isNumber(crossing)) {\n const otherAxis = this.isXAxis ? chart.yAxis[0] : chart.xAxis[0], directionFactor = [1, -1, -1, 1][this.side];\n if (otherAxis) {\n let px = otherAxis.toPixels(crossing, true);\n if (axis.horiz) {\n px = otherAxis.len - px;\n }\n axis.offset = directionFactor * px;\n }\n }\n // If the series has data draw the ticks. Else only the line and title\n if (axis.hasData() || isLinked) {\n const slideInTicks = axis.chart.hasRendered &&\n axis.old && isNumber(axis.old.min);\n // minor ticks\n if (axis.minorTickInterval && !axis.categories) {\n axis.getMinorTickPositions().forEach(function (pos) {\n axis.renderMinorTick(pos, slideInTicks);\n });\n }\n // Major ticks. Pull out the first item and render it last so that\n // we can get the position of the neighbour label. #808.\n if (tickPositions.length) { // #1300\n tickPositions.forEach(function (pos, i) {\n axis.renderTick(pos, i, slideInTicks);\n });\n // In a categorized axis, the tick marks are displayed\n // between labels. So we need to add a tick mark and\n // grid line at the left edge of the X axis.\n if (tickmarkOffset && (axis.min === 0 || axis.single)) {\n if (!ticks[-1]) {\n ticks[-1] = new Tick(axis, -1, null, true);\n }\n ticks[-1].render(-1);\n }\n }\n // Alternate grid color\n if (alternateGridColor) {\n tickPositions.forEach(function (pos, i) {\n to = typeof tickPositions[i + 1] !== 'undefined' ?\n tickPositions[i + 1] + tickmarkOffset :\n axis.max - tickmarkOffset;\n if (i % 2 === 0 &&\n pos < axis.max &&\n to <= axis.max + (chart.polar ?\n -tickmarkOffset :\n tickmarkOffset)) { // #2248, #4660\n if (!alternateBands[pos]) {\n // Should be imported from PlotLineOrBand.js, but\n // the dependency cycle with axis is a problem\n alternateBands[pos] = new H.PlotLineOrBand(axis, {});\n }\n from = pos + tickmarkOffset; // #949\n alternateBands[pos].options = {\n from: log ? log.lin2log(from) : from,\n to: log ? log.lin2log(to) : to,\n color: alternateGridColor,\n className: 'highcharts-alternate-grid'\n };\n alternateBands[pos].render();\n alternateBands[pos].isActive = true;\n }\n });\n }\n // custom plot lines and bands\n if (!axis._addedPlotLB) { // only first time\n axis._addedPlotLB = true;\n (options.plotLines || [])\n .concat(options.plotBands || [])\n .forEach(function (plotLineOptions) {\n axis\n .addPlotBandOrLine(plotLineOptions);\n });\n }\n } // end if hasData\n // Remove inactive ticks\n [ticks, minorTicks, alternateBands].forEach(function (coll) {\n const forDestruction = [], delay = animation.duration, destroyInactiveItems = function () {\n let i = forDestruction.length;\n while (i--) {\n // When resizing rapidly, the same items\n // may be destroyed in different timeouts,\n // or the may be reactivated\n if (coll[forDestruction[i]] &&\n !coll[forDestruction[i]].isActive) {\n coll[forDestruction[i]].destroy();\n delete coll[forDestruction[i]];\n }\n }\n };\n objectEach(coll, function (tick, pos) {\n if (!tick.isActive) {\n // Render to zero opacity\n tick.render(pos, false, 0);\n tick.isActive = false;\n forDestruction.push(pos);\n }\n });\n // When the objects are finished fading out, destroy them\n syncTimeout(destroyInactiveItems, coll === alternateBands ||\n !chart.hasRendered ||\n !delay ?\n 0 :\n delay);\n });\n // Set the axis line path\n if (axisLine) {\n axisLine[axisLine.isPlaced ? 'animate' : 'attr']({\n d: this.getLinePath(axisLine.strokeWidth())\n });\n axisLine.isPlaced = true;\n // Show or hide the line depending on options.showEmpty\n axisLine[showAxis ? 'show' : 'hide'](showAxis);\n }\n if (axisTitle && showAxis) {\n axisTitle[axisTitle.isNew ? 'attr' : 'animate'](axis.getTitlePosition(axisTitle));\n axisTitle.isNew = false;\n }\n // Stacked totals:\n if (stackLabelOptions && stackLabelOptions.enabled && axis.stacking) {\n axis.stacking.renderStackTotals();\n }\n // End stacked totals\n // Record old scaling for updating/animation. Pinch base must be\n // preserved until the pinch ends.\n axis.old = {\n len: axis.len,\n max: axis.max,\n min: axis.min,\n transA: axis.transA,\n userMax: axis.userMax,\n userMin: axis.userMin\n };\n axis.isDirty = false;\n fireEvent(this, 'afterRender');\n }\n /**\n * Redraw the axis to reflect changes in the data or axis extremes. Called\n * internally from Highcharts.Chart#redraw.\n *\n * @private\n * @function Highcharts.Axis#redraw\n */\n redraw() {\n if (this.visible) {\n // render the axis\n this.render();\n // move plot lines and bands\n this.plotLinesAndBands.forEach(function (plotLine) {\n plotLine.render();\n });\n }\n // mark associated series as dirty and ready for redraw\n this.series.forEach(function (series) {\n series.isDirty = true;\n });\n }\n /**\n * Returns an array of axis properties, that should be untouched during\n * reinitialization.\n *\n * @private\n * @function Highcharts.Axis#getKeepProps\n */\n getKeepProps() {\n return (this.keepProps || Axis.keepProps);\n }\n /**\n * Destroys an Axis instance. See {@link Axis#remove} for the API endpoint\n * to fully remove the axis.\n *\n * @private\n * @function Highcharts.Axis#destroy\n *\n * @param {boolean} [keepEvents]\n * Whether to preserve events, used internally in Axis.update.\n */\n destroy(keepEvents) {\n const axis = this, plotLinesAndBands = axis.plotLinesAndBands, eventOptions = this.eventOptions;\n fireEvent(this, 'destroy', { keepEvents: keepEvents });\n // Remove the events\n if (!keepEvents) {\n removeEvent(axis);\n }\n // Destroy collections\n [axis.ticks, axis.minorTicks, axis.alternateBands].forEach(function (coll) {\n destroyObjectProperties(coll);\n });\n if (plotLinesAndBands) {\n let i = plotLinesAndBands.length;\n while (i--) { // #1975\n plotLinesAndBands[i].destroy();\n }\n }\n // Destroy elements\n ['axisLine', 'axisTitle', 'axisGroup',\n 'gridGroup', 'labelGroup', 'cross', 'scrollbar'].forEach(function (prop) {\n if (axis[prop]) {\n axis[prop] = axis[prop].destroy();\n }\n });\n // Destroy each generated group for plotlines and plotbands\n for (const plotGroup in axis.plotLinesAndBandsGroups) { // eslint-disable-line guard-for-in\n axis.plotLinesAndBandsGroups[plotGroup] =\n axis.plotLinesAndBandsGroups[plotGroup].destroy();\n }\n // Delete all properties and fall back to the prototype.\n objectEach(axis, function (val, key) {\n if (axis.getKeepProps().indexOf(key) === -1) {\n delete axis[key];\n }\n });\n this.eventOptions = eventOptions;\n }\n /**\n * Internal function to draw a crosshair.\n *\n * @function Highcharts.Axis#drawCrosshair\n *\n * @param {Highcharts.PointerEventObject} [e]\n * The event arguments from the modified pointer event, extended with\n * `chartX` and `chartY`\n *\n * @param {Highcharts.Point} [point]\n * The Point object if the crosshair snaps to points.\n *\n * @emits Highcharts.Axis#event:afterDrawCrosshair\n * @emits Highcharts.Axis#event:drawCrosshair\n */\n drawCrosshair(e, point) {\n const options = this.crosshair, snap = pick(options && options.snap, true), chart = this.chart;\n let path, pos, categorized, graphic = this.cross, crossOptions;\n fireEvent(this, 'drawCrosshair', { e: e, point: point });\n // Use last available event when updating non-snapped crosshairs without\n // mouse interaction (#5287)\n if (!e) {\n e = this.cross && this.cross.e;\n }\n if (\n // Disabled in options\n !options ||\n // Snap\n ((defined(point) || !snap) === false)) {\n this.hideCrosshair();\n }\n else {\n // Get the path\n if (!snap) {\n pos = e &&\n (this.horiz ?\n e.chartX - this.pos :\n this.len - e.chartY + this.pos);\n }\n else if (defined(point)) {\n // #3834\n pos = pick(this.coll !== 'colorAxis' ?\n point.crosshairPos : // 3D axis extension\n null, this.isXAxis ?\n point.plotX :\n this.len - point.plotY);\n }\n if (defined(pos)) {\n crossOptions = {\n // value, only used on radial\n value: point && (this.isXAxis ?\n point.x :\n pick(point.stackY, point.y)),\n translatedValue: pos\n };\n if (chart.polar) {\n // Additional information required for crosshairs in\n // polar chart\n extend(crossOptions, {\n isCrosshair: true,\n chartX: e && e.chartX,\n chartY: e && e.chartY,\n point: point\n });\n }\n path = this.getPlotLinePath(crossOptions) ||\n null; // #3189\n }\n if (!defined(path)) {\n this.hideCrosshair();\n return;\n }\n categorized = this.categories && !this.isRadial;\n // Draw the cross\n if (!graphic) {\n this.cross = graphic = chart.renderer\n .path()\n .addClass('highcharts-crosshair highcharts-crosshair-' +\n (categorized ? 'category ' : 'thin ') +\n (options.className || ''))\n .attr({\n zIndex: pick(options.zIndex, 2)\n })\n .add();\n // Presentational attributes\n if (!chart.styledMode) {\n graphic.attr({\n stroke: options.color ||\n (categorized ?\n Color\n .parse(\"#ccd3ff\" /* Palette.highlightColor20 */)\n .setOpacity(0.25)\n .get() :\n \"#cccccc\" /* Palette.neutralColor20 */),\n 'stroke-width': pick(options.width, 1)\n }).css({\n 'pointer-events': 'none'\n });\n if (options.dashStyle) {\n graphic.attr({\n dashstyle: options.dashStyle\n });\n }\n }\n }\n graphic.show().attr({\n d: path\n });\n if (categorized && !options.width) {\n graphic.attr({\n 'stroke-width': this.transA\n });\n }\n this.cross.e = e;\n }\n fireEvent(this, 'afterDrawCrosshair', { e: e, point: point });\n }\n /**\n * Hide the crosshair if visible.\n *\n * @function Highcharts.Axis#hideCrosshair\n */\n hideCrosshair() {\n if (this.cross) {\n this.cross.hide();\n }\n fireEvent(this, 'afterHideCrosshair');\n }\n /**\n * Update an axis object with a new set of options. The options are merged\n * with the existing options, so only new or altered options need to be\n * specified.\n *\n * @sample highcharts/members/axis-update/\n * Axis update demo\n *\n * @function Highcharts.Axis#update\n *\n * @param {Highcharts.AxisOptions} options\n * The new options that will be merged in with existing options on the axis.\n *\n * @param {boolean} [redraw=true]\n * Whether to redraw the chart after the axis is altered. If doing more\n * operations on the chart, it is a good idea to set redraw to false and\n * call {@link Chart#redraw} after.\n */\n update(options, redraw) {\n const chart = this.chart;\n options = merge(this.userOptions, options);\n this.destroy(true);\n this.init(chart, options);\n chart.isDirtyBox = true;\n if (pick(redraw, true)) {\n chart.redraw();\n }\n }\n /**\n * Remove the axis from the chart.\n *\n * @sample highcharts/members/chart-addaxis/\n * Add and remove axes\n *\n * @function Highcharts.Axis#remove\n *\n * @param {boolean} [redraw=true]\n * Whether to redraw the chart following the remove.\n */\n remove(redraw) {\n const chart = this.chart, coll = this.coll, axisSeries = this.series;\n let i = axisSeries.length;\n // Remove associated series (#2687)\n while (i--) {\n if (axisSeries[i]) {\n axisSeries[i].remove(false);\n }\n }\n // Remove the axis\n erase(chart.axes, this);\n erase(chart[coll] || [], this);\n chart.orderItems(coll);\n this.destroy();\n chart.isDirtyBox = true;\n if (pick(redraw, true)) {\n chart.redraw();\n }\n }\n /**\n * Update the axis title by options after render time.\n *\n * @sample highcharts/members/axis-settitle/\n * Set a new Y axis title\n *\n * @function Highcharts.Axis#setTitle\n *\n * @param {Highcharts.AxisTitleOptions} titleOptions\n * The additional title options.\n *\n * @param {boolean} [redraw=true]\n * Whether to redraw the chart after setting the title.\n */\n setTitle(titleOptions, redraw) {\n this.update({ title: titleOptions }, redraw);\n }\n /**\n * Set new axis categories and optionally redraw.\n *\n * @sample highcharts/members/axis-setcategories/\n * Set categories by click on a button\n *\n * @function Highcharts.Axis#setCategories\n *\n * @param {Array} categories\n * The new categories.\n *\n * @param {boolean} [redraw=true]\n * Whether to redraw the chart.\n */\n setCategories(categories, redraw) {\n this.update({ categories: categories }, redraw);\n }\n}\n/* *\n *\n * Static Properties\n *\n * */\n// Properties to survive after destroy, needed for Axis.update (#4317,\n// #5773, #5881).\nAxis.keepProps = [\n 'coll',\n 'extKey',\n 'hcEvents',\n 'names',\n 'series',\n 'userMax',\n 'userMin'\n];\n/* *\n *\n * Default Export\n *\n * */\nexport default Axis;\n/* *\n *\n * API Declarations\n *\n * */\n/**\n * Options for the path on the Axis to be calculated.\n * @interface Highcharts.AxisPlotLinePathOptionsObject\n */ /**\n* Axis value.\n* @name Highcharts.AxisPlotLinePathOptionsObject#value\n* @type {number|undefined}\n*/ /**\n* Line width used for calculation crisp line coordinates. Defaults to 1.\n* @name Highcharts.AxisPlotLinePathOptionsObject#lineWidth\n* @type {number|undefined}\n*/ /**\n* If `false`, the function will return null when it falls outside the axis\n* bounds. If `true`, the function will return a path aligned to the plot area\n* sides if it falls outside. If `pass`, it will return a path outside.\n* @name Highcharts.AxisPlotLinePathOptionsObject#force\n* @type {string|boolean|undefined}\n*/ /**\n* Used in Highcharts Stock. When `true`, plot paths\n* (crosshair, plotLines, gridLines)\n* will be rendered on all axes when defined on the first axis.\n* @name Highcharts.AxisPlotLinePathOptionsObject#acrossPanes\n* @type {boolean|undefined}\n*/ /**\n* Use old coordinates (for resizing and rescaling).\n* If not set, defaults to `false`.\n* @name Highcharts.AxisPlotLinePathOptionsObject#old\n* @type {boolean|undefined}\n*/ /**\n* If given, return the plot line path of a pixel position on the axis.\n* @name Highcharts.AxisPlotLinePathOptionsObject#translatedValue\n* @type {number|undefined}\n*/ /**\n* Used in Polar axes. Reverse the positions for concatenation of polygonal\n* plot bands\n* @name Highcharts.AxisPlotLinePathOptionsObject#reverse\n* @type {boolean|undefined}\n*/\n/**\n * Options for crosshairs on axes.\n *\n * @product highstock\n *\n * @typedef {Highcharts.XAxisCrosshairOptions|Highcharts.YAxisCrosshairOptions} Highcharts.AxisCrosshairOptions\n */\n/**\n * @typedef {\"navigator\"|\"pan\"|\"rangeSelectorButton\"|\"rangeSelectorInput\"|\"scrollbar\"|\"traverseUpButton\"|\"zoom\"} Highcharts.AxisExtremesTriggerValue\n */\n/**\n * @callback Highcharts.AxisEventCallbackFunction\n *\n * @param {Highcharts.Axis} this\n */\n/**\n * @callback Highcharts.AxisLabelsFormatterCallbackFunction\n *\n * @param {Highcharts.AxisLabelsFormatterContextObject} this\n *\n * @param {Highcharts.AxisLabelsFormatterContextObject} ctx\n *\n * @return {string}\n */\n/**\n * @interface Highcharts.AxisLabelsFormatterContextObject\n */ /**\n* The axis item of the label\n* @name Highcharts.AxisLabelsFormatterContextObject#axis\n* @type {Highcharts.Axis}\n*/ /**\n* The chart instance.\n* @name Highcharts.AxisLabelsFormatterContextObject#chart\n* @type {Highcharts.Chart}\n*/ /**\n* Default formatting of date/time labels.\n* @name Highcharts.AxisLabelsFormatterContextObject#dateTimeLabelFormat\n* @type {string|undefined}\n*/ /**\n* Whether the label belongs to the first tick on the axis.\n* @name Highcharts.AxisLabelsFormatterContextObject#isFirst\n* @type {boolean}\n*/ /**\n* Whether the label belongs to the last tick on the axis.\n* @name Highcharts.AxisLabelsFormatterContextObject#isLast\n* @type {boolean}\n*/ /**\n* The position on the axis in terms of axis values. For category axes, a\n* zero-based index. For datetime axes, the JavaScript time in milliseconds\n* since 1970.\n* @name Highcharts.AxisLabelsFormatterContextObject#pos\n* @type {number}\n*/ /**\n* The preformatted text as the result of the default formatting. For example\n* dates will be formatted as strings, and numbers with language-specific comma\n* separators, thousands separators and numeric symbols like `k` or `M`.\n* @name Highcharts.AxisLabelsFormatterContextObject#text\n* @type {string|undefined}\n*/ /**\n* The Tick instance.\n* @name Highcharts.AxisLabelsFormatterContextObject#tick\n* @type {Highcharts.Tick}\n*/ /**\n* This can be either a numeric value or a category string.\n* @name Highcharts.AxisLabelsFormatterContextObject#value\n* @type {number|string}\n*/\n/**\n * Options for axes.\n *\n * @typedef {Highcharts.XAxisOptions|Highcharts.YAxisOptions|Highcharts.ZAxisOptions} Highcharts.AxisOptions\n */\n/**\n * @callback Highcharts.AxisPointBreakEventCallbackFunction\n *\n * @param {Highcharts.Axis} this\n *\n * @param {Highcharts.AxisPointBreakEventObject} evt\n */\n/**\n * @interface Highcharts.AxisPointBreakEventObject\n */ /**\n* @name Highcharts.AxisPointBreakEventObject#brk\n* @type {Highcharts.Dictionary}\n*/ /**\n* @name Highcharts.AxisPointBreakEventObject#point\n* @type {Highcharts.Point}\n*/ /**\n* @name Highcharts.AxisPointBreakEventObject#preventDefault\n* @type {Function}\n*/ /**\n* @name Highcharts.AxisPointBreakEventObject#target\n* @type {Highcharts.SVGElement}\n*/ /**\n* @name Highcharts.AxisPointBreakEventObject#type\n* @type {\"pointBreak\"|\"pointInBreak\"}\n*/\n/**\n * @callback Highcharts.AxisSetExtremesEventCallbackFunction\n *\n * @param {Highcharts.Axis} this\n *\n * @param {Highcharts.AxisSetExtremesEventObject} evt\n */\n/**\n * @interface Highcharts.AxisSetExtremesEventObject\n * @extends Highcharts.ExtremesObject\n */ /**\n* @name Highcharts.AxisSetExtremesEventObject#preventDefault\n* @type {Function}\n*/ /**\n* @name Highcharts.AxisSetExtremesEventObject#target\n* @type {Highcharts.SVGElement}\n*/ /**\n* @name Highcharts.AxisSetExtremesEventObject#trigger\n* @type {Highcharts.AxisExtremesTriggerValue|string}\n*/ /**\n* @name Highcharts.AxisSetExtremesEventObject#type\n* @type {\"setExtremes\"}\n*/\n/**\n * @callback Highcharts.AxisTickPositionerCallbackFunction\n *\n * @param {Highcharts.Axis} this\n *\n * @return {Highcharts.AxisTickPositionsArray}\n */\n/**\n * @interface Highcharts.AxisTickPositionsArray\n * @augments Array\n */\n/**\n * @typedef {\"high\"|\"low\"|\"middle\"} Highcharts.AxisTitleAlignValue\n */\n/**\n * @typedef {Highcharts.XAxisTitleOptions|Highcharts.YAxisTitleOptions|Highcharts.ZAxisTitleOptions} Highcharts.AxisTitleOptions\n */\n/**\n * @typedef {\"linear\"|\"logarithmic\"|\"datetime\"|\"category\"|\"treegrid\"} Highcharts.AxisTypeValue\n */\n/**\n * The returned object literal from the {@link Highcharts.Axis#getExtremes}\n * function.\n *\n * @interface Highcharts.ExtremesObject\n */ /**\n* The maximum value of the axis' associated series.\n* @name Highcharts.ExtremesObject#dataMax\n* @type {number}\n*/ /**\n* The minimum value of the axis' associated series.\n* @name Highcharts.ExtremesObject#dataMin\n* @type {number}\n*/ /**\n* The maximum axis value, either automatic or set manually. If the `max` option\n* is not set, `maxPadding` is 0 and `endOnTick` is false, this value will be\n* the same as `dataMax`.\n* @name Highcharts.ExtremesObject#max\n* @type {number}\n*/ /**\n* The minimum axis value, either automatic or set manually. If the `min` option\n* is not set, `minPadding` is 0 and `startOnTick` is false, this value will be\n* the same as `dataMin`.\n* @name Highcharts.ExtremesObject#min\n* @type {number}\n*/ /**\n* The user defined maximum, either from the `max` option or from a zoom or\n* `setExtremes` action.\n* @name Highcharts.ExtremesObject#userMax\n* @type {number|undefined}\n*/ /**\n* The user defined minimum, either from the `min` option or from a zoom or\n* `setExtremes` action.\n* @name Highcharts.ExtremesObject#userMin\n* @type {number|undefined}\n*/\n/**\n * Formatter function for the text of a crosshair label.\n *\n * @callback Highcharts.XAxisCrosshairLabelFormatterCallbackFunction\n *\n * @param {Highcharts.Axis} this\n * Axis context\n *\n * @param {number} value\n * Y value of the data point\n *\n * @return {string}\n */\n''; // keeps doclets above in JS file\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport U from '../Utilities.js';\nconst { addEvent, getMagnitude, normalizeTickInterval, timeUnits } = U;\n/* *\n *\n * Composition\n *\n * */\n/* eslint-disable valid-jsdoc */\nvar DateTimeAxis;\n(function (DateTimeAxis) {\n /* *\n *\n * Declarations\n *\n * */\n /* *\n *\n * Functions\n *\n * */\n /**\n * Extends axis class with date and time support.\n * @private\n */\n function compose(AxisClass) {\n if (!AxisClass.keepProps.includes('dateTime')) {\n AxisClass.keepProps.push('dateTime');\n const axisProto = AxisClass.prototype;\n axisProto.getTimeTicks = getTimeTicks;\n addEvent(AxisClass, 'afterSetOptions', onAfterSetOptions);\n }\n return AxisClass;\n }\n DateTimeAxis.compose = compose;\n /**\n * Set the tick positions to a time unit that makes sense, for example\n * on the first of each month or on every Monday. Return an array with\n * the time positions. Used in datetime axes as well as for grouping\n * data on a datetime axis.\n *\n * @private\n * @function Highcharts.Axis#getTimeTicks\n * @param {Highcharts.TimeNormalizeObject} normalizedInterval\n * The interval in axis values (ms) and the count.\n * @param {number} min\n * The minimum in axis values.\n * @param {number} max\n * The maximum in axis values.\n */\n function getTimeTicks() {\n return this.chart.time.getTimeTicks.apply(this.chart.time, arguments);\n }\n /**\n * @private\n */\n function onAfterSetOptions() {\n if (this.options.type !== 'datetime') {\n this.dateTime = void 0;\n return;\n }\n if (!this.dateTime) {\n this.dateTime = new Additions(this);\n }\n }\n /* *\n *\n * Classes\n *\n * */\n class Additions {\n /* *\n *\n * Constructors\n *\n * */\n constructor(axis) {\n this.axis = axis;\n }\n /* *\n *\n * Functions\n *\n * */\n /**\n * Get a normalized tick interval for dates. Returns a configuration\n * object with unit range (interval), count and name. Used to prepare\n * data for `getTimeTicks`. Previously this logic was part of\n * getTimeTicks, but as `getTimeTicks` now runs of segments in stock\n * charts, the normalizing logic was extracted in order to prevent it\n * for running over again for each segment having the same interval.\n * #662, #697.\n * @private\n */\n normalizeTimeTickInterval(tickInterval, unitsOption) {\n const units = (unitsOption || [[\n // unit name\n 'millisecond',\n // allowed multiples\n [1, 2, 5, 10, 20, 25, 50, 100, 200, 500]\n ], [\n 'second',\n [1, 2, 5, 10, 15, 30]\n ], [\n 'minute',\n [1, 2, 5, 10, 15, 30]\n ], [\n 'hour',\n [1, 2, 3, 4, 6, 8, 12]\n ], [\n 'day',\n [1, 2]\n ], [\n 'week',\n [1, 2]\n ], [\n 'month',\n [1, 2, 3, 4, 6]\n ], [\n 'year',\n null\n ]]);\n let unit = units[units.length - 1], // default unit is years\n interval = timeUnits[unit[0]], multiples = unit[1], i;\n // loop through the units to find the one that best fits the\n // tickInterval\n for (i = 0; i < units.length; i++) {\n unit = units[i];\n interval = timeUnits[unit[0]];\n multiples = unit[1];\n if (units[i + 1]) {\n // lessThan is in the middle between the highest multiple\n // and the next unit.\n const lessThan = (interval *\n multiples[multiples.length - 1] +\n timeUnits[units[i + 1][0]]) / 2;\n // break and keep the current unit\n if (tickInterval <= lessThan) {\n break;\n }\n }\n }\n // prevent 2.5 years intervals, though 25, 250 etc. are allowed\n if (interval === timeUnits.year && tickInterval < 5 * interval) {\n multiples = [1, 2, 5];\n }\n // get the count\n const count = normalizeTickInterval(tickInterval / interval, multiples, unit[0] === 'year' ? // #1913, #2360\n Math.max(getMagnitude(tickInterval / interval), 1) :\n 1);\n return {\n unitRange: interval,\n count: count,\n unitName: unit[0]\n };\n }\n /**\n * Get the best date format for a specific X value based on the closest\n * point range on the axis.\n *\n * @private\n */\n getXDateFormat(x, dateTimeLabelFormats) {\n const { axis } = this, time = axis.chart.time;\n return axis.closestPointRange ?\n time.getDateFormat(axis.closestPointRange, x, axis.options.startOfWeek, dateTimeLabelFormats) ||\n // #2546, 2581\n time.resolveDTLFormat(dateTimeLabelFormats.year).main :\n time.resolveDTLFormat(dateTimeLabelFormats.day).main;\n }\n }\n DateTimeAxis.Additions = Additions;\n})(DateTimeAxis || (DateTimeAxis = {}));\n/* *\n *\n * Default Export\n *\n * */\nexport default DateTimeAxis;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport U from '../Utilities.js';\nconst { addEvent, normalizeTickInterval, pick } = U;\n/* *\n *\n * Class\n *\n * */\n/**\n * @private\n */\nvar LogarithmicAxis;\n(function (LogarithmicAxis) {\n /* *\n *\n * Declarations\n *\n * */\n /* *\n *\n * Functions\n *\n * */\n /**\n * Provides logarithmic support for axes.\n * @private\n */\n function compose(AxisClass) {\n if (!AxisClass.keepProps.includes('logarithmic')) {\n AxisClass.keepProps.push('logarithmic');\n addEvent(AxisClass, 'init', onInit);\n addEvent(AxisClass, 'afterInit', onAfterInit);\n }\n return AxisClass;\n }\n LogarithmicAxis.compose = compose;\n /**\n * @private\n */\n function onInit(e) {\n const axis = this;\n const options = e.userOptions;\n let logarithmic = axis.logarithmic;\n if (options.type !== 'logarithmic') {\n axis.logarithmic = void 0;\n }\n else {\n if (!logarithmic) {\n logarithmic = axis.logarithmic = new Additions(axis);\n }\n }\n }\n /**\n * @private\n */\n function onAfterInit() {\n const axis = this;\n const log = axis.logarithmic;\n // extend logarithmic axis\n if (log) {\n axis.lin2val = function (num) {\n return log.lin2log(num);\n };\n axis.val2lin = function (num) {\n return log.log2lin(num);\n };\n }\n }\n /* *\n *\n * Class\n *\n * */\n /**\n * Provides logarithmic support for axes.\n * @private\n * @class\n */\n class Additions {\n /* *\n *\n * Constructors\n *\n * */\n constructor(axis) {\n this.axis = axis;\n }\n /* *\n *\n * Functions\n *\n * */\n /**\n * Set the tick positions of a logarithmic axis.\n */\n getLogTickPositions(interval, min, max, minor) {\n const log = this;\n const axis = log.axis;\n const axisLength = axis.len;\n const options = axis.options;\n // Since we use this method for both major and minor ticks,\n // use a local variable and return the result\n let positions = [];\n // Reset\n if (!minor) {\n log.minorAutoInterval = void 0;\n }\n // First case: All ticks fall on whole logarithms: 1, 10, 100 etc.\n if (interval >= 0.5) {\n interval = Math.round(interval);\n positions = axis.getLinearTickPositions(interval, min, max);\n // Second case: We need intermediary ticks. For example\n // 1, 2, 4, 6, 8, 10, 20, 40 etc.\n }\n else if (interval >= 0.08) {\n const roundedMin = Math.floor(min);\n let intermediate, i, j, len, pos, lastPos, break2;\n if (interval > 0.3) {\n intermediate = [1, 2, 4];\n // 0.2 equals five minor ticks per 1, 10, 100 etc\n }\n else if (interval > 0.15) {\n intermediate = [1, 2, 4, 6, 8];\n }\n else { // 0.1 equals ten minor ticks per 1, 10, 100 etc\n intermediate = [1, 2, 3, 4, 5, 6, 7, 8, 9];\n }\n for (i = roundedMin; i < max + 1 && !break2; i++) {\n len = intermediate.length;\n for (j = 0; j < len && !break2; j++) {\n pos = log.log2lin(log.lin2log(i) * intermediate[j]);\n // #1670, lastPos is #3113\n if (pos > min &&\n (!minor || lastPos <= max) &&\n typeof lastPos !== 'undefined') {\n positions.push(lastPos);\n }\n if (lastPos > max) {\n break2 = true;\n }\n lastPos = pos;\n }\n }\n // Third case: We are so deep in between whole logarithmic values,\n // that we might as well handle the tick positions like a linear\n // axis. For example 1.01, 1.02, 1.03, 1.04.\n }\n else {\n const realMin = log.lin2log(min), realMax = log.lin2log(max), tickIntervalOption = minor ?\n axis.getMinorTickInterval() :\n options.tickInterval, filteredTickIntervalOption = tickIntervalOption === 'auto' ?\n null :\n tickIntervalOption, tickPixelIntervalOption = options.tickPixelInterval / (minor ? 5 : 1), totalPixelLength = minor ?\n axisLength / axis.tickPositions.length :\n axisLength;\n interval = pick(filteredTickIntervalOption, log.minorAutoInterval, (realMax - realMin) *\n tickPixelIntervalOption / (totalPixelLength || 1));\n interval = normalizeTickInterval(interval);\n positions = axis.getLinearTickPositions(interval, realMin, realMax).map(log.log2lin);\n if (!minor) {\n log.minorAutoInterval = interval / 5;\n }\n }\n // Set the axis-level tickInterval variable\n if (!minor) {\n axis.tickInterval = interval;\n }\n return positions;\n }\n lin2log(num) {\n return Math.pow(10, num);\n }\n log2lin(num) {\n return Math.log(num) / Math.LN10;\n }\n }\n LogarithmicAxis.Additions = Additions;\n})(LogarithmicAxis || (LogarithmicAxis = {}));\n/* *\n *\n * Default Export\n *\n * */\nexport default LogarithmicAxis;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport U from '../../Utilities.js';\nconst { erase, extend, isNumber } = U;\n/* *\n *\n * Composition\n *\n * */\nvar PlotLineOrBandAxis;\n(function (PlotLineOrBandAxis) {\n /* *\n *\n * Declarations\n *\n * */\n /* *\n *\n * Variables\n *\n * */\n let PlotLineOrBandClass;\n /* *\n *\n * Functions\n *\n * */\n /**\n * Add a plot band after render time.\n *\n * @sample highcharts/members/axis-addplotband/\n * Toggle the plot band from a button\n *\n * @function Highcharts.Axis#addPlotBand\n *\n * @param {Highcharts.AxisPlotBandsOptions} options\n * A configuration object for the plot band, as defined in\n * [xAxis.plotBands](https://api.highcharts.com/highcharts/xAxis.plotBands).\n *\n * @return {Highcharts.PlotLineOrBand|undefined}\n * The added plot band, or `undefined` if the options are not valid.\n */\n function addPlotBand(options) {\n return this.addPlotBandOrLine(options, 'plotBands');\n }\n /**\n * Add a plot band or plot line after render time. Called from\n * addPlotBand and addPlotLine internally.\n *\n * @private\n * @function Highcharts.Axis#addPlotBandOrLine\n * @param {Highcharts.AxisPlotBandsOptions|Highcharts.AxisPlotLinesOptions} options\n * The plotBand or plotLine configuration object.\n */\n function addPlotBandOrLine(options, coll) {\n const userOptions = this.userOptions;\n let obj = new PlotLineOrBandClass(this, options);\n if (this.visible) {\n obj = obj.render();\n }\n if (obj) { // #2189\n if (!this._addedPlotLB) {\n this._addedPlotLB = true;\n (userOptions.plotLines || [])\n .concat(userOptions.plotBands || [])\n .forEach((plotLineOptions) => {\n this.addPlotBandOrLine(plotLineOptions);\n });\n }\n // Add it to the user options for exporting and Axis.update\n if (coll) {\n // Workaround Microsoft/TypeScript issue #32693\n const updatedOptions = (userOptions[coll] || []);\n updatedOptions.push(options);\n userOptions[coll] = updatedOptions;\n }\n this.plotLinesAndBands.push(obj);\n }\n return obj;\n }\n /**\n * Add a plot line after render time.\n *\n * @sample highcharts/members/axis-addplotline/\n * Toggle the plot line from a button\n *\n * @function Highcharts.Axis#addPlotLine\n *\n * @param {Highcharts.AxisPlotLinesOptions} options\n * A configuration object for the plot line, as defined in\n * [xAxis.plotLines](https://api.highcharts.com/highcharts/xAxis.plotLines).\n *\n * @return {Highcharts.PlotLineOrBand|undefined}\n * The added plot line, or `undefined` if the options are not valid.\n */\n function addPlotLine(options) {\n return this.addPlotBandOrLine(options, 'plotLines');\n }\n /**\n * @private\n */\n function compose(PlotLineOrBandType, AxisClass) {\n const axisProto = AxisClass.prototype;\n if (!axisProto.addPlotBand) {\n PlotLineOrBandClass = PlotLineOrBandType;\n extend(axisProto, {\n addPlotBand,\n addPlotLine,\n addPlotBandOrLine,\n getPlotBandPath,\n removePlotBand,\n removePlotLine,\n removePlotBandOrLine\n });\n }\n return AxisClass;\n }\n PlotLineOrBandAxis.compose = compose;\n /**\n * Internal function to create the SVG path definition for a plot band.\n *\n * @function Highcharts.Axis#getPlotBandPath\n *\n * @param {number} from\n * The axis value to start from.\n *\n * @param {number} to\n * The axis value to end on.\n *\n * @param {Highcharts.AxisPlotBandsOptions|Highcharts.AxisPlotLinesOptions} options\n * The plotBand or plotLine configuration object.\n *\n * @return {Highcharts.SVGPathArray}\n * The SVG path definition in array form.\n */\n function getPlotBandPath(from, to, options) {\n options = options || this.options;\n const toPath = this.getPlotLinePath({\n value: to,\n force: true,\n acrossPanes: options.acrossPanes\n }), result = [], horiz = this.horiz, outside = !isNumber(this.min) ||\n !isNumber(this.max) ||\n (from < this.min && to < this.min) ||\n (from > this.max && to > this.max), path = this.getPlotLinePath({\n value: from,\n force: true,\n acrossPanes: options.acrossPanes\n });\n let i, \n // #4964 check if chart is inverted or plotband is on yAxis\n plus = 1, isFlat;\n if (path && toPath) {\n // Flat paths don't need labels (#3836)\n if (outside) {\n isFlat = path.toString() === toPath.toString();\n plus = 0;\n }\n // Go over each subpath - for panes in Highcharts Stock\n for (i = 0; i < path.length; i += 2) {\n const pathStart = path[i], pathEnd = path[i + 1], toPathStart = toPath[i], toPathEnd = toPath[i + 1];\n // Type checking all affected path segments. Consider\n // something smarter.\n if ((pathStart[0] === 'M' || pathStart[0] === 'L') &&\n (pathEnd[0] === 'M' || pathEnd[0] === 'L') &&\n (toPathStart[0] === 'M' || toPathStart[0] === 'L') &&\n (toPathEnd[0] === 'M' || toPathEnd[0] === 'L')) {\n // Add 1 pixel when coordinates are the same\n if (horiz && toPathStart[1] === pathStart[1]) {\n toPathStart[1] += plus;\n toPathEnd[1] += plus;\n }\n else if (!horiz && toPathStart[2] === pathStart[2]) {\n toPathStart[2] += plus;\n toPathEnd[2] += plus;\n }\n result.push(['M', pathStart[1], pathStart[2]], ['L', pathEnd[1], pathEnd[2]], ['L', toPathEnd[1], toPathEnd[2]], ['L', toPathStart[1], toPathStart[2]], ['Z']);\n }\n result.isFlat = isFlat;\n }\n }\n return result;\n }\n /**\n * Remove a plot band by its id.\n *\n * @sample highcharts/members/axis-removeplotband/\n * Remove plot band by id\n * @sample highcharts/members/axis-addplotband/\n * Toggle the plot band from a button\n *\n * @function Highcharts.Axis#removePlotBand\n *\n * @param {string} id\n * The plot band's `id` as given in the original configuration\n * object or in the `addPlotBand` option.\n */\n function removePlotBand(id) {\n this.removePlotBandOrLine(id);\n }\n /**\n * Remove a plot band or plot line from the chart by id. Called\n * internally from `removePlotBand` and `removePlotLine`.\n * @private\n * @function Highcharts.Axis#removePlotBandOrLine\n */\n function removePlotBandOrLine(id) {\n const plotLinesAndBands = this.plotLinesAndBands, options = this.options, userOptions = this.userOptions;\n if (plotLinesAndBands) { // #15639\n let i = plotLinesAndBands.length;\n while (i--) {\n if (plotLinesAndBands[i].id === id) {\n plotLinesAndBands[i].destroy();\n }\n }\n ([\n options.plotLines || [],\n userOptions.plotLines || [],\n options.plotBands || [],\n userOptions.plotBands || []\n ]).forEach(function (arr) {\n i = arr.length;\n while (i--) {\n if ((arr[i] || {}).id === id) {\n erase(arr, arr[i]);\n }\n }\n });\n }\n }\n /**\n * Remove a plot line by its id.\n *\n * @sample highcharts/xaxis/plotlines-id/\n * Remove plot line by id\n * @sample highcharts/members/axis-addplotline/\n * Toggle the plot line from a button\n *\n * @function Highcharts.Axis#removePlotLine\n *\n * @param {string} id\n * The plot line's `id` as given in the original configuration\n * object or in the `addPlotLine` option.\n */\n function removePlotLine(id) {\n this.removePlotBandOrLine(id);\n }\n})(PlotLineOrBandAxis || (PlotLineOrBandAxis = {}));\n/* *\n *\n * Default Export\n *\n * */\nexport default PlotLineOrBandAxis;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport PlotLineOrBandAxis from './PlotLineOrBandAxis.js';\nimport U from '../../Utilities.js';\nconst { arrayMax, arrayMin, defined, destroyObjectProperties, erase, fireEvent, merge, objectEach, pick } = U;\n/* *\n *\n * Class\n *\n * */\n/**\n * The object wrapper for plot lines and plot bands\n *\n * @class\n * @name Highcharts.PlotLineOrBand\n *\n * @param {Highcharts.Axis} axis\n * Related axis.\n *\n * @param {Highcharts.AxisPlotLinesOptions|Highcharts.AxisPlotBandsOptions} [options]\n * Options to use.\n */\nclass PlotLineOrBand {\n /* *\n *\n * Static Functions\n *\n * */\n static compose(AxisClass) {\n return PlotLineOrBandAxis.compose(PlotLineOrBand, AxisClass);\n }\n /* *\n *\n * Constructor\n *\n * */\n constructor(axis, options) {\n /**\n * Related axis.\n *\n * @name Highcharts.PlotLineOrBand#axis\n * @type {Highcharts.Axis}\n */\n this.axis = axis;\n /**\n * Options of the plot line or band.\n *\n * @name Highcharts.PlotLineOrBand#options\n * @type {AxisPlotBandsOptions|AxisPlotLinesOptions}\n */\n this.options = options;\n this.id = options.id;\n }\n /* *\n *\n * Functions\n *\n * */\n /* eslint-disable no-invalid-this, valid-jsdoc */\n /**\n * Render the plot line or plot band. If it is already existing,\n * move it.\n * @private\n * @function Highcharts.PlotLineOrBand#render\n */\n render() {\n fireEvent(this, 'render');\n const { axis, options } = this, { horiz, logarithmic } = axis, { color, events, zIndex = 0 } = options, groupAttribs = {}, renderer = axis.chart.renderer, \n // These properties only exist on either band or line\n to = options.to, from = options.from, value = options.value, borderWidth = options.borderWidth;\n let optionsLabel = options.label, { label, svgElem } = this, path = [], group;\n const isBand = defined(from) && defined(to), isLine = defined(value), isNew = !svgElem, attribs = {\n 'class': 'highcharts-plot-' + (isBand ? 'band ' : 'line ') +\n (options.className || '')\n };\n let groupName = isBand ? 'bands' : 'lines';\n // Set the presentational attributes\n if (!axis.chart.styledMode) {\n if (isLine) {\n attribs.stroke = color || \"#999999\" /* Palette.neutralColor40 */;\n attribs['stroke-width'] = pick(options.width, 1);\n if (options.dashStyle) {\n attribs.dashstyle = options.dashStyle;\n }\n }\n else if (isBand) { // Plot band\n attribs.fill = color || \"#e6e9ff\" /* Palette.highlightColor10 */;\n if (borderWidth) {\n attribs.stroke = options.borderColor;\n attribs['stroke-width'] = borderWidth;\n }\n }\n }\n // Grouping and zIndex\n groupAttribs.zIndex = zIndex;\n groupName += '-' + zIndex;\n group = axis.plotLinesAndBandsGroups[groupName];\n if (!group) {\n axis.plotLinesAndBandsGroups[groupName] = group =\n renderer.g('plot-' + groupName)\n .attr(groupAttribs).add();\n }\n // Create the path\n if (!svgElem) {\n /**\n * SVG element of the plot line or band.\n *\n * @name Highcharts.PlotLineOrBand#svgElem\n * @type {Highcharts.SVGElement}\n */\n this.svgElem = svgElem = renderer\n .path()\n .attr(attribs)\n .add(group);\n }\n // Set the path or return\n if (defined(value)) { // Plot line\n path = axis.getPlotLinePath({\n value: logarithmic?.log2lin(value) ?? value,\n lineWidth: svgElem.strokeWidth(),\n acrossPanes: options.acrossPanes\n });\n }\n else if (defined(from) && defined(to)) { // Plot band\n path = axis.getPlotBandPath(logarithmic?.log2lin(from) ?? from, logarithmic?.log2lin(to) ?? to, options);\n }\n else {\n return;\n }\n // Common for lines and bands. Add events only if they were not added\n // before.\n if (!this.eventsAdded && events) {\n objectEach(events, (event, eventType) => {\n svgElem?.on(eventType, (e) => {\n events[eventType].apply(this, [e]);\n });\n });\n this.eventsAdded = true;\n }\n if ((isNew || !svgElem.d) && path?.length) {\n svgElem.attr({ d: path });\n }\n else if (svgElem) {\n if (path) {\n svgElem.show();\n svgElem.animate({ d: path });\n }\n else if (svgElem.d) {\n svgElem.hide();\n if (label) {\n this.label = label = label.destroy();\n }\n }\n }\n // The plot band/line label\n if (optionsLabel &&\n (defined(optionsLabel.text) || defined(optionsLabel.formatter)) &&\n path?.length &&\n axis.width > 0 &&\n axis.height > 0 &&\n !path.isFlat) {\n // Apply defaults\n optionsLabel = merge({\n align: horiz && isBand && 'center',\n x: horiz ? !isBand && 4 : 10,\n verticalAlign: !horiz && isBand && 'middle',\n y: horiz ? isBand ? 16 : 10 : isBand ? 6 : -4,\n rotation: horiz && !isBand && 90\n }, optionsLabel);\n this.renderLabel(optionsLabel, path, isBand, zIndex);\n // Move out of sight\n }\n else if (label) {\n label.hide();\n }\n // Chainable\n return this;\n }\n /**\n * Render and align label for plot line or band.\n * @private\n * @function Highcharts.PlotLineOrBand#renderLabel\n */\n renderLabel(optionsLabel, path, isBand, zIndex) {\n const plotLine = this, axis = plotLine.axis, renderer = axis.chart.renderer;\n let label = plotLine.label;\n // Add the SVG element\n if (!label) {\n /**\n * SVG element of the label.\n *\n * @name Highcharts.PlotLineOrBand#label\n * @type {Highcharts.SVGElement}\n */\n plotLine.label = label = renderer\n .text(this.getLabelText(optionsLabel), 0, 0, optionsLabel.useHTML)\n .attr({\n align: optionsLabel.textAlign || optionsLabel.align,\n rotation: optionsLabel.rotation,\n 'class': 'highcharts-plot-' + (isBand ? 'band' : 'line') +\n '-label' + (optionsLabel.className || ''),\n zIndex\n });\n if (!axis.chart.styledMode) {\n label.css(merge({\n fontSize: '0.8em',\n textOverflow: 'ellipsis'\n }, optionsLabel.style));\n }\n label.add();\n }\n // Get the bounding box and align the label\n // #3000 changed to better handle choice between plotband or plotline\n const xBounds = path.xBounds ||\n [path[0][1], path[1][1], (isBand ? path[2][1] : path[0][1])], yBounds = path.yBounds ||\n [path[0][2], path[1][2], (isBand ? path[2][2] : path[0][2])], x = arrayMin(xBounds), y = arrayMin(yBounds);\n label.align(optionsLabel, false, {\n x,\n y,\n width: arrayMax(xBounds) - x,\n height: arrayMax(yBounds) - y\n });\n if (!label.alignValue || label.alignValue === 'left') {\n const width = optionsLabel.clip ?\n axis.width : axis.chart.chartWidth;\n label.css({\n width: (label.rotation === 90 ?\n axis.height - (label.alignAttr.y - axis.top) :\n width - (label.alignAttr.x - axis.left)) + 'px'\n });\n }\n label.show(true);\n }\n /**\n * Get label's text content.\n * @private\n * @function Highcharts.PlotLineOrBand#getLabelText\n */\n getLabelText(optionsLabel) {\n return defined(optionsLabel.formatter) ?\n optionsLabel.formatter\n .call(this) :\n optionsLabel.text;\n }\n /**\n * Remove the plot line or band.\n *\n * @function Highcharts.PlotLineOrBand#destroy\n */\n destroy() {\n // Remove it from the lookup\n erase(this.axis.plotLinesAndBands, this);\n delete this.axis;\n destroyObjectProperties(this);\n }\n}\n/* *\n *\n * Default Export\n *\n * */\nexport default PlotLineOrBand;\n/* *\n *\n * API Options\n *\n * */\n/**\n * Options for plot bands on axes.\n *\n * @typedef {Highcharts.XAxisPlotBandsOptions|Highcharts.YAxisPlotBandsOptions|Highcharts.ZAxisPlotBandsOptions} Highcharts.AxisPlotBandsOptions\n */\n/**\n * Options for plot band labels on axes.\n *\n * @typedef {Highcharts.XAxisPlotBandsLabelOptions|Highcharts.YAxisPlotBandsLabelOptions|Highcharts.ZAxisPlotBandsLabelOptions} Highcharts.AxisPlotBandsLabelOptions\n */\n/**\n * Options for plot lines on axes.\n *\n * @typedef {Highcharts.XAxisPlotLinesOptions|Highcharts.YAxisPlotLinesOptions|Highcharts.ZAxisPlotLinesOptions} Highcharts.AxisPlotLinesOptions\n */\n/**\n * Options for plot line labels on axes.\n *\n * @typedef {Highcharts.XAxisPlotLinesLabelOptions|Highcharts.YAxisPlotLinesLabelOptions|Highcharts.ZAxisPlotLinesLabelOptions} Highcharts.AxisPlotLinesLabelOptions\n */\n('');\n/* *\n *\n * API Options\n *\n * */\n/**\n * An array of colored bands stretching across the plot area marking an\n * interval on the axis.\n *\n * In styled mode, the plot bands are styled by the `.highcharts-plot-band`\n * class in addition to the `className` option.\n *\n * @productdesc {highcharts}\n * In a gauge, a plot band on the Y axis (value axis) will stretch along the\n * perimeter of the gauge.\n *\n * @type {Array<*>}\n * @product highcharts highstock gantt\n * @apioption xAxis.plotBands\n */\n/**\n * Flag to decide if plotBand should be rendered across all panes.\n *\n * @since 7.1.2\n * @product highstock\n * @type {boolean}\n * @default true\n * @apioption xAxis.plotBands.acrossPanes\n */\n/**\n * Border color for the plot band. Also requires `borderWidth` to be set.\n *\n * @type {Highcharts.ColorString}\n * @apioption xAxis.plotBands.borderColor\n */\n/**\n * Border width for the plot band. Also requires `borderColor` to be set.\n *\n * @type {number}\n * @default 0\n * @apioption xAxis.plotBands.borderWidth\n */\n/**\n * A custom class name, in addition to the default `highcharts-plot-band`,\n * to apply to each individual band.\n *\n * @type {string}\n * @since 5.0.0\n * @apioption xAxis.plotBands.className\n */\n/**\n * The color of the plot band.\n *\n * @sample {highcharts} highcharts/xaxis/plotbands-color/\n * Color band\n * @sample {highstock} stock/xaxis/plotbands/\n * Plot band on Y axis\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @default ${palette.highlightColor10}\n * @apioption xAxis.plotBands.color\n */\n/**\n * An object defining mouse events for the plot band. Supported properties\n * are `click`, `mouseover`, `mouseout`, `mousemove`.\n *\n * @sample {highcharts} highcharts/xaxis/plotbands-events/\n * Mouse events demonstrated\n *\n * @since 1.2\n * @apioption xAxis.plotBands.events\n */\n/**\n * Click event on a plot band.\n *\n * @type {Highcharts.EventCallbackFunction}\n * @apioption xAxis.plotBands.events.click\n */\n/**\n * Mouse move event on a plot band.\n *\n * @type {Highcharts.EventCallbackFunction}\n * @apioption xAxis.plotBands.events.mousemove\n */\n/**\n * Mouse out event on the corner of a plot band.\n *\n * @type {Highcharts.EventCallbackFunction}\n * @apioption xAxis.plotBands.events.mouseout\n */\n/**\n * Mouse over event on a plot band.\n *\n * @type {Highcharts.EventCallbackFunction}\n * @apioption xAxis.plotBands.events.mouseover\n */\n/**\n * The start position of the plot band in axis units.\n *\n * @sample {highcharts} highcharts/xaxis/plotbands-color/\n * Datetime axis\n * @sample {highcharts} highcharts/xaxis/plotbands-from/\n * Categorized axis\n * @sample {highstock} stock/xaxis/plotbands/\n * Plot band on Y axis\n *\n * @type {number}\n * @apioption xAxis.plotBands.from\n */\n/**\n * An id used for identifying the plot band in Axis.removePlotBand.\n *\n * @sample {highcharts} highcharts/xaxis/plotbands-id/\n * Remove plot band by id\n * @sample {highstock} highcharts/xaxis/plotbands-id/\n * Remove plot band by id\n *\n * @type {string}\n * @apioption xAxis.plotBands.id\n */\n/**\n * The end position of the plot band in axis units.\n *\n * @sample {highcharts} highcharts/xaxis/plotbands-color/\n * Datetime axis\n * @sample {highcharts} highcharts/xaxis/plotbands-from/\n * Categorized axis\n * @sample {highstock} stock/xaxis/plotbands/\n * Plot band on Y axis\n *\n * @type {number}\n * @apioption xAxis.plotBands.to\n */\n/**\n * The z index of the plot band within the chart, relative to other\n * elements. Using the same z index as another element may give\n * unpredictable results, as the last rendered element will be on top.\n * Values from 0 to 20 make sense.\n *\n * @sample {highcharts} highcharts/xaxis/plotbands-color/\n * Behind plot lines by default\n * @sample {highcharts} highcharts/xaxis/plotbands-zindex/\n * Above plot lines\n * @sample {highcharts} highcharts/xaxis/plotbands-zindex-above-series/\n * Above plot lines and series\n *\n * @type {number}\n * @since 1.2\n * @apioption xAxis.plotBands.zIndex\n */\n/**\n * Text labels for the plot bands\n *\n * @product highcharts highstock gantt\n * @apioption xAxis.plotBands.label\n */\n/**\n * Horizontal alignment of the label. Can be one of \"left\", \"center\" or\n * \"right\".\n *\n * @sample {highcharts} highcharts/xaxis/plotbands-label-align/\n * Aligned to the right\n * @sample {highstock} stock/xaxis/plotbands-label/\n * Plot band with labels\n *\n * @type {Highcharts.AlignValue}\n * @default center\n * @since 2.1\n * @apioption xAxis.plotBands.label.align\n */\n/**\n * Rotation of the text label in degrees .\n *\n * @sample {highcharts} highcharts/xaxis/plotbands-label-rotation/\n * Vertical text\n *\n * @type {number}\n * @default 0\n * @since 2.1\n * @apioption xAxis.plotBands.label.rotation\n */\n/**\n * CSS styles for the text label.\n *\n * In styled mode, the labels are styled by the\n * `.highcharts-plot-band-label` class.\n *\n * @sample {highcharts} highcharts/xaxis/plotbands-label-style/\n * Blue and bold label\n *\n * @type {Highcharts.CSSObject}\n * @since 2.1\n * @apioption xAxis.plotBands.label.style\n */\n/**\n * The string text itself. A subset of HTML is supported.\n *\n * @type {string}\n * @since 2.1\n * @apioption xAxis.plotBands.label.text\n */\n/**\n * The text alignment for the label. While `align` determines where the\n * texts anchor point is placed within the plot band, `textAlign` determines\n * how the text is aligned against its anchor point. Possible values are\n * \"left\", \"center\" and \"right\". Defaults to the same as the `align` option.\n *\n * @sample {highcharts} highcharts/xaxis/plotbands-label-rotation/\n * Vertical text in center position but text-aligned left\n *\n * @type {Highcharts.AlignValue}\n * @since 2.1\n * @apioption xAxis.plotBands.label.textAlign\n */\n/**\n * Whether to [use HTML](https://www.highcharts.com/docs/chart-concepts/labels-and-string-formatting#html)\n * to render the labels.\n *\n * @type {boolean}\n * @default false\n * @since 3.0.3\n * @apioption xAxis.plotBands.label.useHTML\n */\n/**\n * Vertical alignment of the label relative to the plot band. Can be one of\n * \"top\", \"middle\" or \"bottom\".\n *\n * @sample {highcharts} highcharts/xaxis/plotbands-label-verticalalign/\n * Vertically centered label\n * @sample {highstock} stock/xaxis/plotbands-label/\n * Plot band with labels\n *\n * @type {Highcharts.VerticalAlignValue}\n * @default top\n * @since 2.1\n * @apioption xAxis.plotBands.label.verticalAlign\n */\n/**\n * Horizontal position relative the alignment. Default varies by\n * orientation.\n *\n * @sample {highcharts} highcharts/xaxis/plotbands-label-align/\n * Aligned 10px from the right edge\n * @sample {highstock} stock/xaxis/plotbands-label/\n * Plot band with labels\n *\n * @type {number}\n * @since 2.1\n * @apioption xAxis.plotBands.label.x\n */\n/**\n * Vertical position of the text baseline relative to the alignment. Default\n * varies by orientation.\n *\n * @sample {highcharts} highcharts/xaxis/plotbands-label-y/\n * Label on x axis\n * @sample {highstock} stock/xaxis/plotbands-label/\n * Plot band with labels\n *\n * @type {number}\n * @since 2.1\n * @apioption xAxis.plotBands.label.y\n */\n/**\n * An array of lines stretching across the plot area, marking a specific\n * value on one of the axes.\n *\n * In styled mode, the plot lines are styled by the\n * `.highcharts-plot-line` class in addition to the `className` option.\n *\n * @type {Array<*>}\n * @product highcharts highstock gantt\n * @sample {highcharts} highcharts/xaxis/plotlines-color/\n * Basic plot line\n * @sample {highcharts} highcharts/series-solidgauge/labels-auto-aligned/\n * Solid gauge plot line\n * @apioption xAxis.plotLines\n */\n/**\n * Flag to decide if plotLine should be rendered across all panes.\n *\n * @sample {highstock} stock/xaxis/plotlines-acrosspanes/\n * Plot lines on different panes\n *\n * @since 7.1.2\n * @product highstock\n * @type {boolean}\n * @default true\n * @apioption xAxis.plotLines.acrossPanes\n */\n/**\n * A custom class name, in addition to the default `highcharts-plot-line`,\n * to apply to each individual line.\n *\n * @type {string}\n * @since 5.0.0\n * @apioption xAxis.plotLines.className\n */\n/**\n * The color of the line.\n *\n * @sample {highcharts} highcharts/xaxis/plotlines-color/\n * A red line from X axis\n * @sample {highstock} stock/xaxis/plotlines/\n * Plot line on Y axis\n *\n * @type {Highcharts.ColorString}\n * @default ${palette.neutralColor40}\n * @apioption xAxis.plotLines.color\n */\n/**\n * The dashing or dot style for the plot line. For possible values see\n * [this overview](https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-dashstyle-all/).\n *\n * @sample {highcharts} highcharts/xaxis/plotlines-dashstyle/\n * Dash and dot pattern\n * @sample {highstock} stock/xaxis/plotlines/\n * Plot line on Y axis\n *\n * @type {Highcharts.DashStyleValue}\n * @default Solid\n * @since 1.2\n * @apioption xAxis.plotLines.dashStyle\n */\n/**\n * An object defining mouse events for the plot line. Supported\n * properties are `click`, `mouseover`, `mouseout`, `mousemove`.\n *\n * @sample {highcharts} highcharts/xaxis/plotlines-events/\n * Mouse events demonstrated\n *\n * @since 1.2\n * @apioption xAxis.plotLines.events\n */\n/**\n * Click event on a plot band.\n *\n * @type {Highcharts.EventCallbackFunction}\n * @apioption xAxis.plotLines.events.click\n */\n/**\n * Mouse move event on a plot band.\n *\n * @type {Highcharts.EventCallbackFunction}\n * @apioption xAxis.plotLines.events.mousemove\n */\n/**\n * Mouse out event on the corner of a plot band.\n *\n * @type {Highcharts.EventCallbackFunction}\n * @apioption xAxis.plotLines.events.mouseout\n */\n/**\n * Mouse over event on a plot band.\n *\n * @type {Highcharts.EventCallbackFunction}\n * @apioption xAxis.plotLines.events.mouseover\n */\n/**\n * An id used for identifying the plot line in Axis.removePlotLine.\n *\n * @sample {highcharts} highcharts/xaxis/plotlines-id/\n * Remove plot line by id\n *\n * @type {string}\n * @apioption xAxis.plotLines.id\n */\n/**\n * The position of the line in axis units.\n *\n * @sample {highcharts} highcharts/xaxis/plotlines-color/\n * Between two categories on X axis\n * @sample {highstock} stock/xaxis/plotlines/\n * Plot line on Y axis\n *\n * @type {number}\n * @apioption xAxis.plotLines.value\n */\n/**\n * The width or thickness of the plot line.\n *\n * @sample {highcharts} highcharts/xaxis/plotlines-color/\n * 2px wide line from X axis\n * @sample {highstock} stock/xaxis/plotlines/\n * Plot line on Y axis\n *\n * @type {number}\n * @default 2\n * @apioption xAxis.plotLines.width\n */\n/**\n * The z index of the plot line within the chart.\n *\n * @sample {highcharts} highcharts/xaxis/plotlines-zindex-behind/\n * Behind plot lines by default\n * @sample {highcharts} highcharts/xaxis/plotlines-zindex-above/\n * Above plot lines\n * @sample {highcharts} highcharts/xaxis/plotlines-zindex-above-all/\n * Above plot lines and series\n *\n * @type {number}\n * @since 1.2\n * @apioption xAxis.plotLines.zIndex\n */\n/**\n * Text labels for the plot bands\n *\n * @apioption xAxis.plotLines.label\n */\n/**\n * Horizontal alignment of the label. Can be one of \"left\", \"center\" or\n * \"right\".\n *\n * @sample {highcharts} highcharts/xaxis/plotlines-label-align-right/\n * Aligned to the right\n * @sample {highstock} stock/xaxis/plotlines/\n * Plot line on Y axis\n *\n * @type {Highcharts.AlignValue}\n * @default left\n * @since 2.1\n * @apioption xAxis.plotLines.label.align\n */\n/**\n * Whether to hide labels that are outside the plot area.\n *\n * @type {boolean}\n * @default false\n * @since 10.3.3\n * @apioption xAxis.plotLines.labels.clip\n */\n/**\n * Callback JavaScript function to format the label. Useful properties like\n * the value of plot line or the range of plot band (`from` & `to`\n * properties) can be found in `this.options` object.\n *\n * @sample {highcharts} highcharts/xaxis/plotlines-plotbands-label-formatter\n * Label formatters for plot line and plot band.\n * @type {Highcharts.FormatterCallbackFunction}\n * @apioption xAxis.plotLines.label.formatter\n */\n/**\n * Rotation of the text label in degrees. Defaults to 0 for horizontal plot\n * lines and 90 for vertical lines.\n *\n * @sample {highcharts} highcharts/xaxis/plotlines-label-verticalalign-middle/\n * Slanted text\n *\n * @type {number}\n * @since 2.1\n * @apioption xAxis.plotLines.label.rotation\n */\n/**\n * CSS styles for the text label.\n *\n * In styled mode, the labels are styled by the\n * `.highcharts-plot-line-label` class.\n *\n * @sample {highcharts} highcharts/xaxis/plotlines-label-style/\n * Blue and bold label\n *\n * @type {Highcharts.CSSObject}\n * @since 2.1\n * @apioption xAxis.plotLines.label.style\n */\n/**\n * The text itself. A subset of HTML is supported.\n *\n * @type {string}\n * @since 2.1\n * @apioption xAxis.plotLines.label.text\n */\n/**\n * The text alignment for the label. While `align` determines where the\n * texts anchor point is placed within the plot band, `textAlign` determines\n * how the text is aligned against its anchor point. Possible values are\n * \"left\", \"center\" and \"right\". Defaults to the same as the `align` option.\n *\n * @sample {highcharts} highcharts/xaxis/plotlines-label-textalign/\n * Text label in bottom position\n *\n * @type {Highcharts.AlignValue}\n * @since 2.1\n * @apioption xAxis.plotLines.label.textAlign\n */\n/**\n * Whether to [use HTML](https://www.highcharts.com/docs/chart-concepts/labels-and-string-formatting#html)\n * to render the labels.\n *\n * @type {boolean}\n * @default false\n * @since 3.0.3\n * @apioption xAxis.plotLines.label.useHTML\n */\n/**\n * Vertical alignment of the label relative to the plot line. Can be\n * one of \"top\", \"middle\" or \"bottom\".\n *\n * @sample {highcharts} highcharts/xaxis/plotlines-label-verticalalign-middle/\n * Vertically centered label\n *\n * @type {Highcharts.VerticalAlignValue}\n * @default {highcharts} top\n * @default {highstock} top\n * @since 2.1\n * @apioption xAxis.plotLines.label.verticalAlign\n */\n/**\n * Horizontal position relative the alignment. Default varies by\n * orientation.\n *\n * @sample {highcharts} highcharts/xaxis/plotlines-label-align-right/\n * Aligned 10px from the right edge\n * @sample {highstock} stock/xaxis/plotlines/\n * Plot line on Y axis\n *\n * @type {number}\n * @since 2.1\n * @apioption xAxis.plotLines.label.x\n */\n/**\n * Vertical position of the text baseline relative to the alignment. Default\n * varies by orientation.\n *\n * @sample {highcharts} highcharts/xaxis/plotlines-label-y/\n * Label below the plot line\n * @sample {highstock} stock/xaxis/plotlines/\n * Plot line on Y axis\n *\n * @type {number}\n * @since 2.1\n * @apioption xAxis.plotLines.label.y\n */\n/**\n * @type {Array<*>}\n * @extends xAxis.plotBands\n * @apioption yAxis.plotBands\n */\n/**\n * In a gauge chart, this option determines the inner radius of the\n * plot band that stretches along the perimeter. It can be given as\n * a percentage string, like `\"100%\"`, or as a pixel number, like `100`.\n * By default, the inner radius is controlled by the [thickness](\n * #yAxis.plotBands.thickness) option.\n *\n * @sample {highcharts} highcharts/xaxis/plotbands-gauge\n * Gauge plot band\n *\n * @type {number|string}\n * @since 2.3\n * @product highcharts\n * @apioption yAxis.plotBands.innerRadius\n */\n/**\n * In a gauge chart, this option determines the outer radius of the\n * plot band that stretches along the perimeter. It can be given as\n * a percentage string, like `\"100%\"`, or as a pixel number, like `100`.\n *\n * @sample {highcharts} highcharts/xaxis/plotbands-gauge\n * Gauge plot band\n *\n * @type {number|string}\n * @default 100%\n * @since 2.3\n * @product highcharts\n * @apioption yAxis.plotBands.outerRadius\n */\n/**\n * In a gauge chart, this option sets the width of the plot band\n * stretching along the perimeter. It can be given as a percentage\n * string, like `\"10%\"`, or as a pixel number, like `10`. The default\n * value 10 is the same as the default [tickLength](#yAxis.tickLength),\n * thus making the plot band act as a background for the tick markers.\n *\n * @sample {highcharts} highcharts/xaxis/plotbands-gauge\n * Gauge plot band\n *\n * @type {number|string}\n * @default 10\n * @since 2.3\n * @product highcharts\n * @apioption yAxis.plotBands.thickness\n */\n/**\n * @type {Array<*>}\n * @extends xAxis.plotLines\n * @apioption yAxis.plotLines\n */\n(''); // keeps doclets above in JS file\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport F from './Templating.js';\nconst { format } = F;\nimport H from './Globals.js';\nconst { composed, doc, isSafari } = H;\nimport R from './Renderer/RendererUtilities.js';\nconst { distribute } = R;\nimport RendererRegistry from './Renderer/RendererRegistry.js';\nimport U from './Utilities.js';\nconst { addEvent, clamp, css, discardElement, extend, fireEvent, isArray, isNumber, isString, merge, pick, pushUnique, splat, syncTimeout } = U;\n/* *\n *\n * Class\n *\n * */\n/* eslint-disable no-invalid-this, valid-jsdoc */\n/**\n * Tooltip of a chart.\n *\n * @class\n * @name Highcharts.Tooltip\n *\n * @param {Highcharts.Chart} chart\n * The chart instance.\n *\n * @param {Highcharts.TooltipOptions} options\n * Tooltip options.\n */\nclass Tooltip {\n /* *\n *\n * Constructors\n *\n * */\n constructor(chart, options, pointer) {\n /* *\n *\n * Properties\n *\n * */\n this.allowShared = true;\n this.crosshairs = [];\n this.distance = 0;\n this.isHidden = true;\n this.isSticky = false;\n this.now = {};\n this.options = {};\n this.outside = false;\n this.chart = chart;\n this.init(chart, options);\n this.pointer = pointer;\n }\n /* *\n *\n * Functions\n *\n * */\n /**\n * Build the body (lines) of the tooltip by iterating over the items and\n * returning one entry for each item, abstracting this functionality allows\n * to easily overwrite and extend it.\n *\n * @private\n * @function Highcharts.Tooltip#bodyFormatter\n */\n bodyFormatter(items) {\n return items.map(function (item) {\n const tooltipOptions = item.series.tooltipOptions;\n return (tooltipOptions[(item.point.formatPrefix || 'point') + 'Formatter'] ||\n item.point.tooltipFormatter).call(item.point, tooltipOptions[(item.point.formatPrefix || 'point') + 'Format'] || '');\n });\n }\n /**\n * Destroy the single tooltips in a split tooltip.\n * If the tooltip is active then it is not destroyed, unless forced to.\n *\n * @private\n * @function Highcharts.Tooltip#cleanSplit\n *\n * @param {boolean} [force]\n * Force destroy all tooltips.\n */\n cleanSplit(force) {\n this.chart.series.forEach(function (series) {\n const tt = series && series.tt;\n if (tt) {\n if (!tt.isActive || force) {\n series.tt = tt.destroy();\n }\n else {\n tt.isActive = false;\n }\n }\n });\n }\n /**\n * In case no user defined formatter is given, this will be used. Note that\n * the context here is an object holding point, series, x, y etc.\n *\n * @function Highcharts.Tooltip#defaultFormatter\n *\n * @param {Highcharts.Tooltip} tooltip\n *\n * @return {string|Array}\n * Returns a string (single tooltip and shared)\n * or an array of strings (split tooltip)\n */\n defaultFormatter(tooltip) {\n const items = this.points || splat(this);\n let s;\n // Build the header\n s = [tooltip.tooltipFooterHeaderFormatter(items[0])];\n // build the values\n s = s.concat(tooltip.bodyFormatter(items));\n // footer\n s.push(tooltip.tooltipFooterHeaderFormatter(items[0], true));\n return s;\n }\n /**\n * Removes and destroys the tooltip and its elements.\n *\n * @function Highcharts.Tooltip#destroy\n */\n destroy() {\n // Destroy and clear local variables\n if (this.label) {\n this.label = this.label.destroy();\n }\n if (this.split) {\n this.cleanSplit(true);\n if (this.tt) {\n this.tt = this.tt.destroy();\n }\n }\n if (this.renderer) {\n this.renderer = this.renderer.destroy();\n discardElement(this.container);\n }\n U.clearTimeout(this.hideTimer);\n U.clearTimeout(this.tooltipTimeout);\n }\n /**\n * Extendable method to get the anchor position of the tooltip\n * from a point or set of points\n *\n * @private\n * @function Highcharts.Tooltip#getAnchor\n */\n getAnchor(points, mouseEvent) {\n const { chart, pointer } = this, inverted = chart.inverted, plotTop = chart.plotTop, plotLeft = chart.plotLeft;\n let ret;\n points = splat(points);\n // If reversedStacks are false the tooltip position should be taken from\n // the last point (#17948)\n if (points[0].series &&\n points[0].series.yAxis &&\n !points[0].series.yAxis.options.reversedStacks) {\n points = points.slice().reverse();\n }\n // When tooltip follows mouse, relate the position to the mouse\n if (this.followPointer && mouseEvent) {\n if (typeof mouseEvent.chartX === 'undefined') {\n mouseEvent = pointer.normalize(mouseEvent);\n }\n ret = [\n mouseEvent.chartX - plotLeft,\n mouseEvent.chartY - plotTop\n ];\n // Some series types use a specificly calculated tooltip position for\n // each point\n }\n else if (points[0].tooltipPos) {\n ret = points[0].tooltipPos;\n // Calculate the average position and adjust for axis positions\n }\n else {\n let chartX = 0, chartY = 0;\n points.forEach(function (point) {\n const pos = point.pos(true);\n if (pos) {\n chartX += pos[0];\n chartY += pos[1];\n }\n });\n chartX /= points.length;\n chartY /= points.length;\n // When shared, place the tooltip next to the mouse (#424)\n if (this.shared && points.length > 1 && mouseEvent) {\n if (inverted) {\n chartX = mouseEvent.chartX;\n }\n else {\n chartY = mouseEvent.chartY;\n }\n }\n // Use the average position for multiple points\n ret = [chartX - plotLeft, chartY - plotTop];\n }\n return ret.map(Math.round);\n }\n /**\n * Get the CSS class names for the tooltip's label. Styles the label\n * by `colorIndex` or user-defined CSS.\n *\n * @function Highcharts.Tooltip#getClassName\n *\n * @return {string}\n * The class names.\n */\n getClassName(point, isSplit, isHeader) {\n const options = this.options, series = point.series, seriesOptions = series.options;\n return [\n options.className,\n 'highcharts-label',\n isHeader && 'highcharts-tooltip-header',\n isSplit ? 'highcharts-tooltip-box' : 'highcharts-tooltip',\n !isHeader && 'highcharts-color-' + pick(point.colorIndex, series.colorIndex),\n (seriesOptions && seriesOptions.className)\n ].filter(isString).join(' ');\n }\n /**\n * Creates the Tooltip label element if it does not exist, then returns it.\n *\n * @function Highcharts.Tooltip#getLabel\n *\n * @return {Highcharts.SVGElement}\n * Tooltip label\n */\n getLabel() {\n const tooltip = this, styledMode = this.chart.styledMode, options = this.options, doSplit = this.split && this.allowShared;\n let container = this.container, renderer = this.chart.renderer;\n // If changing from a split tooltip to a non-split tooltip, we must\n // destroy it in order to get the SVG right. #13868.\n if (this.label) {\n const wasSplit = !this.label.hasClass('highcharts-label');\n if ((!doSplit && wasSplit) || (doSplit && !wasSplit)) {\n this.destroy();\n }\n }\n if (!this.label) {\n if (this.outside) {\n const chartStyle = this.chart.options.chart.style, Renderer = RendererRegistry.getRendererType();\n /**\n * Reference to the tooltip's container, when\n * [Highcharts.Tooltip#outside] is set to true, otherwise\n * it's undefined.\n *\n * @name Highcharts.Tooltip#container\n * @type {Highcharts.HTMLDOMElement|undefined}\n */\n this.container = container = H.doc.createElement('div');\n container.className = 'highcharts-tooltip-container';\n // We need to set pointerEvents = 'none' as otherwise it makes\n // the area under the tooltip non-hoverable even after the\n // tooltip disappears, #19035.\n css(container, {\n position: 'absolute',\n top: '1px',\n pointerEvents: 'none',\n zIndex: Math.max(this.options.style.zIndex || 0, (chartStyle && chartStyle.zIndex || 0) + 3)\n });\n /**\n * Reference to the tooltip's renderer, when\n * [Highcharts.Tooltip#outside] is set to true, otherwise\n * it's undefined.\n *\n * @name Highcharts.Tooltip#renderer\n * @type {Highcharts.SVGRenderer|undefined}\n */\n this.renderer = renderer = new Renderer(container, 0, 0, chartStyle, void 0, void 0, renderer.styledMode);\n }\n // Create the label\n if (doSplit) {\n this.label = renderer.g('tooltip');\n }\n else {\n this.label = renderer\n .label('', 0, 0, options.shape, void 0, void 0, options.useHTML, void 0, 'tooltip')\n .attr({\n padding: options.padding,\n r: options.borderRadius\n });\n if (!styledMode) {\n this.label\n .attr({\n fill: options.backgroundColor,\n 'stroke-width': options.borderWidth || 0\n })\n // #2301, #2657\n .css(options.style)\n .css({\n pointerEvents: (options.style.pointerEvents ||\n (this.shouldStickOnContact() ? 'auto' : 'none'))\n });\n }\n }\n // Split tooltip use updateTooltipContainer to position the tooltip\n // container.\n if (tooltip.outside) {\n const label = this.label;\n const { xSetter, ySetter } = label;\n label.xSetter = function (value) {\n xSetter.call(label, tooltip.distance);\n if (container) {\n container.style.left = value + 'px';\n }\n };\n label.ySetter = function (value) {\n ySetter.call(label, tooltip.distance);\n if (container) {\n container.style.top = value + 'px';\n }\n };\n }\n this.label\n .attr({ zIndex: 8 })\n .shadow(options.shadow)\n .add();\n }\n if (container && !container.parentElement) {\n H.doc.body.appendChild(container);\n }\n return this.label;\n }\n /**\n * Get the total area available area to place the tooltip\n *\n * @private\n */\n getPlayingField() {\n const { body, documentElement } = doc, { chart, distance, outside } = this;\n return {\n width: outside ?\n // Subtract distance to prevent scrollbars\n Math.max(body.scrollWidth, documentElement.scrollWidth, body.offsetWidth, documentElement.offsetWidth, documentElement.clientWidth) - 2 * distance :\n chart.chartWidth,\n height: outside ?\n Math.max(body.scrollHeight, documentElement.scrollHeight, body.offsetHeight, documentElement.offsetHeight, documentElement.clientHeight) :\n chart.chartHeight\n };\n }\n /**\n * Place the tooltip in a chart without spilling over and not covering the\n * point itself.\n *\n * @function Highcharts.Tooltip#getPosition\n *\n * @param {number} boxWidth\n * Width of the tooltip box.\n *\n * @param {number} boxHeight\n * Height of the tooltip box.\n *\n * @param {Highcharts.Point} point\n * Tooltip related point.\n *\n * @return {Highcharts.PositionObject}\n * Recommended position of the tooltip.\n */\n getPosition(boxWidth, boxHeight, point) {\n const { distance, chart, outside, pointer } = this, { inverted, plotLeft, plotTop, polar } = chart, { plotX = 0, plotY = 0 } = point, ret = {}, \n // Don't use h if chart isn't inverted (#7242) ???\n h = (inverted && point.h) || 0, // #4117 ???\n { height: outerHeight, width: outerWidth } = this.getPlayingField(), chartPosition = pointer.getChartPosition(), scaleX = (val) => (val * chartPosition.scaleX), scaleY = (val) => (val * chartPosition.scaleY), \n // Build parameter arrays for firstDimension()/secondDimension()\n buildDimensionArray = (dim) => {\n const isX = dim === 'x';\n return [\n dim,\n isX ? outerWidth : outerHeight,\n isX ? boxWidth : boxHeight\n ].concat(outside ? [\n // If we are using tooltip.outside, we need to scale the\n // position to match scaling of the container in case there\n // is a transform/zoom on the container. #11329\n isX ? scaleX(boxWidth) : scaleY(boxHeight),\n isX ? chartPosition.left - distance +\n scaleX(plotX + plotLeft) :\n chartPosition.top - distance +\n scaleY(plotY + plotTop),\n 0,\n isX ? outerWidth : outerHeight\n ] : [\n // Not outside, no scaling is needed\n isX ? boxWidth : boxHeight,\n isX ? plotX + plotLeft : plotY + plotTop,\n isX ? plotLeft : plotTop,\n isX ? plotLeft + chart.plotWidth :\n plotTop + chart.plotHeight\n ]);\n };\n let first = buildDimensionArray('y'), second = buildDimensionArray('x'), swapped;\n // Handle negative points or reversed axis (#13780)\n let flipped = !!point.negative;\n if (!polar &&\n chart.hoverSeries?.yAxis?.reversed) {\n flipped = !flipped;\n }\n // The far side is right or bottom\n const preferFarSide = !this.followPointer &&\n pick(point.ttBelow, polar ? false : !inverted === flipped), // #4984\n /*\n * Handle the preferred dimension. When the preferred dimension is\n * tooltip on top or bottom of the point, it will look for space\n * there.\n *\n * @private\n */\n firstDimension = function (dim, outerSize, innerSize, scaledInnerSize, // #11329\n point, min, max) {\n const scaledDist = outside ?\n (dim === 'y' ? scaleY(distance) : scaleX(distance)) :\n distance, scaleDiff = (innerSize - scaledInnerSize) / 2, roomLeft = scaledInnerSize < point - distance, roomRight = point + distance + scaledInnerSize < outerSize, alignedLeft = point - scaledDist - innerSize + scaleDiff, alignedRight = point + scaledDist - scaleDiff;\n if (preferFarSide && roomRight) {\n ret[dim] = alignedRight;\n }\n else if (!preferFarSide && roomLeft) {\n ret[dim] = alignedLeft;\n }\n else if (roomLeft) {\n ret[dim] = Math.min(max - scaledInnerSize, alignedLeft - h < 0 ? alignedLeft : alignedLeft - h);\n }\n else if (roomRight) {\n ret[dim] = Math.max(min, alignedRight + h + innerSize > outerSize ?\n alignedRight :\n alignedRight + h);\n }\n else {\n return false;\n }\n }, \n /*\n * Handle the secondary dimension. If the preferred dimension is\n * tooltip on top or bottom of the point, the second dimension is to\n * align the tooltip above the point, trying to align center but\n * allowing left or right align within the chart box.\n *\n * @private\n */\n secondDimension = function (dim, outerSize, innerSize, scaledInnerSize, // #11329\n point) {\n // Too close to the edge, return false and swap dimensions\n if (point < distance || point > outerSize - distance) {\n return false;\n }\n // Align left/top\n if (point < innerSize / 2) {\n ret[dim] = 1;\n // Align right/bottom\n }\n else if (point > outerSize - scaledInnerSize / 2) {\n ret[dim] = outerSize - scaledInnerSize - 2;\n // Align center\n }\n else {\n ret[dim] = point - innerSize / 2;\n }\n }, \n /*\n * Swap the dimensions\n */\n swap = function (count) {\n [first, second] = [second, first];\n swapped = count;\n }, run = () => {\n if (firstDimension.apply(0, first) !== false) {\n if (secondDimension.apply(0, second) === false &&\n !swapped) {\n swap(true);\n run();\n }\n }\n else if (!swapped) {\n swap(true);\n run();\n }\n else {\n ret.x = ret.y = 0;\n }\n };\n // Under these conditions, prefer the tooltip on the side of the point\n if ((inverted && !polar) || this.len > 1) {\n swap();\n }\n run();\n return ret;\n }\n /**\n * Hides the tooltip with a fade out animation.\n *\n * @function Highcharts.Tooltip#hide\n *\n * @param {number} [delay]\n * The fade out in milliseconds. If no value is provided the value\n * of the tooltip.hideDelay option is used. A value of 0 disables\n * the fade out animation.\n */\n hide(delay) {\n const tooltip = this;\n // Disallow duplicate timers (#1728, #1766)\n U.clearTimeout(this.hideTimer);\n delay = pick(delay, this.options.hideDelay);\n if (!this.isHidden) {\n this.hideTimer = syncTimeout(function () {\n const label = tooltip.getLabel();\n // If there is a delay, fade out with the default duration. If\n // the hideDelay is 0, we assume no animation is wanted, so we\n // pass 0 duration. #12994.\n tooltip.getLabel().animate({\n opacity: 0\n }, {\n duration: delay ? 150 : delay,\n complete: () => {\n // #3088, assuming we're only using this for tooltips\n label.hide();\n // Clear the container for outside tooltip (#18490)\n if (tooltip.container) {\n tooltip.container.remove();\n }\n }\n });\n tooltip.isHidden = true;\n }, delay);\n }\n }\n /**\n * Initialize tooltip.\n *\n * @private\n * @function Highcharts.Tooltip#init\n *\n * @param {Highcharts.Chart} chart\n * The chart instance.\n *\n * @param {Highcharts.TooltipOptions} options\n * Tooltip options.\n */\n init(chart, options) {\n /**\n * Chart of the tooltip.\n *\n * @readonly\n * @name Highcharts.Tooltip#chart\n * @type {Highcharts.Chart}\n */\n this.chart = chart;\n /**\n * Used tooltip options.\n *\n * @readonly\n * @name Highcharts.Tooltip#options\n * @type {Highcharts.TooltipOptions}\n */\n this.options = options;\n /**\n * List of crosshairs.\n *\n * @private\n * @readonly\n * @name Highcharts.Tooltip#crosshairs\n * @type {Array}\n */\n this.crosshairs = [];\n /**\n * Current values of x and y when animating.\n *\n * @private\n * @readonly\n * @name Highcharts.Tooltip#now\n * @type {Highcharts.PositionObject}\n */\n this.now = { x: 0, y: 0 };\n /**\n * Tooltips are initially hidden.\n *\n * @private\n * @readonly\n * @name Highcharts.Tooltip#isHidden\n * @type {boolean}\n */\n this.isHidden = true;\n /**\n * True, if the tooltip is split into one label per series, with the\n * header close to the axis.\n *\n * @readonly\n * @name Highcharts.Tooltip#split\n * @type {boolean|undefined}\n */\n this.split = options.split && !chart.inverted && !chart.polar;\n /**\n * When the tooltip is shared, the entire plot area will capture mouse\n * movement or touch events.\n *\n * @readonly\n * @name Highcharts.Tooltip#shared\n * @type {boolean|undefined}\n */\n this.shared = options.shared || this.split;\n /**\n * Whether to allow the tooltip to render outside the chart's SVG\n * element box. By default (false), the tooltip is rendered within the\n * chart's SVG element, which results in the tooltip being aligned\n * inside the chart area.\n *\n * @readonly\n * @name Highcharts.Tooltip#outside\n * @type {boolean}\n *\n * @todo\n * Split tooltip does not support outside in the first iteration. Should\n * not be too complicated to implement.\n */\n this.outside = pick(options.outside, Boolean(chart.scrollablePixelsX || chart.scrollablePixelsY));\n }\n shouldStickOnContact(pointerEvent) {\n return !!(!this.followPointer &&\n this.options.stickOnContact &&\n (!pointerEvent || this.pointer.inClass(pointerEvent.target, 'highcharts-tooltip')));\n }\n /**\n * Moves the tooltip with a soft animation to a new position.\n *\n * @private\n * @function Highcharts.Tooltip#move\n *\n * @param {number} x\n *\n * @param {number} y\n *\n * @param {number} anchorX\n *\n * @param {number} anchorY\n */\n move(x, y, anchorX, anchorY) {\n const tooltip = this, now = tooltip.now, animate = tooltip.options.animation !== false &&\n !tooltip.isHidden &&\n // When we get close to the target position, abort animation and\n // land on the right place (#3056)\n (Math.abs(x - now.x) > 1 || Math.abs(y - now.y) > 1), skipAnchor = tooltip.followPointer || tooltip.len > 1;\n // Get intermediate values for animation\n extend(now, {\n x: animate ? (2 * now.x + x) / 3 : x,\n y: animate ? (now.y + y) / 2 : y,\n anchorX: skipAnchor ?\n void 0 :\n animate ? (2 * now.anchorX + anchorX) / 3 : anchorX,\n anchorY: skipAnchor ?\n void 0 :\n animate ? (now.anchorY + anchorY) / 2 : anchorY\n });\n // Move to the intermediate value\n tooltip.getLabel().attr(now);\n tooltip.drawTracker();\n // Run on next tick of the mouse tracker\n if (animate) {\n // Never allow two timeouts\n U.clearTimeout(this.tooltipTimeout);\n // Set the fixed interval ticking for the smooth tooltip\n this.tooltipTimeout = setTimeout(function () {\n // The interval function may still be running during destroy,\n // so check that the chart is really there before calling.\n if (tooltip) {\n tooltip.move(x, y, anchorX, anchorY);\n }\n }, 32);\n }\n }\n /**\n * Refresh the tooltip's text and position.\n *\n * @function Highcharts.Tooltip#refresh\n *\n * @param {Highcharts.Point|Array} pointOrPoints\n * Either a point or an array of points.\n *\n * @param {Highcharts.PointerEventObject} [mouseEvent]\n * Mouse event, that is responsible for the refresh and should be\n * used for the tooltip update.\n */\n refresh(pointOrPoints, mouseEvent) {\n const tooltip = this, { chart, options, pointer, shared } = this, points = splat(pointOrPoints), point = points[0], pointConfig = [], formatString = options.format, formatter = options.formatter || tooltip.defaultFormatter, styledMode = chart.styledMode;\n let formatterContext = {};\n if (!options.enabled || !point.series) { // #16820\n return;\n }\n U.clearTimeout(this.hideTimer);\n // A switch saying if this specific tooltip configuration allows shared\n // or split modes\n tooltip.allowShared = !(!isArray(pointOrPoints) &&\n pointOrPoints.series &&\n pointOrPoints.series.noSharedTooltip);\n // get the reference point coordinates (pie charts use tooltipPos)\n tooltip.followPointer = (!tooltip.split && point.series.tooltipOptions.followPointer);\n const anchor = tooltip.getAnchor(pointOrPoints, mouseEvent), x = anchor[0], y = anchor[1];\n // shared tooltip, array is sent over\n if (shared && tooltip.allowShared) {\n pointer.applyInactiveState(points);\n // Now set hover state for the chosen ones:\n points.forEach(function (item) {\n item.setState('hover');\n pointConfig.push(item.getLabelConfig());\n });\n formatterContext = point.getLabelConfig();\n formatterContext.points = pointConfig;\n // single point tooltip\n }\n else {\n formatterContext = point.getLabelConfig();\n }\n this.len = pointConfig.length; // #6128\n const text = isString(formatString) ?\n format(formatString, formatterContext, chart) :\n formatter.call(formatterContext, tooltip);\n // register the current series\n const currentSeries = point.series;\n this.distance = pick(currentSeries.tooltipOptions.distance, 16);\n // update the inner HTML\n if (text === false) {\n this.hide();\n }\n else {\n // update text\n if (tooltip.split && tooltip.allowShared) { // #13868\n this.renderSplit(text, points);\n }\n else {\n let checkX = x;\n let checkY = y;\n if (mouseEvent && pointer.isDirectTouch) {\n checkX = mouseEvent.chartX - chart.plotLeft;\n checkY = mouseEvent.chartY - chart.plotTop;\n }\n // #11493, #13095\n if (chart.polar ||\n currentSeries.options.clip === false ||\n points.some((p) => // #16004\n pointer.isDirectTouch || // ##17929\n p.series.shouldShowTooltip(checkX, checkY))) {\n const label = tooltip.getLabel();\n // Prevent the tooltip from flowing over the chart box\n // (#6659)\n if (!options.style.width || styledMode) {\n label.css({\n width: (this.outside ?\n this.getPlayingField() :\n chart.spacingBox).width + 'px'\n });\n }\n label.attr({\n text: text && text.join ?\n text.join('') :\n text\n });\n // Set the stroke color of the box to reflect the point\n label.addClass(tooltip.getClassName(point), true);\n if (!styledMode) {\n label.attr({\n stroke: (options.borderColor ||\n point.color ||\n currentSeries.color ||\n \"#666666\" /* Palette.neutralColor60 */)\n });\n }\n tooltip.updatePosition({\n plotX: x,\n plotY: y,\n negative: point.negative,\n ttBelow: point.ttBelow,\n h: anchor[2] || 0\n });\n }\n else {\n tooltip.hide();\n return;\n }\n }\n // show it\n if (tooltip.isHidden && tooltip.label) {\n tooltip.label.attr({\n opacity: 1\n }).show();\n }\n tooltip.isHidden = false;\n }\n fireEvent(this, 'refresh');\n }\n /**\n * Render the split tooltip. Loops over each point's text and adds\n * a label next to the point, then uses the distribute function to\n * find best non-overlapping positions.\n *\n * @private\n * @function Highcharts.Tooltip#renderSplit\n *\n * @param {string|Array<(boolean|string)>} labels\n *\n * @param {Array} points\n */\n renderSplit(labels, points) {\n const tooltip = this;\n const { chart, chart: { chartWidth, chartHeight, plotHeight, plotLeft, plotTop, scrollablePixelsY = 0, scrollablePixelsX, styledMode }, distance, options, options: { positioner }, pointer } = tooltip;\n const { scrollLeft = 0, scrollTop = 0 } = chart.scrollablePlotArea?.scrollingContainer || {};\n // The area which the tooltip should be limited to. Limit to scrollable\n // plot area if enabled, otherwise limit to the chart container. If\n // outside is true it should be the whole viewport\n const bounds = (tooltip.outside &&\n typeof scrollablePixelsX !== 'number') ?\n doc.documentElement.getBoundingClientRect() : {\n left: scrollLeft,\n right: scrollLeft + chartWidth,\n top: scrollTop,\n bottom: scrollTop + chartHeight\n };\n const tooltipLabel = tooltip.getLabel();\n const ren = this.renderer || chart.renderer;\n const headerTop = Boolean(chart.xAxis[0] && chart.xAxis[0].opposite);\n const { left: chartLeft, top: chartTop } = pointer.getChartPosition();\n let distributionBoxTop = plotTop + scrollTop;\n let headerHeight = 0;\n let adjustedPlotHeight = plotHeight - scrollablePixelsY;\n /**\n * Calculates the anchor position for the partial tooltip\n *\n * @private\n * @param {Highcharts.Point} point The point related to the tooltip\n * @return {Object} Returns an object with anchorX and anchorY\n */\n function getAnchor(point) {\n const { isHeader, plotX = 0, plotY = 0, series } = point;\n let anchorX;\n let anchorY;\n if (isHeader) {\n // Set anchorX to plotX\n anchorX = Math.max(plotLeft + plotX, plotLeft);\n // Set anchorY to center of visible plot area.\n anchorY = plotTop + plotHeight / 2;\n }\n else {\n const { xAxis, yAxis } = series;\n // Set anchorX to plotX. Limit to within xAxis.\n anchorX = xAxis.pos + clamp(plotX, -distance, xAxis.len + distance);\n // Set anchorY, limit to the scrollable plot area\n if (series.shouldShowTooltip(0, yAxis.pos - plotTop + plotY, {\n ignoreX: true\n })) {\n anchorY = yAxis.pos + plotY;\n }\n }\n // Limit values to plot area\n anchorX = clamp(anchorX, bounds.left - distance, bounds.right + distance);\n return { anchorX, anchorY };\n }\n /**\n * Calculates the position of the partial tooltip\n *\n * @private\n * @param {number} anchorX\n * The partial tooltip anchor x position\n *\n * @param {number} anchorY\n * The partial tooltip anchor y position\n *\n * @param {boolean|undefined} isHeader\n * Whether the partial tooltip is a header\n *\n * @param {number} boxWidth\n * Width of the partial tooltip\n *\n * @return {Highcharts.PositionObject}\n * Returns the partial tooltip x and y position\n */\n function defaultPositioner(anchorX, anchorY, isHeader, boxWidth, alignedLeft = true) {\n let y;\n let x;\n if (isHeader) {\n y = headerTop ? 0 : adjustedPlotHeight;\n x = clamp(anchorX - (boxWidth / 2), bounds.left, bounds.right - boxWidth - (tooltip.outside ? chartLeft : 0));\n }\n else {\n y = anchorY - distributionBoxTop;\n x = alignedLeft ?\n anchorX - boxWidth - distance :\n anchorX + distance;\n x = clamp(x, alignedLeft ? x : bounds.left, bounds.right);\n }\n // NOTE: y is relative to distributionBoxTop\n return { x, y };\n }\n /**\n * Updates the attributes and styling of the partial tooltip. Creates a\n * new partial tooltip if it does not exists.\n *\n * @private\n * @param {Highcharts.SVGElement|undefined} partialTooltip\n * The partial tooltip to update\n * @param {Highcharts.Point} point\n * The point related to the partial tooltip\n * @param {boolean|string} str The text for the partial tooltip\n * @return {Highcharts.SVGElement} Returns the updated partial tooltip\n */\n function updatePartialTooltip(partialTooltip, point, str) {\n let tt = partialTooltip;\n const { isHeader, series } = point;\n if (!tt) {\n const attribs = {\n padding: options.padding,\n r: options.borderRadius\n };\n if (!styledMode) {\n attribs.fill = options.backgroundColor;\n attribs['stroke-width'] = options.borderWidth ?? 1;\n }\n tt = ren\n .label('', 0, 0, (options[isHeader ? 'headerShape' : 'shape']), void 0, void 0, options.useHTML)\n .addClass(tooltip.getClassName(point, true, isHeader))\n .attr(attribs)\n .add(tooltipLabel);\n }\n tt.isActive = true;\n tt.attr({\n text: str\n });\n if (!styledMode) {\n tt.css(options.style)\n .attr({\n stroke: (options.borderColor ||\n point.color ||\n series.color ||\n \"#333333\" /* Palette.neutralColor80 */)\n });\n }\n return tt;\n }\n // Graceful degradation for legacy formatters\n if (isString(labels)) {\n labels = [false, labels];\n }\n // Create the individual labels for header and points, ignore footer\n let boxes = labels.slice(0, points.length + 1).reduce(function (boxes, str, i) {\n if (str !== false && str !== '') {\n const point = (points[i - 1] ||\n {\n // Item 0 is the header. Instead of this, we could also\n // use the crosshair label\n isHeader: true,\n plotX: points[0].plotX,\n plotY: plotHeight,\n series: {}\n });\n const isHeader = point.isHeader;\n // Store the tooltip label reference on the series\n const owner = isHeader ? tooltip : point.series;\n const tt = owner.tt = updatePartialTooltip(owner.tt, point, str.toString());\n // Get X position now, so we can move all to the other side in\n // case of overflow\n const bBox = tt.getBBox();\n const boxWidth = bBox.width + tt.strokeWidth();\n if (isHeader) {\n headerHeight = bBox.height;\n adjustedPlotHeight += headerHeight;\n if (headerTop) {\n distributionBoxTop -= headerHeight;\n }\n }\n const { anchorX, anchorY } = getAnchor(point);\n if (typeof anchorY === 'number') {\n const size = bBox.height + 1;\n const boxPosition = (positioner ?\n positioner.call(tooltip, boxWidth, size, point) :\n defaultPositioner(anchorX, anchorY, isHeader, boxWidth));\n boxes.push({\n // 0-align to the top, 1-align to the bottom\n align: positioner ? 0 : void 0,\n anchorX,\n anchorY,\n boxWidth,\n point,\n rank: pick(boxPosition.rank, isHeader ? 1 : 0),\n size,\n target: boxPosition.y,\n tt,\n x: boxPosition.x\n });\n }\n else {\n // Hide tooltips which anchorY is outside the visible plot\n // area\n tt.isActive = false;\n }\n }\n return boxes;\n }, []);\n // Realign the tooltips towards the right if there is not enough space\n // to the left and there is space to the right\n if (!positioner && boxes.some((box) => {\n // Always realign if the beginning of a label is outside bounds\n const { outside } = tooltip;\n const boxStart = (outside ? chartLeft : 0) + box.anchorX;\n if (boxStart < bounds.left &&\n boxStart + box.boxWidth < bounds.right) {\n return true;\n }\n // Otherwise, check if there is more space available to the right\n return boxStart < (chartLeft - bounds.left) + box.boxWidth &&\n bounds.right - boxStart > boxStart;\n })) {\n boxes = boxes.map((box) => {\n const { x, y } = defaultPositioner(box.anchorX, box.anchorY, box.point.isHeader, box.boxWidth, false);\n return extend(box, {\n target: y,\n x\n });\n });\n }\n // Clean previous run (for missing points)\n tooltip.cleanSplit();\n // Distribute and put in place\n distribute(boxes, adjustedPlotHeight);\n const boxExtremes = {\n left: chartLeft,\n right: chartLeft\n };\n // Get the extremes from series tooltips\n boxes.forEach(function (box) {\n const { x, boxWidth, isHeader } = box;\n if (!isHeader) {\n if (tooltip.outside && chartLeft + x < boxExtremes.left) {\n boxExtremes.left = chartLeft + x;\n }\n if (!isHeader &&\n tooltip.outside &&\n boxExtremes.left + boxWidth > boxExtremes.right) {\n boxExtremes.right = chartLeft + x;\n }\n }\n });\n boxes.forEach(function (box) {\n const { x, anchorX, anchorY, pos, point: { isHeader } } = box;\n const attributes = {\n visibility: typeof pos === 'undefined' ? 'hidden' : 'inherit',\n x,\n /* NOTE: y should equal pos to be consistent with !split\n * tooltip, but is currently relative to plotTop. Is left as is\n * to avoid breaking change. Remove distributionBoxTop to make\n * it consistent.\n */\n y: (pos || 0) + distributionBoxTop,\n anchorX,\n anchorY\n };\n // Handle left-aligned tooltips overflowing the chart area\n if (tooltip.outside && x < anchorX) {\n const offset = chartLeft - boxExtremes.left;\n // Skip this if there is no overflow\n if (offset > 0) {\n if (!isHeader) {\n attributes.x = x + offset;\n attributes.anchorX = anchorX + offset;\n }\n if (isHeader) {\n attributes.x = (boxExtremes.right - boxExtremes.left) / 2;\n attributes.anchorX = anchorX + offset;\n }\n }\n }\n // Put the label in place\n box.tt.attr(attributes);\n });\n /* If we have a separate tooltip container, then update the necessary\n * container properties.\n * Test that tooltip has its own container and renderer before executing\n * the operation.\n */\n const { container, outside, renderer } = tooltip;\n if (outside && container && renderer) {\n // Set container size to fit the bounds\n const { width, height, x, y } = tooltipLabel.getBBox();\n renderer.setSize(width + x, height + y, false);\n // Position the tooltip container to the chart container\n container.style.left = boxExtremes.left + 'px';\n container.style.top = chartTop + 'px';\n }\n // Workaround for #18927, artefacts left by the shadows of split\n // tooltips in Safari v16 (2023). Check again with later versions if we\n // can remove this.\n if (isSafari) {\n tooltipLabel.attr({\n // Force a redraw of the whole group by chaining the opacity\n // slightly\n opacity: tooltipLabel.opacity === 1 ? 0.999 : 1\n });\n }\n }\n /**\n * If the `stickOnContact` option is active, this will add a tracker shape.\n *\n * @private\n * @function Highcharts.Tooltip#drawTracker\n */\n drawTracker() {\n const tooltip = this;\n if (!this.shouldStickOnContact()) {\n if (tooltip.tracker) {\n tooltip.tracker = tooltip.tracker.destroy();\n }\n return;\n }\n const chart = tooltip.chart;\n const label = tooltip.label;\n const points = tooltip.shared ? chart.hoverPoints : chart.hoverPoint;\n if (!label || !points) {\n return;\n }\n const box = {\n x: 0,\n y: 0,\n width: 0,\n height: 0\n };\n // Combine anchor and tooltip\n const anchorPos = this.getAnchor(points);\n const labelBBox = label.getBBox();\n anchorPos[0] += chart.plotLeft - (label.translateX || 0);\n anchorPos[1] += chart.plotTop - (label.translateY || 0);\n // When the mouse pointer is between the anchor point and the label,\n // the label should stick.\n box.x = Math.min(0, anchorPos[0]);\n box.y = Math.min(0, anchorPos[1]);\n box.width = (anchorPos[0] < 0 ?\n Math.max(Math.abs(anchorPos[0]), (labelBBox.width - anchorPos[0])) :\n Math.max(Math.abs(anchorPos[0]), labelBBox.width));\n box.height = (anchorPos[1] < 0 ?\n Math.max(Math.abs(anchorPos[1]), (labelBBox.height - Math.abs(anchorPos[1]))) :\n Math.max(Math.abs(anchorPos[1]), labelBBox.height));\n if (tooltip.tracker) {\n tooltip.tracker.attr(box);\n }\n else {\n tooltip.tracker = label.renderer\n .rect(box)\n .addClass('highcharts-tracker')\n .add(label);\n if (!chart.styledMode) {\n tooltip.tracker.attr({\n fill: 'rgba(0,0,0,0)'\n });\n }\n }\n }\n /**\n * @private\n */\n styledModeFormat(formatString) {\n return formatString\n .replace('style=\"font-size: 0.8em\"', 'class=\"highcharts-header\"')\n .replace(/style=\"color:{(point|series)\\.color}\"/g, 'class=\"highcharts-color-{$1.colorIndex} ' +\n '{series.options.className} ' +\n '{point.options.className}\"');\n }\n /**\n * Format the footer/header of the tooltip\n * #3397: abstraction to enable formatting of footer and header\n *\n * @private\n * @function Highcharts.Tooltip#tooltipFooterHeaderFormatter\n */\n tooltipFooterHeaderFormatter(labelConfig, isFooter) {\n const series = labelConfig.series, tooltipOptions = series.tooltipOptions, xAxis = series.xAxis, dateTime = xAxis && xAxis.dateTime, e = {\n isFooter: isFooter,\n labelConfig: labelConfig\n };\n let xDateFormat = tooltipOptions.xDateFormat, formatString = tooltipOptions[isFooter ? 'footerFormat' : 'headerFormat'];\n fireEvent(this, 'headerFormatter', e, function (e) {\n // Guess the best date format based on the closest point distance\n // (#568, #3418)\n if (dateTime && !xDateFormat && isNumber(labelConfig.key)) {\n xDateFormat = dateTime.getXDateFormat(labelConfig.key, tooltipOptions.dateTimeLabelFormats);\n }\n // Insert the footer date format if any\n if (dateTime && xDateFormat) {\n ((labelConfig.point && labelConfig.point.tooltipDateKeys) ||\n ['key']).forEach(function (key) {\n formatString = formatString.replace('{point.' + key + '}', '{point.' + key + ':' + xDateFormat + '}');\n });\n }\n // Replace default header style with class name\n if (series.chart.styledMode) {\n formatString = this.styledModeFormat(formatString);\n }\n e.text = format(formatString, {\n point: labelConfig,\n series: series\n }, this.chart);\n });\n return e.text;\n }\n /**\n * Updates the tooltip with the provided tooltip options.\n *\n * @function Highcharts.Tooltip#update\n *\n * @param {Highcharts.TooltipOptions} options\n * The tooltip options to update.\n */\n update(options) {\n this.destroy();\n this.init(this.chart, merge(true, this.options, options));\n }\n /**\n * Find the new position and perform the move\n *\n * @private\n * @function Highcharts.Tooltip#updatePosition\n *\n * @param {Highcharts.Point} point\n */\n updatePosition(point) {\n const { chart, container, distance, options, pointer, renderer } = this, { height = 0, width = 0 } = this.getLabel(), \n // Needed for outside: true (#11688)\n { left, top, scaleX, scaleY } = pointer.getChartPosition(), pos = (options.positioner || this.getPosition).call(this, width, height, point);\n let anchorX = (point.plotX || 0) + chart.plotLeft, anchorY = (point.plotY || 0) + chart.plotTop, pad;\n // Set the renderer size dynamically to prevent document size to change.\n // Renderer only exists when tooltip is outside.\n if (renderer && container) {\n // Corrects positions, occurs with tooltip positioner (#16944)\n if (options.positioner) {\n pos.x += left - distance;\n pos.y += top - distance;\n }\n // Pad it by the border width and distance. Add 2 to make room for\n // the default shadow (#19314).\n pad = (options.borderWidth || 0) + 2 * distance + 2;\n renderer.setSize(width + pad, height + pad, false);\n // Anchor and tooltip container need scaling if chart container has\n // scale transform/css zoom. #11329.\n if (scaleX !== 1 || scaleY !== 1) {\n css(container, {\n transform: `scale(${scaleX}, ${scaleY})`\n });\n anchorX *= scaleX;\n anchorY *= scaleY;\n }\n anchorX += left - pos.x;\n anchorY += top - pos.y;\n }\n // Do the move\n this.move(Math.round(pos.x), Math.round(pos.y || 0), // Can be undefined (#3977)\n anchorX, anchorY);\n }\n}\n/* *\n *\n * Class namespace\n *\n * */\n(function (Tooltip) {\n /* *\n *\n * Declarations\n *\n * */\n /* *\n *\n * Functions\n *\n * */\n /**\n * @private\n */\n function compose(PointerClass) {\n if (pushUnique(composed, 'Core.Tooltip')) {\n addEvent(PointerClass, 'afterInit', function () {\n const chart = this.chart;\n if (chart.options.tooltip) {\n /**\n * Tooltip object for points of series.\n *\n * @name Highcharts.Chart#tooltip\n * @type {Highcharts.Tooltip}\n */\n chart.tooltip = new Tooltip(chart, chart.options.tooltip, this);\n }\n });\n }\n }\n Tooltip.compose = compose;\n})(Tooltip || (Tooltip = {}));\n/* *\n *\n * Default export\n *\n * */\nexport default Tooltip;\n/* *\n *\n * API Declarations\n *\n * */\n/**\n * Callback function to format the text of the tooltip from scratch.\n *\n * In case of single or shared tooltips, a string should be returned. In case\n * of splitted tooltips, it should return an array where the first item is the\n * header, and subsequent items are mapped to the points. Return `false` to\n * disable tooltip for a specific point on series.\n *\n * @callback Highcharts.TooltipFormatterCallbackFunction\n *\n * @param {Highcharts.TooltipFormatterContextObject} this\n * Context to format\n *\n * @param {Highcharts.Tooltip} tooltip\n * The tooltip instance\n *\n * @return {false|string|Array<(string|null|undefined)>|null|undefined}\n * Formatted text or false\n */\n/**\n * Configuration for the tooltip formatters.\n *\n * @interface Highcharts.TooltipFormatterContextObject\n * @extends Highcharts.PointLabelObject\n */ /**\n* Array of points in shared tooltips.\n* @name Highcharts.TooltipFormatterContextObject#points\n* @type {Array|undefined}\n*/\n/**\n * A callback function to place the tooltip in a specific position.\n *\n * @callback Highcharts.TooltipPositionerCallbackFunction\n *\n * @param {Highcharts.Tooltip} this\n * Tooltip context of the callback.\n *\n * @param {number} labelWidth\n * Width of the tooltip.\n *\n * @param {number} labelHeight\n * Height of the tooltip.\n *\n * @param {Highcharts.TooltipPositionerPointObject} point\n * Point information for positioning a tooltip.\n *\n * @return {Highcharts.PositionObject}\n * New position for the tooltip.\n */\n/**\n * Point information for positioning a tooltip.\n *\n * @interface Highcharts.TooltipPositionerPointObject\n * @extends Highcharts.Point\n */ /**\n* If `tooltip.split` option is enabled and positioner is called for each of the\n* boxes separately, this property indicates the call on the xAxis header, which\n* is not a point itself.\n* @name Highcharts.TooltipPositionerPointObject#isHeader\n* @type {boolean}\n*/ /**\n* The reference point relative to the plot area. Add chart.plotLeft to get the\n* full coordinates.\n* @name Highcharts.TooltipPositionerPointObject#plotX\n* @type {number}\n*/ /**\n* The reference point relative to the plot area. Add chart.plotTop to get the\n* full coordinates.\n* @name Highcharts.TooltipPositionerPointObject#plotY\n* @type {number}\n*/\n/**\n * @typedef {\"callout\"|\"circle\"|\"rect\"} Highcharts.TooltipShapeValue\n */\n''; // keeps doclets above in JS file\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport AST from '../Renderer/HTML/AST.js';\nimport A from '../Animation/AnimationUtilities.js';\nconst { animObject } = A;\nimport D from '../Defaults.js';\nconst { defaultOptions } = D;\nimport F from '../Templating.js';\nconst { format } = F;\nimport U from '../Utilities.js';\nconst { addEvent, erase, extend, fireEvent, getNestedProperty, isArray, isFunction, isNumber, isObject, pick, syncTimeout, removeEvent, uniqueKey } = U;\n/* eslint-disable no-invalid-this, valid-jsdoc */\n/* *\n *\n * Class\n *\n * */\n/**\n * The Point object. The point objects are generated from the `series.data`\n * configuration objects or raw numbers. They can be accessed from the\n * `Series.points` array. Other ways to instantiate points are through {@link\n * Highcharts.Series#addPoint} or {@link Highcharts.Series#setData}.\n *\n * @class\n * @name Highcharts.Point\n */\nclass Point {\n /**\n * For categorized axes this property holds the category name for the\n * point. For other axes it holds the X value.\n *\n * @name Highcharts.Point#category\n * @type {number|string}\n */\n /**\n * The name of the point. The name can be given as the first position of the\n * point configuration array, or as a `name` property in the configuration:\n *\n * @example\n * // Array config\n * data: [\n * ['John', 1],\n * ['Jane', 2]\n * ]\n *\n * // Object config\n * data: [{\n * name: 'John',\n * y: 1\n * }, {\n * name: 'Jane',\n * y: 2\n * }]\n *\n * @name Highcharts.Point#name\n * @type {string}\n */\n /**\n * The point's options as applied in the initial configuration, or\n * extended through `Point.update`.\n *\n * In TypeScript you have to extend `PointOptionsObject` via an\n * additional interface to allow custom data options:\n *\n * ```\n * declare interface PointOptionsObject {\n * customProperty: string;\n * }\n * ```\n *\n * @name Highcharts.Point#options\n * @type {Highcharts.PointOptionsObject}\n */\n /**\n * The percentage for points in a stacked series, pies or gauges.\n *\n * @name Highcharts.Point#percentage\n * @type {number|undefined}\n */\n /**\n * The series object associated with the point.\n *\n * @name Highcharts.Point#series\n * @type {Highcharts.Series}\n */\n /**\n * The attributes of the rendered SVG shape like in `column` or `pie`\n * series.\n *\n * @readonly\n * @name Highcharts.Point#shapeArgs\n * @type {Readonly|undefined}\n */\n /**\n * The total of values in either a stack for stacked series, or a pie in a\n * pie series.\n *\n * @name Highcharts.Point#total\n * @type {number|undefined}\n */\n /**\n * For certain series types, like pie charts, where individual points can\n * be shown or hidden.\n *\n * @name Highcharts.Point#visible\n * @type {boolean}\n * @default true\n */\n /* *\n *\n * Functions\n *\n * */\n /**\n * Animate SVG elements associated with the point.\n *\n * @private\n * @function Highcharts.Point#animateBeforeDestroy\n */\n animateBeforeDestroy() {\n const point = this, animateParams = { x: point.startXPos, opacity: 0 }, graphicalProps = point.getGraphicalProps();\n graphicalProps.singular.forEach(function (prop) {\n const isDataLabel = prop === 'dataLabel';\n point[prop] = point[prop].animate(isDataLabel ? {\n x: point[prop].startXPos,\n y: point[prop].startYPos,\n opacity: 0\n } : animateParams);\n });\n graphicalProps.plural.forEach(function (plural) {\n point[plural].forEach(function (item) {\n if (item.element) {\n item.animate(extend({ x: point.startXPos }, (item.startYPos ? {\n x: item.startXPos,\n y: item.startYPos\n } : {})));\n }\n });\n });\n }\n /**\n * Apply the options containing the x and y data and possible some extra\n * properties. Called on point init or from point.update.\n *\n * @private\n * @function Highcharts.Point#applyOptions\n *\n * @param {Highcharts.PointOptionsType} options\n * The point options as defined in series.data.\n *\n * @param {number} [x]\n * Optionally, the x value.\n *\n * @return {Highcharts.Point}\n * The Point instance.\n */\n applyOptions(options, x) {\n const point = this, series = point.series, pointValKey = series.options.pointValKey || series.pointValKey;\n options = Point.prototype.optionsToObject.call(this, options);\n // copy options directly to point\n extend(point, options);\n point.options = point.options ?\n extend(point.options, options) :\n options;\n // Since options are copied into the Point instance, some accidental\n // options must be shielded (#5681)\n if (options.group) {\n delete point.group;\n }\n if (options.dataLabels) {\n delete point.dataLabels;\n }\n /**\n * The y value of the point.\n * @name Highcharts.Point#y\n * @type {number|undefined}\n */\n // For higher dimension series types. For instance, for ranges, point.y\n // is mapped to point.low.\n if (pointValKey) {\n point.y = Point.prototype.getNestedProperty.call(point, pointValKey);\n }\n // The point is initially selected by options (#5777)\n if (point.selected) {\n point.state = 'select';\n }\n /**\n * The x value of the point.\n * @name Highcharts.Point#x\n * @type {number}\n */\n // If no x is set by now, get auto incremented value. All points must\n // have an x value, however the y value can be null to create a gap in\n // the series\n if ('name' in point &&\n typeof x === 'undefined' &&\n series.xAxis &&\n series.xAxis.hasNames) {\n point.x = series.xAxis.nameToX(point);\n }\n if (typeof point.x === 'undefined' && series) {\n if (typeof x === 'undefined') {\n point.x = series.autoIncrement();\n }\n else {\n point.x = x;\n }\n }\n else if (isNumber(options.x) && series.options.relativeXValue) {\n point.x = series.autoIncrement(options.x);\n }\n point.isNull = this.isValid && !this.isValid();\n point.formatPrefix = point.isNull ? 'null' : 'point'; // #9233, #10874\n return point;\n }\n /**\n * Destroy a point to clear memory. Its reference still stays in\n * `series.data`.\n *\n * @private\n * @function Highcharts.Point#destroy\n */\n destroy() {\n if (!this.destroyed) {\n const point = this, series = point.series, chart = series.chart, dataSorting = series.options.dataSorting, hoverPoints = chart.hoverPoints, globalAnimation = point.series.chart.renderer.globalAnimation, animation = animObject(globalAnimation);\n /**\n * Allow to call after animation.\n * @private\n */\n const destroyPoint = () => {\n // Remove all events and elements\n if (point.graphic ||\n point.graphics ||\n point.dataLabel ||\n point.dataLabels) {\n removeEvent(point);\n point.destroyElements();\n }\n for (const prop in point) { // eslint-disable-line guard-for-in\n delete point[prop];\n }\n };\n if (point.legendItem) {\n // pies have legend items\n chart.legend.destroyItem(point);\n }\n if (hoverPoints) {\n point.setState();\n erase(hoverPoints, point);\n if (!hoverPoints.length) {\n chart.hoverPoints = null;\n }\n }\n if (point === chart.hoverPoint) {\n point.onMouseOut();\n }\n // Remove properties after animation\n if (!dataSorting || !dataSorting.enabled) {\n destroyPoint();\n }\n else {\n this.animateBeforeDestroy();\n syncTimeout(destroyPoint, animation.duration);\n }\n chart.pointCount--;\n }\n this.destroyed = true;\n }\n /**\n * Destroy SVG elements associated with the point.\n *\n * @private\n * @function Highcharts.Point#destroyElements\n * @param {Highcharts.Dictionary} [kinds]\n */\n destroyElements(kinds) {\n const point = this, props = point.getGraphicalProps(kinds);\n props.singular.forEach(function (prop) {\n point[prop] = point[prop].destroy();\n });\n props.plural.forEach(function (plural) {\n point[plural].forEach(function (item) {\n if (item && item.element) {\n item.destroy();\n }\n });\n delete point[plural];\n });\n }\n /**\n * Fire an event on the Point object.\n *\n * @private\n * @function Highcharts.Point#firePointEvent\n *\n * @param {string} eventType\n * Type of the event.\n *\n * @param {Highcharts.Dictionary|Event} [eventArgs]\n * Additional event arguments.\n *\n * @param {Highcharts.EventCallbackFunction|Function} [defaultFunction]\n * Default event handler.\n *\n * @emits Highcharts.Point#event:*\n */\n firePointEvent(eventType, eventArgs, defaultFunction) {\n const point = this, series = this.series, seriesOptions = series.options;\n // Load event handlers on demand to save time on mouseover/out\n point.manageEvent(eventType);\n // Add default handler if in selection mode\n if (eventType === 'click' && seriesOptions.allowPointSelect) {\n defaultFunction = function (event) {\n // Control key is for Windows, meta (= Cmd key) for Mac, Shift\n // for Opera.\n if (!point.destroyed && point.select) { // #2911, #19075\n point.select(null, event.ctrlKey || event.metaKey || event.shiftKey);\n }\n };\n }\n fireEvent(point, eventType, eventArgs, defaultFunction);\n }\n /**\n * Get the CSS class names for individual points. Used internally where the\n * returned value is set on every point.\n *\n * @function Highcharts.Point#getClassName\n *\n * @return {string}\n * The class names.\n */\n getClassName() {\n const point = this;\n return 'highcharts-point' +\n (point.selected ? ' highcharts-point-select' : '') +\n (point.negative ? ' highcharts-negative' : '') +\n (point.isNull ? ' highcharts-null-point' : '') +\n (typeof point.colorIndex !== 'undefined' ?\n ' highcharts-color-' + point.colorIndex : '') +\n (point.options.className ? ' ' + point.options.className : '') +\n (point.zone && point.zone.className ? ' ' +\n point.zone.className.replace('highcharts-negative', '') : '');\n }\n /**\n * Get props of all existing graphical point elements.\n *\n * @private\n * @function Highcharts.Point#getGraphicalProps\n */\n getGraphicalProps(kinds) {\n const point = this, props = [], graphicalProps = { singular: [], plural: [] };\n let prop, i;\n kinds = kinds || { graphic: 1, dataLabel: 1 };\n if (kinds.graphic) {\n props.push('graphic', 'connector' // Used by dumbbell\n );\n }\n if (kinds.dataLabel) {\n props.push('dataLabel', 'dataLabelPath', 'dataLabelUpper');\n }\n i = props.length;\n while (i--) {\n prop = props[i];\n if (point[prop]) {\n graphicalProps.singular.push(prop);\n }\n }\n [\n 'graphic',\n 'dataLabel'\n ].forEach(function (prop) {\n const plural = prop + 's';\n if (kinds[prop] && point[plural]) {\n graphicalProps.plural.push(plural);\n }\n });\n return graphicalProps;\n }\n /**\n * Return the configuration hash needed for the data label and tooltip\n * formatters.\n *\n * @function Highcharts.Point#getLabelConfig\n *\n * @return {Highcharts.PointLabelObject}\n * Abstract object used in formatters and formats.\n */\n getLabelConfig() {\n return {\n x: this.category,\n y: this.y,\n color: this.color,\n colorIndex: this.colorIndex,\n key: this.name || this.category,\n series: this.series,\n point: this,\n percentage: this.percentage,\n total: this.total || this.stackTotal\n };\n }\n /**\n * Returns the value of the point property for a given value.\n * @private\n */\n getNestedProperty(key) {\n if (!key) {\n return;\n }\n if (key.indexOf('custom.') === 0) {\n return getNestedProperty(key, this.options);\n }\n return this[key];\n }\n /**\n * In a series with `zones`, return the zone that the point belongs to.\n *\n * @function Highcharts.Point#getZone\n *\n * @return {Highcharts.SeriesZonesOptionsObject}\n * The zone item.\n */\n getZone() {\n const series = this.series, zones = series.zones, zoneAxis = series.zoneAxis || 'y';\n let zone, i = 0;\n zone = zones[i];\n while (this[zoneAxis] >= zone.value) {\n zone = zones[++i];\n }\n // For resetting or reusing the point (#8100)\n if (!this.nonZonedColor) {\n this.nonZonedColor = this.color;\n }\n if (zone && zone.color && !this.options.color) {\n this.color = zone.color;\n }\n else {\n this.color = this.nonZonedColor;\n }\n return zone;\n }\n /**\n * Utility to check if point has new shape type. Used in column series and\n * all others that are based on column series.\n * @private\n */\n hasNewShapeType() {\n const point = this;\n const oldShapeType = point.graphic &&\n (point.graphic.symbolName || point.graphic.element.nodeName);\n return oldShapeType !== this.shapeType;\n }\n /**\n * Initialize the point. Called internally based on the `series.data`\n * option.\n *\n * @function Highcharts.Point#init\n *\n * @param {Highcharts.Series} series\n * The series object containing this point.\n *\n * @param {Highcharts.PointOptionsType} options\n * The data in either number, array or object format.\n *\n * @param {number} [x]\n * Optionally, the X value of the point.\n *\n * @return {Highcharts.Point}\n * The Point instance.\n *\n * @emits Highcharts.Point#event:afterInit\n */\n constructor(series, options, x) {\n this.formatPrefix = 'point';\n this.visible = true;\n this.series = series;\n this.applyOptions(options, x);\n // Add a unique ID to the point if none is assigned\n this.id ?? (this.id = uniqueKey());\n this.resolveColor();\n series.chart.pointCount++;\n fireEvent(this, 'afterInit');\n }\n /**\n * Determine if point is valid.\n * @private\n * @function Highcharts.Point#isValid\n */\n isValid() {\n return ((isNumber(this.x) ||\n this.x instanceof Date) &&\n isNumber(this.y));\n }\n /**\n * Transform number or array configs into objects. Also called for object\n * configs. Used internally to unify the different configuration formats for\n * points. For example, a simple number `10` in a line series will be\n * transformed to `{ y: 10 }`, and an array config like `[1, 10]` in a\n * scatter series will be transformed to `{ x: 1, y: 10 }`.\n *\n * @deprecated\n * @function Highcharts.Point#optionsToObject\n *\n * @param {Highcharts.PointOptionsType} options\n * Series data options.\n *\n * @return {Highcharts.Dictionary<*>}\n * Transformed point options.\n */\n optionsToObject(options) {\n const series = this.series, keys = series.options.keys, pointArrayMap = keys || series.pointArrayMap || ['y'], valueCount = pointArrayMap.length;\n let ret = {}, firstItemType, i = 0, j = 0;\n if (isNumber(options) || options === null) {\n ret[pointArrayMap[0]] = options;\n }\n else if (isArray(options)) {\n // with leading x value\n if (!keys && options.length > valueCount) {\n firstItemType = typeof options[0];\n if (firstItemType === 'string') {\n ret.name = options[0];\n }\n else if (firstItemType === 'number') {\n ret.x = options[0];\n }\n i++;\n }\n while (j < valueCount) {\n // Skip undefined positions for keys\n if (!keys || typeof options[i] !== 'undefined') {\n if (pointArrayMap[j].indexOf('.') > 0) {\n // Handle nested keys, e.g. ['color.pattern.image']\n // Avoid function call unless necessary.\n Point.prototype.setNestedProperty(ret, options[i], pointArrayMap[j]);\n }\n else {\n ret[pointArrayMap[j]] = options[i];\n }\n }\n i++;\n j++;\n }\n }\n else if (typeof options === 'object') {\n ret = options;\n // This is the fastest way to detect if there are individual point\n // dataLabels that need to be considered in drawDataLabels. These\n // can only occur in object configs.\n if (options.dataLabels) {\n // Override the prototype function to always return true,\n // regardless of whether data labels are enabled series-wide\n series.hasDataLabels = () => true;\n }\n // Same approach as above for markers\n if (options.marker) {\n series._hasPointMarkers = true;\n }\n }\n return ret;\n }\n /**\n * Get the pixel position of the point relative to the plot area.\n * @function Highcharts.Point#pos\n *\n * @sample highcharts/point/position\n * Get point's position in pixels.\n *\n * @param {boolean} chartCoordinates\n * If true, the returned position is relative to the full chart area.\n * If false, it is relative to the plot area determined by the axes.\n *\n * @param {number|undefined} plotY\n * A custom plot y position to be computed. Used internally for some\n * series types that have multiple `y` positions, like area range (low\n * and high values).\n *\n * @return {Array|undefined}\n * Coordinates of the point if the point exists.\n */\n pos(chartCoordinates, plotY = this.plotY) {\n if (!this.destroyed) {\n const { plotX, series } = this, { chart, xAxis, yAxis } = series;\n let posX = 0, posY = 0;\n if (isNumber(plotX) && isNumber(plotY)) {\n if (chartCoordinates) {\n posX = xAxis ? xAxis.pos : chart.plotLeft;\n posY = yAxis ? yAxis.pos : chart.plotTop;\n }\n return chart.inverted && xAxis && yAxis ?\n [yAxis.len - plotY + posY, xAxis.len - plotX + posX] :\n [plotX + posX, plotY + posY];\n }\n }\n }\n /**\n * @private\n * @function Highcharts.Point#resolveColor\n */\n resolveColor() {\n const series = this.series, optionsChart = series.chart.options.chart, styledMode = series.chart.styledMode;\n let color, colors, colorCount = optionsChart.colorCount, colorIndex;\n // remove points nonZonedColor for later recalculation\n delete this.nonZonedColor;\n if (series.options.colorByPoint) {\n if (!styledMode) {\n colors = series.options.colors || series.chart.options.colors;\n color = colors[series.colorCounter];\n colorCount = colors.length;\n }\n colorIndex = series.colorCounter;\n series.colorCounter++;\n // loop back to zero\n if (series.colorCounter === colorCount) {\n series.colorCounter = 0;\n }\n }\n else {\n if (!styledMode) {\n color = series.color;\n }\n colorIndex = series.colorIndex;\n }\n /**\n * The point's current color index, used in styled mode instead of\n * `color`. The color index is inserted in class names used for styling.\n *\n * @name Highcharts.Point#colorIndex\n * @type {number|undefined}\n */\n this.colorIndex = pick(this.options.colorIndex, colorIndex);\n /**\n * The point's current color.\n *\n * @name Highcharts.Point#color\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject|undefined}\n */\n this.color = pick(this.options.color, color);\n }\n /**\n * Set a value in an object, on the property defined by key. The key\n * supports nested properties using dot notation. The function modifies the\n * input object and does not make a copy.\n *\n * @function Highcharts.Point#setNestedProperty\n *\n * @param {T} object\n * The object to set the value on.\n *\n * @param {*} value\n * The value to set.\n *\n * @param {string} key\n * Key to the property to set.\n *\n * @return {T}\n * The modified object.\n */\n setNestedProperty(object, value, key) {\n const nestedKeys = key.split('.');\n nestedKeys.reduce(function (result, key, i, arr) {\n const isLastKey = arr.length - 1 === i;\n result[key] = (isLastKey ?\n value :\n isObject(result[key], true) ?\n result[key] :\n {});\n return result[key];\n }, object);\n return object;\n }\n shouldDraw() {\n return !this.isNull;\n }\n /**\n * Extendable method for formatting each point's tooltip line.\n *\n * @function Highcharts.Point#tooltipFormatter\n *\n * @param {string} pointFormat\n * The point format.\n *\n * @return {string}\n * A string to be concatenated in to the common tooltip text.\n */\n tooltipFormatter(pointFormat) {\n // Insert options for valueDecimals, valuePrefix, and valueSuffix\n const series = this.series, seriesTooltipOptions = series.tooltipOptions, valueDecimals = pick(seriesTooltipOptions.valueDecimals, ''), valuePrefix = seriesTooltipOptions.valuePrefix || '', valueSuffix = seriesTooltipOptions.valueSuffix || '';\n // Replace default point style with class name\n if (series.chart.styledMode) {\n pointFormat =\n series.chart.tooltip.styledModeFormat(pointFormat);\n }\n // Loop over the point array map and replace unformatted values with\n // sprintf formatting markup\n (series.pointArrayMap || ['y']).forEach(function (key) {\n key = '{point.' + key; // without the closing bracket\n if (valuePrefix || valueSuffix) {\n pointFormat = pointFormat.replace(RegExp(key + '}', 'g'), valuePrefix + key + '}' + valueSuffix);\n }\n pointFormat = pointFormat.replace(RegExp(key + '}', 'g'), key + ':,.' + valueDecimals + 'f}');\n });\n return format(pointFormat, {\n point: this,\n series: this.series\n }, series.chart);\n }\n /**\n * Update point with new options (typically x/y data) and optionally redraw\n * the series.\n *\n * @sample highcharts/members/point-update-column/\n * Update column value\n * @sample highcharts/members/point-update-pie/\n * Update pie slice\n * @sample maps/members/point-update/\n * Update map area value in Highmaps\n *\n * @function Highcharts.Point#update\n *\n * @param {Highcharts.PointOptionsType} options\n * The point options. Point options are handled as described under\n * the `series.type.data` item for each series type. For example\n * for a line series, if options is a single number, the point will\n * be given that number as the marin y value. If it is an array, it\n * will be interpreted as x and y values respectively. If it is an\n * object, advanced options are applied.\n *\n * @param {boolean} [redraw=true]\n * Whether to redraw the chart after the point is updated. If doing\n * more operations on the chart, it is best practice to set\n * `redraw` to false and call `chart.redraw()` after.\n *\n * @param {boolean|Partial} [animation=true]\n * Whether to apply animation, and optionally animation\n * configuration.\n *\n * @emits Highcharts.Point#event:update\n */\n update(options, redraw, animation, runEvent) {\n const point = this, series = point.series, graphic = point.graphic, chart = series.chart, seriesOptions = series.options;\n let i;\n redraw = pick(redraw, true);\n /**\n * @private\n */\n function update() {\n point.applyOptions(options);\n // Update visuals, #4146\n // Handle mock graphic elements for a11y, #12718\n const hasMockGraphic = graphic && point.hasMockGraphic;\n const shouldDestroyGraphic = point.y === null ?\n !hasMockGraphic :\n hasMockGraphic;\n if (graphic && shouldDestroyGraphic) {\n point.graphic = graphic.destroy();\n delete point.hasMockGraphic;\n }\n if (isObject(options, true)) {\n // Destroy so we can get new elements\n if (graphic && graphic.element) {\n // \"null\" is also a valid symbol\n if (options &&\n options.marker &&\n typeof options.marker.symbol !== 'undefined') {\n point.graphic = graphic.destroy();\n }\n }\n if (options?.dataLabels && point.dataLabel) {\n point.dataLabel = point.dataLabel.destroy(); // #2468\n }\n }\n // record changes in the parallel arrays\n i = point.index;\n series.updateParallelArrays(point, i);\n // Record the options to options.data. If the old or the new config\n // is an object, use point options, otherwise use raw options\n // (#4701, #4916).\n seriesOptions.data[i] = (isObject(seriesOptions.data[i], true) ||\n isObject(options, true)) ?\n point.options :\n pick(options, seriesOptions.data[i]);\n // redraw\n series.isDirty = series.isDirtyData = true;\n if (!series.fixedBox && series.hasCartesianSeries) { // #1906, #2320\n chart.isDirtyBox = true;\n }\n if (seriesOptions.legendType === 'point') { // #1831, #1885\n chart.isDirtyLegend = true;\n }\n if (redraw) {\n chart.redraw(animation);\n }\n }\n // Fire the event with a default handler of doing the update\n if (runEvent === false) { // When called from setData\n update();\n }\n else {\n point.firePointEvent('update', { options: options }, update);\n }\n }\n /**\n * Remove a point and optionally redraw the series and if necessary the axes\n *\n * @sample highcharts/plotoptions/series-point-events-remove/\n * Remove point and confirm\n * @sample highcharts/members/point-remove/\n * Remove pie slice\n * @sample maps/members/point-remove/\n * Remove selected points in Highmaps\n *\n * @function Highcharts.Point#remove\n *\n * @param {boolean} [redraw=true]\n * Whether to redraw the chart or wait for an explicit call. When\n * doing more operations on the chart, for example running\n * `point.remove()` in a loop, it is best practice to set `redraw`\n * to false and call `chart.redraw()` after.\n *\n * @param {boolean|Partial} [animation=false]\n * Whether to apply animation, and optionally animation\n * configuration.\n */\n remove(redraw, animation) {\n this.series.removePoint(this.series.data.indexOf(this), redraw, animation);\n }\n /**\n * Toggle the selection status of a point.\n *\n * @see Highcharts.Chart#getSelectedPoints\n *\n * @sample highcharts/members/point-select/\n * Select a point from a button\n * @sample highcharts/members/point-select-lasso/\n * Lasso selection\n * @sample highcharts/chart/events-selection-points/\n * Rectangle selection\n * @sample maps/series/data-id/\n * Select a point in Highmaps\n *\n * @function Highcharts.Point#select\n *\n * @param {boolean} [selected]\n * When `true`, the point is selected. When `false`, the point is\n * unselected. When `null` or `undefined`, the selection state is toggled.\n *\n * @param {boolean} [accumulate=false]\n * When `true`, the selection is added to other selected points.\n * When `false`, other selected points are deselected. Internally in\n * Highcharts, when\n * [allowPointSelect](https://api.highcharts.com/highcharts/plotOptions.series.allowPointSelect)\n * is `true`, selected points are accumulated on Control, Shift or Cmd\n * clicking the point.\n *\n * @emits Highcharts.Point#event:select\n * @emits Highcharts.Point#event:unselect\n */\n select(selected, accumulate) {\n const point = this, series = point.series, chart = series.chart;\n selected = pick(selected, !point.selected);\n this.selectedStaging = selected;\n // fire the event with the default handler\n point.firePointEvent(selected ? 'select' : 'unselect', { accumulate: accumulate }, function () {\n /**\n * Whether the point is selected or not.\n *\n * @see Point#select\n * @see Chart#getSelectedPoints\n *\n * @name Highcharts.Point#selected\n * @type {boolean}\n */\n point.selected = point.options.selected = selected;\n series.options.data[series.data.indexOf(point)] =\n point.options;\n point.setState(selected && 'select');\n // unselect all other points unless Ctrl or Cmd + click\n if (!accumulate) {\n chart.getSelectedPoints().forEach(function (loopPoint) {\n const loopSeries = loopPoint.series;\n if (loopPoint.selected && loopPoint !== point) {\n loopPoint.selected = loopPoint.options.selected =\n false;\n loopSeries.options.data[loopSeries.data.indexOf(loopPoint)] = loopPoint.options;\n // Programmatically selecting a point should restore\n // normal state, but when click happened on other\n // point, set inactive state to match other points\n loopPoint.setState(chart.hoverPoints &&\n loopSeries.options.inactiveOtherPoints ?\n 'inactive' : '');\n loopPoint.firePointEvent('unselect');\n }\n });\n }\n });\n delete this.selectedStaging;\n }\n /**\n * Runs on mouse over the point. Called internally from mouse and touch\n * events.\n *\n * @function Highcharts.Point#onMouseOver\n *\n * @param {Highcharts.PointerEventObject} [e]\n * The event arguments.\n */\n onMouseOver(e) {\n const point = this, series = point.series, { inverted, pointer } = series.chart;\n if (pointer) {\n e = e ?\n pointer.normalize(e) :\n // In cases where onMouseOver is called directly without an\n // event\n pointer.getChartCoordinatesFromPoint(point, inverted);\n pointer.runPointActions(e, point);\n }\n }\n /**\n * Runs on mouse out from the point. Called internally from mouse and touch\n * events.\n *\n * @function Highcharts.Point#onMouseOut\n * @emits Highcharts.Point#event:mouseOut\n */\n onMouseOut() {\n const point = this, chart = point.series.chart;\n point.firePointEvent('mouseOut');\n if (!point.series.options.inactiveOtherPoints) {\n (chart.hoverPoints || []).forEach(function (p) {\n p.setState();\n });\n }\n chart.hoverPoints = chart.hoverPoint = null;\n }\n /**\n * Manage specific event from the series' and point's options. Only do it on\n * demand, to save processing time on hovering.\n *\n * @private\n * @function Highcharts.Point#importEvents\n */\n manageEvent(eventType) {\n const point = this, options = point.series.options.point || {}, userEvent = options.events?.[eventType];\n if (isFunction(userEvent) &&\n (!point.hcEvents?.[eventType] ||\n // Some HC modules, like marker-clusters, draggable-poins etc.\n // use events in their logic, so we need to be sure, that\n // callback function is different\n point.hcEvents?.[eventType]?.map((el) => el.fn)\n .indexOf(userEvent) === -1)) {\n addEvent(point, eventType, userEvent);\n point.hasImportedEvents = true;\n }\n else if (point.hasImportedEvents &&\n !userEvent &&\n point.hcEvents?.[eventType]) {\n removeEvent(point, eventType);\n delete point.hcEvents[eventType];\n if (!Object.keys(point.hcEvents)) {\n point.hasImportedEvents = false;\n }\n }\n }\n /**\n * Set the point's state.\n *\n * @function Highcharts.Point#setState\n *\n * @param {Highcharts.PointStateValue|\"\"} [state]\n * The new state, can be one of `'hover'`, `'select'`, `'inactive'`,\n * or `''` (an empty string), `'normal'` or `undefined` to set to\n * normal state.\n * @param {boolean} [move]\n * State for animation.\n *\n * @emits Highcharts.Point#event:afterSetState\n */\n setState(state, move) {\n const point = this, series = point.series, previousState = point.state, stateOptions = (series.options.states[state || 'normal'] ||\n {}), markerOptions = (defaultOptions.plotOptions[series.type].marker &&\n series.options.marker), normalDisabled = (markerOptions && markerOptions.enabled === false), markerStateOptions = ((markerOptions &&\n markerOptions.states &&\n markerOptions.states[state || 'normal']) || {}), stateDisabled = markerStateOptions.enabled === false, pointMarker = point.marker || {}, chart = series.chart, hasMarkers = (markerOptions && series.markerAttribs);\n let halo = series.halo, markerAttribs, pointAttribs, pointAttribsAnimation, stateMarkerGraphic = series.stateMarkerGraphic, newSymbol;\n state = state || ''; // empty string\n if (\n // already has this state\n (state === point.state && !move) ||\n // selected points don't respond to hover\n (point.selected && state !== 'select') ||\n // series' state options is disabled\n (stateOptions.enabled === false) ||\n // general point marker's state options is disabled\n (state && (stateDisabled ||\n (normalDisabled &&\n markerStateOptions.enabled === false))) ||\n // individual point marker's state options is disabled\n (state &&\n pointMarker.states &&\n pointMarker.states[state] &&\n pointMarker.states[state].enabled === false) // #1610\n ) {\n return;\n }\n point.state = state;\n if (hasMarkers) {\n markerAttribs = series.markerAttribs(point, state);\n }\n // Apply hover styles to the existing point\n // Prevent from mocked null points (#14966)\n if (point.graphic && !point.hasMockGraphic) {\n if (previousState) {\n point.graphic.removeClass('highcharts-point-' + previousState);\n }\n if (state) {\n point.graphic.addClass('highcharts-point-' + state);\n }\n if (!chart.styledMode) {\n pointAttribs = series.pointAttribs(point, state);\n pointAttribsAnimation = pick(chart.options.chart.animation, stateOptions.animation);\n const opacity = pointAttribs.opacity;\n // Some inactive points (e.g. slices in pie) should apply\n // opacity also for their labels\n if (series.options.inactiveOtherPoints && isNumber(opacity)) {\n (point.dataLabels || []).forEach(function (label) {\n if (label &&\n !label.hasClass('highcharts-data-label-hidden')) {\n label.animate({ opacity }, pointAttribsAnimation);\n if (label.connector) {\n label.connector.animate({ opacity }, pointAttribsAnimation);\n }\n }\n });\n }\n point.graphic.animate(pointAttribs, pointAttribsAnimation);\n }\n if (markerAttribs) {\n point.graphic.animate(markerAttribs, pick(\n // Turn off globally:\n chart.options.chart.animation, markerStateOptions.animation, markerOptions.animation));\n }\n // Zooming in from a range with no markers to a range with markers\n if (stateMarkerGraphic) {\n stateMarkerGraphic.hide();\n }\n }\n else {\n // if a graphic is not applied to each point in the normal state,\n // create a shared graphic for the hover state\n if (state && markerStateOptions) {\n newSymbol = pointMarker.symbol || series.symbol;\n // If the point has another symbol than the previous one, throw\n // away the state marker graphic and force a new one (#1459)\n if (stateMarkerGraphic &&\n stateMarkerGraphic.currentSymbol !== newSymbol) {\n stateMarkerGraphic = stateMarkerGraphic.destroy();\n }\n // Add a new state marker graphic\n if (markerAttribs) {\n if (!stateMarkerGraphic) {\n if (newSymbol) {\n series.stateMarkerGraphic = stateMarkerGraphic =\n chart.renderer\n .symbol(newSymbol, markerAttribs.x, markerAttribs.y, markerAttribs.width, markerAttribs.height)\n .add(series.markerGroup);\n stateMarkerGraphic.currentSymbol = newSymbol;\n }\n // Move the existing graphic\n }\n else {\n stateMarkerGraphic[move ? 'animate' : 'attr']({\n x: markerAttribs.x,\n y: markerAttribs.y\n });\n }\n }\n if (!chart.styledMode && stateMarkerGraphic &&\n point.state !== 'inactive') {\n stateMarkerGraphic.attr(series.pointAttribs(point, state));\n }\n }\n if (stateMarkerGraphic) {\n stateMarkerGraphic[state && point.isInside ? 'show' : 'hide'](); // #2450\n stateMarkerGraphic.element.point = point; // #4310\n stateMarkerGraphic.addClass(point.getClassName(), true);\n }\n }\n // Show me your halo\n const haloOptions = stateOptions.halo;\n const markerGraphic = (point.graphic || stateMarkerGraphic);\n const markerVisibility = (markerGraphic && markerGraphic.visibility || 'inherit');\n if (haloOptions &&\n haloOptions.size &&\n markerGraphic &&\n markerVisibility !== 'hidden' &&\n !point.isCluster) {\n if (!halo) {\n series.halo = halo = chart.renderer.path()\n // #5818, #5903, #6705\n .add(markerGraphic.parentGroup);\n }\n halo.show()[move ? 'animate' : 'attr']({\n d: point.haloPath(haloOptions.size)\n });\n halo.attr({\n 'class': 'highcharts-halo highcharts-color-' +\n pick(point.colorIndex, series.colorIndex) +\n (point.className ? ' ' + point.className : ''),\n 'visibility': markerVisibility,\n 'zIndex': -1 // #4929, #8276\n });\n halo.point = point; // #6055\n if (!chart.styledMode) {\n halo.attr(extend({\n 'fill': point.color || series.color,\n 'fill-opacity': haloOptions.opacity\n }, AST.filterUserAttributes(haloOptions.attributes || {})));\n }\n }\n else if (halo && halo.point && halo.point.haloPath) {\n // Animate back to 0 on the current halo point (#6055)\n halo.animate({ d: halo.point.haloPath(0) }, null, \n // Hide after unhovering. The `complete` callback runs in the\n // halo's context (#7681).\n halo.hide);\n }\n fireEvent(point, 'afterSetState', { state });\n }\n /**\n * Get the path definition for the halo, which is usually a shadow-like\n * circle around the currently hovered point.\n *\n * @function Highcharts.Point#haloPath\n *\n * @param {number} size\n * The radius of the circular halo.\n *\n * @return {Highcharts.SVGPathArray}\n * The path definition.\n */\n haloPath(size) {\n const pos = this.pos();\n return pos ? this.series.chart.renderer.symbols.circle(Math.floor(pos[0]) - size, pos[1] - size, size * 2, size * 2) : [];\n }\n}\n/* *\n *\n * Default Export\n *\n * */\nexport default Point;\n/* *\n *\n * API Declarations\n *\n * */\n/**\n * Function callback when a series point is clicked. Return false to cancel the\n * action.\n *\n * @callback Highcharts.PointClickCallbackFunction\n *\n * @param {Highcharts.Point} this\n * The point where the event occurred.\n *\n * @param {Highcharts.PointClickEventObject} event\n * Event arguments.\n */\n/**\n * Common information for a click event on a series point.\n *\n * @interface Highcharts.PointClickEventObject\n * @extends Highcharts.PointerEventObject\n */ /**\n* Clicked point.\n* @name Highcharts.PointClickEventObject#point\n* @type {Highcharts.Point}\n*/\n/**\n * Configuration for the data label and tooltip formatters.\n *\n * @interface Highcharts.PointLabelObject\n */ /**\n* The point's current color.\n* @name Highcharts.PointLabelObject#color\n* @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject|undefined}\n*/ /**\n* The point's current color index, used in styled mode instead of `color`. The\n* color index is inserted in class names used for styling.\n* @name Highcharts.PointLabelObject#colorIndex\n* @type {number}\n*/ /**\n* The name of the related point.\n* @name Highcharts.PointLabelObject#key\n* @type {string|undefined}\n*/ /**\n* The percentage for related points in a stacked series or pies.\n* @name Highcharts.PointLabelObject#percentage\n* @type {number}\n*/ /**\n* The related point. The point name, if defined, is available through\n* `this.point.name`.\n* @name Highcharts.PointLabelObject#point\n* @type {Highcharts.Point}\n*/ /**\n* The related series. The series name is available through `this.series.name`.\n* @name Highcharts.PointLabelObject#series\n* @type {Highcharts.Series}\n*/ /**\n* The total of values in either a stack for stacked series, or a pie in a pie\n* series.\n* @name Highcharts.PointLabelObject#total\n* @type {number|undefined}\n*/ /**\n* For categorized axes this property holds the category name for the point. For\n* other axes it holds the X value.\n* @name Highcharts.PointLabelObject#x\n* @type {number|string|undefined}\n*/ /**\n* The y value of the point.\n* @name Highcharts.PointLabelObject#y\n* @type {number|null|undefined}\n*/\n/**\n * Gets fired when the mouse leaves the area close to the point.\n *\n * @callback Highcharts.PointMouseOutCallbackFunction\n *\n * @param {Highcharts.Point} this\n * Point where the event occurred.\n *\n * @param {global.PointerEvent} event\n * Event that occurred.\n */\n/**\n * Gets fired when the mouse enters the area close to the point.\n *\n * @callback Highcharts.PointMouseOverCallbackFunction\n *\n * @param {Highcharts.Point} this\n * Point where the event occurred.\n *\n * @param {global.Event} event\n * Event that occurred.\n */\n/**\n * The generic point options for all series.\n *\n * In TypeScript you have to extend `PointOptionsObject` with an additional\n * declaration to allow custom data options:\n *\n * ```\n * declare interface PointOptionsObject {\n * customProperty: string;\n * }\n * ```\n *\n * @interface Highcharts.PointOptionsObject\n */\n/**\n * Possible option types for a data point. Use `null` to indicate a gap.\n *\n * @typedef {number|string|Highcharts.PointOptionsObject|Array<(number|string|null)>|null} Highcharts.PointOptionsType\n */\n/**\n * Gets fired when the point is removed using the `.remove()` method.\n *\n * @callback Highcharts.PointRemoveCallbackFunction\n *\n * @param {Highcharts.Point} this\n * Point where the event occurred.\n *\n * @param {global.Event} event\n * Event that occurred.\n */\n/**\n * Possible key values for the point state options.\n *\n * @typedef {\"hover\"|\"inactive\"|\"normal\"|\"select\"} Highcharts.PointStateValue\n */\n/**\n * Gets fired when the point is updated programmatically through the `.update()`\n * method.\n *\n * @callback Highcharts.PointUpdateCallbackFunction\n *\n * @param {Highcharts.Point} this\n * Point where the event occurred.\n *\n * @param {Highcharts.PointUpdateEventObject} event\n * Event that occurred.\n */\n/**\n * Information about the update event.\n *\n * @interface Highcharts.PointUpdateEventObject\n * @extends global.Event\n */ /**\n* Options data of the update event.\n* @name Highcharts.PointUpdateEventObject#options\n* @type {Highcharts.PointOptionsType}\n*/\n/**\n * @interface Highcharts.PointEventsOptionsObject\n */ /**\n* Fires when the point is selected either programmatically or following a click\n* on the point. One parameter, `event`, is passed to the function. Returning\n* `false` cancels the operation.\n* @name Highcharts.PointEventsOptionsObject#select\n* @type {Highcharts.PointSelectCallbackFunction|undefined}\n*/ /**\n* Fires when the point is unselected either programmatically or following a\n* click on the point. One parameter, `event`, is passed to the function.\n* Returning `false` cancels the operation.\n* @name Highcharts.PointEventsOptionsObject#unselect\n* @type {Highcharts.PointUnselectCallbackFunction|undefined}\n*/\n/**\n * Information about the select/unselect event.\n *\n * @interface Highcharts.PointInteractionEventObject\n * @extends global.Event\n */ /**\n* @name Highcharts.PointInteractionEventObject#accumulate\n* @type {boolean}\n*/\n/**\n * Gets fired when the point is selected either programmatically or following a\n * click on the point.\n *\n * @callback Highcharts.PointSelectCallbackFunction\n *\n * @param {Highcharts.Point} this\n * Point where the event occurred.\n *\n * @param {Highcharts.PointInteractionEventObject} event\n * Event that occurred.\n */\n/**\n * Fires when the point is unselected either programmatically or following a\n * click on the point.\n *\n * @callback Highcharts.PointUnselectCallbackFunction\n *\n * @param {Highcharts.Point} this\n * Point where the event occurred.\n *\n * @param {Highcharts.PointInteractionEventObject} event\n * Event that occurred.\n */\n''; // keeps doclets above in JS file.\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport Color from './Color/Color.js';\nconst { parse: color } = Color;\nimport H from './Globals.js';\nconst { charts, composed } = H;\nimport U from './Utilities.js';\nconst { addEvent, attr, css, extend, find, fireEvent, isNumber, isObject, objectEach, offset, pick, pushUnique, splat } = U;\n/* *\n *\n * Class\n *\n * */\n/**\n * The mouse and touch tracker object. Each {@link Chart} item has one\n * associated Pointer item that can be accessed from the {@link Chart.pointer}\n * property.\n *\n * @class\n * @name Highcharts.Pointer\n *\n * @param {Highcharts.Chart} chart\n * The chart instance.\n *\n * @param {Highcharts.Options} options\n * The root options object. The pointer uses options from the chart and tooltip\n * structures.\n */\nclass Pointer {\n /* *\n *\n * Functions\n *\n * */\n /**\n * Set inactive state to all series that are not currently hovered,\n * or, if `inactiveOtherPoints` is set to true, set inactive state to\n * all points within that series.\n *\n * @private\n * @function Highcharts.Pointer#applyInactiveState\n *\n * @param {Array} points\n * Currently hovered points\n */\n applyInactiveState(points) {\n let activeSeries = [], series;\n // Get all active series from the hovered points\n (points || []).forEach(function (item) {\n series = item.series;\n // Include itself\n activeSeries.push(series);\n // Include parent series\n if (series.linkedParent) {\n activeSeries.push(series.linkedParent);\n }\n // Include all child series\n if (series.linkedSeries) {\n activeSeries = activeSeries.concat(series.linkedSeries);\n }\n // Include navigator series\n if (series.navigatorSeries) {\n activeSeries.push(series.navigatorSeries);\n }\n });\n // Now loop over all series, filtering out active series\n this.chart.series.forEach(function (inactiveSeries) {\n if (activeSeries.indexOf(inactiveSeries) === -1) {\n // Inactive series\n inactiveSeries.setState('inactive', true);\n }\n else if (inactiveSeries.options.inactiveOtherPoints) {\n // Active series, but other points should be inactivated\n inactiveSeries.setAllPointsToState('inactive');\n }\n });\n }\n /**\n * Destroys the Pointer object and disconnects DOM events.\n *\n * @function Highcharts.Pointer#destroy\n */\n destroy() {\n const pointer = this;\n this.eventsToUnbind.forEach((unbind) => unbind());\n this.eventsToUnbind = [];\n if (!H.chartCount) {\n if (Pointer.unbindDocumentMouseUp) {\n Pointer.unbindDocumentMouseUp = Pointer.unbindDocumentMouseUp();\n }\n if (Pointer.unbindDocumentTouchEnd) {\n Pointer.unbindDocumentTouchEnd = (Pointer.unbindDocumentTouchEnd());\n }\n }\n // memory and CPU leak\n clearInterval(pointer.tooltipTimeout);\n objectEach(pointer, function (_val, prop) {\n pointer[prop] = void 0;\n });\n }\n /**\n * Calculate attrs for selection marker.\n * @private\n * @function Highcharts.Pointer#getSelectionMarkerAttrs\n * @emits getSelectionMarkerAttrs\n */\n getSelectionMarkerAttrs(chartX, chartY) {\n const e = {\n args: { chartX, chartY },\n attrs: {},\n shapeType: 'rect'\n };\n fireEvent(this, 'getSelectionMarkerAttrs', e, (e) => {\n const { chart, zoomHor, zoomVert } = this, { mouseDownX = 0, mouseDownY = 0 } = chart, attrs = e.attrs;\n let size;\n attrs.x = chart.plotLeft;\n attrs.y = chart.plotTop;\n attrs.width = zoomHor ? 1 : chart.plotWidth;\n attrs.height = zoomVert ? 1 : chart.plotHeight;\n // Adjust the width of the selection marker. Firefox needs at\n // least one pixel width or height in order to return a bounding\n // box.\n if (zoomHor) {\n size = chartX - mouseDownX;\n attrs.width = Math.max(1, Math.abs(size));\n attrs.x = (size > 0 ? 0 : size) + mouseDownX;\n }\n // Adjust the height of the selection marker\n if (zoomVert) {\n size = chartY - mouseDownY;\n attrs.height = Math.max(1, Math.abs(size));\n attrs.y = (size > 0 ? 0 : size) + mouseDownY;\n }\n });\n return e;\n }\n /**\n * Perform a drag operation in response to a mousemove event while the mouse\n * is down.\n * @private\n * @function Highcharts.Pointer#drag\n */\n drag(e) {\n const { chart } = this, { mouseDownX = 0, mouseDownY = 0 } = chart, { panning, panKey, selectionMarkerFill } = chart.options.chart, plotLeft = chart.plotLeft, plotTop = chart.plotTop, plotWidth = chart.plotWidth, plotHeight = chart.plotHeight, panningEnabled = isObject(panning) ?\n panning.enabled :\n panning, panKeyPressed = panKey && e[`${panKey}Key`];\n let chartX = e.chartX, chartY = e.chartY, clickedInside, selectionMarker = this.selectionMarker;\n // If the device supports both touch and mouse (like IE11), and we are\n // touch-dragging inside the plot area, don't handle the mouse event.\n // #4339.\n if (selectionMarker && selectionMarker.touch) {\n return;\n }\n // If the mouse is outside the plot area, adjust to coordinates\n // inside to prevent the selection marker from going outside\n if (chartX < plotLeft) {\n chartX = plotLeft;\n }\n else if (chartX > plotLeft + plotWidth) {\n chartX = plotLeft + plotWidth;\n }\n if (chartY < plotTop) {\n chartY = plotTop;\n }\n else if (chartY > plotTop + plotHeight) {\n chartY = plotTop + plotHeight;\n }\n // Determine if the mouse has moved more than 10px\n this.hasDragged = Math.sqrt(Math.pow(mouseDownX - chartX, 2) +\n Math.pow(mouseDownY - chartY, 2));\n if (this.hasDragged > 10) {\n clickedInside = chart.isInsidePlot(mouseDownX - plotLeft, mouseDownY - plotTop, {\n visiblePlotOnly: true\n });\n const { shapeType, attrs } = this.getSelectionMarkerAttrs(chartX, chartY);\n // Make a selection\n if ((chart.hasCartesianSeries || chart.mapView) &&\n this.hasZoom &&\n clickedInside &&\n !panKeyPressed) {\n if (!selectionMarker) {\n this.selectionMarker = selectionMarker =\n chart.renderer[shapeType]();\n selectionMarker\n .attr({\n 'class': 'highcharts-selection-marker',\n zIndex: 7\n })\n .add();\n if (!chart.styledMode) {\n selectionMarker.attr({\n fill: selectionMarkerFill ||\n color(\"#334eff\" /* Palette.highlightColor80 */)\n .setOpacity(0.25).get()\n });\n }\n }\n }\n if (selectionMarker) {\n selectionMarker.attr(attrs);\n }\n // Panning\n if (clickedInside && !selectionMarker && panningEnabled) {\n chart.pan(e, panning);\n }\n }\n }\n /**\n * Start a drag operation.\n * @private\n * @function Highcharts.Pointer#dragStart\n */\n dragStart(e) {\n const chart = this.chart;\n // Record the start position\n chart.mouseIsDown = e.type;\n chart.cancelClick = false;\n chart.mouseDownX = e.chartX;\n chart.mouseDownY = e.chartY;\n }\n /**\n * Get selection box to calculate extremes\n * @private\n * @function Highcharts.Pointer#getSelectionBox\n * @emits getSelectionBox\n */\n getSelectionBox(marker) {\n const e = {\n args: { marker },\n result: marker.getBBox()\n };\n fireEvent(this, 'getSelectionBox', e);\n return e.result;\n }\n /**\n * On mouse up or touch end across the entire document, drop the selection.\n * @private\n * @function Highcharts.Pointer#drop\n */\n drop(e) {\n const { chart, selectionMarker } = this;\n // During a mouse, touch or mousewheel pan, the `startOnTick` and\n // `endOnTick` options are ignored. Otherwise the zooming or panning\n // would be jumpy, or even not performed because the end ticks would\n // block it. After the touch has ended, we undo this and render again.\n let redraw;\n for (const axis of chart.axes) {\n if (axis.isPanning) {\n axis.isPanning = false;\n if (axis.options.startOnTick ||\n axis.options.endOnTick ||\n axis.series.some((s) => s.boosted)) {\n axis.forceRedraw = true;\n axis.setExtremes(axis.userMin, axis.userMax, false);\n redraw = true;\n }\n }\n }\n if (redraw) {\n chart.redraw();\n }\n if (selectionMarker && e) {\n // A selection has been made\n if (this.hasDragged) {\n const from = this.getSelectionBox(selectionMarker);\n chart.transform({\n axes: chart.axes.filter((a) => a.zoomEnabled &&\n ((a.coll === 'xAxis' && this.zoomX) ||\n (a.coll === 'yAxis' && this.zoomY))),\n selection: {\n originalEvent: e,\n xAxis: [],\n yAxis: [],\n ...from\n },\n from\n });\n }\n if (isNumber(chart.index)) {\n this.selectionMarker = selectionMarker.destroy();\n }\n }\n // Reset all. Check isNumber because it may be destroyed on mouse up\n // (#877)\n if (chart && isNumber(chart.index)) {\n css(chart.container, { cursor: chart._cursor });\n chart.cancelClick = this.hasDragged > 10; // #370\n chart.mouseIsDown = false;\n this.hasDragged = 0;\n this.pinchDown = [];\n }\n }\n /**\n * Finds the closest point to a set of coordinates, using the k-d-tree\n * algorithm.\n *\n * @function Highcharts.Pointer#findNearestKDPoint\n *\n * @param {Array} series\n * All the series to search in.\n *\n * @param {boolean|undefined} shared\n * Whether it is a shared tooltip or not.\n *\n * @param {Highcharts.PointerEventObject} e\n * The pointer event object, containing chart coordinates of the pointer.\n *\n * @return {Highcharts.Point|undefined}\n * The point closest to given coordinates.\n */\n findNearestKDPoint(series, shared, e) {\n let closest;\n /** @private */\n function sort(p1, p2) {\n const isCloserX = p1.distX - p2.distX, isCloser = p1.dist - p2.dist, isAbove = (p2.series.group?.zIndex -\n p1.series.group?.zIndex);\n let result;\n // We have two points which are not in the same place on xAxis\n // and shared tooltip:\n if (isCloserX !== 0 && shared) { // #5721\n result = isCloserX;\n // Points are not exactly in the same place on x/yAxis:\n }\n else if (isCloser !== 0) {\n result = isCloser;\n // The same xAxis and yAxis position, sort by z-index:\n }\n else if (isAbove !== 0) {\n result = isAbove;\n // The same zIndex, sort by array index:\n }\n else {\n result =\n p1.series.index > p2.series.index ?\n -1 :\n 1;\n }\n return result;\n }\n series.forEach(function (s) {\n const noSharedTooltip = s.noSharedTooltip && shared, compareX = (!noSharedTooltip &&\n s.options.findNearestPointBy.indexOf('y') < 0), point = s.searchPoint(e, compareX);\n if ( // Check that we actually found a point on the series.\n isObject(point, true) && point.series &&\n // Use the new point if it is closer.\n (!isObject(closest, true) ||\n (sort(closest, point) > 0))) {\n closest = point;\n }\n });\n return closest;\n }\n /**\n * @private\n * @function Highcharts.Pointer#getChartCoordinatesFromPoint\n */\n getChartCoordinatesFromPoint(point, inverted) {\n const { xAxis, yAxis } = point.series, shapeArgs = point.shapeArgs;\n if (xAxis && yAxis) {\n let x = point.clientX ?? point.plotX ?? 0, y = point.plotY || 0;\n if (point.isNode &&\n shapeArgs &&\n isNumber(shapeArgs.x) &&\n isNumber(shapeArgs.y)) {\n x = shapeArgs.x;\n y = shapeArgs.y;\n }\n return inverted ? {\n chartX: yAxis.len + yAxis.pos - y,\n chartY: xAxis.len + xAxis.pos - x\n } : {\n chartX: x + xAxis.pos,\n chartY: y + yAxis.pos\n };\n }\n if (shapeArgs && shapeArgs.x && shapeArgs.y) {\n // E.g. pies do not have axes\n return {\n chartX: shapeArgs.x,\n chartY: shapeArgs.y\n };\n }\n }\n /**\n * Return the cached chartPosition if it is available on the Pointer,\n * otherwise find it. Running offset is quite expensive, so it should be\n * avoided when we know the chart hasn't moved.\n *\n * @function Highcharts.Pointer#getChartPosition\n *\n * @return {Highcharts.ChartPositionObject}\n * The offset of the chart container within the page\n */\n getChartPosition() {\n if (this.chartPosition) {\n return this.chartPosition;\n }\n const { container } = this.chart;\n const pos = offset(container);\n this.chartPosition = {\n left: pos.left,\n top: pos.top,\n scaleX: 1,\n scaleY: 1\n };\n const { offsetHeight, offsetWidth } = container;\n // #13342 - tooltip was not visible in Chrome, when chart\n // updates height.\n if (offsetWidth > 2 && // #13342\n offsetHeight > 2 // #13342\n ) {\n this.chartPosition.scaleX = pos.width / offsetWidth;\n this.chartPosition.scaleY = pos.height / offsetHeight;\n }\n return this.chartPosition;\n }\n /**\n * Get the click position in terms of axis values.\n *\n * @function Highcharts.Pointer#getCoordinates\n *\n * @param {Highcharts.PointerEventObject} e\n * Pointer event, extended with `chartX` and `chartY` properties.\n *\n * @return {Highcharts.PointerAxisCoordinatesObject}\n * Axis coordinates.\n */\n getCoordinates(e) {\n const coordinates = {\n xAxis: [],\n yAxis: []\n };\n for (const axis of this.chart.axes) {\n coordinates[axis.isXAxis ? 'xAxis' : 'yAxis'].push({\n axis,\n value: axis.toValue(e[axis.horiz ? 'chartX' : 'chartY'])\n });\n }\n return coordinates;\n }\n /**\n * Calculates what is the current hovered point/points and series.\n *\n * @private\n * @function Highcharts.Pointer#getHoverData\n *\n * @param {Highcharts.Point|undefined} existingHoverPoint\n * The point currently being hovered.\n *\n * @param {Highcharts.Series|undefined} existingHoverSeries\n * The series currently being hovered.\n *\n * @param {Array} series\n * All the series in the chart.\n *\n * @param {boolean} isDirectTouch\n * Is the pointer directly hovering the point.\n *\n * @param {boolean|undefined} shared\n * Whether it is a shared tooltip or not.\n *\n * @param {Highcharts.PointerEventObject} [e]\n * The triggering event, containing chart coordinates of the pointer.\n *\n * @return {Object}\n * Object containing resulting hover data: hoverPoint, hoverSeries, and\n * hoverPoints.\n */\n getHoverData(existingHoverPoint, existingHoverSeries, series, isDirectTouch, shared, e) {\n const hoverPoints = [], useExisting = !!(isDirectTouch && existingHoverPoint), filter = function (s) {\n return (s.visible &&\n !(!shared && s.directTouch) && // #3821\n pick(s.options.enableMouseTracking, true));\n };\n let hoverSeries = existingHoverSeries, \n // Which series to look in for the hover point\n searchSeries, \n // Parameters needed for beforeGetHoverData event.\n eventArgs = {\n chartX: e ? e.chartX : void 0,\n chartY: e ? e.chartY : void 0,\n shared: shared\n };\n // Find chart.hoverPane and update filter method in polar.\n fireEvent(this, 'beforeGetHoverData', eventArgs);\n const notSticky = hoverSeries && !hoverSeries.stickyTracking;\n searchSeries = notSticky ?\n // Only search on hovered series if it has stickyTracking false\n [hoverSeries] :\n // Filter what series to look in.\n series.filter((s) => s.stickyTracking &&\n (eventArgs.filter || filter)(s));\n // Use existing hovered point or find the one closest to coordinates.\n const hoverPoint = useExisting || !e ?\n existingHoverPoint :\n this.findNearestKDPoint(searchSeries, shared, e);\n // Assign hover series\n hoverSeries = hoverPoint && hoverPoint.series;\n // If we have a hoverPoint, assign hoverPoints.\n if (hoverPoint) {\n // When tooltip is shared, it displays more than one point\n if (shared && !hoverSeries.noSharedTooltip) {\n searchSeries = series.filter(function (s) {\n return eventArgs.filter ?\n eventArgs.filter(s) : filter(s) && !s.noSharedTooltip;\n });\n // Get all points with the same x value as the hoverPoint\n searchSeries.forEach(function (s) {\n let point = find(s.points, function (p) {\n return p.x === hoverPoint.x && !p.isNull;\n });\n if (isObject(point)) {\n /*\n * Boost returns a minimal point. Convert it to a usable\n * point for tooltip and states.\n */\n if (s.boosted && s.boost) {\n point = s.boost.getPoint(point);\n }\n hoverPoints.push(point);\n }\n });\n }\n else {\n hoverPoints.push(hoverPoint);\n }\n }\n // Check whether the hoverPoint is inside pane we are hovering over.\n eventArgs = { hoverPoint: hoverPoint };\n fireEvent(this, 'afterGetHoverData', eventArgs);\n return {\n hoverPoint: eventArgs.hoverPoint,\n hoverSeries: hoverSeries,\n hoverPoints: hoverPoints\n };\n }\n /**\n * @private\n * @function Highcharts.Pointer#getPointFromEvent\n */\n getPointFromEvent(e) {\n let target = e.target, point;\n while (target && !point) {\n point = target.point;\n target = target.parentNode;\n }\n return point;\n }\n /**\n * @private\n * @function Highcharts.Pointer#onTrackerMouseOut\n */\n onTrackerMouseOut(e) {\n const chart = this.chart;\n const relatedTarget = e.relatedTarget;\n const series = chart.hoverSeries;\n this.isDirectTouch = false;\n if (series &&\n relatedTarget &&\n !series.stickyTracking &&\n !this.inClass(relatedTarget, 'highcharts-tooltip') &&\n (!this.inClass(relatedTarget, 'highcharts-series-' + series.index) || // #2499, #4465, #5553\n !this.inClass(relatedTarget, 'highcharts-tracker'))) {\n series.onMouseOut();\n }\n }\n /**\n * Utility to detect whether an element has, or has a parent with, a\n * specific class name. Used on detection of tracker objects and on deciding\n * whether hovering the tooltip should cause the active series to mouse out.\n *\n * @function Highcharts.Pointer#inClass\n *\n * @param {Highcharts.SVGDOMElement|Highcharts.HTMLDOMElement} element\n * The element to investigate.\n *\n * @param {string} className\n * The class name to look for.\n *\n * @return {boolean|undefined}\n * True if either the element or one of its parents has the given class\n * name.\n */\n inClass(element, className) {\n let elem = element, elemClassName;\n while (elem) {\n elemClassName = attr(elem, 'class');\n if (elemClassName) {\n if (elemClassName.indexOf(className) !== -1) {\n return true;\n }\n if (elemClassName.indexOf('highcharts-container') !== -1) {\n return false;\n }\n }\n elem = elem.parentElement;\n }\n }\n /**\n * Initialize the Pointer.\n *\n * @private\n * @function Highcharts.Pointer#init\n *\n * @param {Highcharts.Chart} chart\n * The Chart instance.\n *\n * @param {Highcharts.Options} options\n * The root options object. The pointer uses options from the chart and\n * tooltip structures.\n */\n constructor(chart, options) {\n this.hasDragged = 0;\n this.eventsToUnbind = [];\n // Store references\n this.options = options;\n this.chart = chart;\n // Do we need to handle click on a touch device?\n this.runChartClick = Boolean(options.chart.events?.click);\n this.pinchDown = [];\n this.setDOMEvents();\n fireEvent(this, 'afterInit');\n }\n /**\n * Takes a browser event object and extends it with custom Highcharts\n * properties `chartX` and `chartY` in order to work on the internal\n * coordinate system.\n *\n * On map charts, the properties `lon` and `lat` are added to the event\n * object given that the chart has projection information.\n *\n * @function Highcharts.Pointer#normalize\n *\n * @param {global.MouseEvent|global.PointerEvent|global.TouchEvent} e\n * Event object in standard browsers.\n *\n * @param {Highcharts.OffsetObject} [chartPosition]\n * Additional chart offset.\n *\n * @return {Highcharts.PointerEventObject}\n * A browser event with extended properties `chartX` and `chartY`.\n */\n normalize(e, chartPosition) {\n const touches = e.touches;\n // Position for iOS (#2757)\n const ePos = (touches ?\n touches.length ?\n touches.item(0) :\n (pick(// #13534\n touches.changedTouches, e.changedTouches))[0] :\n e);\n // Get mouse position\n if (!chartPosition) {\n chartPosition = this.getChartPosition();\n }\n let chartX = ePos.pageX - chartPosition.left, chartY = ePos.pageY - chartPosition.top;\n // #11329 - when there is scaling on a parent element, we need to take\n // this into account\n chartX /= chartPosition.scaleX;\n chartY /= chartPosition.scaleY;\n return extend(e, {\n chartX: Math.round(chartX),\n chartY: Math.round(chartY)\n });\n }\n /**\n * @private\n * @function Highcharts.Pointer#onContainerClick\n */\n onContainerClick(e) {\n const chart = this.chart;\n const hoverPoint = chart.hoverPoint;\n const pEvt = this.normalize(e);\n const plotLeft = chart.plotLeft;\n const plotTop = chart.plotTop;\n if (!chart.cancelClick) {\n // On tracker click, fire the series and point events. #783, #1583\n if (hoverPoint &&\n this.inClass(pEvt.target, 'highcharts-tracker')) {\n // The series click event\n fireEvent(hoverPoint.series, 'click', extend(pEvt, {\n point: hoverPoint\n }));\n // The point click event\n if (chart.hoverPoint) { // It may be destroyed (#1844)\n hoverPoint.firePointEvent('click', pEvt);\n }\n // When clicking outside a tracker, fire a chart event\n }\n else {\n extend(pEvt, this.getCoordinates(pEvt));\n // Fire a click event in the chart\n if (chart.isInsidePlot(pEvt.chartX - plotLeft, pEvt.chartY - plotTop, {\n visiblePlotOnly: true\n })) {\n fireEvent(chart, 'click', pEvt);\n }\n }\n }\n }\n /**\n * @private\n * @function Highcharts.Pointer#onContainerMouseDown\n */\n onContainerMouseDown(e) {\n const isPrimaryButton = ((e.buttons || e.button) & 1) === 1;\n e = this.normalize(e);\n // #11635, Firefox does not reliably fire move event after click scroll\n if (H.isFirefox &&\n e.button !== 0) {\n this.onContainerMouseMove(e);\n }\n // #11635, limiting to primary button\n if (typeof e.button === 'undefined' ||\n isPrimaryButton) {\n this.zoomOption(e);\n // #295, #13737 solve conflict between container drag and chart zoom\n if (isPrimaryButton) {\n e.preventDefault?.();\n }\n this.dragStart(e);\n }\n }\n /**\n * When mouse leaves the container, hide the tooltip.\n * @private\n * @function Highcharts.Pointer#onContainerMouseLeave\n */\n onContainerMouseLeave(e) {\n const { pointer } = charts[pick(Pointer.hoverChartIndex, -1)] || {};\n e = this.normalize(e);\n this.onContainerMouseMove(e);\n // #4886, MS Touch end fires mouseleave but with no related target\n if (pointer &&\n e.relatedTarget &&\n !this.inClass(e.relatedTarget, 'highcharts-tooltip')) {\n pointer.reset();\n // Also reset the chart position, used in #149 fix\n pointer.chartPosition = void 0;\n }\n }\n /**\n * When mouse enters the container, delete pointer's chartPosition.\n * @private\n * @function Highcharts.Pointer#onContainerMouseEnter\n */\n onContainerMouseEnter() {\n delete this.chartPosition;\n }\n /**\n * The mousemove, touchmove and touchstart event handler\n * @private\n * @function Highcharts.Pointer#onContainerMouseMove\n */\n onContainerMouseMove(e) {\n const chart = this.chart, tooltip = chart.tooltip, pEvt = this.normalize(e);\n this.setHoverChartIndex(e);\n if (chart.mouseIsDown === 'mousedown' || this.touchSelect(pEvt)) {\n this.drag(pEvt);\n }\n // Show the tooltip and run mouse over events (#977)\n if (!chart.openMenu &&\n (this.inClass(pEvt.target, 'highcharts-tracker') ||\n chart.isInsidePlot(pEvt.chartX - chart.plotLeft, pEvt.chartY - chart.plotTop, {\n visiblePlotOnly: true\n })) &&\n // If the tooltip has stickOnContact enabled, do nothing. This\n // applies regardless of any combinations of the `split` and\n // `useHTML` options.\n !(tooltip &&\n tooltip.shouldStickOnContact(pEvt))) {\n if (this.inClass(pEvt.target, 'highcharts-no-tooltip')) {\n this.reset(false, 0);\n }\n else {\n this.runPointActions(pEvt);\n }\n }\n }\n /**\n * @private\n * @function Highcharts.Pointer#onDocumentTouchEnd\n */\n onDocumentTouchEnd(e) {\n this.onDocumentMouseUp(e);\n }\n /**\n * @private\n * @function Highcharts.Pointer#onContainerTouchMove\n */\n onContainerTouchMove(e) {\n if (this.touchSelect(e)) {\n this.onContainerMouseMove(e);\n }\n else {\n this.touch(e);\n }\n }\n /**\n * @private\n * @function Highcharts.Pointer#onContainerTouchStart\n */\n onContainerTouchStart(e) {\n if (this.touchSelect(e)) {\n this.onContainerMouseDown(e);\n }\n else {\n this.zoomOption(e);\n this.touch(e, true);\n }\n }\n /**\n * Special handler for mouse move that will hide the tooltip when the mouse\n * leaves the plotarea. Issue #149 workaround. The mouseleave event does not\n * always fire.\n * @private\n * @function Highcharts.Pointer#onDocumentMouseMove\n */\n onDocumentMouseMove(e) {\n const chart = this.chart;\n const tooltip = chart.tooltip;\n const chartPosition = this.chartPosition;\n const pEvt = this.normalize(e, chartPosition);\n // If we're outside, hide the tooltip\n if (chartPosition &&\n !chart.isInsidePlot(pEvt.chartX - chart.plotLeft, pEvt.chartY - chart.plotTop, {\n visiblePlotOnly: true\n }) &&\n !(tooltip &&\n tooltip.shouldStickOnContact(pEvt)) &&\n !this.inClass(pEvt.target, 'highcharts-tracker')) {\n this.reset();\n }\n }\n /**\n * @private\n * @function Highcharts.Pointer#onDocumentMouseUp\n */\n onDocumentMouseUp(e) {\n charts[pick(Pointer.hoverChartIndex, -1)]\n ?.pointer\n ?.drop(e);\n }\n /**\n * Handle touch events with two touches\n * @private\n * @function Highcharts.Pointer#pinch\n */\n pinch(e) {\n const pointer = this, { chart, hasZoom, lastTouches } = pointer, touches = [].map.call(e.touches || [], \n // Normalize each touch\n (touch) => pointer.normalize(touch)), touchesLength = touches.length, fireClickEvent = touchesLength === 1 && ((pointer.inClass(e.target, 'highcharts-tracker') &&\n chart.runTrackerClick) ||\n pointer.runChartClick), tooltip = chart.tooltip, followTouchMove = touchesLength === 1 &&\n pick(tooltip?.options.followTouchMove, true);\n // Don't initiate panning until the user has pinched. This prevents us\n // from blocking page scrolling as users scroll down a long page\n // (#4210).\n if (touchesLength > 1) {\n pointer.initiated = true;\n }\n else if (followTouchMove) {\n // #16119: Prevent blocking scroll when single-finger panning is\n // not enabled\n pointer.initiated = false;\n }\n // On touch devices, only proceed to trigger click if a handler is\n // defined\n if (hasZoom &&\n pointer.initiated &&\n !fireClickEvent &&\n e.cancelable !== false) {\n e.preventDefault();\n }\n // Register the touch start position\n if (e.type === 'touchstart') {\n pointer.pinchDown = touches;\n pointer.res = true; // Reset on next move\n // Optionally move the tooltip on touchmove\n }\n else if (followTouchMove) {\n this.runPointActions(pointer.normalize(e));\n // Event type is touchmove, handle panning and pinching. The length can\n // be 0 when releasing, if touchend fires first\n }\n else if (lastTouches) {\n fireEvent(chart, 'touchpan', {\n originalEvent: e,\n touches\n }, () => {\n const boxFromTouches = (touches) => {\n const finger0 = touches[0], finger1 = touches[1] || finger0;\n return {\n x: finger0.chartX,\n y: finger0.chartY,\n width: finger1.chartX - finger0.chartX,\n height: finger1.chartY - finger0.chartY\n };\n };\n chart.transform({\n axes: chart.axes\n .filter((axis) => axis.zoomEnabled &&\n ((this.zoomHor && axis.horiz) ||\n (this.zoomVert && !axis.horiz))),\n to: boxFromTouches(touches),\n from: boxFromTouches(lastTouches),\n trigger: e.type\n });\n });\n if (pointer.res) {\n pointer.res = false;\n this.reset(false, 0);\n }\n }\n pointer.lastTouches = touches;\n }\n /**\n * Run translation operations\n * @private\n * @function Highcharts.Pointer#pinchTranslate\n * /\n public pinchTranslate(\n pinchDown: Array,\n touches: Array,\n transform: any,\n selectionMarker: any,\n clip: any,\n lastValidTouch: any\n ): void {\n if (this.zoomHor) {\n this.pinchTranslateDirection(\n true,\n pinchDown,\n touches,\n transform,\n selectionMarker,\n clip,\n lastValidTouch\n );\n }\n if (this.zoomVert) {\n this.pinchTranslateDirection(\n false,\n pinchDown,\n touches,\n transform,\n selectionMarker,\n clip,\n lastValidTouch\n );\n }\n }\n */\n /**\n * Run translation operations for each direction (horizontal and vertical)\n * independently.\n * @private\n * @function Highcharts.Pointer#pinchTranslateDirection\n * /\n public pinchTranslateDirection(\n horiz: boolean,\n pinchDown: Array,\n touches: Array,\n transform: any,\n selectionMarker: any,\n clip: any,\n lastValidTouch: any,\n forcedScale?: number\n ): void {\n const chart = this.chart,\n xy: ('x'|'y') = horiz ? 'x' : 'y',\n XY: ('X'|'Y') = horiz ? 'X' : 'Y',\n sChartXY: ('chartX'|'chartY') = ('chart' + XY) as any,\n wh = horiz ? 'width' : 'height',\n plotLeftTop = (chart as any)['plot' + (horiz ? 'Left' : 'Top')],\n inverted = chart.inverted,\n bounds = chart.bounds[horiz ? 'h' : 'v'],\n singleTouch = pinchDown.length === 1,\n touch0Start = pinchDown[0][sChartXY],\n touch1Start = !singleTouch && pinchDown[1][sChartXY],\n setScale = function (): void {\n // Don't zoom if fingers are too close on this axis\n if (\n typeof touch1Now === 'number' &&\n Math.abs(touch0Start - touch1Start) > 20\n ) {\n scale = forcedScale ||\n Math.abs(touch0Now - touch1Now) /\n Math.abs(touch0Start - touch1Start);\n }\n\n clipXY = ((plotLeftTop - touch0Now) / scale) + touch0Start;\n selectionWH = (chart as any)[\n 'plot' + (horiz ? 'Width' : 'Height')\n ] / scale;\n };\n\n let selectionWH: any,\n selectionXY,\n clipXY: any,\n scale = forcedScale || 1,\n touch0Now = touches[0][sChartXY],\n touch1Now = !singleTouch && touches[1][sChartXY],\n outOfBounds;\n\n // Set the scale, first pass\n setScale();\n\n // The clip position (x or y) is altered if out of bounds, the selection\n // position is not\n selectionXY = clipXY;\n\n // Out of bounds\n if (selectionXY < bounds.min) {\n selectionXY = bounds.min;\n outOfBounds = true;\n } else if (selectionXY + selectionWH > bounds.max) {\n selectionXY = bounds.max - selectionWH;\n outOfBounds = true;\n }\n\n // Is the chart dragged off its bounds, determined by dataMin and\n // dataMax?\n if (outOfBounds) {\n\n // Modify the touchNow position in order to create an elastic drag\n // movement. This indicates to the user that the chart is responsive\n // but can't be dragged further.\n touch0Now -= 0.8 * (touch0Now - lastValidTouch[xy][0]);\n if (typeof touch1Now === 'number') {\n touch1Now -= 0.8 * (touch1Now - lastValidTouch[xy][1]);\n }\n\n // Set the scale, second pass to adapt to the modified touchNow\n // positions\n setScale();\n\n } else {\n lastValidTouch[xy] = [touch0Now, touch1Now];\n }\n\n // Set geometry for clipping, selection and transformation\n if (!inverted) {\n clip[xy] = clipXY - plotLeftTop;\n clip[wh] = selectionWH;\n }\n const scaleKey = inverted ?\n (horiz ? 'scaleY' : 'scaleX') : 'scale' + XY;\n const transformScale = inverted ? 1 / scale : scale;\n\n selectionMarker[wh] = selectionWH;\n selectionMarker[xy] = selectionXY;\n // Invert scale if needed (#19217)\n transform[scaleKey] = scale * (inverted && !horiz ? -1 : 1);\n transform['translate' + XY] = (transformScale * plotLeftTop) +\n (touch0Now - (transformScale * touch0Start));\n }\n */\n /**\n * Reset the tracking by hiding the tooltip, the hover series state and the\n * hover point\n *\n * @function Highcharts.Pointer#reset\n *\n * @param {boolean} [allowMove]\n * Instead of destroying the tooltip altogether, allow moving it if\n * possible.\n *\n * @param {number} [delay]\n */\n reset(allowMove, delay) {\n const pointer = this, chart = pointer.chart, hoverSeries = chart.hoverSeries, hoverPoint = chart.hoverPoint, hoverPoints = chart.hoverPoints, tooltip = chart.tooltip, tooltipPoints = tooltip && tooltip.shared ?\n hoverPoints :\n hoverPoint;\n // Check if the points have moved outside the plot area (#1003, #4736,\n // #5101)\n if (allowMove && tooltipPoints) {\n splat(tooltipPoints).forEach(function (point) {\n if (point.series.isCartesian &&\n typeof point.plotX === 'undefined') {\n allowMove = false;\n }\n });\n }\n // Just move the tooltip, #349\n if (allowMove) {\n if (tooltip && tooltipPoints && splat(tooltipPoints).length) {\n tooltip.refresh(tooltipPoints);\n if (tooltip.shared && hoverPoints) { // #8284\n hoverPoints.forEach(function (point) {\n point.setState(point.state, true);\n if (point.series.isCartesian) {\n if (point.series.xAxis.crosshair) {\n point.series.xAxis\n .drawCrosshair(null, point);\n }\n if (point.series.yAxis.crosshair) {\n point.series.yAxis\n .drawCrosshair(null, point);\n }\n }\n });\n }\n else if (hoverPoint) { // #2500\n hoverPoint.setState(hoverPoint.state, true);\n chart.axes.forEach(function (axis) {\n if (axis.crosshair &&\n hoverPoint.series[axis.coll] === axis) {\n axis.drawCrosshair(null, hoverPoint);\n }\n });\n }\n }\n // Full reset\n }\n else {\n if (hoverPoint) {\n hoverPoint.onMouseOut();\n }\n if (hoverPoints) {\n hoverPoints.forEach(function (point) {\n point.setState();\n });\n }\n if (hoverSeries) {\n hoverSeries.onMouseOut();\n }\n if (tooltip) {\n tooltip.hide(delay);\n }\n if (pointer.unDocMouseMove) {\n pointer.unDocMouseMove = pointer.unDocMouseMove();\n }\n // Remove crosshairs\n chart.axes.forEach(function (axis) {\n axis.hideCrosshair();\n });\n chart.hoverPoints = chart.hoverPoint = void 0;\n }\n }\n /**\n * With line type charts with a single tracker, get the point closest to the\n * mouse. Run Point.onMouseOver and display tooltip for the point or points.\n *\n * @private\n * @function Highcharts.Pointer#runPointActions\n *\n * @emits Highcharts.Point#event:mouseOut\n * @emits Highcharts.Point#event:mouseOver\n */\n runPointActions(e, p, force) {\n const pointer = this, chart = pointer.chart, series = chart.series, tooltip = (chart.tooltip && chart.tooltip.options.enabled ?\n chart.tooltip :\n void 0), shared = (tooltip ?\n tooltip.shared :\n false);\n let hoverPoint = p || chart.hoverPoint, hoverSeries = hoverPoint && hoverPoint.series || chart.hoverSeries;\n const // onMouseOver or already hovering a series with directTouch\n isDirectTouch = (!e || e.type !== 'touchmove') && (!!p || ((hoverSeries && hoverSeries.directTouch) &&\n pointer.isDirectTouch)), hoverData = this.getHoverData(hoverPoint, hoverSeries, series, isDirectTouch, shared, e);\n // Update variables from hoverData.\n hoverPoint = hoverData.hoverPoint;\n hoverSeries = hoverData.hoverSeries;\n const points = hoverData.hoverPoints, followPointer = hoverSeries &&\n hoverSeries.tooltipOptions.followPointer &&\n !hoverSeries.tooltipOptions.split, useSharedTooltip = (shared &&\n hoverSeries &&\n !hoverSeries.noSharedTooltip);\n // Refresh tooltip for kdpoint if new hover point or tooltip was hidden\n // #3926, #4200\n if (hoverPoint &&\n (force ||\n hoverPoint !== chart.hoverPoint ||\n (tooltip && tooltip.isHidden))) {\n (chart.hoverPoints || []).forEach(function (p) {\n if (points.indexOf(p) === -1) {\n p.setState();\n }\n });\n // Set normal state to previous series\n if (chart.hoverSeries !== hoverSeries) {\n hoverSeries.onMouseOver();\n }\n pointer.applyInactiveState(points);\n // Do mouseover on all points (#3919, #3985, #4410, #5622)\n (points || []).forEach(function (p) {\n p.setState('hover');\n });\n // If tracking is on series in stead of on each point,\n // fire mouseOver on hover point. // #4448\n if (chart.hoverPoint) {\n chart.hoverPoint.firePointEvent('mouseOut');\n }\n // Hover point may have been destroyed in the event handlers (#7127)\n if (!hoverPoint.series) {\n return;\n }\n /**\n * Contains all hovered points.\n *\n * @name Highcharts.Chart#hoverPoints\n * @type {Array|null}\n */\n chart.hoverPoints = points;\n /**\n * Contains the original hovered point.\n *\n * @name Highcharts.Chart#hoverPoint\n * @type {Highcharts.Point|null}\n */\n chart.hoverPoint = hoverPoint;\n /**\n * Hover state should not be lost when axis is updated (#12569)\n * Axis.update runs pointer.reset which uses chart.hoverPoint.state\n * to apply state which does not exist in hoverPoint yet.\n * The mouseOver event should be triggered when hoverPoint\n * is correct.\n */\n hoverPoint.firePointEvent('mouseOver', void 0, () => {\n // Draw tooltip if necessary\n if (tooltip && hoverPoint) {\n tooltip.refresh(useSharedTooltip ? points : hoverPoint, e);\n }\n });\n // Update positions (regardless of kdpoint or hoverPoint)\n }\n else if (followPointer && tooltip && !tooltip.isHidden) {\n const anchor = tooltip.getAnchor([{}], e);\n if (chart.isInsidePlot(anchor[0], anchor[1], {\n visiblePlotOnly: true\n })) {\n tooltip.updatePosition({ plotX: anchor[0], plotY: anchor[1] });\n }\n }\n // Start the event listener to pick up the tooltip and crosshairs\n if (!pointer.unDocMouseMove) {\n pointer.unDocMouseMove = addEvent(chart.container.ownerDocument, 'mousemove', (e) => charts[Pointer.hoverChartIndex ?? -1]\n ?.pointer\n ?.onDocumentMouseMove(e));\n pointer.eventsToUnbind.push(pointer.unDocMouseMove);\n }\n // Issues related to crosshair #4927, #5269 #5066, #5658\n chart.axes.forEach(function drawAxisCrosshair(axis) {\n const snap = pick((axis.crosshair || {}).snap, true);\n let point;\n if (snap) {\n point = chart.hoverPoint; // #13002\n if (!point || point.series[axis.coll] !== axis) {\n point = find(points, (p) => p.series && p.series[axis.coll] === axis);\n }\n }\n // Axis has snapping crosshairs, and one of the hover points belongs\n // to axis. Always call drawCrosshair when it is not snap.\n if (point || !snap) {\n axis.drawCrosshair(e, point);\n // Axis has snapping crosshairs, but no hover point belongs to axis\n }\n else {\n axis.hideCrosshair();\n }\n });\n }\n /**\n * Set the JS DOM events on the container and document. This method should\n * contain a one-to-one assignment between methods and their handlers. Any\n * advanced logic should be moved to the handler reflecting the event's\n * name.\n * @private\n * @function Highcharts.Pointer#setDOMEvents\n */\n setDOMEvents() {\n const container = this.chart.container, ownerDoc = container.ownerDocument;\n container.onmousedown = this.onContainerMouseDown.bind(this);\n container.onmousemove = this.onContainerMouseMove.bind(this);\n container.onclick = this.onContainerClick.bind(this);\n this.eventsToUnbind.push(addEvent(container, 'mouseenter', this.onContainerMouseEnter.bind(this)), addEvent(container, 'mouseleave', this.onContainerMouseLeave.bind(this)));\n if (!Pointer.unbindDocumentMouseUp) {\n Pointer.unbindDocumentMouseUp = addEvent(ownerDoc, 'mouseup', this.onDocumentMouseUp.bind(this));\n }\n // In case we are dealing with overflow, reset the chart position when\n // scrolling parent elements\n let parent = this.chart.renderTo.parentElement;\n while (parent && parent.tagName !== 'BODY') {\n this.eventsToUnbind.push(addEvent(parent, 'scroll', () => {\n delete this.chartPosition;\n }));\n parent = parent.parentElement;\n }\n this.eventsToUnbind.push(addEvent(container, 'touchstart', this.onContainerTouchStart.bind(this), { passive: false }), addEvent(container, 'touchmove', this.onContainerTouchMove.bind(this), { passive: false }));\n if (!Pointer.unbindDocumentTouchEnd) {\n Pointer.unbindDocumentTouchEnd = addEvent(ownerDoc, 'touchend', this.onDocumentTouchEnd.bind(this), { passive: false });\n }\n }\n /**\n * Sets the index of the hovered chart and leaves the previous hovered\n * chart, to reset states like tooltip.\n * @private\n * @function Highcharts.Pointer#setHoverChartIndex\n */\n setHoverChartIndex(e) {\n const chart = this.chart;\n const hoverChart = H.charts[pick(Pointer.hoverChartIndex, -1)];\n if (hoverChart &&\n hoverChart !== chart) {\n hoverChart.pointer?.onContainerMouseLeave(e || { relatedTarget: chart.container });\n }\n if (!hoverChart ||\n !hoverChart.mouseIsDown) {\n Pointer.hoverChartIndex = chart.index;\n }\n }\n /**\n * General touch handler shared by touchstart and touchmove.\n * @private\n * @function Highcharts.Pointer#touch\n */\n touch(e, start) {\n const { chart, pinchDown = [] } = this;\n let hasMoved, isInside;\n this.setHoverChartIndex();\n if (e.touches.length === 1) {\n e = this.normalize(e);\n isInside = chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop, {\n visiblePlotOnly: true\n });\n if (isInside && !chart.openMenu) {\n // Run mouse events and display tooltip etc\n if (start) {\n this.runPointActions(e);\n }\n // Android fires touchmove events after the touchstart even if\n // the finger hasn't moved, or moved only a pixel or two. In iOS\n // however, the touchmove doesn't fire unless the finger moves\n // more than ~4px. So we emulate this behaviour in Android by\n // checking how much it moved, and cancelling on small\n // distances. #3450. Tested and still relevant as of 2024.\n if (e.type === 'touchmove') {\n hasMoved = pinchDown[0] ? // #5266\n (Math.pow(pinchDown[0].chartX - e.chartX, 2) +\n Math.pow(pinchDown[0].chartY - e.chartY, 2)) >= 16 :\n false;\n }\n if (pick(hasMoved, true)) {\n this.pinch(e);\n }\n }\n else if (start) {\n // Hide the tooltip on touching outside the plot area (#1203)\n this.reset();\n }\n }\n else if (e.touches.length === 2) {\n this.pinch(e);\n }\n }\n /**\n * Returns true if the chart is set up for zooming by single touch and the\n * event is capable\n * @private\n * @function Highcharts.Pointer#touchSelect\n */\n touchSelect(e) {\n return Boolean(this.chart.zooming.singleTouch &&\n e.touches &&\n e.touches.length === 1);\n }\n /**\n * Resolve the zoomType option, this is reset on all touch start and mouse\n * down events.\n * @private\n * @function Highcharts.Pointer#zoomOption\n */\n zoomOption(e) {\n const chart = this.chart, inverted = chart.inverted;\n let zoomType = chart.zooming.type || '', zoomX, zoomY;\n // Look for the pinchType option\n if (/touch/.test(e.type)) {\n zoomType = pick(chart.zooming.pinchType, zoomType);\n }\n this.zoomX = zoomX = /x/.test(zoomType);\n this.zoomY = zoomY = /y/.test(zoomType);\n this.zoomHor = (zoomX && !inverted) || (zoomY && inverted);\n this.zoomVert = (zoomY && !inverted) || (zoomX && inverted);\n this.hasZoom = zoomX || zoomY;\n }\n}\n/* *\n *\n * Class Namespace\n *\n * */\n(function (Pointer) {\n /* *\n *\n * Declarations\n *\n * */\n /* *\n *\n * Functions\n *\n * */\n /**\n * @private\n */\n function compose(ChartClass) {\n if (pushUnique(composed, 'Core.Pointer')) {\n addEvent(ChartClass, 'beforeRender', function () {\n /**\n * The Pointer that keeps track of mouse and touch\n * interaction.\n *\n * @memberof Highcharts.Chart\n * @name pointer\n * @type {Highcharts.Pointer}\n * @instance\n */\n this.pointer = new Pointer(this, this.options);\n });\n }\n }\n Pointer.compose = compose;\n})(Pointer || (Pointer = {}));\n/* *\n *\n * Default Export\n *\n * */\nexport default Pointer;\n/* *\n *\n * API Declarations\n *\n * */\n/**\n * Chart position and scale.\n *\n * @interface Highcharts.ChartPositionObject\n */ /**\n* @name Highcharts.ChartPositionObject#left\n* @type {number}\n*/ /**\n* @name Highcharts.ChartPositionObject#scaleX\n* @type {number}\n*/ /**\n* @name Highcharts.ChartPositionObject#scaleY\n* @type {number}\n*/ /**\n* @name Highcharts.ChartPositionObject#top\n* @type {number}\n*/\n/**\n * One position in relation to an axis.\n *\n * @interface Highcharts.PointerAxisCoordinateObject\n */ /**\n* Related axis.\n*\n* @name Highcharts.PointerAxisCoordinateObject#axis\n* @type {Highcharts.Axis}\n*/ /**\n* Axis value.\n*\n* @name Highcharts.PointerAxisCoordinateObject#value\n* @type {number}\n*/\n/**\n * Positions in terms of axis values.\n *\n * @interface Highcharts.PointerAxisCoordinatesObject\n */ /**\n* Positions on the x-axis.\n* @name Highcharts.PointerAxisCoordinatesObject#xAxis\n* @type {Array}\n*/ /**\n* Positions on the y-axis.\n* @name Highcharts.PointerAxisCoordinatesObject#yAxis\n* @type {Array}\n*/\n/**\n * Pointer coordinates.\n *\n * @interface Highcharts.PointerCoordinatesObject\n */ /**\n* @name Highcharts.PointerCoordinatesObject#chartX\n* @type {number}\n*/ /**\n* @name Highcharts.PointerCoordinatesObject#chartY\n* @type {number}\n*/\n/**\n * A native browser mouse or touch event, extended with position information\n * relative to the {@link Chart.container}.\n *\n * @interface Highcharts.PointerEventObject\n * @extends global.PointerEvent\n */ /**\n* The X coordinate of the pointer interaction relative to the chart.\n*\n* @name Highcharts.PointerEventObject#chartX\n* @type {number}\n*/ /**\n* The Y coordinate of the pointer interaction relative to the chart.\n*\n* @name Highcharts.PointerEventObject#chartY\n* @type {number}\n*/\n/**\n * Axis-specific data of a selection.\n *\n * @interface Highcharts.SelectDataObject\n */ /**\n* The selected Axis.\n* @name Highcharts.SelectDataObject#axis\n* @type {Highcharts.Axis}\n*/ /**\n* The maximum axis value, either automatic or set manually.\n* @name Highcharts.SelectDataObject#max\n* @type {number}\n*/ /**\n* The minimum axis value, either automatic or set manually.\n* @name Highcharts.SelectDataObject#min\n* @type {number}\n*/\n/**\n * Object for select events.\n * The primary axes are `xAxis[0]` and `yAxis[0]`. Remember the unit of a\n * datetime axis is milliseconds since 1970-01-01 00:00:00.\n *\n * @interface Highcharts.SelectEventObject\n */ /**\n* The related browser event.\n* @name Highcharts.SelectEventObject#originalEvent\n* @type {global.Event}\n*/ /**\n* Indicates a reset event to restore default state.\n* @name Highcharts.SelectEventObject#resetSelection\n* @type {boolean|undefined}\n*/ /**\n* Arrays containing the axes of each dimension and each axis' min and max\n* values.\n* @name Highcharts.SelectEventObject#xAxis\n* @type {Array}\n*/ /**\n* Arrays containing the axes of each dimension and each axis' min and max\n* values.\n* @name Highcharts.SelectEventObject#yAxis\n* @type {Array}\n*/\n''; // keeps doclets above in JS file\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport A from '../Animation/AnimationUtilities.js';\nconst { animObject, setAnimation } = A;\nimport F from '../Templating.js';\nconst { format } = F;\nimport H from '../Globals.js';\nconst { composed, marginNames } = H;\nimport Point from '../Series/Point.js';\nimport R from '../Renderer/RendererUtilities.js';\nconst { distribute } = R;\nimport U from '../Utilities.js';\nconst { addEvent, createElement, css, defined, discardElement, find, fireEvent, isNumber, merge, pick, pushUnique, relativeLength, stableSort, syncTimeout } = U;\n/* *\n *\n * Class\n *\n * */\n/**\n * The overview of the chart's series. The legend object is instantiated\n * internally in the chart constructor, and is available from the `chart.legend`\n * property. Each chart has only one legend.\n *\n * @class\n * @name Highcharts.Legend\n *\n * @param {Highcharts.Chart} chart\n * The chart instance.\n *\n * @param {Highcharts.LegendOptions} options\n * Legend options.\n */\nclass Legend {\n /* *\n *\n * Functions\n *\n * */\n /**\n * Initialize the legend.\n *\n * @private\n * @function Highcharts.Legend#init\n *\n * @param {Highcharts.Chart} chart\n * The chart instance.\n *\n * @param {Highcharts.LegendOptions} options\n * Legend options.\n */\n constructor(chart, options) {\n /* *\n *\n * Properties\n *\n * */\n this.allItems = [];\n this.initialItemY = 0;\n this.itemHeight = 0;\n this.itemMarginBottom = 0;\n this.itemMarginTop = 0;\n this.itemX = 0;\n this.itemY = 0;\n this.lastItemY = 0;\n this.lastLineHeight = 0;\n this.legendHeight = 0;\n this.legendWidth = 0;\n this.maxItemWidth = 0;\n this.maxLegendWidth = 0;\n this.offsetWidth = 0;\n this.padding = 0;\n this.pages = [];\n this.symbolHeight = 0;\n this.symbolWidth = 0;\n this.titleHeight = 0;\n this.totalItemWidth = 0;\n this.widthOption = 0;\n /**\n * Chart of this legend.\n *\n * @readonly\n * @name Highcharts.Legend#chart\n * @type {Highcharts.Chart}\n */\n this.chart = chart;\n this.setOptions(options);\n if (options.enabled) {\n // Render it\n this.render();\n // Move checkboxes\n addEvent(this.chart, 'endResize', function () {\n this.legend.positionCheckboxes();\n });\n }\n // On Legend.init and Legend.update, make sure that proximate layout\n // events are either added or removed (#18362).\n addEvent(this.chart, 'render', () => {\n if (this.options.enabled && this.proximate) {\n this.proximatePositions();\n this.positionItems();\n }\n });\n }\n /**\n * @private\n * @function Highcharts.Legend#setOptions\n * @param {Highcharts.LegendOptions} options\n */\n setOptions(options) {\n const padding = pick(options.padding, 8);\n /**\n * Legend options.\n *\n * @readonly\n * @name Highcharts.Legend#options\n * @type {Highcharts.LegendOptions}\n */\n this.options = options;\n if (!this.chart.styledMode) {\n this.itemStyle = options.itemStyle;\n this.itemHiddenStyle = merge(this.itemStyle, options.itemHiddenStyle);\n }\n this.itemMarginTop = options.itemMarginTop;\n this.itemMarginBottom = options.itemMarginBottom;\n this.padding = padding;\n this.initialItemY = padding - 5; // 5 is pixels above the text\n this.symbolWidth = pick(options.symbolWidth, 16);\n this.pages = [];\n this.proximate = options.layout === 'proximate' && !this.chart.inverted;\n // #12705: baseline has to be reset on every update\n this.baseline = void 0;\n }\n /**\n * Update the legend with new options. Equivalent to running `chart.update`\n * with a legend configuration option.\n *\n * @sample highcharts/legend/legend-update/\n * Legend update\n *\n * @function Highcharts.Legend#update\n *\n * @param {Highcharts.LegendOptions} options\n * Legend options.\n *\n * @param {boolean} [redraw=true]\n * Whether to redraw the chart after the axis is altered. If doing more\n * operations on the chart, it is a good idea to set redraw to false and\n * call {@link Chart#redraw} after. Whether to redraw the chart.\n *\n * @emits Highcharts.Legends#event:afterUpdate\n */\n update(options, redraw) {\n const chart = this.chart;\n this.setOptions(merge(true, this.options, options));\n this.destroy();\n chart.isDirtyLegend = chart.isDirtyBox = true;\n if (pick(redraw, true)) {\n chart.redraw();\n }\n fireEvent(this, 'afterUpdate', { redraw });\n }\n /**\n * Set the colors for the legend item.\n *\n * @private\n * @function Highcharts.Legend#colorizeItem\n * @param {Highcharts.BubbleLegendItem|Highcharts.Point|Highcharts.Series} item\n * A Series or Point instance\n * @param {boolean} [visible=false]\n * Dimmed or colored\n *\n * @todo\n * Make events official: Fires the event `afterColorizeItem`.\n */\n colorizeItem(item, visible) {\n const { area, group, label, line, symbol } = item.legendItem || {};\n group?.[visible ? 'removeClass' : 'addClass']('highcharts-legend-item-hidden');\n if (!this.chart.styledMode) {\n const { itemHiddenStyle = {} } = this, hiddenColor = itemHiddenStyle.color, { fillColor, fillOpacity, lineColor, marker } = item.options, colorizeHidden = (attr) => {\n if (!visible) {\n if (attr.fill) {\n attr.fill = hiddenColor;\n }\n if (attr.stroke) {\n attr.stroke = hiddenColor;\n }\n }\n return attr;\n };\n label?.css(merge(visible ? this.itemStyle : itemHiddenStyle));\n line?.attr(colorizeHidden({ stroke: lineColor || item.color }));\n if (symbol) {\n // Apply marker options\n symbol.attr(colorizeHidden(marker && symbol.isMarker ? // #585\n item.pointAttribs() :\n { fill: item.color }));\n }\n area?.attr(colorizeHidden({\n fill: fillColor || item.color,\n 'fill-opacity': fillColor ? 1 : (fillOpacity ?? 0.75)\n }));\n }\n fireEvent(this, 'afterColorizeItem', { item, visible });\n }\n /**\n * @private\n * @function Highcharts.Legend#positionItems\n */\n positionItems() {\n // Now that the legend width and height are established, put the items\n // in the final position\n this.allItems.forEach(this.positionItem, this);\n if (!this.chart.isResizing) {\n this.positionCheckboxes();\n }\n }\n /**\n * Position the legend item.\n *\n * @private\n * @function Highcharts.Legend#positionItem\n * @param {Highcharts.BubbleLegendItem|Highcharts.Point|Highcharts.Series} item\n * The item to position\n */\n positionItem(item) {\n const legend = this, { group, x = 0, y = 0 } = item.legendItem || {}, options = legend.options, symbolPadding = options.symbolPadding, ltr = !options.rtl, checkbox = item.checkbox;\n if (group && group.element) {\n const attribs = {\n translateX: ltr ?\n x :\n legend.legendWidth - x - 2 * symbolPadding - 4,\n translateY: y\n };\n const complete = () => {\n fireEvent(this, 'afterPositionItem', { item });\n };\n group[defined(group.translateY) ? 'animate' : 'attr'](attribs, void 0, complete);\n }\n if (checkbox) {\n checkbox.x = x;\n checkbox.y = y;\n }\n }\n /**\n * Destroy a single legend item, used internally on removing series items.\n *\n * @private\n * @function Highcharts.Legend#destroyItem\n * @param {Highcharts.BubbleLegendItem|Highcharts.Point|Highcharts.Series} item\n * The item to remove\n */\n destroyItem(item) {\n const checkbox = item.checkbox, legendItem = item.legendItem || {};\n // destroy SVG elements\n for (const key of ['group', 'label', 'line', 'symbol']) {\n if (legendItem[key]) {\n legendItem[key] = legendItem[key].destroy();\n }\n }\n if (checkbox) {\n discardElement(checkbox);\n }\n item.legendItem = void 0;\n }\n /**\n * Destroy the legend. Used internally. To reflow objects, `chart.redraw`\n * must be called after destruction.\n *\n * @private\n * @function Highcharts.Legend#destroy\n */\n destroy() {\n const legend = this;\n // Destroy items\n for (const item of this.getAllItems()) {\n this.destroyItem(item);\n }\n // Destroy legend elements\n for (const key of [\n 'clipRect',\n 'up',\n 'down',\n 'pager',\n 'nav',\n 'box',\n 'title',\n 'group'\n ]) {\n if (legend[key]) {\n legend[key] = legend[key].destroy();\n }\n }\n this.display = null; // Reset in .render on update.\n }\n /**\n * Position the checkboxes after the width is determined.\n *\n * @private\n * @function Highcharts.Legend#positionCheckboxes\n */\n positionCheckboxes() {\n const alignAttr = this.group && this.group.alignAttr, clipHeight = this.clipHeight || this.legendHeight, titleHeight = this.titleHeight;\n let translateY;\n if (alignAttr) {\n translateY = alignAttr.translateY;\n this.allItems.forEach(function (item) {\n const checkbox = item.checkbox;\n let top;\n if (checkbox) {\n top = translateY + titleHeight + checkbox.y +\n (this.scrollOffset || 0) + 3;\n css(checkbox, {\n left: (alignAttr.translateX + item.checkboxOffset +\n checkbox.x - 20) + 'px',\n top: top + 'px',\n display: this.proximate || (top > translateY - 6 &&\n top < translateY + clipHeight - 6) ?\n '' :\n 'none'\n });\n }\n }, this);\n }\n }\n /**\n * Render the legend title on top of the legend.\n *\n * @private\n * @function Highcharts.Legend#renderTitle\n */\n renderTitle() {\n const options = this.options, padding = this.padding, titleOptions = options.title;\n let bBox, titleHeight = 0;\n if (titleOptions.text) {\n if (!this.title) {\n /**\n * SVG element of the legend title.\n *\n * @readonly\n * @name Highcharts.Legend#title\n * @type {Highcharts.SVGElement}\n */\n this.title = this.chart.renderer.label(titleOptions.text, padding - 3, padding - 4, void 0, void 0, void 0, options.useHTML, void 0, 'legend-title')\n .attr({ zIndex: 1 });\n if (!this.chart.styledMode) {\n this.title.css(titleOptions.style);\n }\n this.title.add(this.group);\n }\n // Set the max title width (#7253)\n if (!titleOptions.width) {\n this.title.css({\n width: this.maxLegendWidth + 'px'\n });\n }\n bBox = this.title.getBBox();\n titleHeight = bBox.height;\n this.offsetWidth = bBox.width; // #1717\n this.contentGroup.attr({ translateY: titleHeight });\n }\n this.titleHeight = titleHeight;\n }\n /**\n * Set the legend item text.\n *\n * @function Highcharts.Legend#setText\n * @param {Highcharts.Point|Highcharts.Series} item\n * The item for which to update the text in the legend.\n */\n setText(item) {\n const options = this.options;\n item.legendItem.label.attr({\n text: options.labelFormat ?\n format(options.labelFormat, item, this.chart) :\n options.labelFormatter.call(item)\n });\n }\n /**\n * Render a single specific legend item. Called internally from the `render`\n * function.\n *\n * @private\n * @function Highcharts.Legend#renderItem\n * @param {Highcharts.BubbleLegendItem|Highcharts.Point|Highcharts.Series} item\n * The item to render.\n */\n renderItem(item) {\n const legend = this, legendItem = item.legendItem = item.legendItem || {}, chart = legend.chart, renderer = chart.renderer, options = legend.options, horizontal = options.layout === 'horizontal', symbolWidth = legend.symbolWidth, symbolPadding = options.symbolPadding || 0, itemStyle = legend.itemStyle, itemHiddenStyle = legend.itemHiddenStyle, itemDistance = horizontal ? pick(options.itemDistance, 20) : 0, ltr = !options.rtl, isSeries = !item.series, series = !isSeries && item.series.drawLegendSymbol ?\n item.series :\n item, seriesOptions = series.options, showCheckbox = (!!legend.createCheckboxForItem &&\n seriesOptions &&\n seriesOptions.showCheckbox), useHTML = options.useHTML, itemClassName = item.options.className;\n let label = legendItem.label, \n // full width minus text width\n itemExtraWidth = symbolWidth + symbolPadding +\n itemDistance + (showCheckbox ? 20 : 0);\n if (!label) { // generate it once, later move it\n // Generate the group box, a group to hold the symbol and text. Text\n // is to be appended in Legend class.\n legendItem.group = renderer\n .g('legend-item')\n .addClass('highcharts-' + series.type + '-series ' +\n 'highcharts-color-' + item.colorIndex +\n (itemClassName ? ' ' + itemClassName : '') +\n (isSeries ?\n ' highcharts-series-' + item.index :\n ''))\n .attr({ zIndex: 1 })\n .add(legend.scrollGroup);\n // Generate the list item text and add it to the group\n legendItem.label = label = renderer.text('', ltr ?\n symbolWidth + symbolPadding :\n -symbolPadding, legend.baseline || 0, useHTML);\n if (!chart.styledMode) {\n // merge to prevent modifying original (#1021)\n label.css(merge(item.visible ?\n itemStyle :\n itemHiddenStyle));\n }\n label\n .attr({\n align: ltr ? 'left' : 'right',\n zIndex: 2\n })\n .add(legendItem.group);\n // Get the baseline for the first item - the font size is equal for\n // all\n if (!legend.baseline) {\n legend.fontMetrics = renderer.fontMetrics(label);\n legend.baseline =\n legend.fontMetrics.f + 3 + legend.itemMarginTop;\n label.attr('y', legend.baseline);\n legend.symbolHeight =\n pick(options.symbolHeight, legend.fontMetrics.f);\n if (options.squareSymbol) {\n legend.symbolWidth = pick(options.symbolWidth, Math.max(legend.symbolHeight, 16));\n itemExtraWidth = legend.symbolWidth + symbolPadding +\n itemDistance + (showCheckbox ? 20 : 0);\n if (ltr) {\n label.attr('x', legend.symbolWidth + symbolPadding);\n }\n }\n }\n // Draw the legend symbol inside the group box\n series.drawLegendSymbol(legend, item);\n if (legend.setItemEvents) {\n legend.setItemEvents(item, label, useHTML);\n }\n }\n // Add the HTML checkbox on top\n if (showCheckbox && !item.checkbox && legend.createCheckboxForItem) {\n legend.createCheckboxForItem(item);\n }\n // Colorize the items\n legend.colorizeItem(item, item.visible);\n // Take care of max width and text overflow (#6659)\n if (chart.styledMode || !itemStyle.width) {\n label.css({\n width: ((options.itemWidth ||\n legend.widthOption ||\n chart.spacingBox.width) - itemExtraWidth) + 'px'\n });\n }\n // Always update the text\n legend.setText(item);\n // calculate the positions for the next line\n const bBox = label.getBBox();\n const fontMetricsH = (legend.fontMetrics && legend.fontMetrics.h) || 0;\n item.itemWidth = item.checkboxOffset =\n options.itemWidth ||\n legendItem.labelWidth ||\n bBox.width + itemExtraWidth;\n legend.maxItemWidth = Math.max(legend.maxItemWidth, item.itemWidth);\n legend.totalItemWidth += item.itemWidth;\n legend.itemHeight = item.itemHeight = Math.round(legendItem.labelHeight ||\n // use bBox for multiline (#16398)\n (bBox.height > fontMetricsH * 1.5 ? bBox.height : fontMetricsH));\n }\n /**\n * Get the position of the item in the layout. We now know the\n * maxItemWidth from the previous loop.\n *\n * @private\n * @function Highcharts.Legend#layoutItem\n * @param {Highcharts.BubbleLegendItem|Highcharts.Point|Highcharts.Series} item\n */\n layoutItem(item) {\n const options = this.options, padding = this.padding, horizontal = options.layout === 'horizontal', itemHeight = item.itemHeight, itemMarginBottom = this.itemMarginBottom, itemMarginTop = this.itemMarginTop, itemDistance = horizontal ? pick(options.itemDistance, 20) : 0, maxLegendWidth = this.maxLegendWidth, itemWidth = (options.alignColumns &&\n this.totalItemWidth > maxLegendWidth) ?\n this.maxItemWidth :\n item.itemWidth, legendItem = item.legendItem || {};\n // If the item exceeds the width, start a new line\n if (horizontal &&\n this.itemX - padding + itemWidth > maxLegendWidth) {\n this.itemX = padding;\n if (this.lastLineHeight) { // Not for the first line (#10167)\n this.itemY += (itemMarginTop +\n this.lastLineHeight +\n itemMarginBottom);\n }\n this.lastLineHeight = 0; // reset for next line (#915, #3976)\n }\n // Set the edge positions\n this.lastItemY = itemMarginTop + this.itemY + itemMarginBottom;\n this.lastLineHeight = Math.max(// #915\n itemHeight, this.lastLineHeight);\n // cache the position of the newly generated or reordered items\n legendItem.x = this.itemX;\n legendItem.y = this.itemY;\n // advance\n if (horizontal) {\n this.itemX += itemWidth;\n }\n else {\n this.itemY +=\n itemMarginTop + itemHeight + itemMarginBottom;\n this.lastLineHeight = itemHeight;\n }\n // the width of the widest item\n this.offsetWidth = this.widthOption || Math.max((horizontal ? this.itemX - padding - (item.checkbox ?\n // decrease by itemDistance only when no checkbox #4853\n 0 :\n itemDistance) : itemWidth) + padding, this.offsetWidth);\n }\n /**\n * Get all items, which is one item per series for most series and one\n * item per point for pie series and its derivatives. Fires the event\n * `afterGetAllItems`.\n *\n * @private\n * @function Highcharts.Legend#getAllItems\n * @return {Array<(Highcharts.BubbleLegendItem|Highcharts.Point|Highcharts.Series)>}\n * The current items in the legend.\n * @emits Highcharts.Legend#event:afterGetAllItems\n */\n getAllItems() {\n let allItems = [];\n this.chart.series.forEach(function (series) {\n const seriesOptions = series && series.options;\n // Handle showInLegend. If the series is linked to another series,\n // defaults to false.\n if (series && pick(seriesOptions.showInLegend, !defined(seriesOptions.linkedTo) ? void 0 : false, true)) {\n // Use points or series for the legend item depending on\n // legendType\n allItems = allItems.concat((series.legendItem || {}).labels ||\n (seriesOptions.legendType === 'point' ?\n series.data :\n series));\n }\n });\n fireEvent(this, 'afterGetAllItems', { allItems });\n return allItems;\n }\n /**\n * Get a short, three letter string reflecting the alignment and layout.\n *\n * @private\n * @function Highcharts.Legend#getAlignment\n * @return {string}\n * The alignment, empty string if floating\n */\n getAlignment() {\n const options = this.options;\n // Use the first letter of each alignment option in order to detect\n // the side. (#4189 - use charAt(x) notation instead of [x] for IE7)\n if (this.proximate) {\n return options.align.charAt(0) + 'tv';\n }\n return options.floating ? '' : (options.align.charAt(0) +\n options.verticalAlign.charAt(0) +\n options.layout.charAt(0));\n }\n /**\n * Adjust the chart margins by reserving space for the legend on only one\n * side of the chart. If the position is set to a corner, top or bottom is\n * reserved for horizontal legends and left or right for vertical ones.\n *\n * @private\n * @function Highcharts.Legend#adjustMargins\n * @param {Array} margin\n * @param {Array} spacing\n */\n adjustMargins(margin, spacing) {\n const chart = this.chart, options = this.options, alignment = this.getAlignment();\n if (alignment) {\n ([\n /(lth|ct|rth)/,\n /(rtv|rm|rbv)/,\n /(rbh|cb|lbh)/,\n /(lbv|lm|ltv)/\n ]).forEach(function (alignments, side) {\n if (alignments.test(alignment) && !defined(margin[side])) {\n // Now we have detected on which side of the chart we should\n // reserve space for the legend\n chart[marginNames[side]] = Math.max(chart[marginNames[side]], (chart.legend[(side + 1) % 2 ? 'legendHeight' : 'legendWidth'] +\n [1, -1, -1, 1][side] * options[(side % 2) ? 'x' : 'y'] +\n pick(options.margin, 12) +\n spacing[side] +\n (chart.titleOffset[side] || 0)));\n }\n });\n }\n }\n /**\n * @private\n * @function Highcharts.Legend#proximatePositions\n */\n proximatePositions() {\n const chart = this.chart, boxes = [], alignLeft = this.options.align === 'left';\n this.allItems.forEach(function (item) {\n let lastPoint, height, useFirstPoint = alignLeft, target, top;\n if (item.yAxis) {\n if (item.xAxis.options.reversed) {\n useFirstPoint = !useFirstPoint;\n }\n if (item.points) {\n lastPoint = find(useFirstPoint ?\n item.points :\n item.points.slice(0).reverse(), function (item) {\n return isNumber(item.plotY);\n });\n }\n height = this.itemMarginTop +\n item.legendItem.label.getBBox().height +\n this.itemMarginBottom;\n top = item.yAxis.top - chart.plotTop;\n if (item.visible) {\n target = lastPoint ?\n lastPoint.plotY :\n item.yAxis.height;\n target += top - 0.3 * height;\n }\n else {\n target = top + item.yAxis.height;\n }\n boxes.push({\n target: target,\n size: height,\n item\n });\n }\n }, this);\n let legendItem;\n for (const box of distribute(boxes, chart.plotHeight)) {\n legendItem = box.item.legendItem || {};\n if (isNumber(box.pos)) {\n legendItem.y = chart.plotTop - chart.spacing[0] + box.pos;\n }\n }\n }\n /**\n * Render the legend. This method can be called both before and after\n * `chart.render`. If called after, it will only rearrange items instead\n * of creating new ones. Called internally on initial render and after\n * redraws.\n *\n * @private\n * @function Highcharts.Legend#render\n */\n render() {\n const legend = this, chart = legend.chart, renderer = chart.renderer, options = legend.options, padding = legend.padding, \n // add each series or point\n allItems = legend.getAllItems();\n let display, legendWidth, legendHeight, legendGroup = legend.group, allowedWidth, box = legend.box;\n legend.itemX = padding;\n legend.itemY = legend.initialItemY;\n legend.offsetWidth = 0;\n legend.lastItemY = 0;\n legend.widthOption = relativeLength(options.width, chart.spacingBox.width - padding);\n // Compute how wide the legend is allowed to be\n allowedWidth = chart.spacingBox.width - 2 * padding - options.x;\n if (['rm', 'lm'].indexOf(legend.getAlignment().substring(0, 2)) > -1) {\n allowedWidth /= 2;\n }\n legend.maxLegendWidth = legend.widthOption || allowedWidth;\n if (!legendGroup) {\n /**\n * SVG group of the legend.\n *\n * @readonly\n * @name Highcharts.Legend#group\n * @type {Highcharts.SVGElement}\n */\n legend.group = legendGroup = renderer\n .g('legend')\n .addClass(options.className || '')\n .attr({ zIndex: 7 })\n .add();\n legend.contentGroup = renderer\n .g()\n .attr({ zIndex: 1 }) // above background\n .add(legendGroup);\n legend.scrollGroup = renderer\n .g()\n .add(legend.contentGroup);\n }\n legend.renderTitle();\n // sort by legendIndex\n stableSort(allItems, (a, b) => ((a.options && a.options.legendIndex) || 0) -\n ((b.options && b.options.legendIndex) || 0));\n // reversed legend\n if (options.reversed) {\n allItems.reverse();\n }\n /**\n * All items for the legend, which is an array of series for most series\n * and an array of points for pie series and its derivatives.\n *\n * @readonly\n * @name Highcharts.Legend#allItems\n * @type {Array<(Highcharts.Point|Highcharts.Series)>}\n */\n legend.allItems = allItems;\n legend.display = display = !!allItems.length;\n // Render the items. First we run a loop to set the text and properties\n // and read all the bounding boxes. The next loop computes the item\n // positions based on the bounding boxes.\n legend.lastLineHeight = 0;\n legend.maxItemWidth = 0;\n legend.totalItemWidth = 0;\n legend.itemHeight = 0;\n allItems.forEach(legend.renderItem, legend);\n allItems.forEach(legend.layoutItem, legend);\n // Get the box\n legendWidth = (legend.widthOption || legend.offsetWidth) + padding;\n legendHeight = legend.lastItemY + legend.lastLineHeight +\n legend.titleHeight;\n legendHeight = legend.handleOverflow(legendHeight);\n legendHeight += padding;\n // Draw the border and/or background\n if (!box) {\n /**\n * SVG element of the legend box.\n *\n * @readonly\n * @name Highcharts.Legend#box\n * @type {Highcharts.SVGElement}\n */\n legend.box = box = renderer.rect()\n .addClass('highcharts-legend-box')\n .attr({\n r: options.borderRadius\n })\n .add(legendGroup);\n }\n // Presentational\n if (!chart.styledMode) {\n box\n .attr({\n stroke: options.borderColor,\n 'stroke-width': options.borderWidth || 0,\n fill: options.backgroundColor || 'none'\n })\n .shadow(options.shadow);\n }\n if (legendWidth > 0 && legendHeight > 0) {\n box[box.placed ? 'animate' : 'attr'](box.crisp.call({}, {\n x: 0,\n y: 0,\n width: legendWidth,\n height: legendHeight\n }, box.strokeWidth()));\n }\n // hide the border if no items\n legendGroup[display ? 'show' : 'hide']();\n // Open for responsiveness\n if (chart.styledMode && legendGroup.getStyle('display') === 'none') {\n legendWidth = legendHeight = 0;\n }\n legend.legendWidth = legendWidth;\n legend.legendHeight = legendHeight;\n if (display) {\n legend.align();\n }\n if (!this.proximate) {\n this.positionItems();\n }\n fireEvent(this, 'afterRender');\n }\n /**\n * Align the legend to chart's box.\n *\n * @private\n * @function Highcharts.align\n * @param {Highcharts.BBoxObject} alignTo\n */\n align(alignTo = this.chart.spacingBox) {\n const chart = this.chart, options = this.options;\n // If aligning to the top and the layout is horizontal, adjust for\n // the title (#7428)\n let y = alignTo.y;\n if (/(lth|ct|rth)/.test(this.getAlignment()) &&\n chart.titleOffset[0] > 0) {\n y += chart.titleOffset[0];\n }\n else if (/(lbh|cb|rbh)/.test(this.getAlignment()) &&\n chart.titleOffset[2] > 0) {\n y -= chart.titleOffset[2];\n }\n if (y !== alignTo.y) {\n alignTo = merge(alignTo, { y });\n }\n if (!chart.hasRendered) {\n // Avoid animation when adjusting alignment for responsiveness and\n // colorAxis label layout\n this.group.placed = false;\n }\n this.group.align(merge(options, {\n width: this.legendWidth,\n height: this.legendHeight,\n verticalAlign: this.proximate ? 'top' : options.verticalAlign\n }), true, alignTo);\n }\n /**\n * Set up the overflow handling by adding navigation with up and down arrows\n * below the legend.\n *\n * @private\n * @function Highcharts.Legend#handleOverflow\n */\n handleOverflow(legendHeight) {\n const legend = this, chart = this.chart, renderer = chart.renderer, options = this.options, optionsY = options.y, alignTop = options.verticalAlign === 'top', padding = this.padding, maxHeight = options.maxHeight, navOptions = options.navigation, animation = pick(navOptions.animation, true), arrowSize = navOptions.arrowSize || 12, pages = this.pages, allItems = this.allItems, clipToHeight = function (height) {\n if (typeof height === 'number') {\n clipRect.attr({\n height: height\n });\n }\n else if (clipRect) { // Reset (#5912)\n legend.clipRect = clipRect.destroy();\n legend.contentGroup.clip();\n }\n // useHTML\n if (legend.contentGroup.div) {\n legend.contentGroup.div.style.clip = height ?\n 'rect(' + padding + 'px,9999px,' +\n (padding + height) + 'px,0)' :\n 'auto';\n }\n }, addTracker = function (key) {\n legend[key] = renderer\n .circle(0, 0, arrowSize * 1.3)\n .translate(arrowSize / 2, arrowSize / 2)\n .add(nav);\n if (!chart.styledMode) {\n legend[key].attr('fill', 'rgba(0,0,0,0.0001)');\n }\n return legend[key];\n };\n let clipHeight, lastY, legendItem, spaceHeight = (chart.spacingBox.height +\n (alignTop ? -optionsY : optionsY) - padding), nav = this.nav, clipRect = this.clipRect;\n // Adjust the height\n if (options.layout === 'horizontal' &&\n options.verticalAlign !== 'middle' &&\n !options.floating) {\n spaceHeight /= 2;\n }\n if (maxHeight) {\n spaceHeight = Math.min(spaceHeight, maxHeight);\n }\n // Reset the legend height and adjust the clipping rectangle\n pages.length = 0;\n if (legendHeight &&\n spaceHeight > 0 &&\n legendHeight > spaceHeight &&\n navOptions.enabled !== false) {\n this.clipHeight = clipHeight =\n Math.max(spaceHeight - 20 - this.titleHeight - padding, 0);\n this.currentPage = pick(this.currentPage, 1);\n this.fullHeight = legendHeight;\n // Fill pages with Y positions so that the top of each a legend item\n // defines the scroll top for each page (#2098)\n allItems.forEach((item, i) => {\n legendItem = item.legendItem || {};\n const y = legendItem.y || 0, h = Math.round(legendItem.label.getBBox().height);\n let len = pages.length;\n if (!len || (y - pages[len - 1] > clipHeight &&\n (lastY || y) !== pages[len - 1])) {\n pages.push(lastY || y);\n len++;\n }\n // Keep track of which page each item is on\n legendItem.pageIx = len - 1;\n if (lastY) {\n (allItems[i - 1].legendItem || {}).pageIx = len - 1;\n }\n // add the last page if needed (#2617, #13683)\n if (\n // check the last item\n i === allItems.length - 1 &&\n // if adding next page is needed (#18768)\n y + h - pages[len - 1] > clipHeight &&\n y > pages[len - 1]) {\n pages.push(y);\n legendItem.pageIx = len;\n }\n if (y !== lastY) {\n lastY = y;\n }\n });\n // Only apply clipping if needed. Clipping causes blurred legend in\n // PDF export (#1787)\n if (!clipRect) {\n clipRect = legend.clipRect =\n renderer.clipRect(0, padding - 2, 9999, 0);\n legend.contentGroup.clip(clipRect);\n }\n clipToHeight(clipHeight);\n // Add navigation elements\n if (!nav) {\n this.nav = nav = renderer.g()\n .attr({ zIndex: 1 })\n .add(this.group);\n this.up = renderer\n .symbol('triangle', 0, 0, arrowSize, arrowSize)\n .add(nav);\n addTracker('upTracker')\n .on('click', function () {\n legend.scroll(-1, animation);\n });\n this.pager = renderer.text('', 15, 10)\n .addClass('highcharts-legend-navigation');\n if (!chart.styledMode && navOptions.style) {\n this.pager.css(navOptions.style);\n }\n this.pager.add(nav);\n this.down = renderer\n .symbol('triangle-down', 0, 0, arrowSize, arrowSize)\n .add(nav);\n addTracker('downTracker')\n .on('click', function () {\n legend.scroll(1, animation);\n });\n }\n // Set initial position\n legend.scroll(0);\n legendHeight = spaceHeight;\n // Reset\n }\n else if (nav) {\n clipToHeight();\n this.nav = nav.destroy(); // #6322\n this.scrollGroup.attr({\n translateY: 1\n });\n this.clipHeight = 0; // #1379\n }\n return legendHeight;\n }\n /**\n * Scroll the legend by a number of pages.\n *\n * @private\n * @function Highcharts.Legend#scroll\n *\n * @param {number} scrollBy\n * The number of pages to scroll.\n *\n * @param {boolean|Partial} [animation]\n * Whether and how to apply animation.\n *\n */\n scroll(scrollBy, animation) {\n const chart = this.chart, pages = this.pages, pageCount = pages.length, clipHeight = this.clipHeight, navOptions = this.options.navigation, pager = this.pager, padding = this.padding;\n let currentPage = this.currentPage + scrollBy;\n // When resizing while looking at the last page\n if (currentPage > pageCount) {\n currentPage = pageCount;\n }\n if (currentPage > 0) {\n if (typeof animation !== 'undefined') {\n setAnimation(animation, chart);\n }\n this.nav.attr({\n translateX: padding,\n translateY: clipHeight + this.padding + 7 + this.titleHeight,\n visibility: 'inherit'\n });\n [this.up, this.upTracker].forEach(function (elem) {\n elem.attr({\n 'class': currentPage === 1 ?\n 'highcharts-legend-nav-inactive' :\n 'highcharts-legend-nav-active'\n });\n });\n pager.attr({\n text: currentPage + '/' + pageCount\n });\n [this.down, this.downTracker].forEach(function (elem) {\n elem.attr({\n // adjust to text width\n x: 18 + this.pager.getBBox().width,\n 'class': currentPage === pageCount ?\n 'highcharts-legend-nav-inactive' :\n 'highcharts-legend-nav-active'\n });\n }, this);\n if (!chart.styledMode) {\n this.up\n .attr({\n fill: currentPage === 1 ?\n navOptions.inactiveColor :\n navOptions.activeColor\n });\n this.upTracker\n .css({\n cursor: currentPage === 1 ? 'default' : 'pointer'\n });\n this.down\n .attr({\n fill: currentPage === pageCount ?\n navOptions.inactiveColor :\n navOptions.activeColor\n });\n this.downTracker\n .css({\n cursor: currentPage === pageCount ?\n 'default' :\n 'pointer'\n });\n }\n this.scrollOffset = -pages[currentPage - 1] + this.initialItemY;\n this.scrollGroup.animate({\n translateY: this.scrollOffset\n });\n this.currentPage = currentPage;\n this.positionCheckboxes();\n // Fire event after scroll animation is complete\n const animOptions = animObject(pick(animation, chart.renderer.globalAnimation, true));\n syncTimeout(() => {\n fireEvent(this, 'afterScroll', { currentPage });\n }, animOptions.duration);\n }\n }\n /**\n * @private\n * @function Highcharts.Legend#setItemEvents\n * @param {Highcharts.BubbleLegendItem|Point|Highcharts.Series} item\n * @param {Highcharts.SVGElement} legendLabel\n * @param {boolean} [useHTML=false]\n * @emits Highcharts.Point#event:legendItemClick\n * @emits Highcharts.Series#event:legendItemClick\n */\n setItemEvents(item, legendLabel, useHTML) {\n const legend = this, legendItem = item.legendItem || {}, boxWrapper = legend.chart.renderer.boxWrapper, isPoint = item instanceof Point, activeClass = 'highcharts-legend-' +\n (isPoint ? 'point' : 'series') + '-active', styledMode = legend.chart.styledMode, \n // When `useHTML`, the symbol is rendered in other group, so\n // we need to apply events listeners to both places\n legendElements = useHTML ?\n [legendLabel, legendItem.symbol] :\n [legendItem.group];\n const setOtherItemsState = (state) => {\n legend.allItems.forEach((otherItem) => {\n if (item !== otherItem) {\n [otherItem]\n .concat(otherItem.linkedSeries || [])\n .forEach((otherItem) => {\n otherItem.setState(state, !isPoint);\n });\n }\n });\n };\n // Set the events on the item group, or in case of useHTML, the item\n // itself (#1249)\n for (const element of legendElements) {\n if (element) {\n element\n .on('mouseover', function () {\n if (item.visible) {\n setOtherItemsState('inactive');\n }\n item.setState('hover');\n // A CSS class to dim or hide other than the hovered\n // series.\n // Works only if hovered series is visible (#10071).\n if (item.visible) {\n boxWrapper.addClass(activeClass);\n }\n if (!styledMode) {\n legendLabel.css(legend.options.itemHoverStyle);\n }\n })\n .on('mouseout', function () {\n if (!legend.chart.styledMode) {\n legendLabel.css(merge(item.visible ?\n legend.itemStyle :\n legend.itemHiddenStyle));\n }\n setOtherItemsState('');\n // A CSS class to dim or hide other than the hovered\n // series.\n boxWrapper.removeClass(activeClass);\n item.setState();\n })\n .on('click', function (event) {\n const strLegendItemClick = 'legendItemClick', fnLegendItemClick = function () {\n if (item.setVisible) {\n item.setVisible();\n }\n // Reset inactive state\n setOtherItemsState(item.visible ? 'inactive' : '');\n };\n // A CSS class to dim or hide other than the hovered\n // series. Event handling in iOS causes the activeClass\n // to be added prior to click in some cases (#7418).\n boxWrapper.removeClass(activeClass);\n // Pass over the click/touch event. #4.\n event = {\n browserEvent: event\n };\n // click the name or symbol\n if (item.firePointEvent) { // point\n item.firePointEvent(strLegendItemClick, event, fnLegendItemClick);\n }\n else {\n fireEvent(item, strLegendItemClick, event, fnLegendItemClick);\n }\n });\n }\n }\n }\n /**\n * @private\n * @function Highcharts.Legend#createCheckboxForItem\n * @param {Highcharts.BubbleLegendItem|Point|Highcharts.Series} item\n * @emits Highcharts.Series#event:checkboxClick\n */\n createCheckboxForItem(item) {\n const legend = this;\n item.checkbox = createElement('input', {\n type: 'checkbox',\n className: 'highcharts-legend-checkbox',\n checked: item.selected,\n defaultChecked: item.selected // required by IE7\n }, legend.options.itemCheckboxStyle, legend.chart.container);\n addEvent(item.checkbox, 'click', function (event) {\n const target = event.target;\n fireEvent(item.series || item, 'checkboxClick', {\n checked: target.checked,\n item: item\n }, function () {\n item.select();\n });\n });\n }\n}\n/* *\n *\n * Class Namespace\n *\n * */\n(function (Legend) {\n /* *\n *\n * Declarations\n *\n * */\n /* *\n *\n * Functions\n *\n * */\n /**\n * @private\n */\n function compose(ChartClass) {\n if (pushUnique(composed, 'Core.Legend')) {\n addEvent(ChartClass, 'beforeMargins', function () {\n /**\n * The legend contains an interactive overview over chart items,\n * usually individual series or points depending on the series\n * type. The color axis and bubble legend are also rendered in\n * the chart legend.\n *\n * @name Highcharts.Chart#legend\n * @type {Highcharts.Legend}\n */\n this.legend = new Legend(this, this.options.legend);\n });\n }\n }\n Legend.compose = compose;\n})(Legend || (Legend = {}));\n/* *\n *\n * Default Export\n *\n * */\nexport default Legend;\n/* *\n *\n * API Declarations\n *\n * */\n/**\n * @interface Highcharts.LegendItemObject\n */ /**\n* @name Highcharts.LegendItemObject#item\n* @type {Highcharts.SVGElement|undefined}\n*/ /**\n* @name Highcharts.LegendItemObject#line\n* @type {Highcharts.SVGElement|undefined}\n*/ /**\n* @name Highcharts.LegendItemObject#symbol\n* @type {Highcharts.SVGElement|undefined}\n*/\n/**\n * Gets fired when the legend item belonging to a point is clicked. The default\n * action is to toggle the visibility of the point. This can be prevented by\n * returning `false` or calling `event.preventDefault()`.\n *\n * @callback Highcharts.PointLegendItemClickCallbackFunction\n *\n * @param {Highcharts.Point} this\n * The point on which the event occurred.\n *\n * @param {Highcharts.PointLegendItemClickEventObject} event\n * The event that occurred.\n */\n/**\n * Information about the legend click event.\n *\n * @interface Highcharts.PointLegendItemClickEventObject\n */ /**\n* Related browser event.\n* @name Highcharts.PointLegendItemClickEventObject#browserEvent\n* @type {Highcharts.PointerEvent}\n*/ /**\n* Prevent the default action of toggle the visibility of the point.\n* @name Highcharts.PointLegendItemClickEventObject#preventDefault\n* @type {Function}\n*/ /**\n* Related point.\n* @name Highcharts.PointLegendItemClickEventObject#target\n* @type {Highcharts.Point}\n*/ /**\n* Event type.\n* @name Highcharts.PointLegendItemClickEventObject#type\n* @type {\"legendItemClick\"}\n*/\n/**\n * Series color as used by the legend and some series types.\n * @name Highcharts.Series#color\n * @type {Highcharts.ColorType|undefined}\n */ /**\n* Legend data for the series.\n* @name Highcharts.Series#legendItem\n* @type {Highcharts.LegendItemObject|undefined}\n* @since 10.3.0\n*/\n/**\n * Gets fired when the legend item belonging to a series is clicked. The default\n * action is to toggle the visibility of the series. This can be prevented by\n * returning `false` or calling `event.preventDefault()`.\n *\n * @callback Highcharts.SeriesLegendItemClickCallbackFunction\n *\n * @param {Highcharts.Series} this\n * The series where the event occurred.\n *\n * @param {Highcharts.SeriesLegendItemClickEventObject} event\n * The event that occurred.\n */\n/**\n * Information about the legend click event.\n *\n * @interface Highcharts.SeriesLegendItemClickEventObject\n */ /**\n* Related browser event.\n* @name Highcharts.SeriesLegendItemClickEventObject#browserEvent\n* @type {Highcharts.PointerEvent}\n*/ /**\n* Prevent the default action of toggle the visibility of the series.\n* @name Highcharts.SeriesLegendItemClickEventObject#preventDefault\n* @type {Function}\n*/ /**\n* Related series.\n* @name Highcharts.SeriesLegendItemClickEventObject#target\n* @type {Highcharts.Series}\n*/ /**\n* Event type.\n* @name Highcharts.SeriesLegendItemClickEventObject#type\n* @type {\"legendItemClick\"}\n*/\n(''); // keeps doclets above in JS file\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport U from '../Utilities.js';\nconst { extend, merge, pick } = U;\n/* *\n *\n * Namespace\n *\n * */\nvar LegendSymbol;\n(function (LegendSymbol) {\n /* *\n *\n * Functions\n *\n * */\n /**\n * Draw a line, a point marker and an area in the legend.\n *\n * @private\n * @function Highcharts.LegendSymbolMixin.areaMarker\n *\n * @param {Highcharts.Legend} legend\n * The legend object.\n */\n function areaMarker(legend, item) {\n lineMarker.call(this, legend, item, true);\n }\n LegendSymbol.areaMarker = areaMarker;\n /**\n * Draw a line and a point marker in the legend.\n *\n * @private\n * @function Highcharts.LegendSymbolMixin.lineMarker\n *\n * @param {Highcharts.Legend} legend\n * The legend object.\n */\n function lineMarker(legend, item, hasArea) {\n const legendItem = this.legendItem = this.legendItem || {}, { chart, options } = this, { baseline = 0, symbolWidth, symbolHeight } = legend, symbol = this.symbol || 'circle', generalRadius = symbolHeight / 2, renderer = chart.renderer, legendItemGroup = legendItem.group, verticalCenter = baseline - Math.round(symbolHeight *\n // Render line and marker slightly higher to make room for the\n // area\n (hasArea ? 0.4 : 0.3)), attr = {};\n let legendSymbol, markerOptions = options.marker, lineSizer = 0;\n // Draw the line\n if (!chart.styledMode) {\n attr['stroke-width'] = Math.min(options.lineWidth || 0, 24);\n if (options.dashStyle) {\n attr.dashstyle = options.dashStyle;\n }\n else if (options.linecap !== 'square') {\n attr['stroke-linecap'] = 'round';\n }\n }\n legendItem.line = renderer\n .path()\n .addClass('highcharts-graph')\n .attr(attr)\n .add(legendItemGroup);\n if (hasArea) {\n legendItem.area = renderer\n .path()\n .addClass('highcharts-area')\n .add(legendItemGroup);\n }\n if (attr['stroke-linecap']) {\n lineSizer = Math.min(legendItem.line.strokeWidth(), symbolWidth) / 2;\n }\n if (symbolWidth) {\n const d = [\n ['M', lineSizer, verticalCenter],\n ['L', symbolWidth - lineSizer, verticalCenter]\n ];\n legendItem.line.attr({ d });\n legendItem.area?.attr({\n d: [\n ...d,\n ['L', symbolWidth - lineSizer, baseline],\n ['L', lineSizer, baseline]\n ]\n });\n }\n // Draw the marker\n if (markerOptions && markerOptions.enabled !== false && symbolWidth) {\n // Do not allow the marker to be larger than the symbolHeight\n let radius = Math.min(pick(markerOptions.radius, generalRadius), generalRadius);\n // Restrict symbol markers size\n if (symbol.indexOf('url') === 0) {\n markerOptions = merge(markerOptions, {\n width: symbolHeight,\n height: symbolHeight\n });\n radius = 0;\n }\n legendItem.symbol = legendSymbol = renderer\n .symbol(symbol, (symbolWidth / 2) - radius, verticalCenter - radius, 2 * radius, 2 * radius, extend({ context: 'legend' }, markerOptions))\n .addClass('highcharts-point')\n .add(legendItemGroup);\n legendSymbol.isMarker = true;\n }\n }\n LegendSymbol.lineMarker = lineMarker;\n /**\n * Get the series' symbol in the legend.\n *\n * This method should be overridable to create custom symbols through\n * Highcharts.seriesTypes[type].prototype.drawLegendSymbol.\n *\n * @private\n * @function Highcharts.LegendSymbolMixin.rectangle\n *\n * @param {Highcharts.Legend} legend\n * The legend object\n *\n * @param {Highcharts.Point|Highcharts.Series} item\n * The series (this) or point\n */\n function rectangle(legend, item) {\n const legendItem = item.legendItem || {}, options = legend.options, symbolHeight = legend.symbolHeight, square = options.squareSymbol, symbolWidth = square ? symbolHeight : legend.symbolWidth;\n legendItem.symbol = this.chart.renderer\n .rect(square ? (legend.symbolWidth - symbolHeight) / 2 : 0, legend.baseline - symbolHeight + 1, // #3988\n symbolWidth, symbolHeight, pick(legend.options.symbolRadius, symbolHeight / 2))\n .addClass('highcharts-point')\n .attr({\n zIndex: 3\n })\n .add(legendItem.group);\n }\n LegendSymbol.rectangle = rectangle;\n})(LegendSymbol || (LegendSymbol = {}));\n/* *\n *\n * Default Export\n *\n * */\nexport default LegendSymbol;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\n/* *\n *\n * API Options\n *\n * */\n/**\n * General options for all series types.\n *\n * @optionparent plotOptions.series\n */\nconst seriesDefaults = {\n // base series options\n /**\n * The SVG value used for the `stroke-linecap` and `stroke-linejoin`\n * of a line graph. Round means that lines are rounded in the ends and\n * bends.\n *\n * @type {Highcharts.SeriesLinecapValue}\n * @default round\n * @since 3.0.7\n * @apioption plotOptions.line.linecap\n */\n /**\n * Pixel width of the graph line.\n *\n * @see In styled mode, the line stroke-width can be set with the\n * `.highcharts-graph` class name.\n *\n * @sample {highcharts} highcharts/plotoptions/series-linewidth-general/\n * On all series\n * @sample {highcharts} highcharts/plotoptions/series-linewidth-specific/\n * On one single series\n *\n * @product highcharts highstock\n */\n lineWidth: 2,\n /**\n * For some series, there is a limit that shuts down animation\n * by default when the total number of points in the chart is too high.\n * For example, for a column chart and its derivatives, animation does\n * not run if there is more than 250 points totally. To disable this\n * cap, set `animationLimit` to `Infinity`. This option works if animation\n * is fired on individual points, not on a group of points like e.g. during\n * the initial animation.\n *\n * @sample {highcharts} highcharts/plotoptions/series-animationlimit/\n * Animation limit on updating individual points\n *\n * @type {number}\n * @apioption plotOptions.series.animationLimit\n */\n /**\n * Allow this series' points to be selected by clicking on the graphic\n * (columns, point markers, pie slices, map areas etc).\n *\n * The selected points can be handled by point select and unselect\n * events, or collectively by the [getSelectedPoints\n * ](/class-reference/Highcharts.Chart#getSelectedPoints) function.\n *\n * And alternative way of selecting points is through dragging.\n *\n * @sample {highcharts} highcharts/plotoptions/series-allowpointselect-line/\n * Line\n * @sample {highcharts} highcharts/plotoptions/series-allowpointselect-column/\n * Column\n * @sample {highcharts} highcharts/plotoptions/series-allowpointselect-pie/\n * Pie\n * @sample {highcharts} highcharts/chart/events-selection-points/\n * Select a range of points through a drag selection\n * @sample {highmaps} maps/plotoptions/series-allowpointselect/\n * Map area\n * @sample {highmaps} maps/plotoptions/mapbubble-allowpointselect/\n * Map bubble\n *\n * @since 1.2.0\n *\n * @private\n */\n allowPointSelect: false,\n /**\n * When true, each point or column edge is rounded to its nearest pixel\n * in order to render sharp on screen. In some cases, when there are a\n * lot of densely packed columns, this leads to visible difference\n * in column widths or distance between columns. In these cases,\n * setting `crisp` to `false` may look better, even though each column\n * is rendered blurry.\n *\n * @sample {highcharts} highcharts/plotoptions/column-crisp-false/\n * Crisp is false\n *\n * @since 5.0.10\n * @product highcharts highstock gantt\n *\n * @private\n */\n crisp: true,\n /**\n * If true, a checkbox is displayed next to the legend item to allow\n * selecting the series. The state of the checkbox is determined by\n * the `selected` option.\n *\n * @productdesc {highmaps}\n * Note that if a `colorAxis` is defined, the color axis is represented\n * in the legend, not the series.\n *\n * @sample {highcharts} highcharts/plotoptions/series-showcheckbox-true/\n * Show select box\n *\n * @since 1.2.0\n *\n * @private\n */\n showCheckbox: false,\n /**\n * Enable or disable the initial animation when a series is displayed.\n * The animation can also be set as a configuration object. Please\n * note that this option only applies to the initial animation of the\n * series itself. For other animations, see [chart.animation](\n * #chart.animation) and the animation parameter under the API methods.\n * The following properties are supported:\n *\n * - `defer`: The animation delay time in milliseconds.\n *\n * - `duration`: The duration of the animation in milliseconds. (Defaults to\n * `1000`)\n *\n * - `easing`: Can be a string reference to an easing function set on\n * the `Math` object or a function. See the _Custom easing function_\n * demo below. (Defaults to `easeInOutSine`)\n *\n * Due to poor performance, animation is disabled in old IE browsers\n * for several chart types.\n *\n * @sample {highcharts} highcharts/plotoptions/series-animation-disabled/\n * Animation disabled\n * @sample {highcharts} highcharts/plotoptions/series-animation-slower/\n * Slower animation\n * @sample {highcharts} highcharts/plotoptions/series-animation-easing/\n * Custom easing function\n * @sample {highstock} stock/plotoptions/animation-slower/\n * Slower animation\n * @sample {highstock} stock/plotoptions/animation-easing/\n * Custom easing function\n * @sample {highmaps} maps/plotoptions/series-animation-true/\n * Animation enabled on map series\n * @sample {highmaps} maps/plotoptions/mapbubble-animation-false/\n * Disabled on mapbubble series\n *\n * @type {boolean|Highcharts.AnimationOptionsObject}\n * @default {highcharts} true\n * @default {highstock} true\n * @default {highmaps} false\n *\n * @private\n */\n animation: {\n /** @ignore-option */\n duration: 1000\n },\n /**\n * An additional class name to apply to the series' graphical elements.\n * This option does not replace default class names of the graphical\n * element. Changes to the series' color will also be reflected in a\n * chart's legend and tooltip.\n *\n * @sample {highcharts} highcharts/css/point-series-classname\n * Series and point class name\n *\n * @type {string}\n * @since 5.0.0\n * @apioption plotOptions.series.className\n */\n /**\n * Disable this option to allow series rendering in the whole plotting\n * area.\n *\n * **Note:** Clipping should be always enabled when\n * [chart.zoomType](#chart.zoomType) is set\n *\n * @sample {highcharts} highcharts/plotoptions/series-clip/\n * Disabled clipping\n *\n * @default true\n * @type {boolean}\n * @since 3.0.0\n * @apioption plotOptions.series.clip\n */\n /**\n * The main color of the series. In line type series it applies to the\n * line and the point markers unless otherwise specified. In bar type\n * series it applies to the bars unless a color is specified per point.\n * The default value is pulled from the `options.colors` array.\n *\n * In styled mode, the color can be defined by the\n * [colorIndex](#plotOptions.series.colorIndex) option. Also, the series\n * color can be set with the `.highcharts-series`,\n * `.highcharts-color-{n}`, `.highcharts-{type}-series` or\n * `.highcharts-series-{n}` class, or individual classes given by the\n * `className` option.\n *\n * @productdesc {highmaps}\n * In maps, the series color is rarely used, as most choropleth maps use\n * the color to denote the value of each point. The series color can\n * however be used in a map with multiple series holding categorized\n * data.\n *\n * @sample {highcharts} highcharts/plotoptions/series-color-general/\n * General plot option\n * @sample {highcharts} highcharts/plotoptions/series-color-specific/\n * One specific series\n * @sample {highcharts} highcharts/plotoptions/series-color-area/\n * Area color\n * @sample {highcharts} highcharts/series/infographic/\n * Pattern fill\n * @sample {highmaps} maps/demo/category-map/\n * Category map by multiple series\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @apioption plotOptions.series.color\n */\n /**\n * Styled mode only. A specific color index to use for the series, so its\n * graphic representations are given the class name `highcharts-color-{n}`.\n *\n * Since v11, CSS variables on the form `--highcharts-color-{n}` make\n * changing the color scheme very convenient.\n *\n * @sample {highcharts} highcharts/css/colorindex/ Series and point color\n * index\n *\n * @type {number}\n * @since 5.0.0\n * @apioption plotOptions.series.colorIndex\n */\n /**\n * Whether to connect a graph line across null points, or render a gap\n * between the two points on either side of the null.\n *\n * In stacked area chart, if `connectNulls` is set to true,\n * null points are interpreted as 0.\n *\n * @sample {highcharts} highcharts/plotoptions/series-connectnulls-false/\n * False by default\n * @sample {highcharts} highcharts/plotoptions/series-connectnulls-true/\n * True\n *\n * @type {boolean}\n * @default false\n * @product highcharts highstock\n * @apioption plotOptions.series.connectNulls\n */\n /**\n * You can set the cursor to \"pointer\" if you have click events attached\n * to the series, to signal to the user that the points and lines can\n * be clicked.\n *\n * In styled mode, the series cursor can be set with the same classes\n * as listed under [series.color](#plotOptions.series.color).\n *\n * @sample {highcharts} highcharts/plotoptions/series-cursor-line/\n * On line graph\n * @sample {highcharts} highcharts/plotoptions/series-cursor-column/\n * On columns\n * @sample {highcharts} highcharts/plotoptions/series-cursor-scatter/\n * On scatter markers\n * @sample {highstock} stock/plotoptions/cursor/\n * Pointer on a line graph\n * @sample {highmaps} maps/plotoptions/series-allowpointselect/\n * Map area\n * @sample {highmaps} maps/plotoptions/mapbubble-allowpointselect/\n * Map bubble\n *\n * @type {string|Highcharts.CursorValue}\n * @apioption plotOptions.series.cursor\n */\n /**\n * A reserved subspace to store options and values for customized\n * functionality. Here you can add additional data for your own event\n * callbacks and formatter callbacks.\n *\n * @sample {highcharts} highcharts/point/custom/\n * Point and series with custom data\n *\n * @type {Highcharts.Dictionary<*>}\n * @apioption plotOptions.series.custom\n */\n /**\n * Name of the dash style to use for the graph, or for some series types\n * the outline of each shape.\n *\n * In styled mode, the\n * [stroke dash-array](https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/css/series-dashstyle/)\n * can be set with the same classes as listed under\n * [series.color](#plotOptions.series.color).\n *\n * @sample {highcharts} highcharts/plotoptions/series-dashstyle-all/\n * Possible values demonstrated\n * @sample {highcharts} highcharts/plotoptions/series-dashstyle/\n * Chart suitable for printing in black and white\n * @sample {highstock} highcharts/plotoptions/series-dashstyle-all/\n * Possible values demonstrated\n * @sample {highmaps} highcharts/plotoptions/series-dashstyle-all/\n * Possible values demonstrated\n * @sample {highmaps} maps/plotoptions/series-dashstyle/\n * Dotted borders on a map\n *\n * @type {Highcharts.DashStyleValue}\n * @default Solid\n * @since 2.1\n * @apioption plotOptions.series.dashStyle\n */\n /**\n * A description of the series to add to the screen reader information\n * about the series.\n *\n * @type {string}\n * @since 5.0.0\n * @requires modules/accessibility\n * @apioption plotOptions.series.description\n */\n /**\n * Options for the series data sorting.\n *\n * @type {Highcharts.DataSortingOptionsObject}\n * @since 8.0.0\n * @product highcharts highstock\n * @apioption plotOptions.series.dataSorting\n */\n /**\n * Enable or disable data sorting for the series. Use [xAxis.reversed](\n * #xAxis.reversed) to change the sorting order.\n *\n * @sample {highcharts} highcharts/datasorting/animation/\n * Data sorting in scatter-3d\n * @sample {highcharts} highcharts/datasorting/labels-animation/\n * Axis labels animation\n * @sample {highcharts} highcharts/datasorting/dependent-sorting/\n * Dependent series sorting\n * @sample {highcharts} highcharts/datasorting/independent-sorting/\n * Independent series sorting\n *\n * @type {boolean}\n * @since 8.0.0\n * @apioption plotOptions.series.dataSorting.enabled\n */\n /**\n * Whether to allow matching points by name in an update. If this option\n * is disabled, points will be matched by order.\n *\n * @sample {highcharts} highcharts/datasorting/match-by-name/\n * Enabled match by name\n *\n * @type {boolean}\n * @since 8.0.0\n * @apioption plotOptions.series.dataSorting.matchByName\n */\n /**\n * Determines what data value should be used to sort by.\n *\n * @sample {highcharts} highcharts/datasorting/sort-key/\n * Sort key as `z` value\n *\n * @type {string}\n * @since 8.0.0\n * @default y\n * @apioption plotOptions.series.dataSorting.sortKey\n */\n /**\n * Enable or disable the mouse tracking for a specific series. This\n * includes point tooltips and click events on graphs and points. For\n * large datasets it improves performance.\n *\n * @sample {highcharts} highcharts/plotoptions/series-enablemousetracking-false/\n * No mouse tracking\n * @sample {highmaps} maps/plotoptions/series-enablemousetracking-false/\n * No mouse tracking\n *\n * @type {boolean}\n * @default true\n * @apioption plotOptions.series.enableMouseTracking\n */\n enableMouseTracking: true,\n /**\n * Whether to use the Y extremes of the total chart width or only the\n * zoomed area when zooming in on parts of the X axis. By default, the\n * Y axis adjusts to the min and max of the visible data. Cartesian\n * series only.\n *\n * @type {boolean}\n * @default false\n * @since 4.1.6\n * @product highcharts highstock gantt\n * @apioption plotOptions.series.getExtremesFromAll\n */\n /**\n * Highlight only the hovered point and fade the remaining points.\n *\n * Scatter-type series require enabling the 'inactive' marker state and\n * adjusting opacity. Note that this approach could affect performance\n * with large datasets.\n *\n * @sample {highcharts} highcharts/plotoptions/series-inactiveotherpoints-enabled/\n * Chart with inactiveOtherPoints option enabled.\n *\n * @type {boolean}\n * @default false\n * @apioption plotOptions.series.inactiveOtherPoints\n */\n /**\n * An array specifying which option maps to which key in the data point\n * array. This makes it convenient to work with unstructured data arrays\n * from different sources.\n *\n * @see [series.data](#series.line.data)\n *\n * @sample {highcharts|highstock} highcharts/series/data-keys/\n * An extended data array with keys\n * @sample {highcharts|highstock} highcharts/series/data-nested-keys/\n * Nested keys used to access object properties\n *\n * @type {Array}\n * @since 4.1.6\n * @apioption plotOptions.series.keys\n */\n /**\n * The line cap used for line ends and line joins on the graph.\n *\n * @sample highcharts/series-line/linecap/\n * Line cap comparison\n *\n * @type {Highcharts.SeriesLinecapValue}\n * @default round\n * @product highcharts highstock\n * @apioption plotOptions.series.linecap\n */\n /**\n * The [id](#series.id) of another series to link to. Additionally,\n * the value can be \":previous\" to link to the previous series. When\n * two series are linked, only the first one appears in the legend.\n * Toggling the visibility of this also toggles the linked series.\n *\n * If master series uses data sorting and linked series does not have\n * its own sorting definition, the linked series will be sorted in the\n * same order as the master one.\n *\n * @sample {highcharts|highstock} highcharts/demo/arearange-line/\n * Linked series\n *\n * @type {string}\n * @since 3.0\n * @product highcharts highstock gantt\n * @apioption plotOptions.series.linkedTo\n */\n /**\n * Options for the corresponding navigator series if `showInNavigator`\n * is `true` for this series. Available options are the same as any\n * series, documented at [plotOptions](#plotOptions.series) and\n * [series](#series).\n *\n * These options are merged with options in [navigator.series](\n * #navigator.series), and will take precedence if the same option is\n * defined both places.\n *\n * @see [navigator.series](#navigator.series)\n *\n * @type {Highcharts.PlotSeriesOptions}\n * @since 5.0.0\n * @product highstock\n * @apioption plotOptions.series.navigatorOptions\n */\n /**\n * The color for the parts of the graph or points that are below the\n * [threshold](#plotOptions.series.threshold). Note that `zones` takes\n * precedence over the negative color. Using `negativeColor` is\n * equivalent to applying a zone with value of 0.\n *\n * @see In styled mode, a negative color is applied by setting this option\n * to `true` combined with the `.highcharts-negative` class name.\n *\n * @sample {highcharts} highcharts/plotoptions/series-negative-color/\n * Spline, area and column\n * @sample {highcharts} highcharts/plotoptions/arearange-negativecolor/\n * Arearange\n * @sample {highcharts} highcharts/css/series-negative-color/\n * Styled mode\n * @sample {highstock} highcharts/plotoptions/series-negative-color/\n * Spline, area and column\n * @sample {highstock} highcharts/plotoptions/arearange-negativecolor/\n * Arearange\n * @sample {highmaps} highcharts/plotoptions/series-negative-color/\n * Spline, area and column\n * @sample {highmaps} highcharts/plotoptions/arearange-negativecolor/\n * Arearange\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @since 3.0\n * @apioption plotOptions.series.negativeColor\n */\n /**\n * Same as\n * [accessibility.point.descriptionFormat](#accessibility.point.descriptionFormat),\n * but for an individual series. Overrides the chart wide configuration.\n *\n * @type {Function}\n * @since 11.1.0\n * @apioption plotOptions.series.pointDescriptionFormat\n */\n /**\n * Same as\n * [accessibility.series.descriptionFormatter](#accessibility.series.descriptionFormatter),\n * but for an individual series. Overrides the chart wide configuration.\n *\n * @type {Function}\n * @since 5.0.12\n * @apioption plotOptions.series.pointDescriptionFormatter\n */\n /**\n * If no x values are given for the points in a series, `pointInterval`\n * defines the interval of the x values. For example, if a series\n * contains one value every decade starting from year 0, set\n * `pointInterval` to `10`. In true `datetime` axes, the `pointInterval`\n * is set in milliseconds.\n *\n * It can be also be combined with `pointIntervalUnit` to draw irregular\n * time intervals.\n *\n * If combined with `relativeXValue`, an x value can be set on each\n * point, and the `pointInterval` is added x times to the `pointStart`\n * setting.\n *\n * Please note that this options applies to the _series data_, not the\n * interval of the axis ticks, which is independent.\n *\n * @sample {highcharts} highcharts/plotoptions/series-pointstart-datetime/\n * Datetime X axis\n * @sample {highcharts} highcharts/plotoptions/series-relativexvalue/\n * Relative x value\n * @sample {highstock} stock/plotoptions/pointinterval-pointstart/\n * Using pointStart and pointInterval\n * @sample {highstock} stock/plotoptions/relativexvalue/\n * Relative x value\n *\n * @type {number}\n * @default 1\n * @product highcharts highstock gantt\n * @apioption plotOptions.series.pointInterval\n */\n /**\n * On datetime series, this allows for setting the\n * [pointInterval](#plotOptions.series.pointInterval) to irregular time\n * units, `day`, `month` and `year`. A day is usually the same as 24\n * hours, but `pointIntervalUnit` also takes the DST crossover into\n * consideration when dealing with local time. Combine this option with\n * `pointInterval` to draw weeks, quarters, 6 months, 10 years etc.\n *\n * Please note that this options applies to the _series data_, not the\n * interval of the axis ticks, which is independent.\n *\n * @sample {highcharts} highcharts/plotoptions/series-pointintervalunit/\n * One point a month\n * @sample {highstock} highcharts/plotoptions/series-pointintervalunit/\n * One point a month\n *\n * @type {string}\n * @since 4.1.0\n * @product highcharts highstock gantt\n * @validvalue [\"day\", \"month\", \"year\"]\n * @apioption plotOptions.series.pointIntervalUnit\n */\n /**\n * Possible values: `\"on\"`, `\"between\"`, `number`.\n *\n * In a column chart, when pointPlacement is `\"on\"`, the point will not\n * create any padding of the X axis. In a polar column chart this means\n * that the first column points directly north. If the pointPlacement is\n * `\"between\"`, the columns will be laid out between ticks. This is\n * useful for example for visualising an amount between two points in\n * time or in a certain sector of a polar chart.\n *\n * Since Highcharts 3.0.2, the point placement can also be numeric,\n * where 0 is on the axis value, -0.5 is between this value and the\n * previous, and 0.5 is between this value and the next. Unlike the\n * textual options, numeric point placement options won't affect axis\n * padding.\n *\n * Note that pointPlacement needs a [pointRange](\n * #plotOptions.series.pointRange) to work. For column series this is\n * computed, but for line-type series it needs to be set.\n *\n * For the `xrange` series type and gantt charts, if the Y axis is a\n * category axis, the `pointPlacement` applies to the Y axis rather than\n * the (typically datetime) X axis.\n *\n * Defaults to `undefined` in cartesian charts, `\"between\"` in polar\n * charts.\n *\n * @see [xAxis.tickmarkPlacement](#xAxis.tickmarkPlacement)\n *\n * @sample {highcharts|highstock} highcharts/plotoptions/series-pointplacement-between/\n * Between in a column chart\n * @sample {highcharts|highstock} highcharts/plotoptions/series-pointplacement-numeric/\n * Numeric placement for custom layout\n * @sample {highcharts|highstock} maps/plotoptions/heatmap-pointplacement/\n * Placement in heatmap\n *\n * @type {string|number}\n * @since 2.3.0\n * @product highcharts highstock gantt\n * @apioption plotOptions.series.pointPlacement\n */\n /**\n * If no x values are given for the points in a series, pointStart\n * defines on what value to start. For example, if a series contains one\n * yearly value starting from 1945, set pointStart to 1945.\n *\n * If combined with `relativeXValue`, an x value can be set on each\n * point. The x value from the point options is multiplied by\n * `pointInterval` and added to `pointStart` to produce a modified x\n * value.\n *\n * @sample {highcharts} highcharts/plotoptions/series-pointstart-linear/\n * Linear\n * @sample {highcharts} highcharts/plotoptions/series-pointstart-datetime/\n * Datetime\n * @sample {highcharts} highcharts/plotoptions/series-relativexvalue/\n * Relative x value\n * @sample {highstock} stock/plotoptions/pointinterval-pointstart/\n * Using pointStart and pointInterval\n * @sample {highstock} stock/plotoptions/relativexvalue/\n * Relative x value\n *\n * @type {number}\n * @default 0\n * @product highcharts highstock gantt\n * @apioption plotOptions.series.pointStart\n */\n /**\n * When true, X values in the data set are relative to the current\n * `pointStart`, `pointInterval` and `pointIntervalUnit` settings. This\n * allows compression of the data for datasets with irregular X values.\n *\n * The real X values are computed on the formula `f(x) = ax + b`, where\n * `a` is the `pointInterval` (optionally with a time unit given by\n * `pointIntervalUnit`), and `b` is the `pointStart`.\n *\n * @sample {highcharts} highcharts/plotoptions/series-relativexvalue/\n * Relative X value\n * @sample {highstock} stock/plotoptions/relativexvalue/\n * Relative X value\n *\n * @type {boolean}\n * @default false\n * @product highcharts highstock\n * @apioption plotOptions.series.relativeXValue\n */\n /**\n * Whether to select the series initially. If `showCheckbox` is true,\n * the checkbox next to the series name in the legend will be checked\n * for a selected series.\n *\n * @sample {highcharts} highcharts/plotoptions/series-selected/\n * One out of two series selected\n *\n * @type {boolean}\n * @default false\n * @since 1.2.0\n * @apioption plotOptions.series.selected\n */\n /**\n * Whether to apply a drop shadow to the graph line. Since 2.3 the\n * shadow can be an object configuration containing `color`, `offsetX`,\n * `offsetY`, `opacity` and `width`.\n *\n * Note that in some cases, like stacked columns or other dense layouts, the\n * series may cast shadows on each other. In that case, the\n * `chart.seriesGroupShadow` allows applying a common drop shadow to the\n * whole series group.\n *\n * @sample {highcharts} highcharts/plotoptions/series-shadow/\n * Shadow enabled\n *\n * @type {boolean|Highcharts.ShadowOptionsObject}\n * @default false\n * @apioption plotOptions.series.shadow\n */\n /**\n * Whether to display this particular series or series type in the\n * legend. Standalone series are shown in legend by default, and linked\n * series are not. Since v7.2.0 it is possible to show series that use\n * colorAxis by setting this option to `true`.\n *\n * @sample {highcharts} highcharts/plotoptions/series-showinlegend/\n * One series in the legend, one hidden\n *\n * @type {boolean}\n * @apioption plotOptions.series.showInLegend\n */\n /**\n * Whether or not to show the series in the navigator. Takes precedence\n * over [navigator.baseSeries](#navigator.baseSeries) if defined.\n *\n * @type {boolean}\n * @since 5.0.0\n * @product highstock\n * @apioption plotOptions.series.showInNavigator\n */\n /**\n * If set to `true`, the accessibility module will skip past the points\n * in this series for keyboard navigation.\n *\n * @type {boolean}\n * @since 5.0.12\n * @apioption plotOptions.series.skipKeyboardNavigation\n */\n /**\n * Whether to stack the values of each series on top of each other.\n * Possible values are `undefined` to disable, `\"normal\"` to stack by\n * value or `\"percent\"`.\n *\n * When stacking is enabled, data must be sorted\n * in ascending X order.\n *\n * Some stacking options are related to specific series types. In the\n * streamgraph series type, the stacking option is set to `\"stream\"`.\n * The second one is `\"overlap\"`, which only applies to waterfall\n * series.\n *\n * @see [yAxis.reversedStacks](#yAxis.reversedStacks)\n *\n * @sample {highcharts} highcharts/plotoptions/series-stacking-line/\n * Line\n * @sample {highcharts} highcharts/plotoptions/series-stacking-column/\n * Column\n * @sample {highcharts} highcharts/plotoptions/series-stacking-bar/\n * Bar\n * @sample {highcharts} highcharts/plotoptions/series-stacking-area/\n * Area\n * @sample {highcharts} highcharts/plotoptions/series-stacking-percent-line/\n * Line\n * @sample {highcharts} highcharts/plotoptions/series-stacking-percent-column/\n * Column\n * @sample {highcharts} highcharts/plotoptions/series-stacking-percent-bar/\n * Bar\n * @sample {highcharts} highcharts/plotoptions/series-stacking-percent-area/\n * Area\n * @sample {highcharts} highcharts/plotoptions/series-waterfall-with-normal-stacking\n * Waterfall with normal stacking\n * @sample {highcharts} highcharts/plotoptions/series-waterfall-with-overlap-stacking\n * Waterfall with overlap stacking\n * @sample {highstock} stock/plotoptions/stacking/\n * Area\n *\n * @type {string}\n * @product highcharts highstock\n * @validvalue [\"normal\", \"overlap\", \"percent\", \"stream\"]\n * @apioption plotOptions.series.stacking\n */\n /**\n * Whether to apply steps to the line. Possible values are `left`,\n * `center` and `right`.\n *\n * @sample {highcharts} highcharts/plotoptions/line-step/\n * Different step line options\n * @sample {highcharts} highcharts/plotoptions/area-step/\n * Stepped, stacked area\n * @sample {highstock} stock/plotoptions/line-step/\n * Step line\n *\n * @type {string}\n * @since 1.2.5\n * @product highcharts highstock\n * @validvalue [\"left\", \"center\", \"right\"]\n * @apioption plotOptions.series.step\n */\n /**\n * The threshold, also called zero level or base level. For line type\n * series this is only used in conjunction with\n * [negativeColor](#plotOptions.series.negativeColor).\n *\n * @see [softThreshold](#plotOptions.series.softThreshold).\n *\n * @type {number|null}\n * @default 0\n * @since 3.0\n * @product highcharts highstock\n * @apioption plotOptions.series.threshold\n */\n /**\n * Set the initial visibility of the series.\n *\n * @sample {highcharts} highcharts/plotoptions/series-visible/\n * Two series, one hidden and one visible\n * @sample {highstock} stock/plotoptions/series-visibility/\n * Hidden series\n *\n * @type {boolean}\n * @default true\n * @apioption plotOptions.series.visible\n */\n /**\n * Defines the Axis on which the zones are applied.\n *\n * @see [zones](#plotOptions.series.zones)\n *\n * @sample {highcharts} highcharts/series/color-zones-zoneaxis-x/\n * Zones on the X-Axis\n * @sample {highstock} highcharts/series/color-zones-zoneaxis-x/\n * Zones on the X-Axis\n *\n * @type {string}\n * @default y\n * @since 4.1.0\n * @product highcharts highstock\n * @apioption plotOptions.series.zoneAxis\n */\n /**\n * General event handlers for the series items. These event hooks can\n * also be attached to the series at run time using the\n * `Highcharts.addEvent` function.\n *\n * @declare Highcharts.SeriesEventsOptionsObject\n *\n * @private\n */\n events: {},\n /**\n * Fires after the series has finished its initial animation, or in case\n * animation is disabled, immediately as the series is displayed.\n *\n * @sample {highcharts} highcharts/plotoptions/series-events-afteranimate/\n * Show label after animate\n * @sample {highstock} highcharts/plotoptions/series-events-afteranimate/\n * Show label after animate\n *\n * @type {Highcharts.SeriesAfterAnimateCallbackFunction}\n * @since 4.0\n * @product highcharts highstock gantt\n * @context Highcharts.Series\n * @apioption plotOptions.series.events.afterAnimate\n */\n /**\n * Fires when the checkbox next to the series' name in the legend is\n * clicked. One parameter, `event`, is passed to the function. The state\n * of the checkbox is found by `event.checked`. The checked item is\n * found by `event.item`. Return `false` to prevent the default action\n * which is to toggle the select state of the series.\n *\n * @sample {highcharts} highcharts/plotoptions/series-events-checkboxclick/\n * Alert checkbox status\n *\n * @type {Highcharts.SeriesCheckboxClickCallbackFunction}\n * @since 1.2.0\n * @context Highcharts.Series\n * @apioption plotOptions.series.events.checkboxClick\n */\n /**\n * Fires when the series is clicked. One parameter, `event`, is passed\n * to the function, containing common event information. Additionally,\n * `event.point` holds a pointer to the nearest point on the graph.\n *\n * @sample {highcharts} highcharts/plotoptions/series-events-click/\n * Alert click info\n * @sample {highstock} stock/plotoptions/series-events-click/\n * Alert click info\n * @sample {highmaps} maps/plotoptions/series-events-click/\n * Display click info in subtitle\n *\n * @type {Highcharts.SeriesClickCallbackFunction}\n * @context Highcharts.Series\n * @apioption plotOptions.series.events.click\n */\n /**\n * Fires when the series is hidden after chart generation time, either\n * by clicking the legend item or by calling `.hide()`.\n *\n * @sample {highcharts} highcharts/plotoptions/series-events-hide/\n * Alert when the series is hidden by clicking the legend item\n *\n * @type {Highcharts.SeriesHideCallbackFunction}\n * @since 1.2.0\n * @context Highcharts.Series\n * @apioption plotOptions.series.events.hide\n */\n /**\n * Fires when the legend item belonging to the series is clicked. One\n * parameter, `event`, is passed to the function. The default action\n * is to toggle the visibility of the series. This can be prevented\n * by returning `false` or calling `event.preventDefault()`.\n *\n * @sample {highcharts} highcharts/plotoptions/series-events-legenditemclick/\n * Confirm hiding and showing\n *\n * @type {Highcharts.SeriesLegendItemClickCallbackFunction}\n * @context Highcharts.Series\n * @apioption plotOptions.series.events.legendItemClick\n */\n /**\n * Fires when the mouse leaves the graph. One parameter, `event`, is\n * passed to the function, containing common event information. If the\n * [stickyTracking](#plotOptions.series) option is true, `mouseOut`\n * doesn't happen before the mouse enters another graph or leaves the\n * plot area.\n *\n * @sample {highcharts} highcharts/plotoptions/series-events-mouseover-sticky/\n * With sticky tracking by default\n * @sample {highcharts} highcharts/plotoptions/series-events-mouseover-no-sticky/\n * Without sticky tracking\n *\n * @type {Highcharts.SeriesMouseOutCallbackFunction}\n * @context Highcharts.Series\n * @apioption plotOptions.series.events.mouseOut\n */\n /**\n * Fires when the mouse enters the graph. One parameter, `event`, is\n * passed to the function, containing common event information.\n *\n * @sample {highcharts} highcharts/plotoptions/series-events-mouseover-sticky/\n * With sticky tracking by default\n * @sample {highcharts} highcharts/plotoptions/series-events-mouseover-no-sticky/\n * Without sticky tracking\n *\n * @type {Highcharts.SeriesMouseOverCallbackFunction}\n * @context Highcharts.Series\n * @apioption plotOptions.series.events.mouseOver\n */\n /**\n * Fires when the series is shown after chart generation time, either\n * by clicking the legend item or by calling `.show()`.\n *\n * @sample {highcharts} highcharts/plotoptions/series-events-show/\n * Alert when the series is shown by clicking the legend item.\n *\n * @type {Highcharts.SeriesShowCallbackFunction}\n * @since 1.2.0\n * @context Highcharts.Series\n * @apioption plotOptions.series.events.show\n */\n /**\n * Options for the point markers of line and scatter-like series. Properties\n * like `fillColor`, `lineColor` and `lineWidth` define the visual\n * appearance of the markers. The `symbol` option defines the shape. Other\n * series types, like column series, don't have markers, but have visual\n * options on the series level instead.\n *\n * In styled mode, the markers can be styled with the `.highcharts-point`,\n * `.highcharts-point-hover` and `.highcharts-point-select` class names.\n *\n * @declare Highcharts.PointMarkerOptionsObject\n *\n * @sample {highmaps} maps/demo/mappoint-mapmarker\n * Using the mapmarker symbol for points\n *\n * @private\n */\n marker: {\n /**\n * Enable or disable the point marker. If `undefined`, the markers\n * are hidden when the data is dense, and shown for more widespread\n * data points.\n *\n * @sample {highcharts} highcharts/plotoptions/series-marker-enabled/\n * Disabled markers\n * @sample {highcharts} highcharts/plotoptions/series-marker-enabled-false/\n * Disabled in normal state but enabled on hover\n * @sample {highstock} stock/plotoptions/series-marker/\n * Enabled markers\n *\n * @type {boolean}\n * @default {highcharts} undefined\n * @default {highstock} false\n * @apioption plotOptions.series.marker.enabled\n */\n /**\n * The threshold for how dense the point markers should be before\n * they are hidden, given that `enabled` is not defined. The number\n * indicates the horizontal distance between the two closest points\n * in the series, as multiples of the `marker.radius`. In other\n * words, the default value of 2 means points are hidden if\n * overlapping horizontally.\n *\n * @sample highcharts/plotoptions/series-marker-enabledthreshold\n * A higher threshold\n *\n * @since 6.0.5\n */\n enabledThreshold: 2,\n /**\n * The fill color of the point marker. When `undefined`, the series'\n * or point's color is used.\n *\n * @sample {highcharts} highcharts/plotoptions/series-marker-fillcolor/\n * White fill\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @apioption plotOptions.series.marker.fillColor\n */\n /**\n * Image markers only. Set the image width explicitly. When using\n * this option, a `width` must also be set.\n *\n * @sample {highcharts} highcharts/plotoptions/series-marker-width-height/\n * Fixed width and height\n * @sample {highstock} highcharts/plotoptions/series-marker-width-height/\n * Fixed width and height\n *\n * @type {number}\n * @since 4.0.4\n * @apioption plotOptions.series.marker.height\n */\n /**\n * The color of the point marker's outline. When `undefined`, the\n * series' or point's color is used.\n *\n * @sample {highcharts} highcharts/plotoptions/series-marker-fillcolor/\n * Inherit from series color (undefined)\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n */\n lineColor: \"#ffffff\" /* Palette.backgroundColor */,\n /**\n * The width of the point marker's outline.\n *\n * @sample {highcharts} highcharts/plotoptions/series-marker-fillcolor/\n * 2px blue marker\n */\n lineWidth: 0,\n /**\n * The radius of the point marker.\n *\n * @sample {highcharts} highcharts/plotoptions/series-marker-radius/\n * Bigger markers\n *\n * @default {highstock} 2\n * @default {highcharts} 4\n *\n */\n radius: 4,\n /**\n * A predefined shape or symbol for the marker. When undefined, the\n * symbol is pulled from options.symbols. Other possible values are\n * `'circle'`, `'square'`,`'diamond'`, `'triangle'` and\n * `'triangle-down'`.\n *\n * Additionally, the URL to a graphic can be given on this form:\n * `'url(graphic.png)'`. Note that for the image to be applied to\n * exported charts, its URL needs to be accessible by the export\n * server.\n *\n * Custom callbacks for symbol path generation can also be added to\n * `Highcharts.SVGRenderer.prototype.symbols`. The callback is then\n * used by its method name, as shown in the demo.\n *\n * @sample {highcharts} highcharts/plotoptions/series-marker-symbol/\n * Predefined, graphic and custom markers\n * @sample {highstock} highcharts/plotoptions/series-marker-symbol/\n * Predefined, graphic and custom markers\n * @sample {highmaps} maps/demo/mappoint-mapmarker\n * Using the mapmarker symbol for points\n *\n * @type {string}\n * @apioption plotOptions.series.marker.symbol\n */\n /**\n * Image markers only. Set the image width explicitly. When using\n * this option, a `height` must also be set.\n *\n * @sample {highcharts} highcharts/plotoptions/series-marker-width-height/\n * Fixed width and height\n * @sample {highstock} highcharts/plotoptions/series-marker-width-height/\n * Fixed width and height\n *\n * @type {number}\n * @since 4.0.4\n * @apioption plotOptions.series.marker.width\n */\n /**\n * States for a single point marker.\n *\n * @declare Highcharts.PointStatesOptionsObject\n */\n states: {\n /**\n * The normal state of a single point marker. Currently only\n * used for setting animation when returning to normal state\n * from hover.\n *\n * @declare Highcharts.PointStatesNormalOptionsObject\n */\n normal: {\n /**\n * Animation when returning to normal state after hovering.\n *\n * @type {boolean|Partial}\n */\n animation: true\n },\n /**\n * The hover state for a single point marker.\n *\n * @declare Highcharts.PointStatesHoverOptionsObject\n */\n hover: {\n /**\n * Animation when hovering over the marker.\n *\n * @type {boolean|Partial}\n */\n animation: {\n /** @internal */\n duration: 150\n },\n /**\n * Enable or disable the point marker.\n *\n * @sample {highcharts} highcharts/plotoptions/series-marker-states-hover-enabled/\n * Disabled hover state\n */\n enabled: true,\n /**\n * The fill color of the marker in hover state. When\n * `undefined`, the series' or point's fillColor for normal\n * state is used.\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @apioption plotOptions.series.marker.states.hover.fillColor\n */\n /**\n * The color of the point marker's outline. When\n * `undefined`, the series' or point's lineColor for normal\n * state is used.\n *\n * @sample {highcharts} highcharts/plotoptions/series-marker-states-hover-linecolor/\n * White fill color, black line color\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @apioption plotOptions.series.marker.states.hover.lineColor\n */\n /**\n * The width of the point marker's outline. When\n * `undefined`, the series' or point's lineWidth for normal\n * state is used.\n *\n * @sample {highcharts} highcharts/plotoptions/series-marker-states-hover-linewidth/\n * 3px line width\n *\n * @type {number}\n * @apioption plotOptions.series.marker.states.hover.lineWidth\n */\n /**\n * The radius of the point marker. In hover state, it\n * defaults to the normal state's radius + 2 as per the\n * [radiusPlus](#plotOptions.series.marker.states.hover.radiusPlus)\n * option.\n *\n * @sample {highcharts} highcharts/plotoptions/series-marker-states-hover-radius/\n * 10px radius\n *\n * @type {number}\n * @apioption plotOptions.series.marker.states.hover.radius\n */\n /**\n * The number of pixels to increase the radius of the\n * hovered point.\n *\n * @sample {highcharts} highcharts/plotoptions/series-states-hover-linewidthplus/\n * 5 pixels greater radius on hover\n * @sample {highstock} highcharts/plotoptions/series-states-hover-linewidthplus/\n * 5 pixels greater radius on hover\n *\n * @since 4.0.3\n */\n radiusPlus: 2,\n /**\n * The additional line width for a hovered point.\n *\n * @sample {highcharts} highcharts/plotoptions/series-states-hover-linewidthplus/\n * 2 pixels wider on hover\n * @sample {highstock} highcharts/plotoptions/series-states-hover-linewidthplus/\n * 2 pixels wider on hover\n *\n * @since 4.0.3\n */\n lineWidthPlus: 1\n },\n /**\n * The appearance of the point marker when selected. In order to\n * allow a point to be selected, set the\n * `series.allowPointSelect` option to true.\n *\n * @declare Highcharts.PointStatesSelectOptionsObject\n */\n select: {\n /**\n * Enable or disable visible feedback for selection.\n *\n * @sample {highcharts} highcharts/plotoptions/series-marker-states-select-enabled/\n * Disabled select state\n *\n * @type {boolean}\n * @default true\n * @apioption plotOptions.series.marker.states.select.enabled\n */\n /**\n * The radius of the point marker. In hover state, it\n * defaults to the normal state's radius + 2.\n *\n * @sample {highcharts} highcharts/plotoptions/series-marker-states-select-radius/\n * 10px radius for selected points\n *\n * @type {number}\n * @apioption plotOptions.series.marker.states.select.radius\n */\n /**\n * The fill color of the point marker.\n *\n * @sample {highcharts} highcharts/plotoptions/series-marker-states-select-fillcolor/\n * Solid red discs for selected points\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n */\n fillColor: \"#cccccc\" /* Palette.neutralColor20 */,\n /**\n * The color of the point marker's outline. When\n * `undefined`, the series' or point's color is used.\n *\n * @sample {highcharts} highcharts/plotoptions/series-marker-states-select-linecolor/\n * Red line color for selected points\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n */\n lineColor: \"#000000\" /* Palette.neutralColor100 */,\n /**\n * The width of the point marker's outline.\n *\n * @sample {highcharts} highcharts/plotoptions/series-marker-states-select-linewidth/\n * 3px line width for selected points\n */\n lineWidth: 2\n }\n }\n },\n /**\n * Properties for each single point.\n *\n * @declare Highcharts.PlotSeriesPointOptions\n *\n * @private\n */\n point: {\n /**\n * Fires when a point is clicked. One parameter, `event`, is passed\n * to the function, containing common event information.\n *\n * If the `series.allowPointSelect` option is true, the default\n * action for the point's click event is to toggle the point's\n * select state. Returning `false` cancels this action.\n *\n * @sample {highcharts} highcharts/plotoptions/series-point-events-click/\n * Click marker to alert values\n * @sample {highcharts} highcharts/plotoptions/series-point-events-click-column/\n * Click column\n * @sample {highcharts} highcharts/plotoptions/series-point-events-click-url/\n * Go to URL\n * @sample {highmaps} maps/plotoptions/series-point-events-click/\n * Click marker to display values\n * @sample {highmaps} maps/plotoptions/series-point-events-click-url/\n * Go to URL\n *\n * @type {Highcharts.PointClickCallbackFunction}\n * @context Highcharts.Point\n * @apioption plotOptions.series.point.events.click\n */\n /**\n * Fires when the mouse leaves the area close to the point. One\n * parameter, `event`, is passed to the function, containing common\n * event information.\n *\n * @sample {highcharts} highcharts/plotoptions/series-point-events-mouseover/\n * Show values in the chart's corner on mouse over\n *\n * @type {Highcharts.PointMouseOutCallbackFunction}\n * @context Highcharts.Point\n * @apioption plotOptions.series.point.events.mouseOut\n */\n /**\n * Fires when the mouse enters the area close to the point. One\n * parameter, `event`, is passed to the function, containing common\n * event information.\n *\n * Returning `false` cancels the default behavior, which is to show a\n * tooltip for the point.\n *\n * @sample {highcharts} highcharts/plotoptions/series-point-events-mouseover/\n * Show values in the chart's corner on mouse over\n *\n * @type {Highcharts.PointMouseOverCallbackFunction}\n * @context Highcharts.Point\n * @apioption plotOptions.series.point.events.mouseOver\n */\n /**\n * Fires when the point is removed using the `.remove()` method. One\n * parameter, `event`, is passed to the function. Returning `false`\n * cancels the operation.\n *\n * @sample {highcharts} highcharts/plotoptions/series-point-events-remove/\n * Remove point and confirm\n *\n * @type {Highcharts.PointRemoveCallbackFunction}\n * @since 1.2.0\n * @context Highcharts.Point\n * @apioption plotOptions.series.point.events.remove\n */\n /**\n * Fires when the point is selected either programmatically or\n * following a click on the point. One parameter, `event`, is passed\n * to the function. Returning `false` cancels the operation.\n *\n * @sample {highcharts} highcharts/plotoptions/series-point-events-select/\n * Report the last selected point\n * @sample {highmaps} maps/plotoptions/series-allowpointselect/\n * Report select and unselect\n *\n * @type {Highcharts.PointSelectCallbackFunction}\n * @since 1.2.0\n * @context Highcharts.Point\n * @apioption plotOptions.series.point.events.select\n */\n /**\n * Fires when the point is unselected either programmatically or\n * following a click on the point. One parameter, `event`, is passed\n * to the function.\n * Returning `false` cancels the operation.\n *\n * @sample {highcharts} highcharts/plotoptions/series-point-events-unselect/\n * Report the last unselected point\n * @sample {highmaps} maps/plotoptions/series-allowpointselect/\n * Report select and unselect\n *\n * @type {Highcharts.PointUnselectCallbackFunction}\n * @since 1.2.0\n * @context Highcharts.Point\n * @apioption plotOptions.series.point.events.unselect\n */\n /**\n * Fires when the point is updated programmatically through the\n * `.update()` method. One parameter, `event`, is passed to the\n * function. The new point options can be accessed through\n * `event.options`. Returning `false` cancels the operation.\n *\n * @sample {highcharts} highcharts/plotoptions/series-point-events-update/\n * Confirm point updating\n *\n * @type {Highcharts.PointUpdateCallbackFunction}\n * @since 1.2.0\n * @context Highcharts.Point\n * @apioption plotOptions.series.point.events.update\n */\n /**\n * Events for each single point.\n *\n * @declare Highcharts.PointEventsOptionsObject\n */\n events: {}\n },\n /**\n * Options for the series data labels, appearing next to each data\n * point.\n *\n * Since v6.2.0, multiple data labels can be applied to each single\n * point by defining them as an array of configs.\n *\n * In styled mode, the data labels can be styled with the\n * `.highcharts-data-label-box` and `.highcharts-data-label` class names\n * ([see example](https://www.highcharts.com/samples/highcharts/css/series-datalabels)).\n *\n * @sample {highcharts} highcharts/plotoptions/series-datalabels-enabled\n * Data labels enabled\n * @sample {highcharts} highcharts/plotoptions/series-datalabels-multiple\n * Multiple data labels on a bar series\n * @sample {highcharts} highcharts/css/series-datalabels\n * Styled mode example\n * @sample {highmaps} maps/demo/color-axis\n * Choropleth map with data labels\n * @sample {highmaps} maps/demo/mappoint-datalabels-mapmarker\n * Using data labels as map markers\n *\n * @type {*|Array<*>}\n * @product highcharts highstock highmaps gantt\n *\n * @private\n */\n dataLabels: {\n /**\n * Enable or disable the initial animation when a series is displayed\n * for the `dataLabels`. The animation can also be set as a\n * configuration object. Please note that this option only applies to\n * the initial animation.\n *\n * For other animations, see [chart.animation](#chart.animation) and the\n * animation parameter under the API methods. The following properties\n * are supported:\n *\n * - `defer`: The animation delay time in milliseconds.\n *\n * @sample {highcharts} highcharts/plotoptions/animation-defer/\n * Animation defer settings\n *\n * @type {boolean|Partial}\n * @since 8.2.0\n * @apioption plotOptions.series.dataLabels.animation\n */\n animation: {},\n /**\n * The animation delay time in milliseconds. Set to `0` to render the\n * data labels immediately. As `undefined` inherits defer time from the\n * [series.animation.defer](#plotOptions.series.animation.defer).\n *\n * @type {number}\n * @since 8.2.0\n * @apioption plotOptions.series.dataLabels.animation.defer\n */\n /**\n * The alignment of the data label compared to the point. If `right`,\n * the right side of the label should be touching the point. For points\n * with an extent, like columns, the alignments also dictates how to\n * align it inside the box, as given with the\n * [inside](#plotOptions.column.dataLabels.inside) option. Can be one of\n * `left`, `center` or `right`.\n *\n * @sample {highcharts}\n * highcharts/plotoptions/series-datalabels-align-left/ Left\n * aligned\n * @sample {highcharts}\n * highcharts/plotoptions/bar-datalabels-align-inside-bar/ Data\n * labels inside the bar\n *\n * @type {Highcharts.AlignValue|null}\n */\n align: 'center',\n /**\n * Whether to allow data labels to overlap. To make the labels less\n * sensitive for overlapping, the\n * [dataLabels.padding](#plotOptions.series.dataLabels.padding)\n * can be set to 0.\n *\n * @sample {highcharts} highcharts/plotoptions/series-datalabels-allowoverlap-false/\n * Don't allow overlap\n *\n * @type {boolean}\n * @default false\n * @since 4.1.0\n * @apioption plotOptions.series.dataLabels.allowOverlap\n */\n /**\n * The background color or gradient for the data label. Setting it to\n * `auto` will use the point's color.\n *\n * @sample {highcharts} highcharts/plotoptions/series-datalabels-box/\n * Data labels box options\n * @sample {highmaps} maps/plotoptions/series-datalabels-box/\n * Data labels box options\n * @sample {highmaps} maps/demo/mappoint-datalabels-mapmarker\n * Data labels as map markers\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @since 2.2.1\n * @apioption plotOptions.series.dataLabels.backgroundColor\n */\n /**\n * The border color for the data label. Setting it to `auto` will use\n * the point's color. Defaults to `undefined`.\n *\n * @sample {highcharts} highcharts/plotoptions/series-datalabels-box/\n * Data labels box options\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @since 2.2.1\n * @apioption plotOptions.series.dataLabels.borderColor\n */\n /**\n * The border radius in pixels for the data label.\n *\n * @sample {highcharts} highcharts/plotoptions/series-datalabels-box/\n * Data labels box options\n * @sample {highmaps} maps/plotoptions/series-datalabels-box/\n * Data labels box options\n *\n * @type {number}\n * @default 0\n * @since 2.2.1\n * @apioption plotOptions.series.dataLabels.borderRadius\n */\n /**\n * The border width in pixels for the data label.\n *\n * @sample {highcharts} highcharts/plotoptions/series-datalabels-box/\n * Data labels box options\n *\n * @type {number}\n * @default 0\n * @since 2.2.1\n * @apioption plotOptions.series.dataLabels.borderWidth\n */\n borderWidth: 0,\n /**\n * A class name for the data label. Particularly in styled mode,\n * this can be used to give each series' or point's data label\n * unique styling. In addition to this option, a default color class\n * name is added so that we can give the labels a contrast text\n * shadow.\n *\n * @sample {highcharts} highcharts/css/data-label-contrast/\n * Contrast text shadow\n * @sample {highcharts} highcharts/css/series-datalabels/\n * Styling by CSS\n *\n * @type {string}\n * @since 5.0.0\n * @apioption plotOptions.series.dataLabels.className\n */\n /**\n * This options is deprecated.\n * Use [style.color](#plotOptions.series.dataLabels.style) instead.\n *\n * The text color for the data labels. Defaults to `undefined`. For\n * certain series types, like column or map, the data labels can be\n * drawn inside the points. In this case the data label will be\n * drawn with maximum contrast by default. Additionally, it will be\n * given a `text-outline` style with the opposite color, to further\n * increase the contrast. This can be overridden by setting the\n * `text-outline` style to `none` in the `dataLabels.style` option.\n *\n * @sample {highcharts} highcharts/plotoptions/series-datalabels-color/\n * Red data labels\n * @sample {highmaps} maps/demo/color-axis/\n * White data labels\n *\n * @see [style.color](#plotOptions.series.dataLabels.style)\n *\n * @type {Highcharts.ColorType}\n * @deprecated 10.3\n * @apioption plotOptions.series.dataLabels.color\n */\n /**\n * Whether to hide data labels that are outside the plot area. By\n * default, the data label is moved inside the plot area according\n * to the\n * [overflow](#plotOptions.series.dataLabels.overflow)\n * option.\n *\n * @type {boolean}\n * @default true\n * @since 2.3.3\n * @apioption plotOptions.series.dataLabels.crop\n */\n /**\n * Whether to defer displaying the data labels until the initial\n * series animation has finished. Setting to `false` renders the\n * data label immediately. If set to `true` inherits the defer\n * time set in [plotOptions.series.animation](#plotOptions.series.animation).\n *\n * @since 4.0.0\n * @type {boolean}\n * @product highcharts highstock gantt\n */\n defer: true,\n /**\n * Enable or disable the data labels.\n *\n * @sample {highcharts} highcharts/plotoptions/series-datalabels-enabled/\n * Data labels enabled\n * @sample {highmaps} maps/demo/color-axis/\n * Data labels enabled\n *\n * @type {boolean}\n * @default false\n * @apioption plotOptions.series.dataLabels.enabled\n */\n /**\n * A declarative filter to control of which data labels to display.\n * The declarative filter is designed for use when callback\n * functions are not available, like when the chart options require\n * a pure JSON structure or for use with graphical editors. For\n * programmatic control, use the `formatter` instead, and return\n * `undefined` to disable a single data label.\n *\n * @example\n * filter: {\n * property: 'percentage',\n * operator: '>',\n * value: 4\n * }\n *\n * @sample {highcharts} highcharts/demo/pie-monochrome\n * Data labels filtered by percentage\n *\n * @declare Highcharts.DataLabelsFilterOptionsObject\n * @since 6.0.3\n * @apioption plotOptions.series.dataLabels.filter\n */\n /**\n * The operator to compare by. Can be one of `>`, `<`, `>=`, `<=`,\n * `==`, `===`, `!=` and `!==`.\n *\n * @type {string}\n * @validvalue [\">\", \"<\", \">=\", \"<=\", \"==\", \"===\", \"!=\", \"!==\"]\n * @apioption plotOptions.series.dataLabels.filter.operator\n */\n /**\n * The point property to filter by. Point options are passed\n * directly to properties, additionally there are `y` value,\n * `percentage` and others listed under {@link Highcharts.Point}\n * members.\n *\n * @type {string}\n * @apioption plotOptions.series.dataLabels.filter.property\n */\n /**\n * The value to compare against.\n *\n * @type {number}\n * @apioption plotOptions.series.dataLabels.filter.value\n */\n /**\n * A\n * [format string](https://www.highcharts.com/docs/chart-concepts/labels-and-string-formatting)\n * for the data label. Available variables are the same as for\n * `formatter`.\n *\n * @sample {highcharts} highcharts/plotoptions/series-datalabels-format/\n * Add a unit\n * @sample {highcharts} highcharts/plotoptions/series-datalabels-format-subexpression/\n * Complex logic in the format string\n * @sample {highmaps} maps/plotoptions/series-datalabels-format/\n * Formatted value in the data label\n *\n * @type {string}\n * @default y\n * @default point.value\n * @since 3.0\n * @apioption plotOptions.series.dataLabels.format\n */\n // eslint-disable-next-line valid-jsdoc\n /**\n * Callback JavaScript function to format the data label. Note that if a\n * `format` is defined, the format takes precedence and the formatter is\n * ignored.\n *\n * @sample {highmaps} maps/plotoptions/series-datalabels-format/\n * Formatted value\n *\n * @type {Highcharts.DataLabelsFormatterCallbackFunction}\n */\n formatter: function () {\n const { numberFormatter } = this.series.chart;\n return typeof this.y !== 'number' ?\n '' : numberFormatter(this.y, -1);\n },\n /**\n * For points with an extent, like columns or map areas, whether to\n * align the data label inside the box or to the actual value point.\n * Defaults to `false` in most cases, `true` in stacked columns.\n *\n * @type {boolean}\n * @since 3.0\n * @apioption plotOptions.series.dataLabels.inside\n */\n /**\n * Format for points with the value of null. Works analogously to\n * [format](#plotOptions.series.dataLabels.format). `nullFormat` can\n * be applied only to series which support displaying null points\n * i.e `heatmap` or `tilemap`. Does not work with series that don't\n * display null points, like `line`, `column`, `bar` or `pie`.\n *\n * @sample {highcharts} highcharts/plotoptions/series-datalabels-nullformat/\n * Format data label for null points in heat map\n *\n * @type {boolean|string}\n * @since 7.1.0\n * @apioption plotOptions.series.dataLabels.nullFormat\n */\n /**\n * Callback JavaScript function that defines formatting for points\n * with the value of null. Works analogously to\n * [formatter](#plotOptions.series.dataLabels.formatter).\n * `nullFormatter` can be applied only to series which support\n * displaying null points i.e `heatmap` or `tilemap`. Does not work\n * with series that don't display null points, like `line`, `column`,\n * `bar` or `pie`.\n *\n * @sample {highcharts} highcharts/plotoptions/series-datalabels-nullformat/\n * Format data label for null points in heat map\n *\n * @type {Highcharts.DataLabelsFormatterCallbackFunction}\n * @since 7.1.0\n * @apioption plotOptions.series.dataLabels.nullFormatter\n */\n /**\n * How to handle data labels that flow outside the plot area. The\n * default is `\"justify\"`, which aligns them inside the plot area.\n * For columns and bars, this means it will be moved inside the bar.\n * To display data labels outside the plot area, set `crop` to\n * `false` and `overflow` to `\"allow\"`.\n *\n * @type {Highcharts.DataLabelsOverflowValue}\n * @default justify\n * @since 3.0.6\n * @apioption plotOptions.series.dataLabels.overflow\n */\n /**\n * When either the `borderWidth` or the `backgroundColor` is set,\n * this is the padding within the box.\n *\n * @sample {highcharts} highcharts/plotoptions/series-datalabels-box/\n * Data labels box options\n * @sample {highmaps} maps/plotoptions/series-datalabels-box/\n * Data labels box options\n *\n * @since 2.2.1\n */\n padding: 5,\n /**\n * Aligns data labels relative to points. If `center` alignment is\n * not possible, it defaults to `right`.\n *\n * @type {Highcharts.AlignValue}\n * @default center\n * @apioption plotOptions.series.dataLabels.position\n */\n /**\n * Text rotation in degrees. Note that due to a more complex\n * structure, backgrounds, borders and padding will be lost on a\n * rotated data label.\n *\n * @sample {highcharts} highcharts/plotoptions/series-datalabels-rotation/\n * Vertical labels\n *\n * @type {number}\n * @default 0\n * @apioption plotOptions.series.dataLabels.rotation\n */\n /**\n * The shadow of the box. Works best with `borderWidth` or\n * `backgroundColor`. Since 2.3 the shadow can be an object\n * configuration containing `color`, `offsetX`, `offsetY`, `opacity`\n * and `width`.\n *\n * @sample {highcharts} highcharts/plotoptions/series-datalabels-box/\n * Data labels box options\n *\n * @type {boolean|Highcharts.ShadowOptionsObject}\n * @default false\n * @since 2.2.1\n * @apioption plotOptions.series.dataLabels.shadow\n */\n /**\n * The name of a symbol to use for the border around the label.\n * Symbols are predefined functions on the Renderer object.\n *\n * @sample {highcharts} highcharts/plotoptions/series-datalabels-shape/\n * A callout for annotations\n *\n * @type {string}\n * @default square\n * @since 4.1.2\n * @apioption plotOptions.series.dataLabels.shape\n */\n /**\n * Styles for the label. The default `color` setting is\n * `\"contrast\"`, which is a pseudo color that Highcharts picks up\n * and applies the maximum contrast to the underlying point item,\n * for example the bar in a bar chart.\n *\n * The `textOutline` is a pseudo property that applies an outline of\n * the given width with the given color, which by default is the\n * maximum contrast to the text. So a bright text color will result\n * in a black text outline for maximum readability on a mixed\n * background. In some cases, especially with grayscale text, the\n * text outline doesn't work well, in which cases it can be disabled\n * by setting it to `\"none\"`. When `useHTML` is true, the\n * `textOutline` will not be picked up. In this, case, the same\n * effect can be acheived through the `text-shadow` CSS property.\n *\n * For some series types, where each point has an extent, like for\n * example tree maps, the data label may overflow the point. There\n * are two strategies for handling overflow. By default, the text\n * will wrap to multiple lines. The other strategy is to set\n * `style.textOverflow` to `ellipsis`, which will keep the text on\n * one line plus it will break inside long words.\n *\n * @sample {highcharts} highcharts/plotoptions/series-datalabels-style/\n * Bold labels\n * @sample {highcharts} highcharts/plotoptions/pie-datalabels-overflow/\n * Long labels truncated with an ellipsis in a pie\n * @sample {highcharts} highcharts/plotoptions/pie-datalabels-overflow-wrap/\n * Long labels are wrapped in a pie\n * @sample {highmaps} maps/demo/color-axis/\n * Bold labels\n *\n * @type {Highcharts.CSSObject}\n * @since 4.1.0\n * @apioption plotOptions.series.dataLabels.style\n */\n style: {\n /** @internal */\n fontSize: '0.7em',\n /** @internal */\n fontWeight: 'bold',\n /** @internal */\n color: 'contrast',\n /** @internal */\n textOutline: '1px contrast'\n },\n /**\n * Options for a label text which should follow marker's shape.\n * Border and background are disabled for a label that follows a\n * path.\n *\n * **Note:** Only SVG-based renderer supports this option. Setting\n * `useHTML` to true will disable this option.\n *\n * @declare Highcharts.DataLabelsTextPathOptionsObject\n * @since 7.1.0\n * @apioption plotOptions.series.dataLabels.textPath\n */\n /**\n * Presentation attributes for the text path.\n *\n * @type {Highcharts.SVGAttributes}\n * @since 7.1.0\n * @apioption plotOptions.series.dataLabels.textPath.attributes\n */\n /**\n * Enable or disable `textPath` option for link's or marker's data\n * labels.\n *\n * @type {boolean}\n * @since 7.1.0\n * @apioption plotOptions.series.dataLabels.textPath.enabled\n */\n /**\n * Whether to\n * [use HTML](https://www.highcharts.com/docs/chart-concepts/labels-and-string-formatting#html)\n * to render the labels.\n *\n * @type {boolean}\n * @default false\n * @apioption plotOptions.series.dataLabels.useHTML\n */\n /**\n * The vertical alignment of a data label. Can be one of `top`,\n * `middle` or `bottom`. The default value depends on the data, for\n * instance in a column chart, the label is above positive values\n * and below negative values.\n *\n * @type {Highcharts.VerticalAlignValue|null}\n * @since 2.3.3\n */\n verticalAlign: 'bottom',\n /**\n * The x position offset of the label relative to the point in\n * pixels.\n *\n * @sample {highcharts} highcharts/plotoptions/series-datalabels-rotation/\n * Vertical and positioned\n * @sample {highcharts} highcharts/plotoptions/bar-datalabels-align-inside-bar/\n * Data labels inside the bar\n */\n x: 0,\n /**\n * The z index of the data labels. Use a `zIndex` of 6 to display it above\n * the series, or use a `zIndex` of 2 to display it behind the series.\n *\n * @type {number}\n * @default 6\n * @since 2.3.5\n * @apioption plotOptions.series.dataLabels.zIndex\n */\n /**\n * The y position offset of the label relative to the point in\n * pixels.\n *\n * @sample {highcharts} highcharts/plotoptions/series-datalabels-rotation/\n * Vertical and positioned\n */\n y: 0\n },\n /**\n * When the series contains less points than the crop threshold, all\n * points are drawn, even if the points fall outside the visible plot\n * area at the current zoom. The advantage of drawing all points\n * (including markers and columns), is that animation is performed on\n * updates. On the other hand, when the series contains more points than\n * the crop threshold, the series data is cropped to only contain points\n * that fall within the plot area. The advantage of cropping away\n * invisible points is to increase performance on large series.\n *\n * @since 2.2\n * @product highcharts highstock\n *\n * @private\n */\n cropThreshold: 300,\n /**\n * Opacity of a series parts: line, fill (e.g. area) and dataLabels.\n *\n * @see [states.inactive.opacity](#plotOptions.series.states.inactive.opacity)\n *\n * @since 7.1.0\n *\n * @private\n */\n opacity: 1,\n /**\n * The width of each point on the x axis. For example in a column chart\n * with one value each day, the pointRange would be 1 day (= 24 * 3600\n * * 1000 milliseconds). This is normally computed automatically, but\n * this option can be used to override the automatic value.\n *\n * @product highstock\n *\n * @private\n */\n pointRange: 0,\n /**\n * When this is true, the series will not cause the Y axis to cross\n * the zero plane (or [threshold](#plotOptions.series.threshold) option)\n * unless the data actually crosses the plane.\n *\n * For example, if `softThreshold` is `false`, a series of 0, 1, 2,\n * 3 will make the Y axis show negative values according to the\n * `minPadding` option. If `softThreshold` is `true`, the Y axis starts\n * at 0.\n *\n * @since 4.1.9\n * @product highcharts highstock\n *\n * @private\n */\n softThreshold: true,\n /**\n * @declare Highcharts.SeriesStatesOptionsObject\n *\n * @private\n */\n states: {\n /**\n * The normal state of a series, or for point items in column, pie\n * and similar series. Currently only used for setting animation\n * when returning to normal state from hover.\n *\n * @declare Highcharts.SeriesStatesNormalOptionsObject\n */\n normal: {\n /**\n * Animation when returning to normal state after hovering.\n *\n * @type {boolean|Partial}\n */\n animation: true\n },\n /**\n * Options for the hovered series. These settings override the\n * normal state options when a series is moused over or touched.\n *\n * @declare Highcharts.SeriesStatesHoverOptionsObject\n */\n hover: {\n /**\n * Enable separate styles for the hovered series to visualize\n * that the user hovers either the series itself or the legend.\n *\n * @sample {highcharts} highcharts/plotoptions/series-states-hover-enabled/\n * Line\n * @sample {highcharts} highcharts/plotoptions/series-states-hover-enabled-column/\n * Column\n * @sample {highcharts} highcharts/plotoptions/series-states-hover-enabled-pie/\n * Pie\n *\n * @type {boolean}\n * @default true\n * @since 1.2\n * @apioption plotOptions.series.states.hover.enabled\n */\n /**\n * Animation setting for hovering the graph in line-type series.\n *\n * @type {boolean|Partial}\n * @since 5.0.8\n * @product highcharts highstock\n */\n animation: {\n /**\n * The duration of the hover animation in milliseconds. By\n * default the hover state animates quickly in, and slowly\n * back to normal.\n *\n * @internal\n */\n duration: 150\n },\n /**\n * Pixel width of the graph line. By default this property is\n * undefined, and the `lineWidthPlus` property dictates how much\n * to increase the linewidth from normal state.\n *\n * @sample {highcharts} highcharts/plotoptions/series-states-hover-linewidth/\n * 5px line on hover\n *\n * @type {number}\n * @product highcharts highstock\n * @apioption plotOptions.series.states.hover.lineWidth\n */\n /**\n * The additional line width for the graph of a hovered series.\n *\n * @sample {highcharts} highcharts/plotoptions/series-states-hover-linewidthplus/\n * 5 pixels wider\n * @sample {highstock} highcharts/plotoptions/series-states-hover-linewidthplus/\n * 5 pixels wider\n *\n * @since 4.0.3\n * @product highcharts highstock\n */\n lineWidthPlus: 1,\n /**\n * In Highcharts 1.0, the appearance of all markers belonging\n * to the hovered series. For settings on the hover state of the\n * individual point, see\n * [marker.states.hover](#plotOptions.series.marker.states.hover).\n *\n * @deprecated\n *\n * @extends plotOptions.series.marker\n * @excluding states, symbol\n * @product highcharts highstock\n */\n marker: {\n // lineWidth: base + 1,\n // radius: base + 1\n },\n /**\n * Options for the halo appearing around the hovered point in\n * line-type series as well as outside the hovered slice in pie\n * charts. By default the halo is filled by the current point or\n * series color with an opacity of 0.25\\. The halo can be\n * disabled by setting the `halo` option to `null`.\n *\n * In styled mode, the halo is styled with the\n * `.highcharts-halo` class, with colors inherited from\n * `.highcharts-color-{n}`.\n *\n * @sample {highcharts} highcharts/plotoptions/halo/\n * Halo options\n * @sample {highstock} highcharts/plotoptions/halo/\n * Halo options\n *\n * @declare Highcharts.SeriesStatesHoverHaloOptionsObject\n * @type {null|*}\n * @since 4.0\n * @product highcharts highstock\n */\n halo: {\n /**\n * A collection of SVG attributes to override the appearance\n * of the halo, for example `fill`, `stroke` and\n * `stroke-width`.\n *\n * @type {Highcharts.SVGAttributes}\n * @since 4.0\n * @product highcharts highstock\n * @apioption plotOptions.series.states.hover.halo.attributes\n */\n /**\n * The pixel size of the halo. For point markers this is the\n * radius of the halo. For pie slices it is the width of the\n * halo outside the slice. For bubbles it defaults to 5 and\n * is the width of the halo outside the bubble.\n *\n * @since 4.0\n * @product highcharts highstock\n */\n size: 10,\n /**\n * Opacity for the halo unless a specific fill is overridden\n * using the `attributes` setting. Note that Highcharts is\n * only able to apply opacity to colors of hex or rgb(a)\n * formats.\n *\n * @since 4.0\n * @product highcharts highstock\n */\n opacity: 0.25\n }\n },\n /**\n * Specific options for point in selected states, after being\n * selected by\n * [allowPointSelect](#plotOptions.series.allowPointSelect)\n * or programmatically.\n *\n * @sample maps/plotoptions/series-allowpointselect/\n * Allow point select demo\n *\n * @declare Highcharts.SeriesStatesSelectOptionsObject\n * @extends plotOptions.series.states.hover\n * @excluding brightness\n */\n select: {\n animation: {\n /** @internal */\n duration: 0\n }\n },\n /**\n * The opposite state of a hover for series.\n *\n * @sample highcharts/plotoptions/series-states-inactive-disabled\n * Disabled inactive state\n *\n * @declare Highcharts.SeriesStatesInactiveOptionsObject\n */\n inactive: {\n /**\n * Enable or disable the inactive state for a series\n *\n * @sample highcharts/plotoptions/series-states-inactive-disabled\n * Disabled inactive state\n *\n * @type {boolean}\n * @default true\n * @apioption plotOptions.series.states.inactive.enabled\n */\n /**\n * The animation for entering the inactive state.\n *\n * @type {boolean|Partial}\n */\n animation: {\n /** @internal */\n duration: 150\n },\n /**\n * Opacity of series elements (dataLabels, line, area).\n *\n * @type {number}\n */\n opacity: 0.2\n }\n },\n /**\n * Sticky tracking of mouse events. When true, the `mouseOut` event on a\n * series isn't triggered until the mouse moves over another series, or\n * out of the plot area. When false, the `mouseOut` event on a series is\n * triggered when the mouse leaves the area around the series' graph or\n * markers. This also implies the tooltip when not shared. When\n * `stickyTracking` is false and `tooltip.shared` is false, the tooltip\n * will be hidden when moving the mouse between series. Defaults to true\n * for line and area type series, but to false for columns, pies etc.\n *\n * **Note:** The boost module will force this option because of\n * technical limitations.\n *\n * @sample {highcharts} highcharts/plotoptions/series-stickytracking-true/\n * True by default\n * @sample {highcharts} highcharts/plotoptions/series-stickytracking-false/\n * False\n *\n * @default {highcharts} true\n * @default {highstock} true\n * @default {highmaps} false\n * @since 2.0\n *\n * @private\n */\n stickyTracking: true,\n /**\n * A configuration object for the tooltip rendering of each single\n * series. Properties are inherited from [tooltip](#tooltip), but only\n * the following properties can be defined on a series level.\n *\n * @declare Highcharts.SeriesTooltipOptionsObject\n * @since 2.3\n * @extends tooltip\n * @excluding animation, backgroundColor, borderColor, borderRadius,\n * borderWidth, className, crosshairs, enabled, formatter,\n * headerShape, hideDelay, outside, padding, positioner,\n * shadow, shape, shared, snap, split, stickOnContact,\n * style, useHTML\n * @apioption plotOptions.series.tooltip\n */\n /**\n * When a series contains a data array that is longer than this, only\n * one dimensional arrays of numbers, or two dimensional arrays with\n * x and y values are allowed. Also, only the first point is tested,\n * and the rest are assumed to be the same format. This saves expensive\n * data checking and indexing in long series. Set it to `0` disable.\n *\n * Note:\n * In boost mode turbo threshold is forced. Only array of numbers or\n * two dimensional arrays are allowed.\n *\n * @since 2.2\n * @product highcharts highstock gantt\n *\n * @private\n */\n turboThreshold: 1000,\n /**\n * An array defining zones within a series. Zones can be applied to the\n * X axis, Y axis or Z axis for bubbles, according to the `zoneAxis`\n * option. The zone definitions have to be in ascending order regarding\n * to the value.\n *\n * In styled mode, the color zones are styled with the\n * `.highcharts-zone-{n}` class, or custom classed from the `className`\n * option\n * ([view live demo](https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/css/color-zones/)).\n *\n * @see [zoneAxis](#plotOptions.series.zoneAxis)\n *\n * @sample {highcharts} highcharts/series/color-zones-simple/\n * Color zones\n * @sample {highstock} highcharts/series/color-zones-simple/\n * Color zones\n *\n * @declare Highcharts.SeriesZonesOptionsObject\n * @type {Array<*>}\n * @since 4.1.0\n * @product highcharts highstock\n * @apioption plotOptions.series.zones\n */\n /**\n * Styled mode only. A custom class name for the zone.\n *\n * @sample highcharts/css/color-zones/\n * Zones styled by class name\n *\n * @type {string}\n * @since 5.0.0\n * @apioption plotOptions.series.zones.className\n */\n /**\n * Defines the color of the series.\n *\n * @see [series color](#plotOptions.series.color)\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @since 4.1.0\n * @product highcharts highstock\n * @apioption plotOptions.series.zones.color\n */\n /**\n * A name for the dash style to use for the graph.\n *\n * @see [plotOptions.series.dashStyle](#plotOptions.series.dashStyle)\n *\n * @sample {highcharts|highstock} highcharts/series/color-zones-dashstyle-dot/\n * Dashed line indicates prognosis\n *\n * @type {Highcharts.DashStyleValue}\n * @since 4.1.0\n * @product highcharts highstock\n * @apioption plotOptions.series.zones.dashStyle\n */\n /**\n * Defines the fill color for the series (in area type series)\n *\n * @see [fillColor](#plotOptions.area.fillColor)\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @since 4.1.0\n * @product highcharts highstock\n * @apioption plotOptions.series.zones.fillColor\n */\n /**\n * The value up to where the zone extends, if undefined the zones\n * stretches to the last value in the series.\n *\n * @type {number}\n * @since 4.1.0\n * @product highcharts highstock\n * @apioption plotOptions.series.zones.value\n */\n /**\n * When using dual or multiple color axes, this number defines which\n * colorAxis the particular series is connected to. It refers to\n * either the\n * {@link #colorAxis.id|axis id}\n * or the index of the axis in the colorAxis array, with 0 being the\n * first. Set this option to false to prevent a series from connecting\n * to the default color axis.\n *\n * Since v7.2.0 the option can also be an axis id or an axis index\n * instead of a boolean flag.\n *\n * @sample highcharts/coloraxis/coloraxis-with-pie/\n * Color axis with pie series\n * @sample highcharts/coloraxis/multiple-coloraxis/\n * Multiple color axis\n *\n * @type {number|string|boolean}\n * @default 0\n * @product highcharts highstock highmaps\n * @apioption plotOptions.series.colorAxis\n */\n /**\n * Determines what data value should be used to calculate point color\n * if `colorAxis` is used. Requires to set `min` and `max` if some\n * custom point property is used or if approximation for data grouping\n * is set to `'sum'`.\n *\n * @sample highcharts/coloraxis/custom-color-key/\n * Custom color key\n * @sample highcharts/coloraxis/color-key-with-stops/\n * Custom colorKey with color axis stops\n * @sample highcharts/coloraxis/changed-default-color-key/\n * Changed default color key\n *\n * @type {string}\n * @default y\n * @since 7.2.0\n * @product highcharts highstock highmaps\n * @apioption plotOptions.series.colorKey\n */\n /**\n * What type of legend symbol to render for this series. Can be one of\n * `areaMarker`, `lineMarker` or `rectangle`.\n *\n * @validvalue [\"areaMarker\", \"lineMarker\", \"rectangle\"]\n *\n * @sample {highcharts} highcharts/series/legend-symbol/\n * Change the legend symbol\n *\n * @type {string}\n * @default rectangle\n * @since 11.0.1\n * @apioption plotOptions.series.legendSymbol\n */\n /**\n * Determines whether the series should look for the nearest point\n * in both dimensions or just the x-dimension when hovering the series.\n * Defaults to `'xy'` for scatter series and `'x'` for most other\n * series. If the data has duplicate x-values, it is recommended to\n * set this to `'xy'` to allow hovering over all points.\n *\n * Applies only to series types using nearest neighbor search (not\n * direct hover) for tooltip.\n *\n * @sample {highcharts} highcharts/series/findnearestpointby/\n * Different hover behaviors\n * @sample {highstock} highcharts/series/findnearestpointby/\n * Different hover behaviors\n * @sample {highmaps} highcharts/series/findnearestpointby/\n * Different hover behaviors\n *\n * @since 5.0.10\n * @validvalue [\"x\", \"xy\"]\n *\n * @private\n */\n findNearestPointBy: 'x'\n};\n/* *\n *\n * Default Export\n *\n * */\nexport default seriesDefaults;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport H from '../Globals.js';\nimport D from '../Defaults.js';\nconst { defaultOptions } = D;\nimport Point from './Point.js';\nimport U from '../Utilities.js';\nconst { extend, extendClass, merge } = U;\n/* *\n *\n * Namespace\n *\n * */\nvar SeriesRegistry;\n(function (SeriesRegistry) {\n /* *\n *\n * Properties\n *\n * */\n /**\n * @internal\n * @todo Move `Globals.seriesTypes` code to her.\n */\n SeriesRegistry.seriesTypes = H.seriesTypes;\n /* *\n *\n * Functions\n *\n * */\n /**\n * Registers class pattern of a series.\n *\n * @private\n */\n function registerSeriesType(seriesType, SeriesClass) {\n const defaultPlotOptions = defaultOptions.plotOptions || {}, seriesOptions = SeriesClass.defaultOptions, seriesProto = SeriesClass.prototype;\n seriesProto.type = seriesType;\n if (!seriesProto.pointClass) {\n seriesProto.pointClass = Point;\n }\n if (SeriesRegistry.seriesTypes[seriesType]) {\n return false;\n }\n if (seriesOptions) {\n defaultPlotOptions[seriesType] = seriesOptions;\n }\n SeriesRegistry.seriesTypes[seriesType] = SeriesClass;\n return true;\n }\n SeriesRegistry.registerSeriesType = registerSeriesType;\n /**\n * Old factory to create new series prototypes.\n *\n * @deprecated\n * @function Highcharts.seriesType\n *\n * @param {string} type\n * The series type name.\n *\n * @param {string} parent\n * The parent series type name. Use `line` to inherit from the basic\n * {@link Series} object.\n *\n * @param {Highcharts.SeriesOptionsType|Highcharts.Dictionary<*>} options\n * The additional default options that are merged with the parent's options.\n *\n * @param {Highcharts.Dictionary<*>} [props]\n * The properties (functions and primitives) to set on the new prototype.\n *\n * @param {Highcharts.Dictionary<*>} [pointProps]\n * Members for a series-specific extension of the {@link Point} prototype if\n * needed.\n *\n * @return {Highcharts.Series}\n * The newly created prototype as extended from {@link Series} or its\n * derivatives.\n */\n function seriesType(type, parent, options, seriesProto, pointProto) {\n const defaultPlotOptions = defaultOptions.plotOptions || {};\n parent = parent || '';\n // Merge the options\n defaultPlotOptions[type] = merge(defaultPlotOptions[parent], options);\n // Create the class\n delete SeriesRegistry.seriesTypes[type];\n registerSeriesType(type, extendClass(SeriesRegistry.seriesTypes[parent] || function () { }, seriesProto));\n SeriesRegistry.seriesTypes[type].prototype.type = type;\n // Create the point class if needed\n if (pointProto) {\n class PointClass extends Point {\n }\n extend(PointClass.prototype, pointProto);\n SeriesRegistry.seriesTypes[type].prototype.pointClass = PointClass;\n }\n return SeriesRegistry.seriesTypes[type];\n }\n SeriesRegistry.seriesType = seriesType;\n})(SeriesRegistry || (SeriesRegistry = {}));\n/* *\n *\n * Default Export\n *\n * */\nexport default SeriesRegistry;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport A from '../Animation/AnimationUtilities.js';\nconst { animObject, setAnimation } = A;\nimport D from '../Defaults.js';\nconst { defaultOptions } = D;\nimport F from '../Foundation.js';\nconst { registerEventOptions } = F;\nimport H from '../Globals.js';\nconst { svg, win } = H;\nimport LegendSymbol from '../Legend/LegendSymbol.js';\nimport Point from './Point.js';\nimport SeriesDefaults from './SeriesDefaults.js';\nimport SeriesRegistry from './SeriesRegistry.js';\nconst { seriesTypes } = SeriesRegistry;\nimport SVGElement from '../Renderer/SVG/SVGElement.js';\nimport U from '../Utilities.js';\nconst { arrayMax, arrayMin, clamp, correctFloat, defined, destroyObjectProperties, diffObjects, erase, error, extend, find, fireEvent, getClosestDistance, getNestedProperty, insertItem, isArray, isNumber, isString, merge, objectEach, pick, removeEvent, splat, syncTimeout } = U;\n/* *\n *\n * Class\n *\n * */\n/**\n * This is the base series prototype that all other series types inherit from.\n * A new series is initialized either through the\n * [series](https://api.highcharts.com/highcharts/series)\n * option structure, or after the chart is initialized, through\n * {@link Highcharts.Chart#addSeries}.\n *\n * The object can be accessed in a number of ways. All series and point event\n * handlers give a reference to the `series` object. The chart object has a\n * {@link Highcharts.Chart#series|series} property that is a collection of all\n * the chart's series. The point objects and axis objects also have the same\n * reference.\n *\n * Another way to reference the series programmatically is by `id`. Add an id\n * in the series configuration options, and get the series object by\n * {@link Highcharts.Chart#get}.\n *\n * Configuration options for the series are given in three levels. Options for\n * all series in a chart are given in the\n * [plotOptions.series](https://api.highcharts.com/highcharts/plotOptions.series)\n * object. Then options for all series of a specific type\n * are given in the plotOptions of that type, for example `plotOptions.line`.\n * Next, options for one single series are given in the series array, or as\n * arguments to `chart.addSeries`.\n *\n * The data in the series is stored in various arrays.\n *\n * - First, `series.options.data` contains all the original config options for\n * each point whether added by options or methods like `series.addPoint`.\n *\n * - Next, `series.data` contains those values converted to points, but in case\n * the series data length exceeds the `cropThreshold`, or if the data is\n * grouped, `series.data` doesn't contain all the points. It only contains the\n * points that have been created on demand.\n *\n * - Then there's `series.points` that contains all currently visible point\n * objects. In case of cropping, the cropped-away points are not part of this\n * array. The `series.points` array starts at `series.cropStart` compared to\n * `series.data` and `series.options.data`. If however the series data is\n * grouped, these can't be correlated one to one.\n *\n * - `series.xData` and `series.processedXData` contain clean x values,\n * equivalent to `series.data` and `series.points`.\n *\n * - `series.yData` and `series.processedYData` contain clean y values,\n * equivalent to `series.data` and `series.points`.\n *\n * @class\n * @name Highcharts.Series\n *\n * @param {Highcharts.Chart} chart\n * The chart instance.\n *\n * @param {Highcharts.SeriesOptionsType|object} options\n * The series options.\n */\nclass Series {\n constructor() {\n /* *\n *\n * Static Properties\n *\n * */\n this.zoneAxis = 'y';\n /** eslint-enable valid-jsdoc */\n }\n /* *\n *\n * Functions\n *\n * */\n /* eslint-disable valid-jsdoc */\n init(chart, userOptions) {\n fireEvent(this, 'init', { options: userOptions });\n const series = this, chartSeries = chart.series;\n // The 'eventsToUnbind' property moved from prototype into the\n // Series init to avoid reference to the same array between\n // the different series and charts. #12959, #13937\n this.eventsToUnbind = [];\n /**\n * Read only. The chart that the series belongs to.\n *\n * @name Highcharts.Series#chart\n * @type {Highcharts.Chart}\n */\n series.chart = chart;\n /**\n * Read only. The series' type, like \"line\", \"area\", \"column\" etc.\n * The type in the series options anc can be altered using\n * {@link Series#update}.\n *\n * @name Highcharts.Series#type\n * @type {string}\n */\n /**\n * Read only. The series' current options. To update, use\n * {@link Series#update}.\n *\n * @name Highcharts.Series#options\n * @type {Highcharts.SeriesOptionsType}\n */\n series.options = series.setOptions(userOptions);\n const options = series.options, visible = options.visible !== false;\n /**\n * All child series that are linked to the current series through the\n * [linkedTo](https://api.highcharts.com/highcharts/series.line.linkedTo)\n * option.\n *\n * @name Highcharts.Series#linkedSeries\n * @type {Array}\n * @readonly\n */\n series.linkedSeries = [];\n // Bind the axes\n series.bindAxes();\n extend(series, {\n /**\n * The series name as given in the options. Defaults to\n * \"Series {n}\".\n *\n * @name Highcharts.Series#name\n * @type {string}\n */\n name: options.name,\n state: '',\n /**\n * Read only. The series' visibility state as set by {@link\n * Series#show}, {@link Series#hide}, or in the initial\n * configuration.\n *\n * @name Highcharts.Series#visible\n * @type {boolean}\n */\n visible,\n /**\n * Read only. The series' selected state as set by {@link\n * Highcharts.Series#select}.\n *\n * @name Highcharts.Series#selected\n * @type {boolean}\n */\n selected: options.selected === true // False by default\n });\n registerEventOptions(this, options);\n const events = options.events;\n if ((events && events.click) ||\n (options.point &&\n options.point.events &&\n options.point.events.click) ||\n options.allowPointSelect) {\n chart.runTrackerClick = true;\n }\n series.getColor();\n series.getSymbol();\n // Initialize the parallel data arrays\n series.parallelArrays.forEach(function (key) {\n if (!series[key + 'Data']) {\n series[key + 'Data'] = [];\n }\n });\n // Mark cartesian\n if (series.isCartesian) {\n chart.hasCartesianSeries = true;\n }\n // Get the index and register the series in the chart. The index is\n // one more than the current latest series index (#5960).\n let lastSeries;\n if (chartSeries.length) {\n lastSeries = chartSeries[chartSeries.length - 1];\n }\n series._i = pick(lastSeries && lastSeries._i, -1) + 1;\n series.opacity = series.options.opacity;\n // Insert the series and re-order all series above the insertion\n // point.\n chart.orderItems('series', insertItem(this, chartSeries));\n // Set options for series with sorting and set data later.\n if (options.dataSorting && options.dataSorting.enabled) {\n series.setDataSortingOptions();\n }\n else if (!series.points && !series.data) {\n series.setData(options.data, false);\n }\n fireEvent(this, 'afterInit');\n }\n /**\n * Check whether the series item is itself or inherits from a certain\n * series type.\n *\n * @function Highcharts.Series#is\n * @param {string} type The type of series to check for, can be either\n * featured or custom series types. For example `column`, `pie`,\n * `ohlc` etc.\n *\n * @return {boolean}\n * True if this item is or inherits from the given type.\n */\n is(type) {\n return seriesTypes[type] && this instanceof seriesTypes[type];\n }\n /**\n * Set the xAxis and yAxis properties of cartesian series, and register\n * the series in the `axis.series` array.\n *\n * @private\n * @function Highcharts.Series#bindAxes\n */\n bindAxes() {\n const series = this, seriesOptions = series.options, chart = series.chart;\n let axisOptions;\n fireEvent(this, 'bindAxes', null, function () {\n // repeat for xAxis and yAxis\n (series.axisTypes || []).forEach(function (coll) {\n // loop through the chart's axis objects\n chart[coll].forEach(function (axis) {\n axisOptions = axis.options;\n // apply if the series xAxis or yAxis option matches\n // the number of the axis, or if undefined, use the\n // first axis\n if (pick(seriesOptions[coll], 0) === axis.index ||\n (typeof seriesOptions[coll] !==\n 'undefined' &&\n seriesOptions[coll] === axisOptions.id)) {\n // register this series in the axis.series lookup\n insertItem(series, axis.series);\n // set this series.xAxis or series.yAxis reference\n /**\n * Read only. The unique xAxis object associated\n * with the series.\n *\n * @name Highcharts.Series#xAxis\n * @type {Highcharts.Axis}\n */\n /**\n * Read only. The unique yAxis object associated\n * with the series.\n *\n * @name Highcharts.Series#yAxis\n * @type {Highcharts.Axis}\n */\n series[coll] = axis;\n // mark dirty for redraw\n axis.isDirty = true;\n }\n });\n // The series needs an X and an Y axis\n if (!series[coll] &&\n series.optionalAxis !== coll) {\n error(18, true, chart);\n }\n });\n });\n fireEvent(this, 'afterBindAxes');\n }\n /**\n * For simple series types like line and column, the data values are\n * held in arrays like xData and yData for quick lookup to find extremes\n * and more. For multidimensional series like bubble and map, this can\n * be extended with arrays like zData and valueData by adding to the\n * `series.parallelArrays` array.\n *\n * @private\n * @function Highcharts.Series#updateParallelArrays\n */\n updateParallelArrays(point, i, iArgs) {\n const series = point.series, fn = isNumber(i) ?\n // Insert the value in the given position\n function (key) {\n const val = key === 'y' && series.toYData ?\n series.toYData(point) :\n point[key];\n series[key + 'Data'][i] = val;\n } :\n // Apply the method specified in i with the following\n // arguments as arguments\n function (key) {\n Array.prototype[i].apply(series[key + 'Data'], iArgs);\n };\n series.parallelArrays.forEach(fn);\n }\n /**\n * Define hasData functions for series. These return true if there\n * are data points on this series within the plot area.\n *\n * @private\n * @function Highcharts.Series#hasData\n */\n hasData() {\n return ((this.visible &&\n typeof this.dataMax !== 'undefined' &&\n typeof this.dataMin !== 'undefined') || ( // #3703\n this.visible &&\n this.yData &&\n this.yData.length > 0) // #9758\n );\n }\n /**\n * Determine whether the marker in a series has changed.\n *\n * @private\n * @function Highcharts.Series#hasMarkerChanged\n */\n hasMarkerChanged(options, oldOptions) {\n const marker = options.marker, oldMarker = oldOptions.marker || {};\n return marker && ((oldMarker.enabled && !marker.enabled) ||\n oldMarker.symbol !== marker.symbol || // #10870, #15946\n oldMarker.height !== marker.height || // #16274\n oldMarker.width !== marker.width // #16274\n );\n }\n /**\n * Return an auto incremented x value based on the pointStart and\n * pointInterval options. This is only used if an x value is not given\n * for the point that calls autoIncrement.\n *\n * @private\n * @function Highcharts.Series#autoIncrement\n */\n autoIncrement(x) {\n const options = this.options, pointIntervalUnit = options.pointIntervalUnit, relativeXValue = options.relativeXValue, time = this.chart.time;\n let xIncrement = this.xIncrement, date, pointInterval;\n xIncrement = pick(xIncrement, options.pointStart, 0);\n this.pointInterval = pointInterval = pick(this.pointInterval, options.pointInterval, 1);\n if (relativeXValue && isNumber(x)) {\n pointInterval *= x;\n }\n // Added code for pointInterval strings\n if (pointIntervalUnit) {\n date = new time.Date(xIncrement);\n if (pointIntervalUnit === 'day') {\n time.set('Date', date, time.get('Date', date) + pointInterval);\n }\n else if (pointIntervalUnit === 'month') {\n time.set('Month', date, time.get('Month', date) + pointInterval);\n }\n else if (pointIntervalUnit === 'year') {\n time.set('FullYear', date, time.get('FullYear', date) + pointInterval);\n }\n pointInterval = date.getTime() - xIncrement;\n }\n if (relativeXValue && isNumber(x)) {\n return xIncrement + pointInterval;\n }\n this.xIncrement = xIncrement + pointInterval;\n return xIncrement;\n }\n /**\n * Internal function to set properties for series if data sorting is\n * enabled.\n *\n * @private\n * @function Highcharts.Series#setDataSortingOptions\n */\n setDataSortingOptions() {\n const options = this.options;\n extend(this, {\n requireSorting: false,\n sorted: false,\n enabledDataSorting: true,\n allowDG: false\n });\n // To allow unsorted data for column series.\n if (!defined(options.pointRange)) {\n options.pointRange = 1;\n }\n }\n /**\n * Set the series options by merging from the options tree. Called\n * internally on initializing and updating series. This function will\n * not redraw the series. For API usage, use {@link Series#update}.\n * @private\n * @function Highcharts.Series#setOptions\n * @param {Highcharts.SeriesOptionsType} itemOptions\n * The series options.\n * @emits Highcharts.Series#event:afterSetOptions\n */\n setOptions(itemOptions) {\n const chart = this.chart, chartOptions = chart.options, plotOptions = chartOptions.plotOptions, userOptions = chart.userOptions || {}, seriesUserOptions = merge(itemOptions), styledMode = chart.styledMode, e = {\n plotOptions: plotOptions,\n userOptions: seriesUserOptions\n };\n let zone;\n fireEvent(this, 'setOptions', e);\n // These may be modified by the event\n const typeOptions = e.plotOptions[this.type], userPlotOptions = (userOptions.plotOptions || {}), userPlotOptionsSeries = userPlotOptions.series || {}, defaultPlotOptionsType = (defaultOptions.plotOptions[this.type] || {}), userPlotOptionsType = userPlotOptions[this.type] || {};\n // use copy to prevent undetected changes (#9762)\n /**\n * Contains series options by the user without defaults.\n * @name Highcharts.Series#userOptions\n * @type {Highcharts.SeriesOptionsType}\n */\n this.userOptions = e.userOptions;\n const options = merge(typeOptions, plotOptions.series, \n // #3881, chart instance plotOptions[type] should trump\n // plotOptions.series\n userPlotOptionsType, seriesUserOptions);\n // The tooltip options are merged between global and series specific\n // options. Importance order asscendingly:\n // globals: (1)tooltip, (2)plotOptions.series,\n // (3)plotOptions[this.type]\n // init userOptions with possible later updates: 4-6 like 1-3 and\n // (7)this series options\n this.tooltipOptions = merge(defaultOptions.tooltip, // 1\n defaultOptions.plotOptions.series?.tooltip, // 2\n defaultPlotOptionsType?.tooltip, // 3\n chart.userOptions.tooltip, // 4\n userPlotOptions.series?.tooltip, // 5\n userPlotOptionsType.tooltip, // 6\n seriesUserOptions.tooltip // 7\n );\n // When shared tooltip, stickyTracking is true by default,\n // unless user says otherwise.\n this.stickyTracking = pick(seriesUserOptions.stickyTracking, userPlotOptionsType.stickyTracking, userPlotOptionsSeries.stickyTracking, (this.tooltipOptions.shared && !this.noSharedTooltip ?\n true :\n options.stickyTracking));\n // Delete marker object if not allowed (#1125)\n if (typeOptions.marker === null) {\n delete options.marker;\n }\n // Handle color zones\n this.zoneAxis = options.zoneAxis || 'y';\n const zones = this.zones = // #20440, create deep copy of zones options\n (options.zones || []).map((z) => ({ ...z }));\n if ((options.negativeColor || options.negativeFillColor) &&\n !options.zones) {\n zone = {\n value: options[this.zoneAxis + 'Threshold'] ||\n options.threshold ||\n 0,\n className: 'highcharts-negative'\n };\n if (!styledMode) {\n zone.color = options.negativeColor;\n zone.fillColor = options.negativeFillColor;\n }\n zones.push(zone);\n }\n // Push one extra zone for the rest\n if (zones.length && defined(zones[zones.length - 1].value)) {\n zones.push(styledMode ? {} : {\n color: this.color,\n fillColor: this.fillColor\n });\n }\n fireEvent(this, 'afterSetOptions', { options: options });\n return options;\n }\n /**\n * Return series name in \"Series {Number}\" format or the one defined by\n * a user. This method can be simply overridden as series name format\n * can vary (e.g. technical indicators).\n *\n * @function Highcharts.Series#getName\n *\n * @return {string}\n * The series name.\n */\n getName() {\n // #4119\n return pick(this.options.name, 'Series ' + (this.index + 1));\n }\n /**\n * @private\n * @function Highcharts.Series#getCyclic\n */\n getCyclic(prop, value, defaults) {\n const chart = this.chart, indexName = `${prop}Index`, counterName = `${prop}Counter`, len = (\n // Symbol count\n defaults?.length ||\n // Color count\n chart.options.chart.colorCount);\n let i, setting;\n if (!value) {\n // Pick up either the colorIndex option, or the series.colorIndex\n // after Series.update()\n setting = pick(prop === 'color' ? this.options.colorIndex : void 0, this[indexName]);\n if (defined(setting)) { // after Series.update()\n i = setting;\n }\n else {\n // #6138\n if (!chart.series.length) {\n chart[counterName] = 0;\n }\n i = chart[counterName] % len;\n chart[counterName] += 1;\n }\n if (defaults) {\n value = defaults[i];\n }\n }\n // Set the colorIndex\n if (typeof i !== 'undefined') {\n this[indexName] = i;\n }\n this[prop] = value;\n }\n /**\n * Get the series' color based on either the options or pulled from\n * global options.\n *\n * @private\n * @function Highcharts.Series#getColor\n */\n getColor() {\n if (this.chart.styledMode) {\n this.getCyclic('color');\n }\n else if (this.options.colorByPoint) {\n this.color = \"#cccccc\" /* Palette.neutralColor20 */;\n }\n else {\n this.getCyclic('color', this.options.color ||\n defaultOptions.plotOptions[this.type].color, this.chart.options.colors);\n }\n }\n /**\n * Get all points' instances created for this series.\n *\n * @private\n * @function Highcharts.Series#getPointsCollection\n */\n getPointsCollection() {\n return (this.hasGroupedData ? this.points : this.data) || [];\n }\n /**\n * Get the series' symbol based on either the options or pulled from\n * global options.\n *\n * @private\n * @function Highcharts.Series#getSymbol\n */\n getSymbol() {\n const seriesMarkerOption = this.options.marker;\n this.getCyclic('symbol', seriesMarkerOption.symbol, this.chart.options.symbols);\n }\n /**\n * Finds the index of an existing point that matches the given point\n * options.\n *\n * @private\n * @function Highcharts.Series#findPointIndex\n * @param {Highcharts.PointOptionsObject} optionsObject\n * The options of the point.\n * @param {number} fromIndex\n * The index to start searching from, used for optimizing series with\n * required sorting.\n * @return {number|undefined}\n * Returns the index of a matching point, or undefined if no match is found.\n */\n findPointIndex(optionsObject, fromIndex) {\n const id = optionsObject.id, x = optionsObject.x, oldData = this.points, dataSorting = this.options.dataSorting;\n let matchingPoint, matchedById, pointIndex;\n if (id) {\n const item = this.chart.get(id);\n if (item instanceof Point) {\n matchingPoint = item;\n }\n }\n else if (this.linkedParent ||\n this.enabledDataSorting ||\n this.options.relativeXValue) {\n let matcher = (oldPoint) => !oldPoint.touched &&\n oldPoint.index === optionsObject.index;\n if (dataSorting && dataSorting.matchByName) {\n matcher = (oldPoint) => !oldPoint.touched &&\n oldPoint.name === optionsObject.name;\n }\n else if (this.options.relativeXValue) {\n matcher = (oldPoint) => !oldPoint.touched &&\n oldPoint.options.x === optionsObject.x;\n }\n matchingPoint = find(oldData, matcher);\n // Add unmatched point as a new point\n if (!matchingPoint) {\n return void 0;\n }\n }\n if (matchingPoint) {\n pointIndex = matchingPoint && matchingPoint.index;\n if (typeof pointIndex !== 'undefined') {\n matchedById = true;\n }\n }\n // Search for the same X in the existing data set\n if (typeof pointIndex === 'undefined' && isNumber(x)) {\n pointIndex = this.xData.indexOf(x, fromIndex);\n }\n // Reduce pointIndex if data is cropped\n if (pointIndex !== -1 &&\n typeof pointIndex !== 'undefined' &&\n this.cropped) {\n pointIndex = (pointIndex >= this.cropStart) ?\n pointIndex - this.cropStart : pointIndex;\n }\n if (!matchedById &&\n isNumber(pointIndex) &&\n oldData[pointIndex] && oldData[pointIndex].touched) {\n pointIndex = void 0;\n }\n return pointIndex;\n }\n /**\n * Internal function called from setData. If the point count is the same\n * as it was, or if there are overlapping X values, just run\n * Point.update which is cheaper, allows animation, and keeps references\n * to points. This also allows adding or removing points if the X-es\n * don't match.\n *\n * @private\n * @function Highcharts.Series#updateData\n */\n updateData(data, animation) {\n const options = this.options, dataSorting = options.dataSorting, oldData = this.points, pointsToAdd = [], requireSorting = this.requireSorting, equalLength = data.length === oldData.length;\n let hasUpdatedByKey, i, point, lastIndex, succeeded = true;\n this.xIncrement = null;\n // Iterate the new data\n data.forEach(function (pointOptions, i) {\n const optionsObject = (defined(pointOptions) &&\n this.pointClass.prototype.optionsToObject.call({ series: this }, pointOptions)) || {};\n let pointIndex;\n // Get the x of the new data point\n const x = optionsObject.x, id = optionsObject.id;\n if (id || isNumber(x)) {\n pointIndex = this.findPointIndex(optionsObject, lastIndex);\n // Matching X not found\n // or used already due to ununique x values (#8995),\n // add point (but later)\n if (pointIndex === -1 ||\n typeof pointIndex === 'undefined') {\n pointsToAdd.push(pointOptions);\n // Matching X found, update\n }\n else if (oldData[pointIndex] &&\n pointOptions !== options.data[pointIndex]) {\n oldData[pointIndex].update(pointOptions, false, null, false);\n // Mark it touched, below we will remove all points that\n // are not touched.\n oldData[pointIndex].touched = true;\n // Speed optimize by only searching after last known\n // index. Performs ~20% bettor on large data sets.\n if (requireSorting) {\n lastIndex = pointIndex + 1;\n }\n // Point exists, no changes, don't remove it\n }\n else if (oldData[pointIndex]) {\n oldData[pointIndex].touched = true;\n }\n // If the length is equal and some of the nodes had a\n // match in the same position, we don't want to remove\n // non-matches.\n if (!equalLength ||\n i !== pointIndex ||\n (dataSorting && dataSorting.enabled) ||\n this.hasDerivedData) {\n hasUpdatedByKey = true;\n }\n }\n else {\n // Gather all points that are not matched\n pointsToAdd.push(pointOptions);\n }\n }, this);\n // Remove points that don't exist in the updated data set\n if (hasUpdatedByKey) {\n i = oldData.length;\n while (i--) {\n point = oldData[i];\n if (point && !point.touched && point.remove) {\n point.remove(false, animation);\n }\n }\n // If we did not find keys (ids or x-values), and the length is the\n // same, update one-to-one\n }\n else if (equalLength && (!dataSorting || !dataSorting.enabled)) {\n data.forEach(function (point, i) {\n // .update doesn't exist on a linked, hidden series (#3709)\n // (#10187)\n if (point !== oldData[i].y && !oldData[i].destroyed) {\n oldData[i].update(point, false, null, false);\n }\n });\n // Don't add new points since those configs are used above\n pointsToAdd.length = 0;\n // Did not succeed in updating data\n }\n else {\n succeeded = false;\n }\n oldData.forEach(function (point) {\n if (point) {\n point.touched = false;\n }\n });\n if (!succeeded) {\n return false;\n }\n // Add new points\n pointsToAdd.forEach(function (point) {\n this.addPoint(point, false, null, null, false);\n }, this);\n if (this.xIncrement === null &&\n this.xData &&\n this.xData.length) {\n this.xIncrement = arrayMax(this.xData);\n this.autoIncrement();\n }\n return true;\n }\n /**\n * Apply a new set of data to the series and optionally redraw it. The\n * new data array is passed by reference (except in case of\n * `updatePoints`), and may later be mutated when updating the chart\n * data.\n *\n * Note the difference in behaviour when setting the same amount of\n * points, or a different amount of points, as handled by the\n * `updatePoints` parameter.\n *\n * @sample highcharts/members/series-setdata/\n * Set new data from a button\n * @sample highcharts/members/series-setdata-pie/\n * Set data in a pie\n * @sample stock/members/series-setdata/\n * Set new data in Highcharts Stock\n * @sample maps/members/series-setdata/\n * Set new data in Highmaps\n *\n * @function Highcharts.Series#setData\n *\n * @param {Array} data\n * Takes an array of data in the same format as described under\n * `series.{type}.data` for the given series type, for example a\n * line series would take data in the form described under\n * [series.line.data](https://api.highcharts.com/highcharts/series.line.data).\n *\n * @param {boolean} [redraw=true]\n * Whether to redraw the chart after the series is altered. If\n * doing more operations on the chart, it is a good idea to set\n * redraw to false and call {@link Chart#redraw} after.\n *\n * @param {boolean|Partial} [animation]\n * When the updated data is the same length as the existing data,\n * points will be updated by default, and animation visualizes\n * how the points are changed. Set false to disable animation, or\n * a configuration object to set duration or easing.\n *\n * @param {boolean} [updatePoints=true]\n * When this is true, points will be updated instead of replaced\n * whenever possible. This occurs a) when the updated data is the\n * same length as the existing data, b) when points are matched\n * by their id's, or c) when points can be matched by X values.\n * This allows updating with animation and performs better. In\n * this case, the original array is not passed by reference. Set\n * `false` to prevent.\n */\n setData(data, redraw = true, animation, updatePoints) {\n const series = this, oldData = series.points, oldDataLength = (oldData && oldData.length) || 0, options = series.options, chart = series.chart, dataSorting = options.dataSorting, xAxis = series.xAxis, turboThreshold = options.turboThreshold, xData = this.xData, yData = this.yData, pointArrayMap = series.pointArrayMap, valueCount = pointArrayMap && pointArrayMap.length, keys = options.keys;\n let i, pt, updatedData, indexOfX = 0, indexOfY = 1, firstPoint = null, copiedData;\n if (!chart.options.chart.allowMutatingData) { // #4259\n // Remove old reference\n if (options.data) {\n delete series.options.data;\n }\n if (series.userOptions.data) {\n delete series.userOptions.data;\n }\n copiedData = merge(true, data);\n }\n data = copiedData || data || [];\n const dataLength = data.length;\n if (dataSorting && dataSorting.enabled) {\n data = this.sortData(data);\n }\n // First try to run Point.update which is cheaper, allows animation,\n // and keeps references to points.\n if (chart.options.chart.allowMutatingData &&\n updatePoints !== false &&\n dataLength &&\n oldDataLength &&\n !series.cropped &&\n !series.hasGroupedData &&\n series.visible &&\n // Soft updating has no benefit in boost, and causes JS error\n // (#8355)\n !series.boosted) {\n updatedData = this.updateData(data, animation);\n }\n if (!updatedData) {\n // Reset properties\n series.xIncrement = null;\n series.colorCounter = 0; // for series with colorByPoint (#1547)\n // Update parallel arrays\n this.parallelArrays.forEach(function (key) {\n series[key + 'Data'].length = 0;\n });\n // In turbo mode, only one- or twodimensional arrays of numbers\n // are allowed. The first value is tested, and we assume that\n // all the rest are defined the same way. Although the 'for'\n // loops are similar, they are repeated inside each if-else\n // conditional for max performance.\n if (turboThreshold && dataLength > turboThreshold) {\n firstPoint = series.getFirstValidPoint(data);\n if (isNumber(firstPoint)) { // assume all points are numbers\n for (i = 0; i < dataLength; i++) {\n xData[i] = this.autoIncrement();\n yData[i] = data[i];\n }\n // Assume all points are arrays when first point is\n }\n else if (isArray(firstPoint)) {\n if (valueCount) { // [x, low, high] or [x, o, h, l, c]\n if (firstPoint.length === valueCount) {\n for (i = 0; i < dataLength; i++) {\n xData[i] = this.autoIncrement();\n yData[i] = data[i];\n }\n }\n else {\n for (i = 0; i < dataLength; i++) {\n pt = data[i];\n xData[i] = pt[0];\n yData[i] =\n pt.slice(1, valueCount + 1);\n }\n }\n }\n else { // [x, y]\n if (keys) {\n indexOfX = keys.indexOf('x');\n indexOfY = keys.indexOf('y');\n indexOfX = indexOfX >= 0 ? indexOfX : 0;\n indexOfY = indexOfY >= 0 ? indexOfY : 1;\n }\n if (firstPoint.length === 1) {\n indexOfY = 0;\n }\n if (indexOfX === indexOfY) {\n for (i = 0; i < dataLength; i++) {\n xData[i] = this.autoIncrement();\n yData[i] = data[i][indexOfY];\n }\n }\n else {\n for (i = 0; i < dataLength; i++) {\n pt = data[i];\n xData[i] = pt[indexOfX];\n yData[i] = pt[indexOfY];\n }\n }\n }\n }\n else {\n // Highcharts expects configs to be numbers or arrays in\n // turbo mode\n error(12, false, chart);\n }\n }\n else {\n for (i = 0; i < dataLength; i++) {\n pt = { series: series };\n series.pointClass.prototype.applyOptions.apply(pt, [data[i]]);\n series.updateParallelArrays(pt, i);\n }\n }\n // Forgetting to cast strings to numbers is a common caveat when\n // handling CSV or JSON\n if (yData && isString(yData[0])) {\n error(14, true, chart);\n }\n series.data = [];\n series.options.data = series.userOptions.data = data;\n // destroy old points\n i = oldDataLength;\n while (i--) {\n oldData[i]?.destroy();\n }\n // reset minRange (#878)\n if (xAxis) {\n xAxis.minRange = xAxis.userMinRange;\n }\n // redraw\n series.isDirty = chart.isDirtyBox = true;\n series.isDirtyData = !!oldData;\n animation = false;\n }\n // Typically for pie series, points need to be processed and\n // generated prior to rendering the legend\n if (options.legendType === 'point') {\n this.processData();\n this.generatePoints();\n }\n if (redraw) {\n chart.redraw(animation);\n }\n }\n /**\n * Internal function to sort series data\n *\n * @private\n * @function Highcharts.Series#sortData\n * @param {Array} data\n * Force data grouping.\n */\n sortData(data) {\n const series = this, options = series.options, dataSorting = options.dataSorting, sortKey = dataSorting.sortKey || 'y', getPointOptionsObject = function (series, pointOptions) {\n return (defined(pointOptions) &&\n series.pointClass.prototype.optionsToObject.call({\n series: series\n }, pointOptions)) || {};\n };\n data.forEach(function (pointOptions, i) {\n data[i] = getPointOptionsObject(series, pointOptions);\n data[i].index = i;\n }, this);\n // Sorting\n const sortedData = data.concat().sort((a, b) => {\n const aValue = getNestedProperty(sortKey, a);\n const bValue = getNestedProperty(sortKey, b);\n return bValue < aValue ? -1 : bValue > aValue ? 1 : 0;\n });\n // Set x value depending on the position in the array\n sortedData.forEach(function (point, i) {\n point.x = i;\n }, this);\n // Set the same x for linked series points if they don't have their\n // own sorting\n if (series.linkedSeries) {\n series.linkedSeries.forEach(function (linkedSeries) {\n const options = linkedSeries.options, seriesData = options.data;\n if ((!options.dataSorting ||\n !options.dataSorting.enabled) &&\n seriesData) {\n seriesData.forEach(function (pointOptions, i) {\n seriesData[i] = getPointOptionsObject(linkedSeries, pointOptions);\n if (data[i]) {\n seriesData[i].x = data[i].x;\n seriesData[i].index = i;\n }\n });\n linkedSeries.setData(seriesData, false);\n }\n });\n }\n return data;\n }\n /**\n * Internal function to process the data by cropping away unused data\n * points if the series is longer than the crop threshold. This saves\n * computing time for large series.\n *\n * @private\n * @function Highcharts.Series#getProcessedData\n * @param {boolean} [forceExtremesFromAll]\n * Force getting extremes of a total series data range.\n */\n getProcessedData(forceExtremesFromAll) {\n const series = this, xAxis = series.xAxis, options = series.options, cropThreshold = options.cropThreshold, getExtremesFromAll = forceExtremesFromAll ||\n series.getExtremesFromAll ||\n options.getExtremesFromAll, // #4599\n logarithmic = xAxis?.logarithmic, isCartesian = series.isCartesian;\n let croppedData, cropped, cropStart = 0, xExtremes, min, max, \n // copied during slice operation:\n processedXData = series.xData, processedYData = series.yData, updatingNames = false;\n const dataLength = processedXData.length;\n if (xAxis) {\n // corrected for log axis (#3053)\n xExtremes = xAxis.getExtremes();\n min = xExtremes.min;\n max = xExtremes.max;\n updatingNames = !!(xAxis.categories && !xAxis.names.length);\n }\n // optionally filter out points outside the plot area\n if (isCartesian &&\n series.sorted &&\n !getExtremesFromAll &&\n (!cropThreshold ||\n dataLength > cropThreshold ||\n series.forceCrop)) {\n // it's outside current extremes\n if (processedXData[dataLength - 1] < min ||\n processedXData[0] > max) {\n processedXData = [];\n processedYData = [];\n // only crop if it's actually spilling out\n }\n else if (series.yData && (processedXData[0] < min ||\n processedXData[dataLength - 1] > max)) {\n croppedData = this.cropData(series.xData, series.yData, min, max);\n processedXData = croppedData.xData;\n processedYData = croppedData.yData;\n cropStart = croppedData.start;\n cropped = true;\n }\n }\n // Find the closest distance between processed points\n const closestPointRange = getClosestDistance([\n logarithmic ?\n processedXData.map(logarithmic.log2lin) :\n processedXData\n ], \n // Unsorted data is not supported by the line tooltip, as well as\n // data grouping and navigation in Stock charts (#725) and width\n // calculation of columns (#1900). Avoid warning during the\n // premature processing pass in updateNames (#16104).\n () => (series.requireSorting &&\n !updatingNames &&\n error(15, false, series.chart)));\n return {\n xData: processedXData,\n yData: processedYData,\n cropped: cropped,\n cropStart: cropStart,\n closestPointRange: closestPointRange\n };\n }\n /**\n * Internal function to apply processed data.\n * In Highcharts Stock, this function is extended to provide data grouping.\n *\n * @private\n * @function Highcharts.Series#processData\n * @param {boolean} [force]\n * Force data grouping.\n */\n processData(force) {\n const series = this, xAxis = series.xAxis;\n // If the series data or axes haven't changed, don't go through\n // this. Return false to pass the message on to override methods\n // like in data grouping.\n if (series.isCartesian &&\n !series.isDirty &&\n !xAxis.isDirty &&\n !series.yAxis.isDirty &&\n !force) {\n return false;\n }\n const processedData = series.getProcessedData();\n // Record the properties\n series.cropped = processedData.cropped; // undefined or true\n series.cropStart = processedData.cropStart;\n series.processedXData = processedData.xData;\n series.processedYData = processedData.yData;\n series.closestPointRange = (series.basePointRange = processedData.closestPointRange);\n fireEvent(series, 'afterProcessData');\n }\n /**\n * Iterate over xData and crop values between min and max. Returns\n * object containing crop start/end cropped xData with corresponding\n * part of yData, dataMin and dataMax within the cropped range.\n *\n * @private\n * @function Highcharts.Series#cropData\n */\n cropData(xData, yData, min, max) {\n const dataLength = xData.length;\n let i, j, start = 0, end = dataLength;\n // Iterate up to find slice start\n for (i = 0; i < dataLength; i++) {\n if (xData[i] >= min) {\n start = Math.max(0, i - 1);\n break;\n }\n }\n // Proceed to find slice end\n for (j = i; j < dataLength; j++) {\n if (xData[j] > max) {\n end = j + 1;\n break;\n }\n }\n return {\n xData: xData.slice(start, end),\n yData: yData.slice(start, end),\n start,\n end\n };\n }\n /**\n * Generate the data point after the data has been processed by cropping\n * away unused points and optionally grouped in Highcharts Stock.\n *\n * @private\n * @function Highcharts.Series#generatePoints\n */\n generatePoints() {\n const series = this, options = series.options, dataOptions = series.processedData || options.data, processedXData = series.processedXData, processedYData = series.processedYData, PointClass = series.pointClass, processedDataLength = processedXData.length, cropStart = series.cropStart || 0, hasGroupedData = series.hasGroupedData, keys = options.keys, points = [], groupCropStartIndex = (options.dataGrouping &&\n options.dataGrouping.groupAll ?\n cropStart :\n 0);\n let dataLength, cursor, point, i, data = series.data;\n if (!data && !hasGroupedData) {\n const arr = [];\n arr.length = dataOptions.length;\n data = series.data = arr;\n }\n if (keys && hasGroupedData) {\n // grouped data has already applied keys (#6590)\n series.options.keys = false;\n }\n for (i = 0; i < processedDataLength; i++) {\n cursor = cropStart + i;\n if (!hasGroupedData) {\n point = data[cursor];\n // #970:\n if (!point &&\n typeof dataOptions[cursor] !== 'undefined') {\n data[cursor] = point = new PointClass(series, dataOptions[cursor], processedXData[i]);\n }\n }\n else {\n // Splat the y data in case of ohlc data array\n point = new PointClass(series, [processedXData[i]].concat(splat(processedYData[i])));\n point.dataGroup = series.groupMap[groupCropStartIndex + i];\n if (point.dataGroup.options) {\n point.options = point.dataGroup.options;\n extend(point, point.dataGroup.options);\n // Collision of props and options (#9770)\n delete point.dataLabels;\n }\n }\n if (point) { // #6279\n /**\n * Contains the point's index in the `Series.points` array.\n *\n * @name Highcharts.Point#index\n * @type {number}\n * @readonly\n */\n // For faster access in Point.update\n point.index = hasGroupedData ?\n (groupCropStartIndex + i) : cursor;\n points[i] = point;\n }\n }\n // restore keys options (#6590)\n series.options.keys = keys;\n // Hide cropped-away points - this only runs when the number of\n // points is above cropThreshold, or when switching view from\n // non-grouped data to grouped data (#637)\n if (data &&\n (processedDataLength !== (dataLength = data.length) ||\n hasGroupedData)) {\n for (i = 0; i < dataLength; i++) {\n // when has grouped data, clear all points\n if (i === cropStart && !hasGroupedData) {\n i += processedDataLength;\n }\n if (data[i]) {\n data[i].destroyElements();\n data[i].plotX = void 0; // #1003\n }\n }\n }\n /**\n * Read only. An array containing those values converted to points.\n * In case the series data length exceeds the `cropThreshold`, or if\n * the data is grouped, `series.data` doesn't contain all the\n * points. Also, in case a series is hidden, the `data` array may be\n * empty. In case of cropping, the `data` array may contain `undefined`\n * values, instead of points. To access raw values,\n * `series.options.data` will always be up to date. `Series.data` only\n * contains the points that have been created on demand. To modify the\n * data, use\n * {@link Highcharts.Series#setData} or\n * {@link Highcharts.Point#update}.\n *\n * @see Series.points\n *\n * @name Highcharts.Series#data\n * @type {Array}\n */\n series.data = data;\n /**\n * An array containing all currently visible point objects. In case\n * of cropping, the cropped-away points are not part of this array.\n * The `series.points` array starts at `series.cropStart` compared\n * to `series.data` and `series.options.data`. If however the series\n * data is grouped, these can't be correlated one to one. To modify\n * the data, use {@link Highcharts.Series#setData} or\n * {@link Highcharts.Point#update}.\n *\n * @name Highcharts.Series#points\n * @type {Array}\n */\n series.points = points;\n fireEvent(this, 'afterGeneratePoints');\n }\n /**\n * Get current X extremes for the visible data.\n *\n * @private\n * @function Highcharts.Series#getXExtremes\n * @param {Array} xData\n * The data to inspect. Defaults to the current data within the visible\n * range.\n */\n getXExtremes(xData) {\n return {\n min: arrayMin(xData),\n max: arrayMax(xData)\n };\n }\n /**\n * Calculate Y extremes for the visible data. The result is returned\n * as an object with `dataMin` and `dataMax` properties.\n *\n * @private\n * @function Highcharts.Series#getExtremes\n * @param {Array} [yData]\n * The data to inspect. Defaults to the current data within the visible\n * range.\n * @param {boolean} [forceExtremesFromAll]\n * Force getting extremes of a total series data range.\n */\n getExtremes(yData, forceExtremesFromAll) {\n const xAxis = this.xAxis, yAxis = this.yAxis, xData = this.processedXData || this.xData, activeYData = [], \n // Handle X outside the viewed area. This does not work with\n // non-sorted data like scatter (#7639).\n shoulder = this.requireSorting && !this.is('column') ?\n 1 : 0, \n // #2117, need to compensate for log X axis\n positiveValuesOnly = yAxis ? yAxis.positiveValuesOnly : false;\n let xExtremes, validValue, withinRange, x, y, i, j, xMin = 0, xMax = 0, activeCounter = 0;\n yData = yData || this.stackedYData || this.processedYData || [];\n const yDataLength = yData.length;\n if (xAxis) {\n xExtremes = xAxis.getExtremes();\n xMin = xExtremes.min;\n xMax = xExtremes.max;\n }\n for (i = 0; i < yDataLength; i++) {\n x = xData[i];\n y = yData[i];\n // For points within the visible range, including the first\n // point outside the visible range (#7061), consider y extremes.\n validValue = ((isNumber(y) ||\n isArray(y)) && ((isNumber(y) ? y > 0 : y.length) ||\n !positiveValuesOnly));\n withinRange = (forceExtremesFromAll ||\n this.getExtremesFromAll ||\n this.options.getExtremesFromAll ||\n this.cropped ||\n !xAxis || // for colorAxis support\n ((xData[i + shoulder] || x) >= xMin &&\n (xData[i - shoulder] || x) <= xMax));\n if (validValue && withinRange) {\n j = y.length;\n if (j) { // array, like ohlc or range data\n while (j--) {\n if (isNumber(y[j])) { // #7380, #11513\n activeYData[activeCounter++] = y[j];\n }\n }\n }\n else {\n activeYData[activeCounter++] = y;\n }\n }\n }\n const dataExtremes = {\n activeYData,\n dataMin: arrayMin(activeYData),\n dataMax: arrayMax(activeYData)\n };\n fireEvent(this, 'afterGetExtremes', { dataExtremes });\n return dataExtremes;\n }\n /**\n * Set the current data extremes as `dataMin` and `dataMax` on the\n * Series item. Use this only when the series properties should be\n * updated.\n *\n * @private\n * @function Highcharts.Series#applyExtremes\n */\n applyExtremes() {\n const dataExtremes = this.getExtremes();\n /**\n * Contains the minimum value of the series' data point. Some series\n * types like `networkgraph` do not support this property as they\n * lack a `y`-value.\n * @name Highcharts.Series#dataMin\n * @type {number|undefined}\n * @readonly\n */\n this.dataMin = dataExtremes.dataMin;\n /**\n * Contains the maximum value of the series' data point. Some series\n * types like `networkgraph` do not support this property as they\n * lack a `y`-value.\n * @name Highcharts.Series#dataMax\n * @type {number|undefined}\n * @readonly\n */\n this.dataMax = dataExtremes.dataMax;\n return dataExtremes;\n }\n /**\n * Find and return the first non null point in the data\n *\n * @private\n * @function Highcharts.Series.getFirstValidPoint\n * @param {Array} data\n * Array of options for points\n */\n getFirstValidPoint(data) {\n const dataLength = data.length;\n let i = 0, firstPoint = null;\n while (firstPoint === null && i < dataLength) {\n firstPoint = data[i];\n i++;\n }\n return firstPoint;\n }\n /**\n * Translate data points from raw data values to chart specific\n * positioning data needed later in the `drawPoints` and `drawGraph`\n * functions. This function can be overridden in plugins and custom\n * series type implementations.\n *\n * @function Highcharts.Series#translate\n *\n * @emits Highcharts.Series#events:translate\n */\n translate() {\n if (!this.processedXData) { // hidden series\n this.processData();\n }\n this.generatePoints();\n const series = this, options = series.options, stacking = options.stacking, xAxis = series.xAxis, categories = xAxis.categories, enabledDataSorting = series.enabledDataSorting, yAxis = series.yAxis, points = series.points, dataLength = points.length, pointPlacement = series.pointPlacementToXValue(), // #7860\n dynamicallyPlaced = Boolean(pointPlacement), threshold = options.threshold, stackThreshold = options.startFromThreshold ? threshold : 0;\n let i, plotX, lastPlotX, stackIndicator, closestPointRangePx = Number.MAX_VALUE;\n /**\n * Plotted coordinates need to be within a limited range. Drawing\n * too far outside the viewport causes various rendering issues\n * (#3201, #3923, #7555).\n * @private\n */\n function limitedRange(val) {\n return clamp(val, -1e5, 1e5);\n }\n // Translate each point\n for (i = 0; i < dataLength; i++) {\n const point = points[i], xValue = point.x;\n let stackItem, stackValues, yValue = point.y, lowValue = point.low;\n const stacks = stacking && yAxis.stacking?.stacks[(series.negStacks &&\n yValue <\n (stackThreshold ? 0 : threshold) ?\n '-' :\n '') + series.stackKey];\n plotX = xAxis.translate(// #3923\n xValue, false, false, false, true, pointPlacement);\n /**\n * The translated X value for the point in terms of pixels. Relative\n * to the X axis position if the series has one, otherwise relative\n * to the plot area. Depending on the series type this value might\n * not be defined.\n *\n * In an inverted chart the x-axis is going from the bottom to the\n * top so the `plotX` value is the number of pixels from the bottom\n * of the axis.\n *\n * @see Highcharts.Point#pos\n * @name Highcharts.Point#plotX\n * @type {number|undefined}\n */\n point.plotX = isNumber(plotX) ? correctFloat(// #5236\n limitedRange(plotX) // #3923\n ) : void 0;\n // Calculate the bottom y value for stacked series\n if (stacking &&\n series.visible &&\n stacks &&\n stacks[xValue]) {\n stackIndicator = series.getStackIndicator(stackIndicator, xValue, series.index);\n if (!point.isNull && stackIndicator.key) {\n stackItem = stacks[xValue];\n stackValues = stackItem.points[stackIndicator.key];\n }\n if (stackItem && isArray(stackValues)) {\n lowValue = stackValues[0];\n yValue = stackValues[1];\n if (lowValue === stackThreshold &&\n stackIndicator.key === stacks[xValue].base) {\n lowValue = pick(isNumber(threshold) ? threshold : yAxis.min);\n }\n // #1200, #1232\n if (yAxis.positiveValuesOnly &&\n defined(lowValue) &&\n lowValue <= 0) {\n lowValue = void 0;\n }\n point.total = point.stackTotal = pick(stackItem.total);\n point.percentage = defined(point.y) && stackItem.total ?\n (point.y / stackItem.total * 100) : void 0;\n point.stackY = yValue;\n // in case of variwide series (where widths of points are\n // different in most cases), stack labels are positioned\n // wrongly, so the call of the setOffset is omitted here and\n // labels are correctly positioned later, at the end of the\n // variwide's translate function (#10962)\n if (!series.irregularWidths) {\n stackItem.setOffset(series.pointXOffset || 0, series.barW || 0, void 0, void 0, void 0, series.xAxis);\n }\n }\n }\n // Set translated yBottom or remove it\n point.yBottom = defined(lowValue) ?\n limitedRange(yAxis.translate(lowValue, false, true, false, true)) :\n void 0;\n // General hook, used for Highcharts Stock compare and cumulative\n if (series.dataModify) {\n yValue = series.dataModify.modifyValue(yValue, i);\n }\n // Set the plotY value, reset it for redraws #3201, #18422\n let plotY;\n if (isNumber(yValue) && point.plotX !== void 0) {\n plotY = yAxis.translate(yValue, false, true, false, true);\n plotY = isNumber(plotY) ? limitedRange(plotY) : void 0;\n }\n /**\n * The translated Y value for the point in terms of pixels. Relative\n * to the Y axis position if the series has one, otherwise relative\n * to the plot area. Depending on the series type this value might\n * not be defined.\n *\n * In an inverted chart the y-axis is going from right to left\n * so the `plotY` value is the number of pixels from the right\n * of the `yAxis`.\n *\n * @see Highcharts.Point#pos\n * @name Highcharts.Point#plotY\n * @type {number|undefined}\n */\n point.plotY = plotY;\n point.isInside = this.isPointInside(point);\n // Set client related positions for mouse tracking\n point.clientX = dynamicallyPlaced ?\n correctFloat(xAxis.translate(xValue, false, false, false, true, pointPlacement)) :\n plotX; // #1514, #5383, #5518\n // Negative points #19028\n point.negative = (point.y || 0) < (threshold || 0);\n // some API data\n point.category = pick(categories && categories[point.x], point.x);\n // Determine auto enabling of markers (#3635, #5099)\n if (!point.isNull && point.visible !== false) {\n if (typeof lastPlotX !== 'undefined') {\n closestPointRangePx = Math.min(closestPointRangePx, Math.abs(plotX - lastPlotX));\n }\n lastPlotX = plotX;\n }\n // Find point zone\n point.zone = this.zones.length ? point.getZone() : void 0;\n // Animate new points with data sorting\n if (!point.graphic && series.group && enabledDataSorting) {\n point.isNew = true;\n }\n }\n series.closestPointRangePx = closestPointRangePx;\n fireEvent(this, 'afterTranslate');\n }\n /**\n * Return the series points with null points filtered out.\n *\n * @function Highcharts.Series#getValidPoints\n *\n * @param {Array} [points]\n * The points to inspect, defaults to {@link Series.points}.\n *\n * @param {boolean} [insideOnly=false]\n * Whether to inspect only the points that are inside the visible view.\n *\n * @param {boolean} [allowNull=false]\n * Whether to allow null points to pass as valid points.\n *\n * @return {Array}\n * The valid points.\n */\n getValidPoints(points, insideOnly, allowNull) {\n const chart = this.chart;\n // #3916, #5029, #5085\n return (points || this.points || []).filter(function (point) {\n const { plotX, plotY } = point, \n // Undefined plotY is treated as null when negative values\n // in log axis (#18422)\n asNull = !allowNull && (point.isNull || !isNumber(plotY));\n if (asNull || (insideOnly && !chart.isInsidePlot(plotX, plotY, { inverted: chart.inverted }))) {\n return false;\n }\n return point.visible !== false;\n });\n }\n /**\n * Get the clipping for the series. Could be called for a series to\n * initiate animating the clip or to set the final clip (only width\n * and x).\n *\n * @private\n * @function Highcharts.Series#getClip\n */\n getClipBox() {\n const { chart, xAxis, yAxis } = this;\n // If no axes on the series, use global clipBox\n let { x, y, width, height } = merge(chart.clipBox);\n // Otherwise, use clipBox.width which is corrected for plotBorderWidth\n // and clipOffset\n if (xAxis && xAxis.len !== chart.plotSizeX) {\n width = xAxis.len;\n }\n if (yAxis && yAxis.len !== chart.plotSizeY) {\n height = yAxis.len;\n }\n // If the chart is inverted and the series is not invertible, the chart\n // clip box should be inverted, but not the series clip box (#20264)\n if (chart.inverted && !this.invertible) {\n [width, height] = [height, width];\n }\n return { x, y, width, height };\n }\n /**\n * Get the shared clip key, creating it if it doesn't exist.\n *\n * @private\n * @function Highcharts.Series#getSharedClipKey\n */\n getSharedClipKey() {\n this.sharedClipKey = (this.options.xAxis || 0) + ',' +\n (this.options.yAxis || 0);\n return this.sharedClipKey;\n }\n /**\n * Set the clipping for the series. For animated series the clip is later\n * modified.\n *\n * @private\n * @function Highcharts.Series#setClip\n */\n setClip() {\n const { chart, group, markerGroup } = this, sharedClips = chart.sharedClips, renderer = chart.renderer, clipBox = this.getClipBox(), sharedClipKey = this.getSharedClipKey(); // #4526\n let clipRect = sharedClips[sharedClipKey];\n // If a clipping rectangle for the same set of axes does not exist,\n // create it\n if (!clipRect) {\n sharedClips[sharedClipKey] = clipRect = renderer.clipRect(clipBox);\n // When setting chart size, or when the series is rendered again before\n // starting animating, in compliance to a responsive rule\n }\n else {\n clipRect.animate(clipBox);\n }\n if (group) {\n // When clip is false, reset to no clip after animation\n group.clip(this.options.clip === false ? void 0 : clipRect);\n }\n // Unclip temporary animation clip\n if (markerGroup) {\n markerGroup.clip();\n }\n }\n /**\n * Animate in the series. Called internally twice. First with the `init`\n * parameter set to true, which sets up the initial state of the\n * animation. Then when ready, it is called with the `init` parameter\n * undefined, in order to perform the actual animation.\n *\n * @function Highcharts.Series#animate\n *\n * @param {boolean} [init]\n * Initialize the animation.\n */\n animate(init) {\n const { chart, group, markerGroup } = this, inverted = chart.inverted, animation = animObject(this.options.animation), \n // The key for temporary animation clips\n animationClipKey = [\n this.getSharedClipKey(),\n animation.duration,\n animation.easing,\n animation.defer\n ].join(',');\n let animationClipRect = chart.sharedClips[animationClipKey], markerAnimationClipRect = chart.sharedClips[animationClipKey + 'm'];\n // Initialize the animation. Set up the clipping rectangle.\n if (init && group) {\n const clipBox = this.getClipBox();\n // Create temporary animation clips\n if (!animationClipRect) {\n clipBox.width = 0;\n if (inverted) {\n clipBox.x = chart.plotHeight;\n }\n animationClipRect = chart.renderer.clipRect(clipBox);\n chart.sharedClips[animationClipKey] = animationClipRect;\n // The marker clip box. The number 99 is a safe margin to avoid\n // markers being clipped during animation.\n const markerClipBox = {\n x: inverted ? -99 : -99,\n y: inverted ? -99 : -99,\n width: inverted ? chart.plotWidth + 199 : 99,\n height: inverted ? 99 : chart.plotHeight + 199\n };\n markerAnimationClipRect = chart.renderer.clipRect(markerClipBox);\n chart.sharedClips[animationClipKey + 'm'] = markerAnimationClipRect;\n }\n else {\n // When height changes during animation, typically due to\n // responsive settings\n animationClipRect.attr('height', clipBox.height);\n }\n group.clip(animationClipRect);\n markerGroup?.clip(markerAnimationClipRect);\n // Run the animation\n }\n else if (animationClipRect &&\n // Only first series in this pane\n !animationClipRect.hasClass('highcharts-animating')) {\n const finalBox = this.getClipBox(), step = animation.step;\n // Only do this when there are actually markers, or we have multiple\n // series (#20473)\n if (markerGroup?.element.childNodes.length ||\n chart.series.length > 1) {\n // To provide as smooth animation as possible, update the marker\n // group clipping in steps of the main group animation\n animation.step = function (val, fx) {\n if (step) {\n step.apply(fx, arguments);\n }\n if (fx.prop === 'width' &&\n markerAnimationClipRect?.element) {\n markerAnimationClipRect.attr(inverted ? 'height' : 'width', val + 99);\n }\n };\n }\n animationClipRect\n .addClass('highcharts-animating')\n .animate(finalBox, animation);\n }\n }\n /**\n * This runs after animation to land on the final plot clipping.\n *\n * @private\n * @function Highcharts.Series#afterAnimate\n *\n * @emits Highcharts.Series#event:afterAnimate\n */\n afterAnimate() {\n this.setClip();\n // Destroy temporary clip rectangles that are no longer in use\n objectEach(this.chart.sharedClips, (clip, key, sharedClips) => {\n if (clip && !this.chart.container.querySelector(`[clip-path=\"url(#${clip.id})\"]`)) {\n clip.destroy();\n delete sharedClips[key];\n }\n });\n this.finishedAnimating = true;\n fireEvent(this, 'afterAnimate');\n }\n /**\n * Draw the markers for line-like series types, and columns or other\n * graphical representation for {@link Point} objects for other series\n * types. The resulting element is typically stored as\n * {@link Point.graphic}, and is created on the first call and updated\n * and moved on subsequent calls.\n *\n * @function Highcharts.Series#drawPoints\n */\n drawPoints(points = this.points) {\n const series = this, chart = series.chart, styledMode = chart.styledMode, { colorAxis, options } = series, seriesMarkerOptions = options.marker, markerGroup = series[series.specialGroup || 'markerGroup'], xAxis = series.xAxis, globallyEnabled = pick(seriesMarkerOptions.enabled, !xAxis || xAxis.isRadial ? true : null, \n // Use larger or equal as radius is null in bubbles (#6321)\n series.closestPointRangePx >= (seriesMarkerOptions.enabledThreshold *\n seriesMarkerOptions.radius));\n let i, point, graphic, verb, pointMarkerOptions, hasPointMarker, markerAttribs;\n if (seriesMarkerOptions.enabled !== false ||\n series._hasPointMarkers) {\n for (i = 0; i < points.length; i++) {\n point = points[i];\n graphic = point.graphic;\n verb = graphic ? 'animate' : 'attr';\n pointMarkerOptions = point.marker || {};\n hasPointMarker = !!point.marker;\n const shouldDrawMarker = ((globallyEnabled &&\n typeof pointMarkerOptions.enabled === 'undefined') || pointMarkerOptions.enabled) && !point.isNull && point.visible !== false;\n // only draw the point if y is defined\n if (shouldDrawMarker) {\n // Shortcuts\n const symbol = pick(pointMarkerOptions.symbol, series.symbol, 'rect');\n markerAttribs = series.markerAttribs(point, (point.selected && 'select'));\n // Set starting position for point sliding animation.\n if (series.enabledDataSorting) {\n point.startXPos = xAxis.reversed ?\n -(markerAttribs.width || 0) :\n xAxis.width;\n }\n const isInside = point.isInside !== false;\n if (!graphic &&\n isInside &&\n ((markerAttribs.width || 0) > 0 || point.hasImage)) {\n /**\n * SVG graphic representing the point in the chart. In\n * some cases it may be a hidden graphic to improve\n * accessibility.\n *\n * Typically this is a simple shape, like a `rect`\n * for column charts or `path` for line markers, but\n * for some complex series types like boxplot or 3D\n * charts, the graphic may be a `g` element\n * containing other shapes. The graphic is generated\n * the first time {@link Series#drawPoints} runs,\n * and updated and moved on subsequent runs.\n *\n * @see Highcharts.Point#graphics\n *\n * @name Highcharts.Point#graphic\n * @type {Highcharts.SVGElement|undefined}\n */\n point.graphic = graphic = chart.renderer\n .symbol(symbol, markerAttribs.x, markerAttribs.y, markerAttribs.width, markerAttribs.height, hasPointMarker ?\n pointMarkerOptions :\n seriesMarkerOptions)\n .add(markerGroup);\n // Sliding animation for new points\n if (series.enabledDataSorting &&\n chart.hasRendered) {\n graphic.attr({\n x: point.startXPos\n });\n verb = 'animate';\n }\n }\n if (graphic && verb === 'animate') { // update\n // Since the marker group isn't clipped, each\n // individual marker must be toggled\n graphic[isInside ? 'show' : 'hide'](isInside)\n .animate(markerAttribs);\n }\n // Presentational attributes\n if (graphic) {\n const pointAttr = series.pointAttribs(point, ((styledMode || !point.selected) ?\n void 0 :\n 'select'));\n if (!styledMode) {\n graphic[verb](pointAttr);\n }\n else if (colorAxis) { // #14114\n graphic['css']({\n fill: pointAttr.fill\n });\n }\n }\n if (graphic) {\n graphic.addClass(point.getClassName(), true);\n }\n }\n else if (graphic) {\n point.graphic = graphic.destroy(); // #1269\n }\n }\n }\n }\n /**\n * Get non-presentational attributes for a point. Used internally for\n * both styled mode and classic. Can be overridden for different series\n * types.\n *\n * @see Series#pointAttribs\n *\n * @function Highcharts.Series#markerAttribs\n *\n * @param {Highcharts.Point} point\n * The Point to inspect.\n *\n * @param {string} [state]\n * The state, can be either `hover`, `select` or undefined.\n *\n * @return {Highcharts.SVGAttributes}\n * A hash containing those attributes that are not settable from CSS.\n */\n markerAttribs(point, state) {\n const seriesOptions = this.options, seriesMarkerOptions = seriesOptions.marker, pointMarkerOptions = point.marker || {}, symbol = (pointMarkerOptions.symbol ||\n seriesMarkerOptions.symbol), attribs = {};\n let seriesStateOptions, pointStateOptions, radius = pick(pointMarkerOptions.radius, seriesMarkerOptions && seriesMarkerOptions.radius);\n // Handle hover and select states\n if (state) {\n seriesStateOptions = seriesMarkerOptions.states[state];\n pointStateOptions = pointMarkerOptions.states &&\n pointMarkerOptions.states[state];\n radius = pick(pointStateOptions && pointStateOptions.radius, seriesStateOptions && seriesStateOptions.radius, radius && radius + (seriesStateOptions && seriesStateOptions.radiusPlus ||\n 0));\n }\n point.hasImage = symbol && symbol.indexOf('url') === 0;\n if (point.hasImage) {\n radius = 0; // and subsequently width and height is not set\n }\n const pos = point.pos();\n if (isNumber(radius) && pos) {\n attribs.x = pos[0] - radius;\n attribs.y = pos[1] - radius;\n if (seriesOptions.crisp) {\n // Math.floor for #1843:\n attribs.x = Math.floor(attribs.x);\n }\n }\n if (radius) {\n attribs.width = attribs.height = 2 * radius;\n }\n return attribs;\n }\n /**\n * Internal function to get presentational attributes for each point.\n * Unlike {@link Series#markerAttribs}, this function should return\n * those attributes that can also be set in CSS. In styled mode,\n * `pointAttribs` won't be called.\n *\n * @private\n * @function Highcharts.Series#pointAttribs\n *\n * @param {Highcharts.Point} [point]\n * The point instance to inspect.\n *\n * @param {string} [state]\n * The point state, can be either `hover`, `select` or 'normal'. If\n * undefined, normal state is assumed.\n *\n * @return {Highcharts.SVGAttributes}\n * The presentational attributes to be set on the point.\n */\n pointAttribs(point, state) {\n const seriesMarkerOptions = this.options.marker, pointOptions = point && point.options, pointMarkerOptions = ((pointOptions && pointOptions.marker) || {}), pointColorOption = pointOptions && pointOptions.color, pointColor = point && point.color, zoneColor = point && point.zone && point.zone.color;\n let seriesStateOptions, pointStateOptions, color = this.color, fill, stroke, strokeWidth = pick(pointMarkerOptions.lineWidth, seriesMarkerOptions.lineWidth), opacity = 1;\n color = (pointColorOption ||\n zoneColor ||\n pointColor ||\n color);\n fill = (pointMarkerOptions.fillColor ||\n seriesMarkerOptions.fillColor ||\n color);\n stroke = (pointMarkerOptions.lineColor ||\n seriesMarkerOptions.lineColor ||\n color);\n // Handle hover and select states\n state = state || 'normal';\n if (state) {\n seriesStateOptions = (seriesMarkerOptions.states[state] || {});\n pointStateOptions = (pointMarkerOptions.states &&\n pointMarkerOptions.states[state]) || {};\n strokeWidth = pick(pointStateOptions.lineWidth, seriesStateOptions.lineWidth, strokeWidth + pick(pointStateOptions.lineWidthPlus, seriesStateOptions.lineWidthPlus, 0));\n fill = (pointStateOptions.fillColor ||\n seriesStateOptions.fillColor ||\n fill);\n stroke = (pointStateOptions.lineColor ||\n seriesStateOptions.lineColor ||\n stroke);\n opacity = pick(pointStateOptions.opacity, seriesStateOptions.opacity, opacity);\n }\n return {\n 'stroke': stroke,\n 'stroke-width': strokeWidth,\n 'fill': fill,\n 'opacity': opacity\n };\n }\n /**\n * Clear DOM objects and free up memory.\n *\n * @private\n * @function Highcharts.Series#destroy\n *\n * @emits Highcharts.Series#event:destroy\n */\n destroy(keepEventsForUpdate) {\n const series = this, chart = series.chart, issue134 = /AppleWebKit\\/533/.test(win.navigator.userAgent), data = series.data || [];\n let destroy, i, point, axis;\n // Add event hook\n fireEvent(series, 'destroy', { keepEventsForUpdate });\n // Remove events\n this.removeEvents(keepEventsForUpdate);\n // Erase from axes\n (series.axisTypes || []).forEach(function (AXIS) {\n axis = series[AXIS];\n if (axis && axis.series) {\n erase(axis.series, series);\n axis.isDirty = axis.forceRedraw = true;\n }\n });\n // Remove legend items\n if (series.legendItem) {\n series.chart.legend.destroyItem(series);\n }\n // Destroy all points with their elements\n i = data.length;\n while (i--) {\n point = data[i];\n if (point && point.destroy) {\n point.destroy();\n }\n }\n for (const zone of series.zones) {\n // Destroy SVGElement's but preserve primitive props (#20426)\n destroyObjectProperties(zone, void 0, true);\n }\n // Clear the animation timeout if we are destroying the series\n // during initial animation\n U.clearTimeout(series.animationTimeout);\n // Destroy all SVGElements associated to the series\n objectEach(series, function (val, prop) {\n // Survive provides a hook for not destroying\n if (val instanceof SVGElement && !val.survive) {\n // Issue 134 workaround\n destroy = issue134 && prop === 'group' ?\n 'hide' :\n 'destroy';\n val[destroy]();\n }\n });\n // Remove from hoverSeries\n if (chart.hoverSeries === series) {\n chart.hoverSeries = void 0;\n }\n erase(chart.series, series);\n chart.orderItems('series');\n // Clear all members\n objectEach(series, function (val, prop) {\n if (!keepEventsForUpdate || prop !== 'hcEvents') {\n delete series[prop];\n }\n });\n }\n /**\n * Clip the graphs into zones for colors and styling.\n *\n * @private\n * @function Highcharts.Series#applyZones\n */\n applyZones() {\n const series = this, { area, chart, graph, zones, points, xAxis, yAxis, zoneAxis } = series, { inverted, renderer } = chart, axis = this[`${zoneAxis}Axis`], { isXAxis, len = 0 } = axis || {}, halfWidth = (graph?.strokeWidth() || 0) / 2 + 1, \n // Avoid points that are so close to the threshold that the graph\n // line would be split\n avoidClose = (zone, plotX = 0, plotY = 0) => {\n if (inverted) {\n plotY = len - plotY;\n }\n const { translated = 0, lineClip } = zone, distance = plotY - translated;\n lineClip?.push([\n 'L',\n plotX,\n Math.abs(distance) < halfWidth ?\n plotY - halfWidth * (distance <= 0 ? -1 : 1) :\n translated\n ]);\n };\n if (zones.length &&\n (graph || area) &&\n axis &&\n isNumber(axis.min)) {\n const axisMax = axis.getExtremes().max, \n // Invert the x and y coordinates of inverted charts\n invertPath = (path) => {\n path.forEach((segment, i) => {\n if (segment[0] === 'M' || segment[0] === 'L') {\n path[i] = [\n segment[0],\n isXAxis ? len - segment[1] : segment[1],\n isXAxis ? segment[2] : len - segment[2]\n ];\n }\n });\n };\n // Reset\n zones.forEach((zone) => {\n zone.lineClip = [];\n zone.translated = clamp(axis.toPixels(pick(zone.value, axisMax), true) || 0, 0, len);\n });\n // The use of the Color Threshold assumes there are no gaps so it is\n // safe to hide the original graph and area unless it is not\n // waterfall series, then use showLine property to set lines between\n // columns to be visible (#7862)\n if (graph && !this.showLine) {\n graph.hide();\n }\n if (area) {\n area.hide();\n }\n // Prepare for adaptive clips, avoiding segments close to the\n // threshold (#19709)\n if (zoneAxis === 'y' &&\n // Overheat protection\n points.length < xAxis.len) {\n for (const point of points) {\n const { plotX, plotY, zone } = point, zoneBelow = zone && zones[zones.indexOf(zone) - 1];\n // Close to upper boundary\n if (zone) {\n avoidClose(zone, plotX, plotY);\n }\n // Close to lower boundary\n if (zoneBelow) {\n avoidClose(zoneBelow, plotX, plotY);\n }\n }\n }\n // Compute and apply the clips\n let lastLineClip = [], lastTranslated = axis.toPixels(axis.getExtremes().min, true);\n zones.forEach((zone) => {\n const lineClip = zone.lineClip || [], translated = Math.round(zone.translated || 0);\n if (xAxis.reversed) {\n lineClip.reverse();\n }\n let { clip, simpleClip } = zone, x1 = 0, y1 = 0, x2 = xAxis.len, y2 = yAxis.len;\n if (isXAxis) {\n x1 = translated;\n x2 = lastTranslated;\n }\n else {\n y1 = translated;\n y2 = lastTranslated;\n }\n // Adaptive clips\n const simplePath = [\n ['M', x1, y1],\n ['L', x2, y1],\n ['L', x2, y2],\n ['L', x1, y2],\n ['Z']\n ], adaptivePath = [\n simplePath[0],\n ...lineClip,\n simplePath[1],\n simplePath[2],\n ...lastLineClip,\n simplePath[3],\n simplePath[4]\n ];\n lastLineClip = lineClip.reverse();\n lastTranslated = translated;\n if (inverted) {\n invertPath(adaptivePath);\n if (area) {\n invertPath(simplePath);\n }\n }\n /* Debug clip paths\n chart.renderer.path(adaptivePath)\n .attr({\n stroke: zone.color || this.color || 'gray',\n 'stroke-width': 1,\n 'dashstyle': 'Dash'\n })\n .add(series.group);\n // */\n if (clip) {\n clip.animate({ d: adaptivePath });\n simpleClip?.animate({ d: simplePath });\n }\n else {\n clip = zone.clip = renderer.path(adaptivePath);\n if (area) {\n simpleClip = zone.simpleClip = renderer.path(simplePath);\n }\n }\n // When no data, graph zone is not applied and after setData\n // clip was ignored. As a result, it should be applied each\n // time.\n if (graph) {\n zone.graph?.clip(clip);\n }\n if (area) {\n zone.area?.clip(simpleClip);\n }\n });\n }\n else if (series.visible) {\n // If zones were removed, restore graph and area\n if (graph) {\n graph.show();\n }\n if (area) {\n area.show();\n }\n }\n }\n /**\n * General abstraction for creating plot groups like series.group,\n * series.dataLabelsGroup and series.markerGroup. On subsequent calls,\n * the group will only be adjusted to the updated plot size.\n *\n * @private\n * @function Highcharts.Series#plotGroup\n */\n plotGroup(prop, name, visibility, zIndex, parent) {\n let group = this[prop];\n const isNew = !group, attrs = {\n visibility,\n zIndex: zIndex || 0.1 // Pointer logic uses this\n };\n // Avoid setting undefined opacity, or in styled mode\n if (defined(this.opacity) &&\n !this.chart.styledMode && this.state !== 'inactive' // #13719\n ) {\n attrs.opacity = this.opacity;\n }\n // Generate it on first call\n if (!group) {\n this[prop] = group = this.chart.renderer\n .g()\n .add(parent);\n }\n // Add the class names, and replace existing ones as response to\n // Series.update (#6660)\n group.addClass(('highcharts-' + name +\n ' highcharts-series-' + this.index +\n ' highcharts-' + this.type + '-series ' +\n (defined(this.colorIndex) ?\n 'highcharts-color-' + this.colorIndex + ' ' :\n '') +\n (this.options.className || '') +\n (group.hasClass('highcharts-tracker') ?\n ' highcharts-tracker' :\n '')), true);\n // Place it on first and subsequent (redraw) calls\n group.attr(attrs)[isNew ? 'attr' : 'animate'](this.getPlotBox(name));\n return group;\n }\n /**\n * Get the translation and scale for the plot area of this series.\n *\n * @function Highcharts.Series#getPlotBox\n */\n getPlotBox(name) {\n let horAxis = this.xAxis, vertAxis = this.yAxis;\n const chart = this.chart, inverted = (chart.inverted &&\n !chart.polar &&\n horAxis &&\n this.invertible &&\n name === 'series');\n // Swap axes for inverted (#2339)\n if (chart.inverted) {\n horAxis = vertAxis;\n vertAxis = this.xAxis;\n }\n return {\n translateX: horAxis ? horAxis.left : chart.plotLeft,\n translateY: vertAxis ? vertAxis.top : chart.plotTop,\n rotation: inverted ? 90 : 0,\n rotationOriginX: inverted ?\n (horAxis.len - vertAxis.len) / 2 :\n 0,\n rotationOriginY: inverted ?\n (horAxis.len + vertAxis.len) / 2 :\n 0,\n scaleX: inverted ? -1 : 1,\n scaleY: 1\n };\n }\n /**\n * Removes the event handlers attached previously with addEvents.\n * @private\n * @function Highcharts.Series#removeEvents\n */\n removeEvents(keepEventsForUpdate) {\n const { eventsToUnbind } = this;\n if (!keepEventsForUpdate) {\n // Remove all events\n removeEvent(this);\n }\n if (eventsToUnbind.length) {\n // Remove only internal events for proper update. #12355 solves\n // problem with multiple destroy events\n eventsToUnbind.forEach((unbind) => {\n unbind();\n });\n eventsToUnbind.length = 0;\n }\n }\n /**\n * Render the graph and markers. Called internally when first rendering\n * and later when redrawing the chart. This function can be extended in\n * plugins, but normally shouldn't be called directly.\n *\n * @function Highcharts.Series#render\n *\n * @emits Highcharts.Series#event:afterRender\n */\n render() {\n const series = this, { chart, options, hasRendered } = series, animOptions = animObject(options.animation), visibility = series.visible ?\n 'inherit' : 'hidden', // #2597\n zIndex = options.zIndex, chartSeriesGroup = chart.seriesGroup;\n let animDuration = series.finishedAnimating ?\n 0 : animOptions.duration;\n fireEvent(this, 'render');\n // The group\n series.plotGroup('group', 'series', visibility, zIndex, chartSeriesGroup);\n series.markerGroup = series.plotGroup('markerGroup', 'markers', visibility, zIndex, chartSeriesGroup);\n // Initial clipping, applies to columns etc. (#3839).\n if (options.clip !== false) {\n series.setClip();\n }\n // Initialize the animation\n if (animDuration) {\n series.animate?.(true);\n }\n // Draw the graph if any\n if (series.drawGraph) {\n series.drawGraph();\n series.applyZones();\n }\n // Draw the points\n if (series.visible) {\n series.drawPoints();\n }\n // Draw the data labels\n series.drawDataLabels?.();\n // In pie charts, slices are added to the DOM, but actual rendering\n // is postponed until labels reserved their space\n series.redrawPoints?.();\n // Draw the mouse tracking area\n if (options.enableMouseTracking) {\n series.drawTracker?.();\n }\n // Run the animation\n if (animDuration) {\n series.animate?.();\n }\n // Call the afterAnimate function on animation complete (but don't\n // overwrite the animation.complete option which should be available\n // to the user).\n if (!hasRendered) {\n // Additional time if defer is defined before afterAnimate\n // will be triggered\n if (animDuration && animOptions.defer) {\n animDuration += animOptions.defer;\n }\n series.animationTimeout = syncTimeout(() => {\n series.afterAnimate();\n }, animDuration || 0);\n }\n // Means data is in accordance with what you see\n series.isDirty = false;\n // (See #322) series.isDirty = series.isDirtyData = false; // means\n // data is in accordance with what you see\n series.hasRendered = true;\n fireEvent(series, 'afterRender');\n }\n /**\n * Redraw the series. This function is called internally from\n * `chart.redraw` and normally shouldn't be called directly.\n * @private\n * @function Highcharts.Series#redraw\n */\n redraw() {\n // Cache it here as it is set to false in render, but used after\n const wasDirty = this.isDirty || this.isDirtyData;\n this.translate();\n this.render();\n if (wasDirty) { // #3868, #3945\n delete this.kdTree;\n }\n }\n /**\n * Whether to reserve space for the series, either because it is visible or\n * because the `chart.ignoreHiddenSeries` option is false.\n *\n * @private\n */\n reserveSpace() {\n return this.visible || !this.chart.options.chart.ignoreHiddenSeries;\n }\n /**\n * Find the nearest point from a pointer event. This applies to series that\n * use k-d-trees to get the nearest point. Native pointer events must be\n * normalized using `Pointer.normalize`, that adds `chartX` and `chartY`\n * properties.\n *\n * @sample highcharts/demo/synchronized-charts\n * Synchronized charts with tooltips\n *\n * @function Highcharts.Series#searchPoint\n *\n * @param {Highcharts.PointerEvent} e\n * The normalized pointer event\n * @param {boolean} [compareX=false]\n * Search only by the X value, not Y\n *\n * @return {Point|undefined}\n * The closest point to the pointer event\n */\n searchPoint(e, compareX) {\n const { xAxis, yAxis } = this, inverted = this.chart.inverted;\n return this.searchKDTree({\n clientX: inverted ?\n xAxis.len - e.chartY + xAxis.pos :\n e.chartX - xAxis.pos,\n plotY: inverted ?\n yAxis.len - e.chartX + yAxis.pos :\n e.chartY - yAxis.pos\n }, compareX, e);\n }\n /**\n * Build the k-d-tree that is used by mouse and touch interaction to get\n * the closest point. Line-like series typically have a one-dimensional\n * tree where points are searched along the X axis, while scatter-like\n * series typically search in two dimensions, X and Y.\n *\n * @private\n * @function Highcharts.Series#buildKDTree\n */\n buildKDTree(e) {\n // Prevent multiple k-d-trees from being built simultaneously\n // (#6235)\n this.buildingKdTree = true;\n const series = this, dimensions = series.options.findNearestPointBy\n .indexOf('y') > -1 ? 2 : 1;\n /**\n * Internal function\n * @private\n */\n function kdtree(points, depth, dimensions) {\n const length = points?.length;\n let axis, median;\n if (length) {\n // Alternate between the axis\n axis = series.kdAxisArray[depth % dimensions];\n // Sort point array\n points.sort((a, b) => (a[axis] || 0) - (b[axis] || 0));\n median = Math.floor(length / 2);\n // Build and return node\n return {\n point: points[median],\n left: kdtree(points.slice(0, median), depth + 1, dimensions),\n right: kdtree(points.slice(median + 1), depth + 1, dimensions)\n };\n }\n }\n /**\n * Start the recursive build process with a clone of the points\n * array and null points filtered out. (#3873)\n * @private\n */\n function startRecursive() {\n series.kdTree = kdtree(series.getValidPoints(void 0, \n // For line-type series restrict to plot area, but\n // column-type series not (#3916, #4511)\n !series.directTouch), dimensions, dimensions);\n series.buildingKdTree = false;\n }\n delete series.kdTree;\n // For testing tooltips, don't build async. Also if touchstart, we may\n // be dealing with click events on mobile, so don't delay (#6817).\n syncTimeout(startRecursive, series.options.kdNow || e?.type === 'touchstart' ? 0 : 1);\n }\n /**\n * @private\n * @function Highcharts.Series#searchKDTree\n */\n searchKDTree(point, compareX, e) {\n const series = this, [kdX, kdY] = this.kdAxisArray, kdComparer = compareX ? 'distX' : 'dist', kdDimensions = (series.options.findNearestPointBy || '')\n .indexOf('y') > -1 ? 2 : 1, useRadius = !!series.isBubble;\n /**\n * Set the one and two dimensional distance on the point object.\n * @private\n */\n function setDistance(p1, p2) {\n const p1kdX = p1[kdX], p2kdX = p2[kdX], x = (defined(p1kdX) && defined(p2kdX)) ? p1kdX - p2kdX : null, p1kdY = p1[kdY], p2kdY = p2[kdY], y = (defined(p1kdY) && defined(p2kdY)) ? p1kdY - p2kdY : 0, radius = useRadius ? (p2.marker?.radius || 0) : 0;\n p2.dist = Math.sqrt(((x && x * x) || 0) + y * y) - radius;\n p2.distX = defined(x) ? (Math.abs(x) - radius) : Number.MAX_VALUE;\n }\n /**\n * @private\n */\n function doSearch(search, tree, depth, dimensions) {\n const point = tree.point, axis = series.kdAxisArray[depth % dimensions];\n let nPoint1, nPoint2, ret = point;\n setDistance(search, point);\n // Pick side based on distance to splitting point\n const tdist = (search[axis] || 0) - (point[axis] || 0) +\n (useRadius ? (point.marker?.radius || 0) : 0), sideA = tdist < 0 ? 'left' : 'right', sideB = tdist < 0 ? 'right' : 'left';\n // End of tree\n if (tree[sideA]) {\n nPoint1 = doSearch(search, tree[sideA], depth + 1, dimensions);\n ret = (nPoint1[kdComparer] <\n ret[kdComparer] ?\n nPoint1 :\n point);\n }\n if (tree[sideB]) {\n // Compare distance to current best to splitting point to decide\n // whether to check side B or not\n if (Math.sqrt(tdist * tdist) < ret[kdComparer]) {\n nPoint2 = doSearch(search, tree[sideB], depth + 1, dimensions);\n ret = (nPoint2[kdComparer] <\n ret[kdComparer] ?\n nPoint2 :\n ret);\n }\n }\n return ret;\n }\n if (!this.kdTree && !this.buildingKdTree) {\n this.buildKDTree(e);\n }\n if (this.kdTree) {\n return doSearch(point, this.kdTree, kdDimensions, kdDimensions);\n }\n }\n /**\n * @private\n * @function Highcharts.Series#pointPlacementToXValue\n */\n pointPlacementToXValue() {\n const { options, xAxis } = this;\n let factor = options.pointPlacement;\n // Point placement is relative to each series pointRange (#5889)\n if (factor === 'between') {\n factor = xAxis.reversed ? -0.5 : 0.5; // #11955\n }\n return isNumber(factor) ?\n factor * (options.pointRange || xAxis.pointRange) :\n 0;\n }\n /**\n * @private\n * @function Highcharts.Series#isPointInside\n */\n isPointInside(point) {\n const { chart, xAxis, yAxis } = this, { plotX = -1, plotY = -1 } = point, isInside = (plotY >= 0 &&\n plotY <= (yAxis ? yAxis.len : chart.plotHeight) &&\n plotX >= 0 &&\n plotX <= (xAxis ? xAxis.len : chart.plotWidth));\n return isInside;\n }\n /**\n * Draw the tracker object that sits above all data labels and markers to\n * track mouse events on the graph or points. For the line type charts\n * the tracker uses the same graphPath, but with a greater stroke width\n * for better control.\n * @private\n */\n drawTracker() {\n const series = this, options = series.options, trackByArea = options.trackByArea, trackerPath = [].concat((trackByArea ? series.areaPath : series.graphPath) || []), chart = series.chart, pointer = chart.pointer, renderer = chart.renderer, snap = chart.options.tooltip?.snap || 0, onMouseOver = () => {\n if (options.enableMouseTracking &&\n chart.hoverSeries !== series) {\n series.onMouseOver();\n }\n }, \n /*\n * Empirical lowest possible opacities for TRACKER_FILL for an\n * element to stay invisible but clickable\n * IE9: 0.00000000001 (unlimited)\n * IE10: 0.0001 (exporting only)\n * FF: 0.00000000001 (unlimited)\n * Chrome: 0.000001\n * Safari: 0.000001\n * Opera: 0.00000000001 (unlimited)\n */\n TRACKER_FILL = 'rgba(192,192,192,' + (svg ? 0.0001 : 0.002) + ')';\n let tracker = series.tracker;\n // Draw the tracker\n if (tracker) {\n tracker.attr({ d: trackerPath });\n }\n else if (series.graph) { // Create\n series.tracker = tracker = renderer.path(trackerPath)\n .attr({\n visibility: series.visible ? 'inherit' : 'hidden',\n zIndex: 2\n })\n .addClass(trackByArea ?\n 'highcharts-tracker-area' :\n 'highcharts-tracker-line')\n .add(series.group);\n if (!chart.styledMode) {\n tracker.attr({\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n stroke: TRACKER_FILL,\n fill: trackByArea ? TRACKER_FILL : 'none',\n 'stroke-width': series.graph.strokeWidth() +\n (trackByArea ? 0 : 2 * snap)\n });\n }\n // The tracker is added to the series group, which is clipped, but\n // is covered by the marker group. So the marker group also needs to\n // capture events.\n [\n series.tracker,\n series.markerGroup,\n series.dataLabelsGroup\n ].forEach((tracker) => {\n if (tracker) {\n tracker.addClass('highcharts-tracker')\n .on('mouseover', onMouseOver)\n .on('mouseout', (e) => {\n pointer?.onTrackerMouseOut(e);\n });\n if (options.cursor && !chart.styledMode) {\n tracker.css({ cursor: options.cursor });\n }\n tracker.on('touchstart', onMouseOver);\n }\n });\n }\n fireEvent(this, 'afterDrawTracker');\n }\n /**\n * Add a point to the series after render time. The point can be added at\n * the end, or by giving it an X value, to the start or in the middle of the\n * series.\n *\n * @sample highcharts/members/series-addpoint-append/\n * Append point\n * @sample highcharts/members/series-addpoint-append-and-shift/\n * Append and shift\n * @sample highcharts/members/series-addpoint-x-and-y/\n * Both X and Y values given\n * @sample highcharts/members/series-addpoint-pie/\n * Append pie slice\n * @sample stock/members/series-addpoint/\n * Append 100 points in Highcharts Stock\n * @sample stock/members/series-addpoint-shift/\n * Append and shift in Highcharts Stock\n * @sample maps/members/series-addpoint/\n * Add a point in Highmaps\n *\n * @function Highcharts.Series#addPoint\n *\n * @param {Highcharts.PointOptionsType} options\n * The point options. If options is a single number, a point with\n * that y value is appended to the series. If it is an array, it will\n * be interpreted as x and y values respectively. If it is an\n * object, advanced options as outlined under `series.data` are\n * applied.\n *\n * @param {boolean} [redraw=true]\n * Whether to redraw the chart after the point is added. When adding\n * more than one point, it is highly recommended that the redraw\n * option be set to false, and instead {@link Chart#redraw} is\n * explicitly called after the adding of points is finished.\n * Otherwise, the chart will redraw after adding each point.\n *\n * @param {boolean} [shift=false]\n * If true, a point is shifted off the start of the series as one is\n * appended to the end.\n *\n * @param {boolean|Partial} [animation]\n * Whether to apply animation, and optionally animation\n * configuration.\n *\n * @param {boolean} [withEvent=true]\n * Used internally, whether to fire the series `addPoint` event.\n *\n * @emits Highcharts.Series#event:addPoint\n */\n addPoint(options, redraw, shift, animation, withEvent) {\n const series = this, seriesOptions = series.options, data = series.data, chart = series.chart, xAxis = series.xAxis, names = xAxis && xAxis.hasNames && xAxis.names, dataOptions = seriesOptions.data, xData = series.xData;\n let isInTheMiddle, i;\n // Optional redraw, defaults to true\n redraw = pick(redraw, true);\n // Get options and push the point to xData, yData and series.options. In\n // series.generatePoints the Point instance will be created on demand\n // and pushed to the series.data array.\n const point = { series: series };\n series.pointClass.prototype.applyOptions.apply(point, [options]);\n const x = point.x;\n // Get the insertion point\n i = xData.length;\n if (series.requireSorting && x < xData[i - 1]) {\n isInTheMiddle = true;\n while (i && xData[i - 1] > x) {\n i--;\n }\n }\n // Insert undefined item\n series.updateParallelArrays(point, 'splice', [i, 0, 0]);\n // Update it\n series.updateParallelArrays(point, i);\n if (names && point.name) {\n names[x] = point.name;\n }\n dataOptions.splice(i, 0, options);\n if (isInTheMiddle ||\n // When processedData is present we need to splice an empty slot\n // into series.data, otherwise generatePoints won't pick it up.\n series.processedData) {\n series.data.splice(i, 0, null);\n series.processData();\n }\n // Generate points to be added to the legend (#1329)\n if (seriesOptions.legendType === 'point') {\n series.generatePoints();\n }\n // Shift the first point off the parallel arrays\n if (shift) {\n if (data[0] && !!data[0].remove) {\n data[0].remove(false);\n }\n else {\n data.shift();\n series.updateParallelArrays(point, 'shift');\n dataOptions.shift();\n }\n }\n // Fire event\n if (withEvent !== false) {\n fireEvent(series, 'addPoint', { point: point });\n }\n // redraw\n series.isDirty = true;\n series.isDirtyData = true;\n if (redraw) {\n chart.redraw(animation); // Animation is set anyway on redraw, #5665\n }\n }\n /**\n * Remove a point from the series. Unlike the\n * {@link Highcharts.Point#remove} method, this can also be done on a point\n * that is not instantiated because it is outside the view or subject to\n * Highcharts Stock data grouping.\n *\n * @sample highcharts/members/series-removepoint/\n * Remove cropped point\n *\n * @function Highcharts.Series#removePoint\n *\n * @param {number} i\n * The index of the point in the {@link Highcharts.Series.data|data}\n * array.\n *\n * @param {boolean} [redraw=true]\n * Whether to redraw the chart after the point is added. When\n * removing more than one point, it is highly recommended that the\n * `redraw` option be set to `false`, and instead {@link\n * Highcharts.Chart#redraw} is explicitly called after the adding of\n * points is finished.\n *\n * @param {boolean|Partial} [animation]\n * Whether and optionally how the series should be animated.\n *\n * @emits Highcharts.Point#event:remove\n */\n removePoint(i, redraw, animation) {\n const series = this, data = series.data, point = data[i], points = series.points, chart = series.chart, remove = function () {\n if (points && points.length === data.length) { // #4935\n points.splice(i, 1);\n }\n data.splice(i, 1);\n series.options.data.splice(i, 1);\n series.updateParallelArrays(point || { series: series }, 'splice', [i, 1]);\n if (point) {\n point.destroy();\n }\n // redraw\n series.isDirty = true;\n series.isDirtyData = true;\n if (redraw) {\n chart.redraw();\n }\n };\n setAnimation(animation, chart);\n redraw = pick(redraw, true);\n // Fire the event with a default handler of removing the point\n if (point) {\n point.firePointEvent('remove', null, remove);\n }\n else {\n remove();\n }\n }\n /**\n * Remove a series and optionally redraw the chart.\n *\n * @sample highcharts/members/series-remove/\n * Remove first series from a button\n *\n * @function Highcharts.Series#remove\n *\n * @param {boolean} [redraw=true]\n * Whether to redraw the chart or wait for an explicit call to\n * {@link Highcharts.Chart#redraw}.\n *\n * @param {boolean|Partial} [animation]\n * Whether to apply animation, and optionally animation\n * configuration.\n *\n * @param {boolean} [withEvent=true]\n * Used internally, whether to fire the series `remove` event.\n *\n * @emits Highcharts.Series#event:remove\n */\n remove(redraw, animation, withEvent, keepEvents) {\n const series = this, chart = series.chart;\n /**\n * @private\n */\n function remove() {\n // Destroy elements\n series.destroy(keepEvents);\n // Redraw\n chart.isDirtyLegend = chart.isDirtyBox = true;\n chart.linkSeries(keepEvents);\n if (pick(redraw, true)) {\n chart.redraw(animation);\n }\n }\n // Fire the event with a default handler of removing the point\n if (withEvent !== false) {\n fireEvent(series, 'remove', null, remove);\n }\n else {\n remove();\n }\n }\n /**\n * Update the series with a new set of options. For a clean and precise\n * handling of new options, all methods and elements from the series are\n * removed, and it is initialized from scratch. Therefore, this method is\n * more performance expensive than some other utility methods like {@link\n * Series#setData} or {@link Series#setVisible}.\n *\n * Note that `Series.update` may mutate the passed `data` options.\n *\n * @sample highcharts/members/series-update/\n * Updating series options\n * @sample maps/members/series-update/\n * Update series options in Highmaps\n *\n * @function Highcharts.Series#update\n *\n * @param {Highcharts.SeriesOptionsType} options\n * New options that will be merged with the series' existing options.\n *\n * @param {boolean} [redraw=true]\n * Whether to redraw the chart after the series is altered. If doing\n * more operations on the chart, it is a good idea to set redraw to\n * false and call {@link Chart#redraw} after.\n *\n * @emits Highcharts.Series#event:update\n * @emits Highcharts.Series#event:afterUpdate\n */\n update(options, redraw) {\n options = diffObjects(options, this.userOptions);\n fireEvent(this, 'update', { options: options });\n const series = this, chart = series.chart, \n // must use user options when changing type because series.options\n // is merged in with type specific plotOptions\n oldOptions = series.userOptions, initialType = series.initialType || series.type, plotOptions = chart.options.plotOptions, initialSeriesProto = seriesTypes[initialType].prototype, groups = [\n 'group',\n 'markerGroup',\n 'dataLabelsGroup',\n 'transformGroup'\n ], optionsToCheck = [\n 'dataGrouping',\n 'pointStart',\n 'pointInterval',\n 'pointIntervalUnit',\n 'keys'\n ], \n // Animation must be enabled when calling update before the initial\n // animation has first run. This happens when calling update\n // directly after chart initialization, or when applying responsive\n // rules (#6912).\n animation = series.finishedAnimating && { animation: false }, kinds = {};\n let seriesOptions, n, preserve = [\n 'colorIndex',\n 'eventOptions',\n 'navigatorSeries',\n 'symbolIndex',\n 'baseSeries'\n ], newType = (options.type ||\n oldOptions.type ||\n chart.options.chart.type);\n const keepPoints = !(\n // Indicators, histograms etc recalculate the data. It should be\n // possible to omit this.\n this.hasDerivedData ||\n // New type requires new point classes\n (newType && newType !== this.type) ||\n // New options affecting how the data points are built\n typeof options.pointStart !== 'undefined' ||\n typeof options.pointInterval !== 'undefined' ||\n typeof options.relativeXValue !== 'undefined' ||\n options.joinBy ||\n options.mapData || // #11636\n // Changes to data grouping requires new points in new group\n optionsToCheck.some((option) => series.hasOptionChanged(option)));\n newType = newType || initialType;\n if (keepPoints) {\n preserve.push('data', 'isDirtyData', \n // GeoHeatMap interpolation\n 'isDirtyCanvas', 'points', 'processedData', // #17057\n 'processedXData', 'processedYData', 'xIncrement', 'cropped', '_hasPointMarkers', 'hasDataLabels', \n // Networkgraph (#14397)\n 'nodes', 'layout', \n // Treemap\n 'level', \n // Map specific, consider moving it to series-specific preserve-\n // properties (#10617)\n 'mapMap', 'mapData', 'minY', 'maxY', 'minX', 'maxX', 'transformGroups' // #18857\n );\n if (options.visible !== false) {\n preserve.push('area', 'graph');\n }\n series.parallelArrays.forEach(function (key) {\n preserve.push(key + 'Data');\n });\n if (options.data) {\n // setData uses dataSorting options so we need to update them\n // earlier\n if (options.dataSorting) {\n extend(series.options.dataSorting, options.dataSorting);\n }\n this.setData(options.data, false);\n }\n }\n // Do the merge, with some forced options\n options = merge(oldOptions, {\n // When oldOptions.index is null it should't be cleared.\n // Otherwise navigator series will have wrong indexes (#10193).\n index: oldOptions.index === void 0 ?\n series.index : oldOptions.index,\n pointStart: \n // When updating from blank (#7933)\n plotOptions?.series?.pointStart ??\n oldOptions.pointStart ??\n // When updating after addPoint\n series.xData?.[0]\n }, !keepPoints && { data: series.options.data }, options, animation);\n // Merge does not merge arrays, but replaces them. Since points were\n // updated, `series.options.data` has correct merged options, use it:\n if (keepPoints && options.data) {\n options.data = series.options.data;\n }\n // Make sure preserved properties are not destroyed (#3094)\n preserve = groups.concat(preserve);\n preserve.forEach(function (prop) {\n preserve[prop] = series[prop];\n delete series[prop];\n });\n let casting = false;\n if (seriesTypes[newType]) {\n casting = newType !== series.type;\n // Destroy the series and delete all properties, it will be\n // reinserted within the `init` call below\n series.remove(false, false, false, true);\n if (casting) {\n // #20264: Re-detect a certain chart properties from new series\n chart.propFromSeries();\n // Modern browsers including IE11\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(series, seriesTypes[newType].prototype);\n // Legacy (IE < 11)\n }\n else {\n const ownEvents = Object.hasOwnProperty.call(series, 'hcEvents') && series.hcEvents;\n for (n in initialSeriesProto) { // eslint-disable-line guard-for-in\n series[n] = void 0;\n }\n // Reinsert all methods and properties from the new type\n // prototype (#2270, #3719).\n extend(series, seriesTypes[newType].prototype);\n // The events are tied to the prototype chain, don't copy if\n // they're not the series' own\n if (ownEvents) {\n series.hcEvents = ownEvents;\n }\n else {\n delete series.hcEvents;\n }\n }\n }\n }\n else {\n error(17, true, chart, { missingModuleFor: newType });\n }\n // Re-register groups (#3094) and other preserved properties\n preserve.forEach(function (prop) {\n series[prop] = preserve[prop];\n });\n series.init(chart, options);\n // Remove particular elements of the points. Check `series.options`\n // because we need to consider the options being set on plotOptions as\n // well.\n if (keepPoints && this.points) {\n seriesOptions = series.options;\n // What kind of elements to destroy\n if (seriesOptions.visible === false) {\n kinds.graphic = 1;\n kinds.dataLabel = 1;\n }\n else {\n // If the marker got disabled or changed its symbol, width or\n // height - destroy\n if (this.hasMarkerChanged(seriesOptions, oldOptions)) {\n kinds.graphic = 1;\n }\n if (!series.hasDataLabels?.()) {\n kinds.dataLabel = 1;\n }\n }\n for (const point of this.points) {\n if (point && point.series) {\n point.resolveColor();\n // Destroy elements in order to recreate based on updated\n // series options.\n if (Object.keys(kinds).length) {\n point.destroyElements(kinds);\n }\n if (seriesOptions.showInLegend === false &&\n point.legendItem) {\n chart.legend.destroyItem(point);\n }\n }\n }\n }\n series.initialType = initialType;\n chart.linkSeries(); // Links are lost in series.remove (#3028)\n // Set data for series with sorting enabled if it isn't set yet (#19715)\n chart.setSortedData();\n // #15383: Fire updatedData if the type has changed to keep linked\n // series such as indicators updated\n if (casting && series.linkedSeries.length) {\n series.isDirtyData = true;\n }\n fireEvent(this, 'afterUpdate');\n if (pick(redraw, true)) {\n chart.redraw(keepPoints ? void 0 : false);\n }\n }\n /**\n * Used from within series.update\n * @private\n */\n setName(name) {\n this.name = this.options.name = this.userOptions.name = name;\n this.chart.isDirtyLegend = true;\n }\n /**\n * Check if the option has changed.\n * @private\n */\n hasOptionChanged(optionName) {\n const chart = this.chart, option = this.options[optionName], plotOptions = chart.options.plotOptions, oldOption = this.userOptions[optionName], plotOptionsOption = pick(plotOptions?.[this.type]?.[optionName], plotOptions?.series?.[optionName]);\n // Check if `plotOptions` are defined already, #19203\n if (oldOption && !defined(plotOptionsOption)) {\n return option !== oldOption;\n }\n return option !== pick(plotOptionsOption, option);\n }\n /**\n * Runs on mouse over the series graphical items.\n *\n * @function Highcharts.Series#onMouseOver\n * @emits Highcharts.Series#event:mouseOver\n */\n onMouseOver() {\n const series = this, chart = series.chart, hoverSeries = chart.hoverSeries, pointer = chart.pointer;\n pointer?.setHoverChartIndex();\n // set normal state to previous series\n if (hoverSeries && hoverSeries !== series) {\n hoverSeries.onMouseOut();\n }\n // trigger the event, but to save processing time,\n // only if defined\n if (series.options.events.mouseOver) {\n fireEvent(series, 'mouseOver');\n }\n // hover this\n series.setState('hover');\n /**\n * Contains the original hovered series.\n *\n * @name Highcharts.Chart#hoverSeries\n * @type {Highcharts.Series|null}\n */\n chart.hoverSeries = series;\n }\n /**\n * Runs on mouse out of the series graphical items.\n *\n * @function Highcharts.Series#onMouseOut\n *\n * @emits Highcharts.Series#event:mouseOut\n */\n onMouseOut() {\n // trigger the event only if listeners exist\n const series = this, options = series.options, chart = series.chart, tooltip = chart.tooltip, hoverPoint = chart.hoverPoint;\n // #182, set to null before the mouseOut event fires\n chart.hoverSeries = null;\n // trigger mouse out on the point, which must be in this series\n if (hoverPoint) {\n hoverPoint.onMouseOut();\n }\n // fire the mouse out event\n if (series && options.events.mouseOut) {\n fireEvent(series, 'mouseOut');\n }\n // hide the tooltip\n if (tooltip &&\n !series.stickyTracking &&\n (!tooltip.shared || series.noSharedTooltip)) {\n tooltip.hide();\n }\n // Reset all inactive states\n chart.series.forEach(function (s) {\n s.setState('', true);\n });\n }\n /**\n * Set the state of the series. Called internally on mouse interaction\n * operations, but it can also be called directly to visually\n * highlight a series.\n *\n * @function Highcharts.Series#setState\n *\n * @param {Highcharts.SeriesStateValue|\"\"} [state]\n * The new state, can be either `'hover'`, `'inactive'`, `'select'`,\n * or `''` (an empty string), `'normal'` or `undefined` to set to\n * normal state.\n * @param {boolean} [inherit]\n * Determines if state should be inherited by points too.\n */\n setState(state, inherit) {\n const series = this, options = series.options, graph = series.graph, inactiveOtherPoints = options.inactiveOtherPoints, stateOptions = options.states, \n // By default a quick animation to hover/inactive,\n // slower to un-hover\n stateAnimation = pick((stateOptions[state || 'normal'] &&\n stateOptions[state || 'normal'].animation), series.chart.options.chart.animation);\n let lineWidth = options.lineWidth, opacity = options.opacity;\n state = state || '';\n if (series.state !== state) {\n // Toggle class names\n [\n series.group,\n series.markerGroup,\n series.dataLabelsGroup\n ].forEach(function (group) {\n if (group) {\n // Old state\n if (series.state) {\n group.removeClass('highcharts-series-' + series.state);\n }\n // New state\n if (state) {\n group.addClass('highcharts-series-' + state);\n }\n }\n });\n series.state = state;\n if (!series.chart.styledMode) {\n if (stateOptions[state] &&\n stateOptions[state].enabled === false) {\n return;\n }\n if (state) {\n lineWidth = (stateOptions[state].lineWidth ||\n lineWidth + (stateOptions[state].lineWidthPlus || 0)); // #4035\n opacity = pick(stateOptions[state].opacity, opacity);\n }\n if (graph && !graph.dashstyle && isNumber(lineWidth)) {\n // Animate the graph stroke-width\n for (const graphElement of [\n graph,\n ...this.zones.map((zone) => zone.graph)\n ]) {\n graphElement?.animate({\n 'stroke-width': lineWidth\n }, stateAnimation);\n }\n }\n // For some types (pie, networkgraph, sankey) opacity is\n // resolved on a point level\n if (!inactiveOtherPoints) {\n [\n series.group,\n series.markerGroup,\n series.dataLabelsGroup,\n series.labelBySeries\n ].forEach(function (group) {\n if (group) {\n group.animate({\n opacity: opacity\n }, stateAnimation);\n }\n });\n }\n }\n }\n // Don't loop over points on a series that doesn't apply inactive state\n // to siblings markers (e.g. line, column)\n if (inherit && inactiveOtherPoints && series.points) {\n series.setAllPointsToState(state || void 0);\n }\n }\n /**\n * Set the state for all points in the series.\n *\n * @function Highcharts.Series#setAllPointsToState\n *\n * @private\n *\n * @param {string} [state]\n * Can be either `hover` or undefined to set to normal state.\n */\n setAllPointsToState(state) {\n this.points.forEach(function (point) {\n if (point.setState) {\n point.setState(state);\n }\n });\n }\n /**\n * Show or hide the series.\n *\n * @function Highcharts.Series#setVisible\n *\n * @param {boolean} [visible]\n * True to show the series, false to hide. If undefined, the visibility is\n * toggled.\n *\n * @param {boolean} [redraw=true]\n * Whether to redraw the chart after the series is altered. If doing more\n * operations on the chart, it is a good idea to set redraw to false and\n * call {@link Chart#redraw|chart.redraw()} after.\n *\n * @emits Highcharts.Series#event:hide\n * @emits Highcharts.Series#event:show\n */\n setVisible(vis, redraw) {\n const series = this, chart = series.chart, ignoreHiddenSeries = chart.options.chart.ignoreHiddenSeries, oldVisibility = series.visible;\n // If called without an argument, toggle visibility\n series.visible =\n vis =\n series.options.visible =\n series.userOptions.visible =\n typeof vis === 'undefined' ? !oldVisibility : vis; // #5618\n const showOrHide = vis ? 'show' : 'hide';\n // Show or hide elements\n [\n 'group',\n 'dataLabelsGroup',\n 'markerGroup',\n 'tracker',\n 'tt'\n ].forEach((key) => {\n series[key]?.[showOrHide]();\n });\n // Hide tooltip (#1361)\n if (chart.hoverSeries === series ||\n chart.hoverPoint?.series === series) {\n series.onMouseOut();\n }\n if (series.legendItem) {\n chart.legend.colorizeItem(series, vis);\n }\n // Rescale or adapt to resized chart\n series.isDirty = true;\n // In a stack, all other series are affected\n if (series.options.stacking) {\n chart.series.forEach((otherSeries) => {\n if (otherSeries.options.stacking && otherSeries.visible) {\n otherSeries.isDirty = true;\n }\n });\n }\n // Show or hide linked series\n series.linkedSeries.forEach((otherSeries) => {\n otherSeries.setVisible(vis, false);\n });\n if (ignoreHiddenSeries) {\n chart.isDirtyBox = true;\n }\n fireEvent(series, showOrHide);\n if (redraw !== false) {\n chart.redraw();\n }\n }\n /**\n * Show the series if hidden.\n *\n * @sample highcharts/members/series-hide/\n * Toggle visibility from a button\n *\n * @function Highcharts.Series#show\n * @emits Highcharts.Series#event:show\n */\n show() {\n this.setVisible(true);\n }\n /**\n * Hide the series if visible. If the\n * [chart.ignoreHiddenSeries](https://api.highcharts.com/highcharts/chart.ignoreHiddenSeries)\n * option is true, the chart is redrawn without this series.\n *\n * @sample highcharts/members/series-hide/\n * Toggle visibility from a button\n *\n * @function Highcharts.Series#hide\n * @emits Highcharts.Series#event:hide\n */\n hide() {\n this.setVisible(false);\n }\n /**\n * Select or unselect the series. This means its\n * {@link Highcharts.Series.selected|selected}\n * property is set, the checkbox in the legend is toggled and when selected,\n * the series is returned by the {@link Highcharts.Chart#getSelectedSeries}\n * function.\n *\n * @sample highcharts/members/series-select/\n * Select a series from a button\n *\n * @function Highcharts.Series#select\n *\n * @param {boolean} [selected]\n * True to select the series, false to unselect. If undefined, the selection\n * state is toggled.\n *\n * @emits Highcharts.Series#event:select\n * @emits Highcharts.Series#event:unselect\n */\n select(selected) {\n const series = this;\n series.selected =\n selected =\n this.options.selected = (typeof selected === 'undefined' ?\n !series.selected :\n selected);\n if (series.checkbox) {\n series.checkbox.checked = selected;\n }\n fireEvent(series, selected ? 'select' : 'unselect');\n }\n /**\n * Checks if a tooltip should be shown for a given point.\n *\n * @private\n */\n shouldShowTooltip(plotX, plotY, options = {}) {\n options.series = this;\n options.visiblePlotOnly = true;\n return this.chart.isInsidePlot(plotX, plotY, options);\n }\n /**\n * Draws the legend symbol based on the legendSymbol user option.\n *\n * @private\n */\n drawLegendSymbol(legend, item) {\n LegendSymbol[this.options.legendSymbol || 'rectangle']\n ?.call(this, legend, item);\n }\n}\nSeries.defaultOptions = SeriesDefaults;\n/**\n * Registry of all available series types.\n *\n * @name Highcharts.Series.types\n * @type {Highcharts.Dictionary}\n */\nSeries.types = SeriesRegistry.seriesTypes;\n/* *\n *\n * Static Functions\n *\n * */\n/**\n * Registers a series class to be accessible via `Series.types`.\n *\n * @function Highcharts.Series.registerType\n *\n * @param {string} seriesType\n * The series type as an identifier string in lower case.\n *\n * @param {Function} SeriesClass\n * The series class as a class pattern or a constructor function with\n * prototype.\n */\nSeries.registerType = SeriesRegistry.registerSeriesType;\nextend(Series.prototype, {\n axisTypes: ['xAxis', 'yAxis'],\n coll: 'series',\n colorCounter: 0,\n directTouch: false,\n invertible: true,\n isCartesian: true,\n kdAxisArray: ['clientX', 'plotY'],\n // Each point's x and y values are stored in this.xData and this.yData:\n parallelArrays: ['x', 'y'],\n pointClass: Point,\n requireSorting: true,\n // Requires the data to be sorted:\n sorted: true\n});\n/* *\n *\n * Registry\n *\n * */\nSeriesRegistry.series = Series;\n/* *\n *\n * Default Export\n *\n * */\nexport default Series;\n/* *\n *\n * API Declarations\n *\n * */\n/**\n * This is a placeholder type of the possible series options for\n * [Highcharts](../highcharts/series), [Highcharts Stock](../highstock/series),\n * [Highmaps](../highmaps/series), and [Gantt](../gantt/series).\n *\n * In TypeScript is this dynamically generated to reference all possible types\n * of series options.\n *\n * @ignore-declaration\n * @typedef {Highcharts.SeriesOptions|Highcharts.Dictionary<*>} Highcharts.SeriesOptionsType\n */\n/**\n * Options for `dataSorting`.\n *\n * @interface Highcharts.DataSortingOptionsObject\n * @since 8.0.0\n */ /**\n* Enable or disable data sorting for the series.\n* @name Highcharts.DataSortingOptionsObject#enabled\n* @type {boolean|undefined}\n*/ /**\n* Whether to allow matching points by name in an update.\n* @name Highcharts.DataSortingOptionsObject#matchByName\n* @type {boolean|undefined}\n*/ /**\n* Determines what data value should be used to sort by.\n* @name Highcharts.DataSortingOptionsObject#sortKey\n* @type {string|undefined}\n*/\n/**\n * Function callback when a series has been animated.\n *\n * @callback Highcharts.SeriesAfterAnimateCallbackFunction\n *\n * @param {Highcharts.Series} this\n * The series where the event occurred.\n *\n * @param {Highcharts.SeriesAfterAnimateEventObject} event\n * Event arguments.\n */\n/**\n * Event information regarding completed animation of a series.\n *\n * @interface Highcharts.SeriesAfterAnimateEventObject\n */ /**\n* Animated series.\n* @name Highcharts.SeriesAfterAnimateEventObject#target\n* @type {Highcharts.Series}\n*/ /**\n* Event type.\n* @name Highcharts.SeriesAfterAnimateEventObject#type\n* @type {\"afterAnimate\"}\n*/\n/**\n * Function callback when the checkbox next to the series' name in the legend is\n * clicked.\n *\n * @callback Highcharts.SeriesCheckboxClickCallbackFunction\n *\n * @param {Highcharts.Series} this\n * The series where the event occurred.\n *\n * @param {Highcharts.SeriesCheckboxClickEventObject} event\n * Event arguments.\n */\n/**\n * Event information regarding check of a series box.\n *\n * @interface Highcharts.SeriesCheckboxClickEventObject\n */ /**\n* Whether the box has been checked.\n* @name Highcharts.SeriesCheckboxClickEventObject#checked\n* @type {boolean}\n*/ /**\n* Related series.\n* @name Highcharts.SeriesCheckboxClickEventObject#item\n* @type {Highcharts.Series}\n*/ /**\n* Related series.\n* @name Highcharts.SeriesCheckboxClickEventObject#target\n* @type {Highcharts.Series}\n*/ /**\n* Event type.\n* @name Highcharts.SeriesCheckboxClickEventObject#type\n* @type {\"checkboxClick\"}\n*/\n/**\n * Function callback when a series is clicked. Return false to cancel toogle\n * actions.\n *\n * @callback Highcharts.SeriesClickCallbackFunction\n *\n * @param {Highcharts.Series} this\n * The series where the event occurred.\n *\n * @param {Highcharts.SeriesClickEventObject} event\n * Event arguments.\n */\n/**\n * Common information for a click event on a series.\n *\n * @interface Highcharts.SeriesClickEventObject\n * @extends global.Event\n */ /**\n* Nearest point on the graph.\n* @name Highcharts.SeriesClickEventObject#point\n* @type {Highcharts.Point}\n*/\n/**\n * Gets fired when the series is hidden after chart generation time, either by\n * clicking the legend item or by calling `.hide()`.\n *\n * @callback Highcharts.SeriesHideCallbackFunction\n *\n * @param {Highcharts.Series} this\n * The series where the event occurred.\n *\n * @param {global.Event} event\n * The event that occurred.\n */\n/**\n * The SVG value used for the `stroke-linecap` and `stroke-linejoin` of a line\n * graph.\n *\n * @typedef {\"butt\"|\"round\"|\"square\"|string} Highcharts.SeriesLinecapValue\n */\n/**\n * Gets fired when the legend item belonging to the series is clicked. The\n * default action is to toggle the visibility of the series. This can be\n * prevented by returning `false` or calling `event.preventDefault()`.\n *\n * @callback Highcharts.SeriesLegendItemClickCallbackFunction\n *\n * @param {Highcharts.Series} this\n * The series where the event occurred.\n *\n * @param {Highcharts.SeriesLegendItemClickEventObject} event\n * The event that occurred.\n */\n/**\n * Information about the event.\n *\n * @interface Highcharts.SeriesLegendItemClickEventObject\n */ /**\n* Related browser event.\n* @name Highcharts.SeriesLegendItemClickEventObject#browserEvent\n* @type {global.PointerEvent}\n*/ /**\n* Prevent the default action of toggle the visibility of the series.\n* @name Highcharts.SeriesLegendItemClickEventObject#preventDefault\n* @type {Function}\n*/ /**\n* Related series.\n* @name Highcharts.SeriesCheckboxClickEventObject#target\n* @type {Highcharts.Series}\n*/ /**\n* Event type.\n* @name Highcharts.SeriesCheckboxClickEventObject#type\n* @type {\"checkboxClick\"}\n*/\n/**\n * Gets fired when the mouse leaves the graph.\n *\n * @callback Highcharts.SeriesMouseOutCallbackFunction\n *\n * @param {Highcharts.Series} this\n * Series where the event occurred.\n *\n * @param {global.PointerEvent} event\n * Event that occurred.\n */\n/**\n * Gets fired when the mouse enters the graph.\n *\n * @callback Highcharts.SeriesMouseOverCallbackFunction\n *\n * @param {Highcharts.Series} this\n * Series where the event occurred.\n *\n * @param {global.PointerEvent} event\n * Event that occurred.\n */\n/**\n * Translation and scale for the plot area of a series.\n *\n * @interface Highcharts.SeriesPlotBoxObject\n */ /**\n* @name Highcharts.SeriesPlotBoxObject#scaleX\n* @type {number}\n*/ /**\n* @name Highcharts.SeriesPlotBoxObject#scaleY\n* @type {number}\n*/ /**\n* @name Highcharts.SeriesPlotBoxObject#translateX\n* @type {number}\n*/ /**\n* @name Highcharts.SeriesPlotBoxObject#translateY\n* @type {number}\n*/\n/**\n * Gets fired when the series is shown after chart generation time, either by\n * clicking the legend item or by calling `.show()`.\n *\n * @callback Highcharts.SeriesShowCallbackFunction\n *\n * @param {Highcharts.Series} this\n * Series where the event occurred.\n *\n * @param {global.Event} event\n * Event that occurred.\n */\n/**\n * Possible key values for the series state options.\n *\n * @typedef {\"hover\"|\"inactive\"|\"normal\"|\"select\"} Highcharts.SeriesStateValue\n */\n''; // detach doclets above\n/* *\n *\n * API Options\n *\n * */\n/**\n * Series options for specific data and the data itself. In TypeScript you\n * have to cast the series options to specific series types, to get all\n * possible options for a series.\n *\n * @example\n * // TypeScript example\n * Highcharts.chart('container', {\n * series: [{\n * color: '#06C',\n * data: [[0, 1], [2, 3]]\n * } as Highcharts.SeriesLineOptions ]\n * });\n *\n * @type {Array<*>}\n * @apioption series\n */\n/**\n * An id for the series. This can be used after render time to get a pointer\n * to the series object through `chart.get()`.\n *\n * @sample {highcharts} highcharts/plotoptions/series-id/\n * Get series by id\n *\n * @type {string}\n * @since 1.2.0\n * @apioption series.id\n */\n/**\n * The index of the series in the chart, affecting the internal index in the\n * `chart.series` array, the visible Z index as well as the order in the\n * legend.\n *\n * @type {number}\n * @since 2.3.0\n * @apioption series.index\n */\n/**\n * The sequential index of the series in the legend.\n *\n * @see [legend.reversed](#legend.reversed),\n * [yAxis.reversedStacks](#yAxis.reversedStacks)\n *\n * @sample {highcharts|highstock} highcharts/series/legendindex/\n * Legend in opposite order\n *\n * @type {number}\n * @apioption series.legendIndex\n */\n/**\n * The name of the series as shown in the legend, tooltip etc.\n *\n * @sample {highcharts} highcharts/series/name/\n * Series name\n * @sample {highmaps} maps/demo/category-map/\n * Series name\n *\n * @type {string}\n * @apioption series.name\n */\n/**\n * This option allows grouping series in a stacked chart. The stack option\n * can be a string or anything else, as long as the grouped series' stack\n * options match each other after conversion into a string.\n *\n * @sample {highcharts} highcharts/series/stack/\n * Stacked and grouped columns\n *\n * @type {number|string}\n * @since 2.1\n * @product highcharts highstock\n * @apioption series.stack\n */\n/**\n * The type of series, for example `line` or `column`. By default, the\n * series type is inherited from [chart.type](#chart.type), so unless the\n * chart is a combination of series types, there is no need to set it on the\n * series level.\n *\n * @sample {highcharts} highcharts/series/type/\n * Line and column in the same chart\n * @sample highcharts/series/type-dynamic/\n * Dynamic types with button selector\n * @sample {highmaps} maps/demo/mapline-mappoint/\n * Multiple types in the same map\n *\n * @type {string}\n * @apioption series.type\n */\n/**\n * When using dual or multiple x axes, this number defines which xAxis the\n * particular series is connected to. It refers to either the\n * {@link #xAxis.id|axis id}\n * or the index of the axis in the xAxis array, with 0 being the first.\n *\n * @type {number|string}\n * @default 0\n * @product highcharts highstock\n * @apioption series.xAxis\n */\n/**\n * When using dual or multiple y axes, this number defines which yAxis the\n * particular series is connected to. It refers to either the\n * {@link #yAxis.id|axis id}\n * or the index of the axis in the yAxis array, with 0 being the first.\n *\n * @sample {highcharts} highcharts/series/yaxis/\n * Apply the column series to the secondary Y axis\n *\n * @type {number|string}\n * @default 0\n * @product highcharts highstock\n * @apioption series.yAxis\n */\n/**\n * Define the visual z index of the series.\n *\n * @sample {highcharts} highcharts/plotoptions/series-zindex-default/\n * With no z index, the series defined last are on top\n * @sample {highcharts} highcharts/plotoptions/series-zindex/\n * With a z index, the series with the highest z index is on top\n * @sample {highstock} highcharts/plotoptions/series-zindex-default/\n * With no z index, the series defined last are on top\n * @sample {highstock} highcharts/plotoptions/series-zindex/\n * With a z index, the series with the highest z index is on top\n *\n * @type {number}\n * @product highcharts highstock\n * @apioption series.zIndex\n */\n''; // include precedent doclets in transpiled\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport A from '../Animation/AnimationUtilities.js';\nconst { animate, animObject, setAnimation } = A;\nimport Axis from '../Axis/Axis.js';\nimport D from '../Defaults.js';\nconst { defaultOptions, defaultTime } = D;\nimport Templating from '../Templating.js';\nconst { numberFormat } = Templating;\nimport Foundation from '../Foundation.js';\nconst { registerEventOptions } = Foundation;\nimport H from '../Globals.js';\nconst { charts, doc, marginNames, svg, win } = H;\nimport RendererRegistry from '../Renderer/RendererRegistry.js';\nimport Series from '../Series/Series.js';\nimport SeriesRegistry from '../Series/SeriesRegistry.js';\nconst { seriesTypes } = SeriesRegistry;\nimport SVGRenderer from '../Renderer/SVG/SVGRenderer.js';\nimport Time from '../Time.js';\nimport U from '../Utilities.js';\nimport AST from '../Renderer/HTML/AST.js';\nimport Tick from '../Axis/Tick.js';\nconst { addEvent, attr, createElement, css, defined, diffObjects, discardElement, erase, error, extend, find, fireEvent, getStyle, isArray, isNumber, isObject, isString, merge, objectEach, pick, pInt, relativeLength, removeEvent, splat, syncTimeout, uniqueKey } = U;\n/* *\n *\n * Class\n *\n * */\n/* eslint-disable no-invalid-this, valid-jsdoc */\n/**\n * The Chart class. The recommended constructor is {@link Highcharts#chart}.\n *\n * @example\n * let chart = Highcharts.chart('container', {\n * title: {\n * text: 'My chart'\n * },\n * series: [{\n * data: [1, 3, 2, 4]\n * }]\n * })\n *\n * @class\n * @name Highcharts.Chart\n *\n * @param {string|Highcharts.HTMLDOMElement} [renderTo]\n * The DOM element to render to, or its id.\n *\n * @param {Highcharts.Options} options\n * The chart options structure.\n *\n * @param {Highcharts.ChartCallbackFunction} [callback]\n * Function to run when the chart has loaded and all external images\n * are loaded. Defining a\n * [chart.events.load](https://api.highcharts.com/highcharts/chart.events.load)\n * handler is equivalent.\n */\nclass Chart {\n /**\n * Factory function for basic charts.\n *\n * @example\n * // Render a chart in to div#container\n * let chart = Highcharts.chart('container', {\n * title: {\n * text: 'My chart'\n * },\n * series: [{\n * data: [1, 3, 2, 4]\n * }]\n * });\n *\n * @function Highcharts.chart\n *\n * @param {string|Highcharts.HTMLDOMElement} [renderTo]\n * The DOM element to render to, or its id.\n *\n * @param {Highcharts.Options} options\n * The chart options structure.\n *\n * @param {Highcharts.ChartCallbackFunction} [callback]\n * Function to run when the chart has loaded and all external images are\n * loaded. Defining a\n * [chart.events.load](https://api.highcharts.com/highcharts/chart.events.load)\n * handler is equivalent.\n *\n * @return {Highcharts.Chart}\n * Returns the Chart object.\n */\n static chart(a, b, c) {\n return new Chart(a, b, c);\n }\n /** Implementation */\n constructor(a, \n /* eslint-disable @typescript-eslint/no-unused-vars */\n b, c\n /* eslint-enable @typescript-eslint/no-unused-vars */\n ) {\n this.sharedClips = {};\n const args = [\n // ES5 builds fail unless we cast it to an Array\n ...arguments\n ];\n // Remove the optional first argument, renderTo, and set it on this.\n if (isString(a) || a.nodeName) {\n this.renderTo = args.shift();\n }\n this.init(args[0], args[1]);\n }\n /* *\n *\n * Functions\n *\n * */\n /**\n * Function setting zoom options after chart init and after chart update.\n * Offers support for deprecated options.\n *\n * @private\n * @function Highcharts.Chart#setZoomOptions\n */\n setZoomOptions() {\n const chart = this, options = chart.options.chart, zooming = options.zooming;\n chart.zooming = {\n ...zooming,\n type: pick(options.zoomType, zooming.type),\n key: pick(options.zoomKey, zooming.key),\n pinchType: pick(options.pinchType, zooming.pinchType),\n singleTouch: pick(options.zoomBySingleTouch, zooming.singleTouch, false),\n resetButton: merge(zooming.resetButton, options.resetZoomButton)\n };\n }\n /**\n * Overridable function that initializes the chart. The constructor's\n * arguments are passed on directly.\n *\n * @function Highcharts.Chart#init\n *\n * @param {Highcharts.Options} userOptions\n * Custom options.\n *\n * @param {Function} [callback]\n * Function to run when the chart has loaded and all external\n * images are loaded.\n *\n *\n * @emits Highcharts.Chart#event:init\n * @emits Highcharts.Chart#event:afterInit\n */\n init(userOptions, callback) {\n // Fire the event with a default function\n fireEvent(this, 'init', { args: arguments }, function () {\n const options = merge(defaultOptions, userOptions), // do the merge\n optionsChart = options.chart;\n /**\n * The original options given to the constructor or a chart factory\n * like {@link Highcharts.chart} and {@link Highcharts.stockChart}.\n * The original options are shallow copied to avoid mutation. The\n * copy, `chart.userOptions`, may later be mutated to reflect\n * updated options throughout the lifetime of the chart.\n *\n * For collections, like `series`, `xAxis` and `yAxis`, the chart\n * user options should always be reflected by the item user option,\n * so for example the following should always be true:\n *\n * `chart.xAxis[0].userOptions === chart.userOptions.xAxis[0]`\n *\n * @name Highcharts.Chart#userOptions\n * @type {Highcharts.Options}\n */\n this.userOptions = extend({}, userOptions);\n this.margin = [];\n this.spacing = [];\n // An array of functions that returns labels that should be\n // considered for anti-collision\n this.labelCollectors = [];\n this.callback = callback;\n this.isResizing = 0;\n /**\n * The options structure for the chart after merging\n * {@link #defaultOptions} and {@link #userOptions}. It contains\n * members for the sub elements like series, legend, tooltip etc.\n *\n * @name Highcharts.Chart#options\n * @type {Highcharts.Options}\n */\n this.options = options;\n /**\n * All the axes in the chart.\n *\n * @see Highcharts.Chart.xAxis\n * @see Highcharts.Chart.yAxis\n *\n * @name Highcharts.Chart#axes\n * @type {Array}\n */\n this.axes = [];\n /**\n * All the current series in the chart.\n *\n * @name Highcharts.Chart#series\n * @type {Array}\n */\n this.series = [];\n /**\n * The `Time` object associated with the chart. Since v6.0.5,\n * time settings can be applied individually for each chart. If\n * no individual settings apply, the `Time` object is shared by\n * all instances.\n *\n * @name Highcharts.Chart#time\n * @type {Highcharts.Time}\n */\n this.time =\n userOptions.time && Object.keys(userOptions.time).length ?\n new Time(userOptions.time) :\n H.time;\n /**\n * Callback function to override the default function that formats\n * all the numbers in the chart. Returns a string with the formatted\n * number.\n *\n * @name Highcharts.Chart#numberFormatter\n * @type {Highcharts.NumberFormatterCallbackFunction}\n */\n this.numberFormatter = optionsChart.numberFormatter || numberFormat;\n /**\n * Whether the chart is in styled mode, meaning all presentational\n * attributes are avoided.\n *\n * @name Highcharts.Chart#styledMode\n * @type {boolean}\n */\n this.styledMode = optionsChart.styledMode;\n this.hasCartesianSeries = optionsChart.showAxes;\n const chart = this;\n /**\n * Index position of the chart in the {@link Highcharts#charts}\n * property.\n *\n * @name Highcharts.Chart#index\n * @type {number}\n * @readonly\n */\n chart.index = charts.length; // Add the chart to the global lookup\n charts.push(chart);\n H.chartCount++;\n // Chart event handlers\n registerEventOptions(this, optionsChart);\n /**\n * A collection of the X axes in the chart.\n *\n * @name Highcharts.Chart#xAxis\n * @type {Array}\n */\n chart.xAxis = [];\n /**\n * A collection of the Y axes in the chart.\n *\n * @name Highcharts.Chart#yAxis\n * @type {Array}\n *\n * @todo\n * Make events official: Fire the event `afterInit`.\n */\n chart.yAxis = [];\n chart.pointCount = chart.colorCounter = chart.symbolCounter = 0;\n this.setZoomOptions();\n // Fire after init but before first render, before axes and series\n // have been initialized.\n fireEvent(chart, 'afterInit');\n chart.firstRender();\n });\n }\n /**\n * Internal function to unitialize an individual series.\n *\n * @private\n * @function Highcharts.Chart#initSeries\n */\n initSeries(options) {\n const chart = this, optionsChart = chart.options.chart, type = (options.type ||\n optionsChart.type), SeriesClass = seriesTypes[type];\n // No such series type\n if (!SeriesClass) {\n error(17, true, chart, { missingModuleFor: type });\n }\n const series = new SeriesClass();\n if (typeof series.init === 'function') {\n series.init(chart, options);\n }\n return series;\n }\n /**\n * Internal function to set data for all series with enabled sorting.\n *\n * @private\n * @function Highcharts.Chart#setSortedData\n */\n setSortedData() {\n this.getSeriesOrderByLinks().forEach(function (series) {\n // We need to set data for series with sorting after series init\n if (!series.points && !series.data && series.enabledDataSorting) {\n series.setData(series.options.data, false);\n }\n });\n }\n /**\n * Sort and return chart series in order depending on the number of linked\n * series.\n *\n * @private\n * @function Highcharts.Series#getSeriesOrderByLinks\n */\n getSeriesOrderByLinks() {\n return this.series.concat().sort(function (a, b) {\n if (a.linkedSeries.length || b.linkedSeries.length) {\n return b.linkedSeries.length - a.linkedSeries.length;\n }\n return 0;\n });\n }\n /**\n * Order all series or axes above a given index. When series or axes are\n * added and ordered by configuration, only the last series is handled\n * (#248, #1123, #2456, #6112). This function is called on series and axis\n * initialization and destroy.\n *\n * @private\n * @function Highcharts.Chart#orderItems\n * @param {string} coll The collection name\n * @param {number} [fromIndex=0]\n * If this is given, only the series above this index are handled.\n */\n orderItems(coll, fromIndex = 0) {\n const collection = this[coll], \n // Item options should be reflected in chart.options.series,\n // chart.options.yAxis etc\n optionsArray = this.options[coll] = splat(this.options[coll])\n .slice(), userOptionsArray = this.userOptions[coll] = this.userOptions[coll] ?\n splat(this.userOptions[coll]).slice() :\n [];\n if (this.hasRendered) {\n // Remove all above index\n optionsArray.splice(fromIndex);\n userOptionsArray.splice(fromIndex);\n }\n if (collection) {\n for (let i = fromIndex, iEnd = collection.length; i < iEnd; ++i) {\n const item = collection[i];\n if (item) {\n /**\n * Contains the series' index in the `Chart.series` array.\n *\n * @name Highcharts.Series#index\n * @type {number}\n * @readonly\n */\n item.index = i;\n if (item instanceof Series) {\n item.name = item.getName();\n }\n if (!item.options.isInternal) {\n optionsArray[i] = item.options;\n userOptionsArray[i] = item.userOptions;\n }\n }\n }\n }\n }\n /**\n * Check whether a given point is within the plot area.\n *\n * @function Highcharts.Chart#isInsidePlot\n *\n * @param {number} plotX\n * Pixel x relative to the plot area.\n *\n * @param {number} plotY\n * Pixel y relative to the plot area.\n *\n * @param {Highcharts.ChartIsInsideOptionsObject} [options]\n * Options object.\n *\n * @return {boolean}\n * Returns true if the given point is inside the plot area.\n */\n isInsidePlot(plotX, plotY, options = {}) {\n const { inverted, plotBox, plotLeft, plotTop, scrollablePlotBox } = this, { scrollLeft = 0, scrollTop = 0 } = (options.visiblePlotOnly &&\n this.scrollablePlotArea?.scrollingContainer) || {}, series = options.series, box = (options.visiblePlotOnly && scrollablePlotBox) || plotBox, x = options.inverted ? plotY : plotX, y = options.inverted ? plotX : plotY, e = {\n x,\n y,\n isInsidePlot: true,\n options\n };\n if (!options.ignoreX) {\n const xAxis = (series &&\n (inverted && !this.polar ? series.yAxis : series.xAxis)) || {\n pos: plotLeft,\n len: Infinity\n };\n const chartX = options.paneCoordinates ?\n xAxis.pos + x : plotLeft + x;\n if (!(chartX >= Math.max(scrollLeft + plotLeft, xAxis.pos) &&\n chartX <= Math.min(scrollLeft + plotLeft + box.width, xAxis.pos + xAxis.len))) {\n e.isInsidePlot = false;\n }\n }\n if (!options.ignoreY && e.isInsidePlot) {\n const yAxis = (!inverted && options.axis &&\n !options.axis.isXAxis && options.axis) || (series && (inverted ? series.xAxis : series.yAxis)) || {\n pos: plotTop,\n len: Infinity\n };\n const chartY = options.paneCoordinates ?\n yAxis.pos + y : plotTop + y;\n if (!(chartY >= Math.max(scrollTop + plotTop, yAxis.pos) &&\n chartY <= Math.min(scrollTop + plotTop + box.height, yAxis.pos + yAxis.len))) {\n e.isInsidePlot = false;\n }\n }\n fireEvent(this, 'afterIsInsidePlot', e);\n return e.isInsidePlot;\n }\n /**\n * Redraw the chart after changes have been done to the data, axis extremes\n * chart size or chart elements. All methods for updating axes, series or\n * points have a parameter for redrawing the chart. This is `true` by\n * default. But in many cases you want to do more than one operation on the\n * chart before redrawing, for example add a number of points. In those\n * cases it is a waste of resources to redraw the chart for each new point\n * added. So you add the points and call `chart.redraw()` after.\n *\n * @function Highcharts.Chart#redraw\n *\n * @param {boolean|Partial} [animation]\n * If or how to apply animation to the redraw. When `undefined`, it applies\n * the animation that is set in the `chart.animation` option.\n *\n * @emits Highcharts.Chart#event:afterSetExtremes\n * @emits Highcharts.Chart#event:beforeRedraw\n * @emits Highcharts.Chart#event:predraw\n * @emits Highcharts.Chart#event:redraw\n * @emits Highcharts.Chart#event:render\n * @emits Highcharts.Chart#event:updatedData\n */\n redraw(animation) {\n fireEvent(this, 'beforeRedraw');\n const chart = this, axes = chart.hasCartesianSeries ? chart.axes : chart.colorAxis || [], series = chart.series, pointer = chart.pointer, legend = chart.legend, legendUserOptions = chart.userOptions.legend, renderer = chart.renderer, isHiddenChart = renderer.isHidden(), afterRedraw = [];\n let hasDirtyStacks, hasStackedSeries, i, isDirtyBox = chart.isDirtyBox, redrawLegend = chart.isDirtyLegend, serie;\n renderer.rootFontSize = renderer.boxWrapper.getStyle('font-size');\n // Handle responsive rules, not only on resize (#6130)\n if (chart.setResponsive) {\n chart.setResponsive(false);\n }\n // Set the global animation. When chart.hasRendered is not true, the\n // redraw call comes from a responsive rule and animation should not\n // occur.\n setAnimation(chart.hasRendered ? animation : false, chart);\n if (isHiddenChart) {\n chart.temporaryDisplay();\n }\n // Adjust title layout (reflow multiline text)\n chart.layOutTitles(false);\n // link stacked series\n i = series.length;\n while (i--) {\n serie = series[i];\n if (serie.options.stacking || serie.options.centerInCategory) {\n hasStackedSeries = true;\n if (serie.isDirty) {\n hasDirtyStacks = true;\n break;\n }\n }\n }\n if (hasDirtyStacks) { // mark others as dirty\n i = series.length;\n while (i--) {\n serie = series[i];\n if (serie.options.stacking) {\n serie.isDirty = true;\n }\n }\n }\n // Handle updated data in the series\n series.forEach(function (serie) {\n if (serie.isDirty) {\n if (serie.options.legendType === 'point') {\n if (typeof serie.updateTotals === 'function') {\n serie.updateTotals();\n }\n redrawLegend = true;\n }\n else if (legendUserOptions &&\n (!!legendUserOptions.labelFormatter ||\n legendUserOptions.labelFormat)) {\n redrawLegend = true; // #2165\n }\n }\n if (serie.isDirtyData) {\n fireEvent(serie, 'updatedData');\n }\n });\n // handle added or removed series\n if (redrawLegend && legend && legend.options.enabled) {\n // draw legend graphics\n legend.render();\n chart.isDirtyLegend = false;\n }\n // reset stacks\n if (hasStackedSeries) {\n chart.getStacks();\n }\n // set axes scales\n axes.forEach(function (axis) {\n axis.updateNames();\n axis.setScale();\n });\n chart.getMargins(); // #3098\n // If one axis is dirty, all axes must be redrawn (#792, #2169)\n axes.forEach(function (axis) {\n if (axis.isDirty) {\n isDirtyBox = true;\n }\n });\n // redraw axes\n axes.forEach(function (axis) {\n // Fire 'afterSetExtremes' only if extremes are set\n const key = axis.min + ',' + axis.max;\n if (axis.extKey !== key) { // #821, #4452\n axis.extKey = key;\n // prevent a recursive call to chart.redraw() (#1119)\n afterRedraw.push(function () {\n fireEvent(axis, 'afterSetExtremes', extend(axis.eventArgs, axis.getExtremes())); // #747, #751\n delete axis.eventArgs;\n });\n }\n if (isDirtyBox || hasStackedSeries) {\n axis.redraw();\n }\n });\n // the plot areas size has changed\n if (isDirtyBox) {\n chart.drawChartBox();\n }\n // Fire an event before redrawing series, used by the boost module to\n // clear previous series renderings.\n fireEvent(chart, 'predraw');\n // redraw affected series\n series.forEach(function (serie) {\n if ((isDirtyBox || serie.isDirty) && serie.visible) {\n serie.redraw();\n }\n // Set it here, otherwise we will have unlimited 'updatedData' calls\n // for a hidden series after setData(). Fixes #6012\n serie.isDirtyData = false;\n });\n // move tooltip or reset\n if (pointer) {\n pointer.reset(true);\n }\n // redraw if canvas\n renderer.draw();\n // Fire the events\n fireEvent(chart, 'redraw');\n fireEvent(chart, 'render');\n if (isHiddenChart) {\n chart.temporaryDisplay(true);\n }\n // Fire callbacks that are put on hold until after the redraw\n afterRedraw.forEach(function (callback) {\n callback.call();\n });\n }\n /**\n * Get an axis, series or point object by `id` as given in the configuration\n * options. Returns `undefined` if no item is found.\n *\n * @sample highcharts/plotoptions/series-id/\n * Get series by id\n *\n * @function Highcharts.Chart#get\n *\n * @param {string} id\n * The id as given in the configuration options.\n *\n * @return {Highcharts.Axis|Highcharts.Series|Highcharts.Point|undefined}\n * The retrieved item.\n */\n get(id) {\n const series = this.series;\n /**\n * @private\n */\n function itemById(item) {\n return (item.id === id ||\n (item.options && item.options.id === id));\n }\n let ret = \n // Search axes\n find(this.axes, itemById) ||\n // Search series\n find(this.series, itemById);\n // Search points\n for (let i = 0; !ret && i < series.length; i++) {\n ret = find(series[i].points || [], itemById);\n }\n return ret;\n }\n /**\n * Create the Axis instances based on the config options.\n *\n * @private\n * @function Highcharts.Chart#getAxes\n * @emits Highcharts.Chart#event:afterGetAxes\n * @emits Highcharts.Chart#event:getAxes\n */\n getAxes() {\n const options = this.userOptions;\n fireEvent(this, 'getAxes');\n for (const coll of ['xAxis', 'yAxis']) {\n const arr = options[coll] = splat(options[coll] || {});\n for (const axisOptions of arr) {\n // eslint-disable-next-line no-new\n new Axis(this, axisOptions, coll);\n }\n }\n fireEvent(this, 'afterGetAxes');\n }\n /**\n * Returns an array of all currently selected points in the chart. Points\n * can be selected by clicking or programmatically by the\n * {@link Highcharts.Point#select}\n * function.\n *\n * @sample highcharts/plotoptions/series-allowpointselect-line/\n * Get selected points\n * @sample highcharts/members/point-select-lasso/\n * Lasso selection\n * @sample highcharts/chart/events-selection-points/\n * Rectangle selection\n *\n * @function Highcharts.Chart#getSelectedPoints\n *\n * @return {Array}\n * The currently selected points.\n */\n getSelectedPoints() {\n return this.series.reduce((acc, series) => {\n // For one-to-one points inspect series.data in order to retrieve\n // points outside the visible range (#6445). For grouped data,\n // inspect the generated series.points.\n series.getPointsCollection()\n .forEach((point) => {\n if (pick(point.selectedStaging, point.selected)) {\n acc.push(point);\n }\n });\n return acc;\n }, []);\n }\n /**\n * Returns an array of all currently selected series in the chart. Series\n * can be selected either programmatically by the\n * {@link Highcharts.Series#select}\n * function or by checking the checkbox next to the legend item if\n * [series.showCheckBox](https://api.highcharts.com/highcharts/plotOptions.series.showCheckbox)\n * is true.\n *\n * @sample highcharts/members/chart-getselectedseries/\n * Get selected series\n *\n * @function Highcharts.Chart#getSelectedSeries\n *\n * @return {Array}\n * The currently selected series.\n */\n getSelectedSeries() {\n return this.series.filter(function (serie) {\n return serie.selected;\n });\n }\n /**\n * Set a new title or subtitle for the chart.\n *\n * @sample highcharts/members/chart-settitle/\n * Set title text and styles\n *\n * @function Highcharts.Chart#setTitle\n *\n * @param {Highcharts.TitleOptions} [titleOptions]\n * New title options. The title text itself is set by the\n * `titleOptions.text` property.\n *\n * @param {Highcharts.SubtitleOptions} [subtitleOptions]\n * New subtitle options. The subtitle text itself is set by the\n * `subtitleOptions.text` property.\n *\n * @param {boolean} [redraw]\n * Whether to redraw the chart or wait for a later call to\n * `chart.redraw()`.\n */\n setTitle(titleOptions, subtitleOptions, redraw) {\n this.applyDescription('title', titleOptions);\n this.applyDescription('subtitle', subtitleOptions);\n // The initial call also adds the caption. On update, chart.update will\n // relay to Chart.setCaption.\n this.applyDescription('caption', void 0);\n this.layOutTitles(redraw);\n }\n /**\n * Apply a title, subtitle or caption for the chart\n *\n * @private\n * @function Highcharts.Chart#applyDescription\n * @param name {string}\n * Either title, subtitle or caption\n * @param {Highcharts.TitleOptions|Highcharts.SubtitleOptions|Highcharts.CaptionOptions|undefined} explicitOptions\n * The options to set, will be merged with default options.\n */\n applyDescription(name, explicitOptions) {\n const chart = this;\n // Merge default options with explicit options\n const options = this.options[name] = merge(this.options[name], explicitOptions);\n let elem = this[name];\n if (elem && explicitOptions) {\n this[name] = elem = elem.destroy(); // remove old\n }\n if (options && !elem) {\n elem = this.renderer.text(options.text, 0, 0, options.useHTML)\n .attr({\n align: options.align,\n 'class': 'highcharts-' + name,\n zIndex: options.zIndex || 4\n })\n .add();\n // Update methods, relay to `applyDescription`\n elem.update = function (updateOptions, redraw) {\n chart.applyDescription(name, updateOptions);\n chart.layOutTitles(redraw);\n };\n // Presentational\n if (!this.styledMode) {\n elem.css(extend(name === 'title' ? {\n // #2944\n fontSize: this.options.isStock ? '1em' : '1.2em'\n } : {}, options.style));\n }\n /**\n * The chart title. The title has an `update` method that allows\n * modifying the options directly or indirectly via\n * `chart.update`.\n *\n * @sample highcharts/members/title-update/\n * Updating titles\n *\n * @name Highcharts.Chart#title\n * @type {Highcharts.TitleObject}\n */\n /**\n * The chart subtitle. The subtitle has an `update` method that\n * allows modifying the options directly or indirectly via\n * `chart.update`.\n *\n * @name Highcharts.Chart#subtitle\n * @type {Highcharts.SubtitleObject}\n */\n this[name] = elem;\n }\n }\n /**\n * Internal function to lay out the chart title, subtitle and caption, and\n * cache the full offset height for use in `getMargins`. The result is\n * stored in `this.titleOffset`.\n *\n * @private\n * @function Highcharts.Chart#layOutTitles\n *\n * @param {boolean} [redraw=true]\n * @emits Highcharts.Chart#event:afterLayOutTitles\n */\n layOutTitles(redraw = true) {\n const titleOffset = [0, 0, 0], renderer = this.renderer, spacingBox = this.spacingBox;\n // Lay out the title and the subtitle respectively\n ['title', 'subtitle', 'caption'].forEach(function (key) {\n const title = this[key], titleOptions = (this.options[key]), verticalAlign = titleOptions.verticalAlign || 'top', offset = key === 'title' ?\n verticalAlign === 'top' ? -3 : 0 :\n // Floating subtitle (#6574)\n verticalAlign === 'top' ? titleOffset[0] + 2 : 0;\n if (title) {\n title\n .css({\n width: (titleOptions.width ||\n spacingBox.width + (titleOptions.widthAdjust || 0)) + 'px'\n });\n const baseline = renderer.fontMetrics(title).b, \n // Skip the cache for HTML (#3481, #11666)\n height = Math.round(title.getBBox(titleOptions.useHTML).height);\n title.align(extend({\n y: verticalAlign === 'bottom' ?\n baseline :\n offset + baseline,\n height\n }, titleOptions), false, 'spacingBox');\n if (!titleOptions.floating) {\n if (verticalAlign === 'top') {\n titleOffset[0] = Math.ceil(titleOffset[0] +\n height);\n }\n else if (verticalAlign === 'bottom') {\n titleOffset[2] = Math.ceil(titleOffset[2] +\n height);\n }\n }\n }\n }, this);\n // Handle title.margin and caption.margin\n if (titleOffset[0] &&\n (this.options.title.verticalAlign || 'top') === 'top') {\n titleOffset[0] += this.options.title.margin;\n }\n if (titleOffset[2] &&\n this.options.caption.verticalAlign === 'bottom') {\n titleOffset[2] += this.options.caption.margin;\n }\n const requiresDirtyBox = (!this.titleOffset ||\n this.titleOffset.join(',') !== titleOffset.join(','));\n // Used in getMargins\n this.titleOffset = titleOffset;\n fireEvent(this, 'afterLayOutTitles');\n if (!this.isDirtyBox && requiresDirtyBox) {\n this.isDirtyBox = this.isDirtyLegend = requiresDirtyBox;\n // Redraw if necessary (#2719, #2744)\n if (this.hasRendered && redraw && this.isDirtyBox) {\n this.redraw();\n }\n }\n }\n /**\n * Internal function to get the available size of the container element\n *\n * @private\n * @function Highcharts.Chart#getContainerBox\n */\n getContainerBox() {\n return {\n width: getStyle(this.renderTo, 'width', true) || 0,\n height: getStyle(this.renderTo, 'height', true) || 0\n };\n }\n /**\n * Internal function to get the chart width and height according to options\n * and container size. Sets {@link Chart.chartWidth} and\n * {@link Chart.chartHeight}.\n *\n * @private\n * @function Highcharts.Chart#getChartSize\n */\n getChartSize() {\n const chart = this, optionsChart = chart.options.chart, widthOption = optionsChart.width, heightOption = optionsChart.height, containerBox = chart.getContainerBox();\n /**\n * The current pixel width of the chart.\n *\n * @name Highcharts.Chart#chartWidth\n * @type {number}\n */\n chart.chartWidth = Math.max(// #1393\n 0, widthOption || containerBox.width || 600 // #1460\n );\n /**\n * The current pixel height of the chart.\n *\n * @name Highcharts.Chart#chartHeight\n * @type {number}\n */\n chart.chartHeight = Math.max(0, relativeLength(heightOption, chart.chartWidth) ||\n (containerBox.height > 1 ? containerBox.height : 400));\n chart.containerBox = containerBox;\n }\n /**\n * If the renderTo element has no offsetWidth, most likely one or more of\n * its parents are hidden. Loop up the DOM tree to temporarily display the\n * parents, then save the original display properties, and when the true\n * size is retrieved, reset them. Used on first render and on redraws.\n *\n * @private\n * @function Highcharts.Chart#temporaryDisplay\n *\n * @param {boolean} [revert]\n * Revert to the saved original styles.\n */\n temporaryDisplay(revert) {\n let node = this.renderTo, tempStyle;\n if (!revert) {\n while (node && node.style) {\n // When rendering to a detached node, it needs to be temporarily\n // attached in order to read styling and bounding boxes (#5783,\n // #7024).\n if (!doc.body.contains(node) && !node.parentNode) {\n node.hcOrigDetached = true;\n doc.body.appendChild(node);\n }\n if (getStyle(node, 'display', false) === 'none' ||\n node.hcOricDetached) {\n node.hcOrigStyle = {\n display: node.style.display,\n height: node.style.height,\n overflow: node.style.overflow\n };\n tempStyle = {\n display: 'block',\n overflow: 'hidden'\n };\n if (node !== this.renderTo) {\n tempStyle.height = 0;\n }\n css(node, tempStyle);\n // If it still doesn't have an offset width after setting\n // display to block, it probably has an !important priority\n // #2631, 6803\n if (!node.offsetWidth) {\n node.style.setProperty('display', 'block', 'important');\n }\n }\n node = node.parentNode;\n if (node === doc.body) {\n break;\n }\n }\n }\n else {\n while (node && node.style) {\n if (node.hcOrigStyle) {\n css(node, node.hcOrigStyle);\n delete node.hcOrigStyle;\n }\n if (node.hcOrigDetached) {\n doc.body.removeChild(node);\n node.hcOrigDetached = false;\n }\n node = node.parentNode;\n }\n }\n }\n /**\n * Set the {@link Chart.container|chart container's} class name, in\n * addition to `highcharts-container`.\n *\n * @function Highcharts.Chart#setClassName\n *\n * @param {string} [className]\n * The additional class name.\n */\n setClassName(className) {\n this.container.className = 'highcharts-container ' + (className || '');\n }\n /**\n * Get the containing element, determine the size and create the inner\n * container div to hold the chart.\n *\n * @private\n * @function Highcharts.Chart#afterGetContainer\n * @emits Highcharts.Chart#event:afterGetContainer\n */\n getContainer() {\n const chart = this, options = chart.options, optionsChart = options.chart, indexAttrName = 'data-highcharts-chart', containerId = uniqueKey();\n let containerStyle, renderTo = chart.renderTo;\n if (!renderTo) {\n chart.renderTo = renderTo =\n optionsChart.renderTo;\n }\n if (isString(renderTo)) {\n chart.renderTo = renderTo =\n doc.getElementById(renderTo);\n }\n // Display an error if the renderTo is wrong\n if (!renderTo) {\n error(13, true, chart);\n }\n // If the container already holds a chart, destroy it. The check for\n // hasRendered is there because web pages that are saved to disk from\n // the browser, will preserve the data-highcharts-chart attribute and\n // the SVG contents, but not an interactive chart. So in this case,\n // charts[oldChartIndex] will point to the wrong chart if any (#2609).\n const oldChartIndex = pInt(attr(renderTo, indexAttrName));\n if (isNumber(oldChartIndex) &&\n charts[oldChartIndex] &&\n charts[oldChartIndex].hasRendered) {\n charts[oldChartIndex].destroy();\n }\n // Make a reference to the chart from the div\n attr(renderTo, indexAttrName, chart.index);\n // remove previous chart\n renderTo.innerHTML = AST.emptyHTML;\n // If the container doesn't have an offsetWidth, it has or is a child of\n // a node that has display:none. We need to temporarily move it out to a\n // visible state to determine the size, else the legend and tooltips\n // won't render properly. The skipClone option is used in sparklines as\n // a micro optimization, saving about 1-2 ms each chart.\n if (!optionsChart.skipClone && !renderTo.offsetWidth) {\n chart.temporaryDisplay();\n }\n // get the width and height\n chart.getChartSize();\n const chartHeight = chart.chartHeight;\n let chartWidth = chart.chartWidth;\n // Allow table cells and flex-boxes to shrink without the chart blocking\n // them out (#6427)\n css(renderTo, { overflow: 'hidden' });\n // Create the inner container\n if (!chart.styledMode) {\n containerStyle = extend({\n position: 'relative',\n // needed for context menu (avoidscrollbars) and content\n // overflow in IE\n overflow: 'hidden',\n width: chartWidth + 'px',\n height: chartHeight + 'px',\n textAlign: 'left',\n lineHeight: 'normal',\n zIndex: 0,\n '-webkit-tap-highlight-color': 'rgba(0,0,0,0)',\n userSelect: 'none',\n 'touch-action': 'manipulation',\n outline: 'none'\n }, optionsChart.style || {});\n }\n /**\n * The containing HTML element of the chart. The container is\n * dynamically inserted into the element given as the `renderTo`\n * parameter in the {@link Highcharts#chart} constructor.\n *\n * @name Highcharts.Chart#container\n * @type {Highcharts.HTMLDOMElement}\n */\n const container = createElement('div', {\n id: containerId\n }, containerStyle, renderTo);\n chart.container = container;\n // Adjust width if setting height affected it (#20334)\n chart.getChartSize();\n if (chartWidth !== chart.chartWidth) {\n chartWidth = chart.chartWidth;\n if (!chart.styledMode) {\n css(container, {\n width: pick(optionsChart.style?.width, chartWidth + 'px')\n });\n }\n }\n chart.containerBox = chart.getContainerBox();\n // cache the cursor (#1650)\n chart._cursor = container.style.cursor;\n // Initialize the renderer\n const Renderer = optionsChart.renderer || !svg ?\n RendererRegistry.getRendererType(optionsChart.renderer) :\n SVGRenderer;\n /**\n * The renderer instance of the chart. Each chart instance has only one\n * associated renderer.\n *\n * @name Highcharts.Chart#renderer\n * @type {Highcharts.SVGRenderer}\n */\n chart.renderer = new Renderer(container, chartWidth, chartHeight, void 0, optionsChart.forExport, options.exporting && options.exporting.allowHTML, chart.styledMode);\n // Set the initial animation from the options\n setAnimation(void 0, chart);\n chart.setClassName(optionsChart.className);\n if (!chart.styledMode) {\n chart.renderer.setStyle(optionsChart.style);\n }\n else {\n // Initialize definitions\n for (const key in options.defs) { // eslint-disable-line guard-for-in\n this.renderer.definition(options.defs[key]);\n }\n }\n // Add a reference to the charts index\n chart.renderer.chartIndex = chart.index;\n fireEvent(this, 'afterGetContainer');\n }\n /**\n * Calculate margins by rendering axis labels in a preliminary position.\n * Title, subtitle and legend have already been rendered at this stage, but\n * will be moved into their final positions.\n *\n * @private\n * @function Highcharts.Chart#getMargins\n * @emits Highcharts.Chart#event:getMargins\n */\n getMargins(skipAxes) {\n const { spacing, margin, titleOffset } = this;\n this.resetMargins();\n // Adjust for title and subtitle\n if (titleOffset[0] && !defined(margin[0])) {\n this.plotTop = Math.max(this.plotTop, titleOffset[0] + spacing[0]);\n }\n if (titleOffset[2] && !defined(margin[2])) {\n this.marginBottom = Math.max(this.marginBottom, titleOffset[2] + spacing[2]);\n }\n // Adjust for legend\n if (this.legend && this.legend.display) {\n this.legend.adjustMargins(margin, spacing);\n }\n fireEvent(this, 'getMargins');\n if (!skipAxes) {\n this.getAxisMargins();\n }\n }\n /**\n * @private\n * @function Highcharts.Chart#getAxisMargins\n */\n getAxisMargins() {\n const chart = this, \n // [top, right, bottom, left]\n axisOffset = chart.axisOffset = [0, 0, 0, 0], colorAxis = chart.colorAxis, margin = chart.margin, getOffset = function (axes) {\n axes.forEach(function (axis) {\n if (axis.visible) {\n axis.getOffset();\n }\n });\n };\n // pre-render axes to get labels offset width\n if (chart.hasCartesianSeries) {\n getOffset(chart.axes);\n }\n else if (colorAxis && colorAxis.length) {\n getOffset(colorAxis);\n }\n // Add the axis offsets\n marginNames.forEach(function (m, side) {\n if (!defined(margin[side])) {\n chart[m] += axisOffset[side];\n }\n });\n chart.setChartSize();\n }\n /**\n * Return the current options of the chart, but only those that differ from\n * default options. Items that can be either an object or an array of\n * objects, like `series`, `xAxis` and `yAxis`, are always returned as\n * array.\n *\n * @sample highcharts/members/chart-getoptions\n *\n * @function Highcharts.Chart#getOptions\n *\n * @since 11.1.0\n */\n getOptions() {\n return diffObjects(this.userOptions, defaultOptions);\n }\n /**\n * Reflows the chart to its container. By default, the Resize Observer is\n * attached to the chart's div which allows to reflows the chart\n * automatically to its container, as per the\n * [chart.reflow](https://api.highcharts.com/highcharts/chart.reflow)\n * option.\n *\n * @sample highcharts/chart/events-container/\n * Pop up and reflow\n *\n * @function Highcharts.Chart#reflow\n *\n * @param {global.Event} [e]\n * Event arguments. Used primarily when the function is called\n * internally as a response to window resize.\n */\n reflow(e) {\n const chart = this, oldBox = chart.containerBox, containerBox = chart.getContainerBox();\n delete chart.pointer?.chartPosition;\n // Width and height checks for display:none. Target is doc in Opera\n // and win in Firefox, Chrome and IE9.\n if (!chart.isPrinting &&\n !chart.isResizing &&\n oldBox &&\n // When fired by resize observer inside hidden container\n containerBox.width) {\n if (containerBox.width !== oldBox.width ||\n containerBox.height !== oldBox.height) {\n U.clearTimeout(chart.reflowTimeout);\n // When called from window.resize, e is set, else it's called\n // directly (#2224)\n chart.reflowTimeout = syncTimeout(function () {\n // Set size, it may have been destroyed in the meantime\n // (#1257)\n if (chart.container) {\n chart.setSize(void 0, void 0, false);\n }\n }, e ? 100 : 0);\n }\n chart.containerBox = containerBox;\n }\n }\n /**\n * Toggle the event handlers necessary for auto resizing, depending on the\n * `chart.reflow` option.\n *\n * @private\n * @function Highcharts.Chart#setReflow\n */\n setReflow() {\n const chart = this;\n const runReflow = (e) => {\n if (chart.options?.chart.reflow && chart.hasLoaded) {\n chart.reflow(e);\n }\n };\n if (typeof ResizeObserver === 'function') {\n (new ResizeObserver(runReflow)).observe(chart.renderTo);\n // Fallback for more legacy browser versions.\n }\n else {\n const unbind = addEvent(win, 'resize', runReflow);\n addEvent(this, 'destroy', unbind);\n }\n }\n /**\n * Resize the chart to a given width and height. In order to set the width\n * only, the height argument may be skipped. To set the height only, pass\n * `undefined` for the width.\n *\n * @sample highcharts/members/chart-setsize-button/\n * Test resizing from buttons\n * @sample highcharts/members/chart-setsize-jquery-resizable/\n * Add a jQuery UI resizable\n * @sample stock/members/chart-setsize/\n * Highcharts Stock with UI resizable\n *\n * @function Highcharts.Chart#setSize\n *\n * @param {number|null} [width]\n * The new pixel width of the chart. Since v4.2.6, the argument can\n * be `undefined` in order to preserve the current value (when\n * setting height only), or `null` to adapt to the width of the\n * containing element.\n *\n * @param {number|null} [height]\n * The new pixel height of the chart. Since v4.2.6, the argument can\n * be `undefined` in order to preserve the current value, or `null`\n * in order to adapt to the height of the containing element.\n *\n * @param {boolean|Partial} [animation]\n * Whether and how to apply animation. When `undefined`, it applies\n * the animation that is set in the `chart.animation` option.\n *\n *\n * @emits Highcharts.Chart#event:endResize\n * @emits Highcharts.Chart#event:resize\n */\n setSize(width, height, animation) {\n const chart = this, renderer = chart.renderer;\n // Handle the isResizing counter\n chart.isResizing += 1;\n // Set the animation for the current process\n setAnimation(animation, chart);\n const globalAnimation = renderer.globalAnimation;\n chart.oldChartHeight = chart.chartHeight;\n chart.oldChartWidth = chart.chartWidth;\n if (typeof width !== 'undefined') {\n chart.options.chart.width = width;\n }\n if (typeof height !== 'undefined') {\n chart.options.chart.height = height;\n }\n chart.getChartSize();\n const { chartWidth, chartHeight, scrollablePixelsX = 0, scrollablePixelsY = 0 } = chart;\n // Avoid expensive redrawing if the computed size didn't change\n if (chart.isDirtyBox ||\n chartWidth !== chart.oldChartWidth ||\n chartHeight !== chart.oldChartHeight) {\n // Resize the container with the global animation applied if enabled\n // (#2503)\n if (!chart.styledMode) {\n (globalAnimation ? animate : css)(chart.container, {\n width: `${chartWidth + scrollablePixelsX}px`,\n height: `${chartHeight + scrollablePixelsY}px`\n }, globalAnimation);\n }\n chart.setChartSize(true);\n renderer.setSize(chartWidth, chartHeight, globalAnimation);\n // Handle axes\n chart.axes.forEach(function (axis) {\n axis.isDirty = true;\n axis.setScale();\n });\n chart.isDirtyLegend = true; // Force legend redraw\n chart.isDirtyBox = true; // Force redraw of plot and chart border\n chart.layOutTitles(); // #2857\n chart.getMargins();\n chart.redraw(globalAnimation);\n chart.oldChartHeight = void 0;\n fireEvent(chart, 'resize');\n // Fire endResize and set isResizing back. If animation is disabled,\n // fire without delay, but in a new thread to avoid triggering the\n // resize observer (#19027).\n setTimeout(() => {\n if (chart) {\n fireEvent(chart, 'endResize', void 0, () => {\n chart.isResizing -= 1;\n });\n }\n }, animObject(globalAnimation).duration);\n }\n }\n /**\n * Set the public chart properties. This is done before and after the\n * pre-render to determine margin sizes.\n *\n * @private\n * @function Highcharts.Chart#setChartSize\n * @emits Highcharts.Chart#event:afterSetChartSize\n */\n setChartSize(skipAxes) {\n const chart = this, inverted = chart.inverted, renderer = chart.renderer, chartWidth = chart.chartWidth, chartHeight = chart.chartHeight, optionsChart = chart.options.chart, spacing = chart.spacing, clipOffset = chart.clipOffset;\n let plotLeft, plotTop, plotWidth, plotHeight;\n /**\n * The current left position of the plot area in pixels.\n *\n * @name Highcharts.Chart#plotLeft\n * @type {number}\n */\n chart.plotLeft = plotLeft = Math.round(chart.plotLeft);\n /**\n * The current top position of the plot area in pixels.\n *\n * @name Highcharts.Chart#plotTop\n * @type {number}\n */\n chart.plotTop = plotTop = Math.round(chart.plotTop);\n /**\n * The current width of the plot area in pixels.\n *\n * @name Highcharts.Chart#plotWidth\n * @type {number}\n */\n chart.plotWidth = plotWidth = Math.max(0, Math.round(chartWidth - plotLeft - chart.marginRight));\n /**\n * The current height of the plot area in pixels.\n *\n * @name Highcharts.Chart#plotHeight\n * @type {number}\n */\n chart.plotHeight = plotHeight = Math.max(0, Math.round(chartHeight - plotTop - chart.marginBottom));\n chart.plotSizeX = inverted ? plotHeight : plotWidth;\n chart.plotSizeY = inverted ? plotWidth : plotHeight;\n chart.plotBorderWidth = optionsChart.plotBorderWidth || 0;\n // Set boxes used for alignment\n chart.spacingBox = renderer.spacingBox = {\n x: spacing[3],\n y: spacing[0],\n width: chartWidth - spacing[3] - spacing[1],\n height: chartHeight - spacing[0] - spacing[2]\n };\n chart.plotBox = renderer.plotBox = {\n x: plotLeft,\n y: plotTop,\n width: plotWidth,\n height: plotHeight\n };\n const plotBorderWidth = 2 * Math.floor(chart.plotBorderWidth / 2), clipX = Math.ceil(Math.max(plotBorderWidth, clipOffset[3]) / 2), clipY = Math.ceil(Math.max(plotBorderWidth, clipOffset[0]) / 2);\n chart.clipBox = {\n x: clipX,\n y: clipY,\n width: Math.floor(chart.plotSizeX -\n Math.max(plotBorderWidth, clipOffset[1]) / 2 -\n clipX),\n height: Math.max(0, Math.floor(chart.plotSizeY -\n Math.max(plotBorderWidth, clipOffset[2]) / 2 -\n clipY))\n };\n if (!skipAxes) {\n chart.axes.forEach(function (axis) {\n axis.setAxisSize();\n axis.setAxisTranslation();\n });\n renderer.alignElements();\n }\n fireEvent(chart, 'afterSetChartSize', { skipAxes: skipAxes });\n }\n /**\n * Initial margins before auto size margins are applied.\n *\n * @private\n * @function Highcharts.Chart#resetMargins\n */\n resetMargins() {\n fireEvent(this, 'resetMargins');\n const chart = this, chartOptions = chart.options.chart;\n // Create margin and spacing array\n ['margin', 'spacing'].forEach(function splashArrays(target) {\n const value = chartOptions[target], values = isObject(value) ? value : [value, value, value, value];\n [\n 'Top',\n 'Right',\n 'Bottom',\n 'Left'\n ].forEach(function (sideName, side) {\n chart[target][side] = pick(chartOptions[target + sideName], values[side]);\n });\n });\n // Set margin names like chart.plotTop, chart.plotLeft,\n // chart.marginRight, chart.marginBottom.\n marginNames.forEach(function (m, side) {\n chart[m] = pick(chart.margin[side], chart.spacing[side]);\n });\n chart.axisOffset = [0, 0, 0, 0]; // top, right, bottom, left\n chart.clipOffset = [0, 0, 0, 0];\n }\n /**\n * Internal function to draw or redraw the borders and backgrounds for chart\n * and plot area.\n *\n * @private\n * @function Highcharts.Chart#drawChartBox\n * @emits Highcharts.Chart#event:afterDrawChartBox\n */\n drawChartBox() {\n const chart = this, optionsChart = chart.options.chart, renderer = chart.renderer, chartWidth = chart.chartWidth, chartHeight = chart.chartHeight, styledMode = chart.styledMode, plotBGImage = chart.plotBGImage, chartBackgroundColor = optionsChart.backgroundColor, plotBackgroundColor = optionsChart.plotBackgroundColor, plotBackgroundImage = optionsChart.plotBackgroundImage, plotLeft = chart.plotLeft, plotTop = chart.plotTop, plotWidth = chart.plotWidth, plotHeight = chart.plotHeight, plotBox = chart.plotBox, clipRect = chart.clipRect, clipBox = chart.clipBox;\n let chartBackground = chart.chartBackground, plotBackground = chart.plotBackground, plotBorder = chart.plotBorder, chartBorderWidth, mgn, bgAttr, verb = 'animate';\n // Chart area\n if (!chartBackground) {\n chart.chartBackground = chartBackground = renderer.rect()\n .addClass('highcharts-background')\n .add();\n verb = 'attr';\n }\n if (!styledMode) {\n // Presentational\n chartBorderWidth = optionsChart.borderWidth || 0;\n mgn = chartBorderWidth + (optionsChart.shadow ? 8 : 0);\n bgAttr = {\n fill: chartBackgroundColor || 'none'\n };\n if (chartBorderWidth || chartBackground['stroke-width']) { // #980\n bgAttr.stroke = optionsChart.borderColor;\n bgAttr['stroke-width'] = chartBorderWidth;\n }\n chartBackground\n .attr(bgAttr)\n .shadow(optionsChart.shadow);\n }\n else {\n chartBorderWidth = mgn = chartBackground.strokeWidth();\n }\n chartBackground[verb]({\n x: mgn / 2,\n y: mgn / 2,\n width: chartWidth - mgn - chartBorderWidth % 2,\n height: chartHeight - mgn - chartBorderWidth % 2,\n r: optionsChart.borderRadius\n });\n // Plot background\n verb = 'animate';\n if (!plotBackground) {\n verb = 'attr';\n chart.plotBackground = plotBackground = renderer.rect()\n .addClass('highcharts-plot-background')\n .add();\n }\n plotBackground[verb](plotBox);\n if (!styledMode) {\n // Presentational attributes for the background\n plotBackground\n .attr({\n fill: plotBackgroundColor || 'none'\n })\n .shadow(optionsChart.plotShadow);\n // Create the background image\n if (plotBackgroundImage) {\n if (!plotBGImage) {\n chart.plotBGImage = renderer.image(plotBackgroundImage, plotLeft, plotTop, plotWidth, plotHeight).add();\n }\n else {\n if (plotBackgroundImage !== plotBGImage.attr('href')) {\n plotBGImage.attr('href', plotBackgroundImage);\n }\n plotBGImage.animate(plotBox);\n }\n }\n }\n // Plot clip\n if (!clipRect) {\n chart.clipRect = renderer.clipRect(clipBox);\n }\n else {\n clipRect.animate({\n width: clipBox.width,\n height: clipBox.height\n });\n }\n // Plot area border\n verb = 'animate';\n if (!plotBorder) {\n verb = 'attr';\n chart.plotBorder = plotBorder = renderer.rect()\n .addClass('highcharts-plot-border')\n .attr({\n zIndex: 1 // Above the grid\n })\n .add();\n }\n if (!styledMode) {\n // Presentational\n plotBorder.attr({\n stroke: optionsChart.plotBorderColor,\n 'stroke-width': optionsChart.plotBorderWidth || 0,\n fill: 'none'\n });\n }\n plotBorder[verb](plotBorder.crisp({\n x: plotLeft,\n y: plotTop,\n width: plotWidth,\n height: plotHeight\n }, -plotBorder.strokeWidth())); // #3282 plotBorder should be negative;\n // reset\n chart.isDirtyBox = false;\n fireEvent(this, 'afterDrawChartBox');\n }\n /**\n * Detect whether a certain chart property is needed based on inspecting its\n * options and series. This mainly applies to the chart.inverted property,\n * and in extensions to the chart.angular and chart.polar properties.\n *\n * @private\n * @function Highcharts.Chart#propFromSeries\n */\n propFromSeries() {\n const chart = this, optionsChart = chart.options.chart, seriesOptions = chart.options.series;\n let i, klass, value;\n /**\n * The flag is set to `true` if a series of the chart is inverted.\n *\n * @name Highcharts.Chart#inverted\n * @type {boolean|undefined}\n */\n ['inverted', 'angular', 'polar'].forEach(function (key) {\n // The default series type's class\n klass = seriesTypes[optionsChart.type];\n // Get the value from available chart-wide properties\n value =\n // It is set in the options:\n optionsChart[key] ||\n // The default series class:\n (klass && klass.prototype[key]);\n // requires it\n // 4. Check if any the chart's series require it\n i = seriesOptions && seriesOptions.length;\n while (!value && i--) {\n klass = seriesTypes[seriesOptions[i].type];\n if (klass && klass.prototype[key]) {\n value = true;\n }\n }\n // Set the chart property\n chart[key] = value;\n });\n }\n /**\n * Internal function to link two or more series together, based on the\n * `linkedTo` option. This is done from `Chart.render`, and after\n * `Chart.addSeries` and `Series.remove`.\n *\n * @private\n * @function Highcharts.Chart#linkSeries\n * @emits Highcharts.Chart#event:afterLinkSeries\n */\n linkSeries(isUpdating) {\n const chart = this, chartSeries = chart.series;\n // Reset links\n chartSeries.forEach(function (series) {\n series.linkedSeries.length = 0;\n });\n // Apply new links\n chartSeries.forEach(function (series) {\n const { linkedTo } = series.options;\n if (isString(linkedTo)) {\n let linkedParent;\n if (linkedTo === ':previous') {\n linkedParent = chart.series[series.index - 1];\n }\n else {\n linkedParent = chart.get(linkedTo);\n }\n // #3341 avoid mutual linking\n if (linkedParent &&\n linkedParent.linkedParent !== series) {\n linkedParent.linkedSeries.push(series);\n /**\n * The parent series of the current series, if the current\n * series has a [linkedTo](https://api.highcharts.com/highcharts/series.line.linkedTo)\n * setting.\n *\n * @name Highcharts.Series#linkedParent\n * @type {Highcharts.Series}\n * @readonly\n */\n series.linkedParent = linkedParent;\n if (linkedParent.enabledDataSorting) {\n series.setDataSortingOptions();\n }\n series.visible = pick(series.options.visible, linkedParent.options.visible, series.visible); // #3879\n }\n }\n });\n fireEvent(this, 'afterLinkSeries', { isUpdating });\n }\n /**\n * Render series for the chart.\n *\n * @private\n * @function Highcharts.Chart#renderSeries\n */\n renderSeries() {\n this.series.forEach(function (serie) {\n serie.translate();\n serie.render();\n });\n }\n /**\n * Render all graphics for the chart. Runs internally on initialization.\n *\n * @private\n * @function Highcharts.Chart#render\n */\n render() {\n const chart = this, axes = chart.axes, colorAxis = chart.colorAxis, renderer = chart.renderer, axisLayoutRuns = chart.options.chart.axisLayoutRuns || 2, renderAxes = (axes) => {\n axes.forEach((axis) => {\n if (axis.visible) {\n axis.render();\n }\n });\n };\n let expectedSpace = 0, // Correction for X axis labels\n // If the plot area size has changed significantly, calculate tick\n // positions again\n redoHorizontal = true, redoVertical, run = 0;\n // Title\n chart.setTitle();\n // Fire an event before the margins are computed. This is where the\n // legend is assigned.\n fireEvent(chart, 'beforeMargins');\n // Get stacks\n chart.getStacks?.();\n // Get chart margins\n chart.getMargins(true);\n chart.setChartSize();\n for (const axis of axes) {\n const { options } = axis, { labels } = options;\n if (axis.horiz &&\n axis.visible &&\n labels.enabled &&\n axis.series.length &&\n axis.coll !== 'colorAxis' &&\n !chart.polar) {\n expectedSpace = options.tickLength;\n axis.createGroups();\n // Calculate expected space based on dummy tick\n const mockTick = new Tick(axis, 0, '', true), label = mockTick.createLabel('x', labels);\n mockTick.destroy();\n if (label &&\n pick(labels.reserveSpace, !isNumber(options.crossing))) {\n expectedSpace = label.getBBox().height +\n labels.distance +\n Math.max(options.offset || 0, 0);\n }\n if (expectedSpace) {\n label?.destroy();\n break;\n }\n }\n }\n // Use Math.max to prevent negative plotHeight\n chart.plotHeight = Math.max(chart.plotHeight - expectedSpace, 0);\n while ((redoHorizontal || redoVertical || axisLayoutRuns > 1) &&\n run < axisLayoutRuns // #19794\n ) {\n const tempWidth = chart.plotWidth, tempHeight = chart.plotHeight;\n for (const axis of axes) {\n if (run === 0) {\n // Get margins by pre-rendering axes\n axis.setScale();\n }\n else if ((axis.horiz && redoHorizontal) ||\n (!axis.horiz && redoVertical)) {\n // Update to reflect the new margins\n axis.setTickInterval(true);\n }\n }\n if (run === 0) {\n chart.getAxisMargins();\n }\n else {\n // Check again for new, rotated or moved labels\n chart.getMargins();\n }\n redoHorizontal = (tempWidth / chart.plotWidth) > (run ? 1 : 1.1);\n redoVertical = (tempHeight / chart.plotHeight) > (run ? 1 : 1.05);\n run++;\n }\n // Draw the borders and backgrounds\n chart.drawChartBox();\n // Axes\n if (chart.hasCartesianSeries) {\n renderAxes(axes);\n }\n else if (colorAxis && colorAxis.length) {\n renderAxes(colorAxis);\n }\n // The series\n if (!chart.seriesGroup) {\n chart.seriesGroup = renderer.g('series-group')\n .attr({ zIndex: 3 })\n .shadow(chart.options.chart.seriesGroupShadow)\n .add();\n }\n chart.renderSeries();\n // Credits\n chart.addCredits();\n // Handle responsiveness\n if (chart.setResponsive) {\n chart.setResponsive();\n }\n // Set flag\n chart.hasRendered = true;\n }\n /**\n * Set a new credits label for the chart.\n *\n * @sample highcharts/credits/credits-update/\n * Add and update credits\n *\n * @function Highcharts.Chart#addCredits\n *\n * @param {Highcharts.CreditsOptions} [credits]\n * A configuration object for the new credits.\n */\n addCredits(credits) {\n const chart = this, creds = merge(true, this.options.credits, credits);\n if (creds.enabled && !this.credits) {\n /**\n * The chart's credits label. The label has an `update` method that\n * allows setting new options as per the\n * [credits options set](https://api.highcharts.com/highcharts/credits).\n *\n * @name Highcharts.Chart#credits\n * @type {Highcharts.SVGElement}\n */\n this.credits = this.renderer.text(creds.text + (this.mapCredits || ''), 0, 0)\n .addClass('highcharts-credits')\n .on('click', function () {\n if (creds.href) {\n win.location.href = creds.href;\n }\n })\n .attr({\n align: creds.position.align,\n zIndex: 8\n });\n if (!chart.styledMode) {\n this.credits.css(creds.style);\n }\n this.credits\n .add()\n .align(creds.position);\n // Dynamically update\n this.credits.update = function (options) {\n chart.credits = chart.credits.destroy();\n chart.addCredits(options);\n };\n }\n }\n /**\n * Remove the chart and purge memory. This method is called internally\n * before adding a second chart into the same container, as well as on\n * window unload to prevent leaks.\n *\n * @sample highcharts/members/chart-destroy/\n * Destroy the chart from a button\n * @sample stock/members/chart-destroy/\n * Destroy with Highcharts Stock\n *\n * @function Highcharts.Chart#destroy\n *\n * @emits Highcharts.Chart#event:destroy\n */\n destroy() {\n const chart = this, axes = chart.axes, series = chart.series, container = chart.container, parentNode = container && container.parentNode;\n let i;\n // fire the chart.destroy event\n fireEvent(chart, 'destroy');\n // Delete the chart from charts lookup array\n if (chart.renderer.forExport) {\n erase(charts, chart); // #6569\n }\n else {\n charts[chart.index] = void 0;\n }\n H.chartCount--;\n chart.renderTo.removeAttribute('data-highcharts-chart');\n // remove events\n removeEvent(chart);\n // ==== Destroy collections:\n // Destroy axes\n i = axes.length;\n while (i--) {\n axes[i] = axes[i].destroy();\n }\n // Destroy scroller & scroller series before destroying base series\n if (this.scroller && this.scroller.destroy) {\n this.scroller.destroy();\n }\n // Destroy each series\n i = series.length;\n while (i--) {\n series[i] = series[i].destroy();\n }\n // ==== Destroy chart properties:\n [\n 'title', 'subtitle', 'chartBackground', 'plotBackground',\n 'plotBGImage', 'plotBorder', 'seriesGroup', 'clipRect', 'credits',\n 'pointer', 'rangeSelector', 'legend', 'resetZoomButton', 'tooltip',\n 'renderer'\n ].forEach(function (name) {\n const prop = chart[name];\n if (prop && prop.destroy) {\n chart[name] = prop.destroy();\n }\n });\n // Remove container and all SVG, check container as it can break in IE\n // when destroyed before finished loading\n if (container) {\n container.innerHTML = AST.emptyHTML;\n removeEvent(container);\n if (parentNode) {\n discardElement(container);\n }\n }\n // clean it all up\n objectEach(chart, function (val, key) {\n delete chart[key];\n });\n }\n /**\n * Prepare for first rendering after all data are loaded.\n *\n * @private\n * @function Highcharts.Chart#firstRender\n * @emits Highcharts.Chart#event:beforeRender\n */\n firstRender() {\n const chart = this, options = chart.options;\n // Create the container\n chart.getContainer();\n chart.resetMargins();\n chart.setChartSize();\n // Set the common chart properties (mainly invert) from the given series\n chart.propFromSeries();\n // get axes\n chart.getAxes();\n // Initialize the series\n const series = isArray(options.series) ? options.series : [];\n options.series = []; // Avoid mutation\n series.forEach(\n // #9680\n function (serieOptions) {\n chart.initSeries(serieOptions);\n });\n chart.linkSeries();\n chart.setSortedData();\n // Run an event after axes and series are initialized, but before\n // render. At this stage, the series data is indexed and cached in the\n // xData and yData arrays, so we can access those before rendering. Used\n // in Highcharts Stock.\n fireEvent(chart, 'beforeRender');\n chart.render();\n chart.pointer?.getChartPosition(); // #14973\n // Fire the load event if there are no external images\n if (!chart.renderer.imgCount && !chart.hasLoaded) {\n chart.onload();\n }\n // If the chart was rendered outside the top container, put it back in\n // (#3679)\n chart.temporaryDisplay(true);\n }\n /**\n * Internal function that runs on chart load, async if any images are loaded\n * in the chart. Runs the callbacks and triggers the `load` and `render`\n * events.\n *\n * @private\n * @function Highcharts.Chart#onload\n * @emits Highcharts.Chart#event:load\n * @emits Highcharts.Chart#event:render\n */\n onload() {\n // Run callbacks, first the ones registered by modules, then user's one\n this.callbacks.concat([this.callback]).forEach(function (fn) {\n // Chart destroyed in its own callback (#3600)\n if (fn && typeof this.index !== 'undefined') {\n fn.apply(this, [this]);\n }\n }, this);\n fireEvent(this, 'load');\n fireEvent(this, 'render');\n // Set up auto resize, check for not destroyed (#6068)\n if (defined(this.index)) {\n this.setReflow();\n }\n this.warnIfA11yModuleNotLoaded();\n // Don't run again\n this.hasLoaded = true;\n }\n /**\n * Emit console warning if the a11y module is not loaded.\n */\n warnIfA11yModuleNotLoaded() {\n const { options, title } = this;\n if (options && !this.accessibility) {\n // Make chart behave as an image with the title as alt text\n this.renderer.boxWrapper.attr({\n role: 'img',\n 'aria-label': ((title && title.element.textContent) || ''\n // #17753, < is not allowed in SVG attributes\n ).replace(/} [animation]\n * Whether to apply animation, and optionally animation\n * configuration. When `undefined`, it applies the animation that is\n * set in the `chart.animation` option.\n *\n * @return {Highcharts.Series}\n * The newly created series object.\n *\n * @emits Highcharts.Chart#event:addSeries\n * @emits Highcharts.Chart#event:afterAddSeries\n */\n addSeries(options, redraw, animation) {\n const chart = this;\n let series;\n if (options) { // <- not necessary\n redraw = pick(redraw, true); // defaults to true\n fireEvent(chart, 'addSeries', { options: options }, function () {\n series = chart.initSeries(options);\n chart.isDirtyLegend = true;\n chart.linkSeries();\n if (series.enabledDataSorting) {\n // We need to call `setData` after `linkSeries`\n series.setData(options.data, false);\n }\n fireEvent(chart, 'afterAddSeries', { series: series });\n if (redraw) {\n chart.redraw(animation);\n }\n });\n }\n return series;\n }\n /**\n * Add an axis to the chart after render time. Note that this method should\n * never be used when adding data synchronously at chart render time, as it\n * adds expense to the calculations and rendering. When adding data at the\n * same time as the chart is initialized, add the axis as a configuration\n * option instead.\n *\n * @sample highcharts/members/chart-addaxis/\n * Add and remove axes\n *\n * @function Highcharts.Chart#addAxis\n *\n * @param {Highcharts.AxisOptions} options\n * The axis options.\n *\n * @param {boolean} [isX=false]\n * Whether it is an X axis or a value axis.\n *\n * @param {boolean} [redraw=true]\n * Whether to redraw the chart after adding.\n *\n * @param {boolean|Partial} [animation]\n * Whether and how to apply animation in the redraw. When\n * `undefined`, it applies the animation that is set in the\n * `chart.animation` option.\n *\n * @return {Highcharts.Axis}\n * The newly generated Axis object.\n */\n addAxis(options, isX, redraw, animation) {\n return this.createAxis(isX ? 'xAxis' : 'yAxis', { axis: options, redraw: redraw, animation: animation });\n }\n /**\n * Add a color axis to the chart after render time. Note that this method\n * should never be used when adding data synchronously at chart render time,\n * as it adds expense to the calculations and rendering. When adding data at\n * the same time as the chart is initialized, add the axis as a\n * configuration option instead.\n *\n * @sample highcharts/members/chart-addaxis/\n * Add and remove axes\n *\n * @function Highcharts.Chart#addColorAxis\n *\n * @param {Highcharts.ColorAxisOptions} options\n * The axis options.\n *\n * @param {boolean} [redraw=true]\n * Whether to redraw the chart after adding.\n *\n * @param {boolean|Partial} [animation]\n * Whether and how to apply animation in the redraw. When\n * `undefined`, it applies the animation that is set in the\n * `chart.animation` option.\n *\n * @return {Highcharts.Axis}\n * The newly generated Axis object.\n */\n addColorAxis(options, redraw, animation) {\n return this.createAxis('colorAxis', { axis: options, redraw: redraw, animation: animation });\n }\n /**\n * Factory for creating different axis types.\n *\n * @private\n * @function Highcharts.Chart#createAxis\n *\n * @param {string} coll\n * An axis type.\n *\n * @param {...Array<*>} arguments\n * All arguments for the constructor.\n *\n * @return {Highcharts.Axis}\n * The newly generated Axis object.\n */\n createAxis(coll, options) {\n const axis = new Axis(this, options.axis, coll);\n if (pick(options.redraw, true)) {\n this.redraw(options.animation);\n }\n return axis;\n }\n /**\n * Dim the chart and show a loading text or symbol. Options for the loading\n * screen are defined in {@link\n * https://api.highcharts.com/highcharts/loading|the loading options}.\n *\n * @sample highcharts/members/chart-hideloading/\n * Show and hide loading from a button\n * @sample highcharts/members/chart-showloading/\n * Apply different text labels\n * @sample stock/members/chart-show-hide-loading/\n * Toggle loading in Highcharts Stock\n *\n * @function Highcharts.Chart#showLoading\n *\n * @param {string} [str]\n * An optional text to show in the loading label instead of the\n * default one. The default text is set in\n * [lang.loading](https://api.highcharts.com/highcharts/lang.loading).\n */\n showLoading(str) {\n const chart = this, options = chart.options, loadingOptions = options.loading, setLoadingSize = function () {\n if (loadingDiv) {\n css(loadingDiv, {\n left: chart.plotLeft + 'px',\n top: chart.plotTop + 'px',\n width: chart.plotWidth + 'px',\n height: chart.plotHeight + 'px'\n });\n }\n };\n let loadingDiv = chart.loadingDiv, loadingSpan = chart.loadingSpan;\n // create the layer at the first call\n if (!loadingDiv) {\n chart.loadingDiv = loadingDiv = createElement('div', {\n className: 'highcharts-loading highcharts-loading-hidden'\n }, null, chart.container);\n }\n if (!loadingSpan) {\n chart.loadingSpan = loadingSpan = createElement('span', { className: 'highcharts-loading-inner' }, null, loadingDiv);\n addEvent(chart, 'redraw', setLoadingSize); // #1080\n }\n loadingDiv.className = 'highcharts-loading';\n // Update text\n AST.setElementHTML(loadingSpan, pick(str, options.lang.loading, ''));\n if (!chart.styledMode) {\n // Update visuals\n css(loadingDiv, extend(loadingOptions.style, {\n zIndex: 10\n }));\n css(loadingSpan, loadingOptions.labelStyle);\n // Show it\n if (!chart.loadingShown) {\n css(loadingDiv, {\n opacity: 0,\n display: ''\n });\n animate(loadingDiv, {\n opacity: loadingOptions.style.opacity || 0.5\n }, {\n duration: loadingOptions.showDuration || 0\n });\n }\n }\n chart.loadingShown = true;\n setLoadingSize();\n }\n /**\n * Hide the loading layer.\n *\n * @see Highcharts.Chart#showLoading\n *\n * @sample highcharts/members/chart-hideloading/\n * Show and hide loading from a button\n * @sample stock/members/chart-show-hide-loading/\n * Toggle loading in Highcharts Stock\n *\n * @function Highcharts.Chart#hideLoading\n */\n hideLoading() {\n const options = this.options, loadingDiv = this.loadingDiv;\n if (loadingDiv) {\n loadingDiv.className =\n 'highcharts-loading highcharts-loading-hidden';\n if (!this.styledMode) {\n animate(loadingDiv, {\n opacity: 0\n }, {\n duration: options.loading.hideDuration || 100,\n complete: function () {\n css(loadingDiv, { display: 'none' });\n }\n });\n }\n }\n this.loadingShown = false;\n }\n /**\n * A generic function to update any element of the chart. Elements can be\n * enabled and disabled, moved, re-styled, re-formatted etc.\n *\n * A special case is configuration objects that take arrays, for example\n * [xAxis](https://api.highcharts.com/highcharts/xAxis),\n * [yAxis](https://api.highcharts.com/highcharts/yAxis) or\n * [series](https://api.highcharts.com/highcharts/series). For these\n * collections, an `id` option is used to map the new option set to an\n * existing object. If an existing object of the same id is not found, the\n * corresponding item is updated. So for example, running `chart.update`\n * with a series item without an id, will cause the existing chart's series\n * with the same index in the series array to be updated. When the\n * `oneToOne` parameter is true, `chart.update` will also take care of\n * adding and removing items from the collection. Read more under the\n * parameter description below.\n *\n * Note that when changing series data, `chart.update` may mutate the passed\n * data options.\n *\n * See also the\n * [responsive option set](https://api.highcharts.com/highcharts/responsive).\n * Switching between `responsive.rules` basically runs `chart.update` under\n * the hood.\n *\n * @sample highcharts/members/chart-update/\n * Update chart geometry\n *\n * @function Highcharts.Chart#update\n *\n * @param {Highcharts.Options} options\n * A configuration object for the new chart options.\n *\n * @param {boolean} [redraw=true]\n * Whether to redraw the chart.\n *\n * @param {boolean} [oneToOne=false]\n * When `true`, the `series`, `xAxis`, `yAxis` and `annotations`\n * collections will be updated one to one, and items will be either\n * added or removed to match the new updated options. For example,\n * if the chart has two series and we call `chart.update` with a\n * configuration containing three series, one will be added. If we\n * call `chart.update` with one series, one will be removed. Setting\n * an empty `series` array will remove all series, but leaving out\n * the`series` property will leave all series untouched. If the\n * series have id's, the new series options will be matched by id,\n * and the remaining ones removed.\n *\n * @param {boolean|Partial} [animation]\n * Whether to apply animation, and optionally animation\n * configuration. When `undefined`, it applies the animation that is\n * set in the `chart.animation` option.\n *\n * @emits Highcharts.Chart#event:update\n * @emits Highcharts.Chart#event:afterUpdate\n */\n update(options, redraw, oneToOne, animation) {\n const chart = this, adders = {\n credits: 'addCredits',\n title: 'setTitle',\n subtitle: 'setSubtitle',\n caption: 'setCaption'\n }, isResponsiveOptions = options.isResponsiveOptions, itemsForRemoval = [];\n let updateAllAxes, updateAllSeries, runSetSize;\n fireEvent(chart, 'update', { options: options });\n // If there are responsive rules in action, undo the responsive rules\n // before we apply the updated options and replay the responsive rules\n // on top from the chart.redraw function (#9617).\n if (!isResponsiveOptions) {\n chart.setResponsive(false, true);\n }\n options = diffObjects(options, chart.options);\n chart.userOptions = merge(chart.userOptions, options);\n // If the top-level chart option is present, some special updates are\n // required\n const optionsChart = options.chart;\n if (optionsChart) {\n merge(true, chart.options.chart, optionsChart);\n // Add support for deprecated zooming options like zoomType, #17861\n this.setZoomOptions();\n // Setter function\n if ('className' in optionsChart) {\n chart.setClassName(optionsChart.className);\n }\n if ('inverted' in optionsChart ||\n 'polar' in optionsChart ||\n 'type' in optionsChart) {\n // Parse options.chart.inverted and options.chart.polar together\n // with the available series.\n chart.propFromSeries();\n updateAllAxes = true;\n }\n if ('alignTicks' in optionsChart) { // #6452\n updateAllAxes = true;\n }\n if ('events' in optionsChart) {\n // Chart event handlers\n registerEventOptions(this, optionsChart);\n }\n objectEach(optionsChart, function (val, key) {\n if (chart.propsRequireUpdateSeries.indexOf('chart.' + key) !==\n -1) {\n updateAllSeries = true;\n }\n // Only dirty box\n if (chart.propsRequireDirtyBox.indexOf(key) !== -1) {\n chart.isDirtyBox = true;\n }\n // Chart setSize\n if (chart.propsRequireReflow.indexOf(key) !== -1) {\n chart.isDirtyBox = true;\n if (!isResponsiveOptions) {\n runSetSize = true;\n }\n }\n });\n if (!chart.styledMode && optionsChart.style) {\n chart.renderer.setStyle(chart.options.chart.style || {});\n }\n }\n // Moved up, because tooltip needs updated plotOptions (#6218)\n if (!chart.styledMode && options.colors) {\n this.options.colors = options.colors;\n }\n if (options.time) {\n // Maintaining legacy global time. If the chart is instantiated\n // first with global time, then updated with time options, we need\n // to create a new Time instance to avoid mutating the global time\n // (#10536).\n if (this.time === defaultTime) {\n this.time = new Time(options.time);\n }\n // If we're updating, the time class is different from other chart\n // classes (chart.legend, chart.tooltip etc) in that it doesn't know\n // about the chart. The other chart[something].update functions also\n // set the chart.options[something]. For the time class however we\n // need to update the chart options separately. #14230.\n merge(true, chart.options.time, options.time);\n }\n // Some option structures correspond one-to-one to chart objects that\n // have update methods, for example\n // options.credits => chart.credits\n // options.legend => chart.legend\n // options.title => chart.title\n // options.tooltip => chart.tooltip\n // options.subtitle => chart.subtitle\n // options.mapNavigation => chart.mapNavigation\n // options.navigator => chart.navigator\n // options.scrollbar => chart.scrollbar\n objectEach(options, function (val, key) {\n if (chart[key] &&\n typeof chart[key].update === 'function') {\n chart[key].update(val, false);\n // If a one-to-one object does not exist, look for an adder function\n }\n else if (typeof chart[adders[key]] === 'function') {\n chart[adders[key]](val);\n // Else, just merge the options. For nodes like loading, noData,\n // plotOptions\n }\n else if (key !== 'colors' &&\n chart.collectionsWithUpdate.indexOf(key) === -1) {\n merge(true, chart.options[key], options[key]);\n }\n if (key !== 'chart' &&\n chart.propsRequireUpdateSeries.indexOf(key) !== -1) {\n updateAllSeries = true;\n }\n });\n // Setters for collections. For axes and series, each item is referred\n // by an id. If the id is not found, it defaults to the corresponding\n // item in the collection, so setting one series without an id, will\n // update the first series in the chart. Setting two series without\n // an id will update the first and the second respectively (#6019)\n // chart.update and responsive.\n this.collectionsWithUpdate.forEach(function (coll) {\n if (options[coll]) {\n splat(options[coll]).forEach(function (newOptions, i) {\n const hasId = defined(newOptions.id);\n let item;\n // Match by id\n if (hasId) {\n item = chart.get(newOptions.id);\n }\n // No match by id found, match by index instead\n if (!item && chart[coll]) {\n item = chart[coll][pick(newOptions.index, i)];\n // Check if we grabbed an item with an existing but\n // different id (#13541). Check that the item in this\n // position is not internal (navigator).\n if (item && ((hasId && defined(item.options.id)) ||\n item.options.isInternal)) {\n item = void 0;\n }\n }\n if (item && item.coll === coll) {\n item.update(newOptions, false);\n if (oneToOne) {\n item.touched = true;\n }\n }\n // If oneToOne and no matching item is found, add one\n if (!item && oneToOne && chart.collectionsWithInit[coll]) {\n chart.collectionsWithInit[coll][0].apply(chart, \n // [newOptions, ...extraArguments, redraw=false]\n [\n newOptions\n ].concat(\n // Not all initializers require extra args\n chart.collectionsWithInit[coll][1] || []).concat([\n false\n ])).touched = true;\n }\n });\n // Add items for removal\n if (oneToOne) {\n chart[coll].forEach(function (item) {\n if (!item.touched && !item.options.isInternal) {\n itemsForRemoval.push(item);\n }\n else {\n delete item.touched;\n }\n });\n }\n }\n });\n itemsForRemoval.forEach(function (item) {\n if (item.chart && item.remove) { // #9097, avoid removing twice\n item.remove(false);\n }\n });\n if (updateAllAxes) {\n chart.axes.forEach(function (axis) {\n axis.update({}, false);\n });\n }\n // Certain options require the whole series structure to be thrown away\n // and rebuilt\n if (updateAllSeries) {\n chart.getSeriesOrderByLinks().forEach(function (series) {\n // Avoid removed navigator series\n if (series.chart) {\n series.update({}, false);\n }\n }, this);\n }\n // Update size. Redraw is forced.\n const newWidth = optionsChart && optionsChart.width;\n const newHeight = optionsChart && (isString(optionsChart.height) ?\n relativeLength(optionsChart.height, newWidth || chart.chartWidth) :\n optionsChart.height);\n if (\n // In this case, run chart.setSize with newWidth and newHeight which\n // are undefined, only for reflowing chart elements because margin\n // or spacing has been set (#8190)\n runSetSize ||\n // In this case, the size is actually set\n (isNumber(newWidth) && newWidth !== chart.chartWidth) ||\n (isNumber(newHeight) && newHeight !== chart.chartHeight)) {\n chart.setSize(newWidth, newHeight, animation);\n }\n else if (pick(redraw, true)) {\n chart.redraw(animation);\n }\n fireEvent(chart, 'afterUpdate', {\n options: options,\n redraw: redraw,\n animation: animation\n });\n }\n /**\n * Shortcut to set the subtitle options. This can also be done from {@link\n * Chart#update} or {@link Chart#setTitle}.\n *\n * @function Highcharts.Chart#setSubtitle\n *\n * @param {Highcharts.SubtitleOptions} options\n * New subtitle options. The subtitle text itself is set by the\n * `options.text` property.\n */\n setSubtitle(options, redraw) {\n this.applyDescription('subtitle', options);\n this.layOutTitles(redraw);\n }\n /**\n * Set the caption options. This can also be done from {@link\n * Chart#update}.\n *\n * @function Highcharts.Chart#setCaption\n *\n * @param {Highcharts.CaptionOptions} options\n * New caption options. The caption text itself is set by the\n * `options.text` property.\n */\n setCaption(options, redraw) {\n this.applyDescription('caption', options);\n this.layOutTitles(redraw);\n }\n /**\n * Display the zoom button, so users can reset zoom to the default view\n * settings.\n *\n * @function Highcharts.Chart#showResetZoom\n *\n * @emits Highcharts.Chart#event:afterShowResetZoom\n * @emits Highcharts.Chart#event:beforeShowResetZoom\n */\n showResetZoom() {\n const chart = this, lang = defaultOptions.lang, btnOptions = chart.zooming.resetButton, theme = btnOptions.theme, alignTo = (btnOptions.relativeTo === 'chart' ||\n btnOptions.relativeTo === 'spacingBox' ?\n null :\n 'plotBox');\n /**\n * @private\n */\n function zoomOut() {\n chart.zoomOut();\n }\n fireEvent(this, 'beforeShowResetZoom', null, function () {\n chart.resetZoomButton = chart.renderer\n .button(lang.resetZoom, null, null, zoomOut, theme)\n .attr({\n align: btnOptions.position.align,\n title: lang.resetZoomTitle\n })\n .addClass('highcharts-reset-zoom')\n .add()\n .align(btnOptions.position, false, alignTo);\n });\n fireEvent(this, 'afterShowResetZoom');\n }\n /**\n * Zoom the chart out after a user has zoomed in. See also\n * [Axis.setExtremes](/class-reference/Highcharts.Axis#setExtremes).\n *\n * @function Highcharts.Chart#zoomOut\n *\n * @emits Highcharts.Chart#event:selection\n */\n zoomOut() {\n fireEvent(this, 'selection', { resetSelection: true }, () => this.transform({ reset: true, trigger: 'zoom' }));\n }\n /**\n * Pan the chart by dragging the mouse across the pane. This function is\n * called on mouse move, and the distance to pan is computed from chartX\n * compared to the first chartX position in the dragging operation.\n *\n * @private\n * @function Highcharts.Chart#pan\n * @param {Highcharts.PointerEventObject} event\n * @param {string} panning\n */\n pan(event, panning) {\n const chart = this, panningOptions = (typeof panning === 'object' ?\n panning :\n {\n enabled: panning,\n type: 'x'\n }), type = panningOptions.type, axes = type && chart[{\n x: 'xAxis',\n xy: 'axes',\n y: 'yAxis'\n }[type]]\n .filter((axis) => axis.options.panningEnabled && !axis.options.isInternal), chartOptions = chart.options.chart;\n if (chartOptions?.panning) {\n chartOptions.panning = panningOptions;\n }\n fireEvent(this, 'pan', { originalEvent: event }, () => {\n chart.transform({\n axes,\n event,\n to: {\n x: event.chartX - (chart.mouseDownX || 0),\n y: event.chartY - (chart.mouseDownY || 0)\n },\n trigger: 'pan'\n });\n css(chart.container, { cursor: 'move' });\n });\n }\n /**\n * Pan and scale the chart. Used internally by mouse-pan, touch-pan,\n * touch-zoom, and mousewheel zoom.\n *\n * The main positioning logic is created around two imaginary boxes. What is\n * currently within the `from` rectangle, should be transformed to fill up\n * the `to` rectangle.\n * - In a mouse zoom, the `from` rectangle is the selection, while the `to`\n * rectangle is the full plot area.\n * - In a touch zoom, the `from` rectangle is made up of the last two-finger\n * touch, while the `to`` rectangle is the current touch.\n * - In a mousewheel zoom, the `to` rectangle is a 10x10 px square,\n * while the `to` rectangle reflects the scale around that.\n *\n * @private\n * @function Highcharts.Chart#transform\n */\n transform(params) {\n const { axes = this.axes, event, from = {}, reset, selection, to = {}, trigger } = params, { inverted, resetZoomButton } = this;\n let hasZoomed = false, displayButton;\n // Remove active points for shared tooltip\n this.hoverPoints?.forEach((point) => point.setState());\n for (const axis of axes) {\n const { horiz, len, minPointOffset = 0, options, reversed } = axis, wh = horiz ? 'width' : 'height', xy = horiz ? 'x' : 'y', toLength = to[wh] || axis.len, fromLength = from[wh] || axis.len, \n // If fingers pinched very close on this axis, treat as pan\n scale = Math.abs(toLength) < 10 ?\n 1 :\n toLength / fromLength, fromCenter = (from[xy] || 0) + fromLength / 2 - axis.pos, toCenter = (to[xy] ?? axis.pos) +\n toLength / 2 - axis.pos, move = fromCenter - toCenter / scale, pointRangeDirection = (reversed && !inverted) ||\n (!reversed && inverted) ?\n -1 :\n 1, minPx = move;\n // Zooming in multiple panes, zoom only in the pane that receives\n // the input\n if (!reset && (fromCenter < 0 || fromCenter > axis.len)) {\n continue;\n }\n let newMin = axis.toValue(minPx, true) +\n minPointOffset * pointRangeDirection, newMax = axis.toValue(minPx + len / scale, true) -\n ((minPointOffset * pointRangeDirection) ||\n // Polar zoom tests failed when this was not commented:\n // (axis.isXAxis && axis.pointRangePadding) ||\n 0), allExtremes = axis.allExtremes;\n if (newMin > newMax) {\n [newMin, newMax] = [newMax, newMin];\n }\n // General calculations of the full data extremes. It is calculated\n // on the first call to transform, then reused for subsequent\n // touch/pan calls. (#11315).\n if (scale === 1 &&\n !reset &&\n axis.coll === 'yAxis' &&\n !allExtremes) {\n for (const series of axis.series) {\n const seriesExtremes = series.getExtremes(series.getProcessedData(true).yData, true);\n allExtremes ?? (allExtremes = {\n dataMin: Number.MAX_VALUE,\n dataMax: -Number.MAX_VALUE\n });\n if (isNumber(seriesExtremes.dataMin) &&\n isNumber(seriesExtremes.dataMax)) {\n allExtremes.dataMin = Math.min(seriesExtremes.dataMin, allExtremes.dataMin);\n allExtremes.dataMax = Math.max(seriesExtremes.dataMax, allExtremes.dataMax);\n }\n }\n axis.allExtremes = allExtremes;\n }\n const { dataMin, dataMax, min, max } = extend(axis.getExtremes(), allExtremes || {}), \n // For boosted chart where data extremes are skipped\n safeDataMin = dataMin ?? options.min, safeDataMax = dataMax ?? options.max, range = newMax - newMin, padRange = axis.categories ? 0 : Math.min(range, safeDataMax - safeDataMin), paddedMin = safeDataMin - padRange * (defined(options.min) ? 0 : options.minPadding), paddedMax = safeDataMax + padRange * (defined(options.max) ? 0 : options.maxPadding), \n // We're allowed to zoom outside the data extremes if we're\n // dealing with a bubble chart, if we're panning, or if we're\n // pinching or mousewheeling in.\n allowZoomOutside = axis.allowZoomOutside ||\n scale === 1 ||\n (trigger !== 'zoom' && scale > 1), \n // Calculate the floor and the ceiling\n floor = Math.min(options.min ?? paddedMin, paddedMin, allowZoomOutside ? min : paddedMin), ceiling = Math.max(options.max ?? paddedMax, paddedMax, allowZoomOutside ? max : paddedMax);\n // It is not necessary to calculate extremes on ordinal axis,\n // because they are already calculated, so we don't want to override\n // them.\n if (!axis.isOrdinal || scale !== 1 || reset) {\n // If the new range spills over, either to the min or max,\n // adjust it.\n if (newMin < floor) {\n newMin = floor;\n if (scale >= 1) {\n newMax = newMin + range;\n }\n }\n if (newMax > ceiling) {\n newMax = ceiling;\n if (scale >= 1) {\n newMin = newMax - range;\n }\n }\n // Set new extremes if they are actually new\n if (reset || (axis.series.length &&\n (newMin !== min || newMax !== max) &&\n newMin >= floor &&\n newMax <= ceiling)) {\n if (selection) {\n selection[axis.coll].push({\n axis,\n min: newMin,\n max: newMax\n });\n }\n else {\n // Temporarily flag the axis as `isPanning` in order to\n // disallow certain axis padding options that would make\n // panning/zooming hard. Reset and redraw after the\n // operation has finished.\n axis.isPanning = trigger !== 'zoom';\n axis.setExtremes(reset ? void 0 : newMin, reset ? void 0 : newMax, false, false, { move, trigger, scale });\n if (!reset &&\n (newMin > floor || newMax < ceiling) &&\n trigger !== 'mousewheel') {\n displayButton = true;\n }\n }\n hasZoomed = true;\n }\n if (event) {\n this[horiz ? 'mouseDownX' : 'mouseDownY'] =\n event[horiz ? 'chartX' : 'chartY'];\n }\n }\n }\n if (hasZoomed) {\n if (selection) {\n fireEvent(this, 'selection', selection, \n // Run transform again, this time without the selection data\n // so that the transform is applied.\n () => {\n delete params.selection;\n params.trigger = 'zoom';\n this.transform(params);\n });\n }\n else {\n // Show or hide the Reset zoom button\n if (displayButton && !resetZoomButton) {\n this.showResetZoom();\n }\n else if (!displayButton && resetZoomButton) {\n this.resetZoomButton = resetZoomButton.destroy();\n }\n this.redraw(trigger === 'zoom' &&\n (this.options.chart.animation ?? this.pointCount < 100));\n }\n }\n return hasZoomed;\n }\n}\nextend(Chart.prototype, {\n // Hook for adding callbacks in modules\n callbacks: [],\n /**\n * These collections (arrays) implement `Chart.addSomething` method used in\n * chart.update() to create new object in the collection. Equivalent for\n * deleting is resolved by simple `Something.remove()`.\n *\n * Note: We need to define these references after initializers are bound to\n * chart's prototype.\n *\n * @private\n */\n collectionsWithInit: {\n // collectionName: [ initializingMethod, [extraArguments] ]\n xAxis: [Chart.prototype.addAxis, [true]],\n yAxis: [Chart.prototype.addAxis, [false]],\n series: [Chart.prototype.addSeries]\n },\n /**\n * These collections (arrays) implement update() methods with support for\n * one-to-one option.\n * @private\n */\n collectionsWithUpdate: [\n 'xAxis',\n 'yAxis',\n 'series'\n ],\n /**\n * These properties cause isDirtyBox to be set to true when updating. Can be\n * extended from plugins.\n * @private\n */\n propsRequireDirtyBox: [\n 'backgroundColor',\n 'borderColor',\n 'borderWidth',\n 'borderRadius',\n 'plotBackgroundColor',\n 'plotBackgroundImage',\n 'plotBorderColor',\n 'plotBorderWidth',\n 'plotShadow',\n 'shadow'\n ],\n /**\n * These properties require a full reflow of chart elements, best\n * implemented through running `Chart.setSize` internally (#8190).\n * @private\n */\n propsRequireReflow: [\n 'margin',\n 'marginTop',\n 'marginRight',\n 'marginBottom',\n 'marginLeft',\n 'spacing',\n 'spacingTop',\n 'spacingRight',\n 'spacingBottom',\n 'spacingLeft'\n ],\n /**\n * These properties cause all series to be updated when updating. Can be\n * extended from plugins.\n * @private\n */\n propsRequireUpdateSeries: [\n 'chart.inverted',\n 'chart.polar',\n 'chart.ignoreHiddenSeries',\n 'chart.type',\n 'colors',\n 'plotOptions',\n 'time',\n 'tooltip'\n ]\n});\n/* *\n *\n * Default Export\n *\n * */\nexport default Chart;\n/* *\n *\n * API Declarations\n *\n * */\n/**\n * Callback for chart constructors.\n *\n * @callback Highcharts.ChartCallbackFunction\n *\n * @param {Highcharts.Chart} chart\n * Created chart.\n */\n/**\n * Format a number and return a string based on input settings.\n *\n * @callback Highcharts.NumberFormatterCallbackFunction\n *\n * @param {number} number\n * The input number to format.\n *\n * @param {number} decimals\n * The amount of decimals. A value of -1 preserves the amount in the\n * input number.\n *\n * @param {string} [decimalPoint]\n * The decimal point, defaults to the one given in the lang options, or\n * a dot.\n *\n * @param {string} [thousandsSep]\n * The thousands separator, defaults to the one given in the lang\n * options, or a space character.\n *\n * @return {string} The formatted number.\n */\n/**\n * The chart title. The title has an `update` method that allows modifying the\n * options directly or indirectly via `chart.update`.\n *\n * @interface Highcharts.TitleObject\n * @extends Highcharts.SVGElement\n */ /**\n* Modify options for the title.\n*\n* @function Highcharts.TitleObject#update\n*\n* @param {Highcharts.TitleOptions} titleOptions\n* Options to modify.\n*\n* @param {boolean} [redraw=true]\n* Whether to redraw the chart after the title is altered. If doing more\n* operations on the chart, it is a good idea to set redraw to false and\n* call {@link Chart#redraw} after.\n*/\n/**\n * The chart subtitle. The subtitle has an `update` method that\n * allows modifying the options directly or indirectly via\n * `chart.update`.\n *\n * @interface Highcharts.SubtitleObject\n * @extends Highcharts.SVGElement\n */ /**\n* Modify options for the subtitle.\n*\n* @function Highcharts.SubtitleObject#update\n*\n* @param {Highcharts.SubtitleOptions} subtitleOptions\n* Options to modify.\n*\n* @param {boolean} [redraw=true]\n* Whether to redraw the chart after the subtitle is altered. If doing\n* more operations on the chart, it is a good idea to set redraw to false\n* and call {@link Chart#redraw} after.\n*/\n/**\n * The chart caption. The caption has an `update` method that\n * allows modifying the options directly or indirectly via\n * `chart.update`.\n *\n * @interface Highcharts.CaptionObject\n * @extends Highcharts.SVGElement\n */ /**\n* Modify options for the caption.\n*\n* @function Highcharts.CaptionObject#update\n*\n* @param {Highcharts.CaptionOptions} captionOptions\n* Options to modify.\n*\n* @param {boolean} [redraw=true]\n* Whether to redraw the chart after the caption is altered. If doing\n* more operations on the chart, it is a good idea to set redraw to false\n* and call {@link Chart#redraw} after.\n*/\n/**\n * @interface Highcharts.ChartIsInsideOptionsObject\n */ /**\n* @name Highcharts.ChartIsInsideOptionsObject#axis\n* @type {Highcharts.Axis|undefined}\n*/ /**\n* @name Highcharts.ChartIsInsideOptionsObject#ignoreX\n* @type {boolean|undefined}\n*/ /**\n* @name Highcharts.ChartIsInsideOptionsObject#ignoreY\n* @type {boolean|undefined}\n*/ /**\n* @name Highcharts.ChartIsInsideOptionsObject#inverted\n* @type {boolean|undefined}\n*/ /**\n* @name Highcharts.ChartIsInsideOptionsObject#paneCoordinates\n* @type {boolean|undefined}\n*/ /**\n* @name Highcharts.ChartIsInsideOptionsObject#series\n* @type {Highcharts.Series|undefined}\n*/ /**\n* @name Highcharts.ChartIsInsideOptionsObject#visiblePlotOnly\n* @type {boolean|undefined}\n*/\n''; // keeps doclets above in JS file\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * Highcharts feature to make the Y axis stay fixed when scrolling the chart\n * horizontally on mobile devices. Supports left and right side axes.\n */\n'use strict';\nimport A from '../Core/Animation/AnimationUtilities.js';\nconst { stop } = A;\nimport H from '../Core/Globals.js';\nconst { composed } = H;\nimport RendererRegistry from '../Core/Renderer/RendererRegistry.js';\nimport U from '../Core/Utilities.js';\nconst { addEvent, createElement, css, defined, merge, pushUnique } = U;\n/* *\n *\n * Functions\n *\n * */\n/** @private */\nfunction onChartRender() {\n let scrollablePlotArea = this.scrollablePlotArea;\n if ((this.scrollablePixelsX || this.scrollablePixelsY) &&\n !scrollablePlotArea) {\n this.scrollablePlotArea = scrollablePlotArea = new ScrollablePlotArea(this);\n }\n scrollablePlotArea?.applyFixed();\n}\n/** @private */\nfunction markDirty() {\n if (this.chart.scrollablePlotArea) {\n this.chart.scrollablePlotArea.isDirty = true;\n }\n}\nclass ScrollablePlotArea {\n static compose(AxisClass, ChartClass, SeriesClass) {\n if (pushUnique(composed, this.compose)) {\n addEvent(AxisClass, 'afterInit', markDirty);\n addEvent(ChartClass, 'afterSetChartSize', (e) => this.afterSetSize(e.target, e));\n addEvent(ChartClass, 'render', onChartRender);\n addEvent(SeriesClass, 'show', markDirty);\n }\n }\n static afterSetSize(chart, e) {\n const { minWidth, minHeight } = chart.options.chart.scrollablePlotArea || {}, { clipBox, plotBox, inverted, renderer } = chart;\n let scrollablePixelsX, scrollablePixelsY, recalculateHoriz;\n if (!renderer.forExport) {\n // The amount of pixels to scroll, the difference between chart\n // width and scrollable width\n if (minWidth) {\n chart.scrollablePixelsX = scrollablePixelsX = Math.max(0, minWidth - chart.chartWidth);\n if (scrollablePixelsX) {\n chart.scrollablePlotBox = merge(chart.plotBox);\n plotBox.width = chart.plotWidth += scrollablePixelsX;\n clipBox[inverted ? 'height' : 'width'] += scrollablePixelsX;\n recalculateHoriz = true;\n }\n // Currently we can only do either X or Y\n }\n else if (minHeight) {\n chart.scrollablePixelsY = scrollablePixelsY = Math.max(0, minHeight - chart.chartHeight);\n if (defined(scrollablePixelsY)) {\n chart.scrollablePlotBox = merge(chart.plotBox);\n plotBox.height = chart.plotHeight += scrollablePixelsY;\n clipBox[inverted ? 'width' : 'height'] += scrollablePixelsY;\n recalculateHoriz = false;\n }\n }\n if (defined(recalculateHoriz) && !e.skipAxes) {\n for (const axis of chart.axes) {\n // Apply the corrected plot size to the axes of the other\n // orientation than the scrolling direction\n if (axis.horiz === recalculateHoriz) {\n axis.setAxisSize();\n axis.setAxisTranslation();\n }\n }\n }\n }\n }\n constructor(chart) {\n const chartOptions = chart.options.chart, Renderer = RendererRegistry.getRendererType(), scrollableOptions = chartOptions.scrollablePlotArea || {}, moveFixedElements = this.moveFixedElements.bind(this), styles = {\n WebkitOverflowScrolling: 'touch',\n overflowX: 'hidden',\n overflowY: 'hidden'\n };\n if (chart.scrollablePixelsX) {\n styles.overflowX = 'auto';\n }\n if (chart.scrollablePixelsY) {\n styles.overflowY = 'auto';\n }\n this.chart = chart;\n // Insert a container with relative position that scrolling and fixed\n // container renders to (#10555)\n const parentDiv = this.parentDiv = createElement('div', {\n className: 'highcharts-scrolling-parent'\n }, {\n position: 'relative'\n }, chart.renderTo), \n // Add the necessary divs to provide scrolling\n scrollingContainer = this.scrollingContainer = createElement('div', {\n 'className': 'highcharts-scrolling'\n }, styles, parentDiv), innerContainer = this.innerContainer = createElement('div', {\n 'className': 'highcharts-inner-container'\n }, void 0, scrollingContainer), fixedDiv = this.fixedDiv = createElement('div', {\n className: 'highcharts-fixed'\n }, {\n position: 'absolute',\n overflow: 'hidden',\n pointerEvents: 'none',\n zIndex: (chartOptions.style?.zIndex || 0) + 2,\n top: 0\n }, void 0, true), fixedRenderer = this.fixedRenderer = new Renderer(fixedDiv, chart.chartWidth, chart.chartHeight, chartOptions.style);\n // Mask\n this.mask = fixedRenderer\n .path()\n .attr({\n fill: chartOptions.backgroundColor || '#fff',\n 'fill-opacity': scrollableOptions.opacity ?? 0.85,\n zIndex: -1\n })\n .addClass('highcharts-scrollable-mask')\n .add();\n scrollingContainer.parentNode.insertBefore(fixedDiv, scrollingContainer);\n css(chart.renderTo, { overflow: 'visible' });\n addEvent(chart, 'afterShowResetZoom', moveFixedElements);\n addEvent(chart, 'afterApplyDrilldown', moveFixedElements);\n addEvent(chart, 'afterLayOutTitles', moveFixedElements);\n // On scroll, reset the chart position because it applies to the\n // scrolled container\n let lastHoverPoint;\n addEvent(scrollingContainer, 'scroll', () => {\n const { pointer, hoverPoint } = chart;\n if (pointer) {\n delete pointer.chartPosition;\n if (hoverPoint) {\n lastHoverPoint = hoverPoint;\n }\n pointer.runPointActions(void 0, lastHoverPoint, true);\n }\n });\n // Now move the container inside\n innerContainer.appendChild(chart.container);\n }\n applyFixed() {\n const { chart, fixedRenderer, isDirty, scrollingContainer } = this, { axisOffset, chartWidth, chartHeight, container, plotHeight, plotLeft, plotTop, plotWidth, scrollablePixelsX = 0, scrollablePixelsY = 0 } = chart, chartOptions = chart.options.chart, scrollableOptions = chartOptions.scrollablePlotArea || {}, { scrollPositionX = 0, scrollPositionY = 0 } = scrollableOptions, scrollableWidth = chartWidth + scrollablePixelsX, scrollableHeight = chartHeight + scrollablePixelsY;\n // Set the size of the fixed renderer to the visible width\n fixedRenderer.setSize(chartWidth, chartHeight);\n if (isDirty ?? true) {\n this.isDirty = false;\n this.moveFixedElements();\n }\n // Increase the size of the scrollable renderer and background\n stop(chart.container);\n css(container, {\n width: `${scrollableWidth}px`,\n height: `${scrollableHeight}px`\n });\n chart.renderer.boxWrapper.attr({\n width: scrollableWidth,\n height: scrollableHeight,\n viewBox: [0, 0, scrollableWidth, scrollableHeight].join(' ')\n });\n chart.chartBackground?.attr({\n width: scrollableWidth,\n height: scrollableHeight\n });\n css(scrollingContainer, {\n width: `${chartWidth}px`,\n height: `${chartHeight}px`\n });\n // Set scroll position the first time (this.isDirty was undefined at\n // the top of this function)\n if (!defined(isDirty)) {\n scrollingContainer.scrollLeft = scrollablePixelsX * scrollPositionX;\n scrollingContainer.scrollTop = scrollablePixelsY * scrollPositionY;\n }\n // Mask behind the left and right side\n const maskTop = plotTop - axisOffset[0] - 1, maskLeft = plotLeft - axisOffset[3] - 1, maskBottom = plotTop + plotHeight + axisOffset[2] + 1, maskRight = plotLeft + plotWidth + axisOffset[1] + 1, maskPlotRight = plotLeft + plotWidth - scrollablePixelsX, maskPlotBottom = plotTop + plotHeight - scrollablePixelsY;\n let d = [['M', 0, 0]];\n if (scrollablePixelsX) {\n d = [\n // Left side\n ['M', 0, maskTop],\n ['L', plotLeft - 1, maskTop],\n ['L', plotLeft - 1, maskBottom],\n ['L', 0, maskBottom],\n ['Z'],\n // Right side\n ['M', maskPlotRight, maskTop],\n ['L', chartWidth, maskTop],\n ['L', chartWidth, maskBottom],\n ['L', maskPlotRight, maskBottom],\n ['Z']\n ];\n }\n else if (scrollablePixelsY) {\n d = [\n // Top side\n ['M', maskLeft, 0],\n ['L', maskLeft, plotTop - 1],\n ['L', maskRight, plotTop - 1],\n ['L', maskRight, 0],\n ['Z'],\n // Bottom side\n ['M', maskLeft, maskPlotBottom],\n ['L', maskLeft, chartHeight],\n ['L', maskRight, chartHeight],\n ['L', maskRight, maskPlotBottom],\n ['Z']\n ];\n }\n if (chart.redrawTrigger !== 'adjustHeight') {\n this.mask.attr({ d });\n }\n }\n /**\n * These elements are moved over to the fixed renderer and stay fixed when\n * the user scrolls the chart\n * @private\n */\n moveFixedElements() {\n const { container, inverted, scrollablePixelsX, scrollablePixelsY } = this.chart, fixedRenderer = this.fixedRenderer, fixedSelectors = [\n '.highcharts-breadcrumbs-group',\n '.highcharts-contextbutton',\n '.highcharts-caption',\n '.highcharts-credits',\n '.highcharts-legend',\n '.highcharts-legend-checkbox',\n '.highcharts-navigator-series',\n '.highcharts-navigator-xaxis',\n '.highcharts-navigator-yaxis',\n '.highcharts-navigator',\n '.highcharts-reset-zoom',\n '.highcharts-drillup-button',\n '.highcharts-scrollbar',\n '.highcharts-subtitle',\n '.highcharts-title'\n ];\n let axisClass;\n if (scrollablePixelsX && !inverted) {\n axisClass = '.highcharts-yaxis';\n }\n else if (scrollablePixelsX && inverted) {\n axisClass = '.highcharts-xaxis';\n }\n else if (scrollablePixelsY && !inverted) {\n axisClass = '.highcharts-xaxis';\n }\n else if (scrollablePixelsY && inverted) {\n axisClass = '.highcharts-yaxis';\n }\n if (axisClass) {\n fixedSelectors.push(`${axisClass}:not(.highcharts-radial-axis)`, `${axisClass}-labels:not(.highcharts-radial-axis-labels)`);\n }\n for (const className of fixedSelectors) {\n [].forEach.call(container.querySelectorAll(className), (elem) => {\n (elem.namespaceURI === fixedRenderer.SVG_NS ?\n fixedRenderer.box :\n fixedRenderer.box.parentNode).appendChild(elem);\n elem.style.pointerEvents = 'auto';\n });\n }\n }\n}\n/* *\n *\n * Default Export\n *\n * */\nexport default ScrollablePlotArea;\n/* *\n *\n * API Declarations\n *\n * */\n/**\n * Options for a scrollable plot area. This feature provides a minimum size for\n * the plot area of the chart. If the size gets smaller than this, typically\n * on mobile devices, a native browser scrollbar is presented. This scrollbar\n * provides smooth scrolling for the contents of the plot area, whereas the\n * title, legend and unaffected axes are fixed.\n *\n * Since v7.1.2, a scrollable plot area can be defined for either horizontal or\n * vertical scrolling, depending on whether the `minWidth` or `minHeight`\n * option is set.\n *\n * @sample highcharts/chart/scrollable-plotarea\n * Scrollable plot area\n * @sample highcharts/chart/scrollable-plotarea-vertical\n * Vertically scrollable plot area\n * @sample {gantt} gantt/chart/scrollable-plotarea-vertical\n * Gantt chart with vertically scrollable plot area\n *\n * @since 6.1.0\n * @product highcharts gantt\n * @apioption chart.scrollablePlotArea\n */\n/**\n * The minimum height for the plot area. If it gets smaller than this, the plot\n * area will become scrollable.\n *\n * @type {number}\n * @since 7.1.2\n * @apioption chart.scrollablePlotArea.minHeight\n */\n/**\n * The minimum width for the plot area. If it gets smaller than this, the plot\n * area will become scrollable.\n *\n * @type {number}\n * @since 6.1.0\n * @apioption chart.scrollablePlotArea.minWidth\n */\n/**\n * The initial scrolling position of the scrollable plot area. Ranges from 0 to\n * 1, where 0 aligns the plot area to the left and 1 aligns it to the right.\n * Typically we would use 1 if the chart has right aligned Y axes.\n *\n * @type {number}\n * @since 6.1.0\n * @apioption chart.scrollablePlotArea.scrollPositionX\n */\n/**\n * The initial scrolling position of the scrollable plot area. Ranges from 0 to\n * 1, where 0 aligns the plot area to the top and 1 aligns it to the bottom.\n *\n * @type {number}\n * @since 7.1.2\n * @apioption chart.scrollablePlotArea.scrollPositionY\n */\n/**\n * The opacity of mask applied on one of the sides of the plot\n * area.\n *\n * @sample {highcharts} highcharts/chart/scrollable-plotarea-opacity\n * Disabled opacity for the mask\n *\n * @type {number}\n * @default 0.85\n * @since 7.1.1\n * @apioption chart.scrollablePlotArea.opacity\n */\n(''); // Keep doclets above in transpiled file\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport T from '../../Templating.js';\nconst { format } = T;\nimport SeriesRegistry from '../../Series/SeriesRegistry.js';\nconst { series: Series } = SeriesRegistry;\nimport U from '../../Utilities.js';\nconst { destroyObjectProperties, fireEvent, isNumber, pick } = U;\n/* *\n *\n * Class\n *\n * */\n/**\n * The class for stacks. Each stack, on a specific X value and either negative\n * or positive, has its own stack item.\n * @private\n */\nclass StackItem {\n /* *\n *\n * Constructor\n *\n * */\n constructor(axis, options, negativeValue, x, stackOption) {\n const inverted = axis.chart.inverted, reversed = axis.reversed;\n this.axis = axis;\n // The stack goes to the left either if the stack has negative value\n // or when axis is reversed. XOR operator.\n const isNegative = (this.isNegative = !!negativeValue !== !!reversed);\n // Save the options to be able to style the label\n this.options = options = options || {};\n // Save the x value to be able to position the label later\n this.x = x;\n // Initialize total value\n this.total = null;\n this.cumulative = null;\n // This will keep each points' extremes stored by series.index and point\n // index\n this.points = {};\n this.hasValidPoints = false;\n // Save the stack option on the series configuration object,\n // and whether to treat it as percent\n this.stack = stackOption;\n this.leftCliff = 0;\n this.rightCliff = 0;\n // The align options and text align varies on whether the stack is\n // negative and if the chart is inverted or not.\n // First test the user supplied value, then use the dynamic.\n this.alignOptions = {\n align: options.align ||\n (inverted ? (isNegative ? 'left' : 'right') : 'center'),\n verticalAlign: options.verticalAlign ||\n (inverted ? 'middle' : isNegative ? 'bottom' : 'top'),\n y: options.y,\n x: options.x\n };\n this.textAlign =\n options.textAlign ||\n (inverted ? (!isNegative ? 'left' : 'right') : 'center');\n }\n /* *\n *\n * Functions\n *\n * */\n /**\n * @private\n */\n destroy() {\n destroyObjectProperties(this, this.axis);\n }\n /**\n * Renders the stack total label and adds it to the stack label group.\n * @private\n */\n render(group) {\n const chart = this.axis.chart, options = this.options, formatOption = options.format, \n // Format the text in the label.\n str = formatOption ?\n format(formatOption, this, chart) :\n options.formatter.call(this);\n // Change the text to reflect the new total and set visibility to hidden\n // in case the series is hidden\n if (this.label) {\n this.label.attr({ text: str, visibility: 'hidden' });\n }\n else {\n // Create new label\n this.label = chart.renderer.label(str, null, void 0, options.shape, void 0, void 0, options.useHTML, false, 'stack-labels');\n const attr = {\n r: options.borderRadius || 0,\n text: str,\n // set default padding to 5 as it is in datalabels #12308\n padding: pick(options.padding, 5),\n visibility: 'hidden' // hidden until setOffset is called\n };\n if (!chart.styledMode) {\n attr.fill = options.backgroundColor;\n attr.stroke = options.borderColor;\n attr['stroke-width'] = options.borderWidth;\n this.label.css(options.style || {});\n }\n this.label.attr(attr);\n if (!this.label.added) {\n this.label.add(group); // add to the labels-group\n }\n }\n // Rank it higher than data labels (#8742)\n this.label.labelrank = chart.plotSizeY;\n fireEvent(this, 'afterRender');\n }\n /**\n * Sets the offset that the stack has from the x value and repositions the\n * label.\n * @private\n */\n setOffset(xOffset, width, boxBottom, boxTop, defaultX, xAxis) {\n const { alignOptions, axis, label, options, textAlign } = this, chart = axis.chart, stackBox = this.getStackBox({\n xOffset,\n width,\n boxBottom,\n boxTop,\n defaultX,\n xAxis\n }), { verticalAlign } = alignOptions;\n if (label && stackBox) {\n const labelBox = label.getBBox(void 0, 0), padding = label.padding;\n let isJustify = pick(options.overflow, 'justify') === 'justify', visible;\n // Reset alignOptions property after justify #12337\n alignOptions.x = options.x || 0;\n alignOptions.y = options.y || 0;\n // Calculate the adjusted Stack position, to take into consideration\n // The size if the labelBox and vertical alignment as\n // well as the text alignment. It's need to be done to work with\n // default SVGLabel.align/justify methods.\n const { x, y } = this.adjustStackPosition({\n labelBox,\n verticalAlign,\n textAlign\n });\n stackBox.x -= x;\n stackBox.y -= y;\n // Align the label to the adjusted box.\n label.align(alignOptions, false, stackBox);\n // Check if label is inside the plotArea #12294\n visible = chart.isInsidePlot(label.alignAttr.x + alignOptions.x + x, label.alignAttr.y + alignOptions.y + y);\n if (!visible) {\n isJustify = false;\n }\n if (isJustify) {\n // Justify stackLabel into the alignBox\n Series.prototype.justifyDataLabel.call(axis, label, alignOptions, label.alignAttr, labelBox, stackBox);\n }\n // Add attr to avoid the default animation of justifyDataLabel.\n // Also add correct rotation with its rotation origin. #15129\n label.attr({\n x: label.alignAttr.x,\n y: label.alignAttr.y,\n rotation: options.rotation,\n rotationOriginX: labelBox.width * {\n left: 0,\n center: 0.5,\n right: 1\n }[options.textAlign || 'center'],\n rotationOriginY: labelBox.height / 2\n });\n // Check if the dataLabel should be visible.\n if (pick(!isJustify && options.crop, true)) {\n visible =\n isNumber(label.x) &&\n isNumber(label.y) &&\n chart.isInsidePlot(label.x - padding + (label.width || 0), label.y) &&\n chart.isInsidePlot(label.x + padding, label.y);\n }\n label[visible ? 'show' : 'hide']();\n }\n fireEvent(this, 'afterSetOffset', { xOffset, width });\n }\n /**\n * Adjust the stack BBox position, to take into consideration the alignment\n * of the dataLabel. This is necessary to make the stackDataLabel work with\n * core methods like `SVGLabel.adjust` and `Series.justifyDataLabel`.\n * @param AdjustStackPositionProps\n * @return {{x: number, y: number}} Adjusted BBox position of the stack.\n */\n adjustStackPosition({ labelBox, verticalAlign, textAlign }) {\n const factorMap = {\n bottom: 0,\n middle: 1,\n top: 2,\n right: 1,\n center: 0,\n left: -1\n }, verticalAlignFactor = factorMap[verticalAlign], textAlignFactor = factorMap[textAlign];\n return {\n x: labelBox.width / 2 + (labelBox.width / 2) * textAlignFactor,\n y: (labelBox.height / 2) * verticalAlignFactor\n };\n }\n /**\n * Get the bbox of the stack.\n * @private\n * @function Highcharts.StackItem#getStackBox\n * @return {BBoxObject} The x, y, height, width of the stack.\n */\n getStackBox(stackBoxProps) {\n const stackItem = this, axis = this.axis, chart = axis.chart, { boxTop, defaultX, xOffset, width, boxBottom } = stackBoxProps, totalStackValue = axis.stacking.usePercentage ?\n 100 :\n pick(boxTop, this.total, 0), y = axis.toPixels(totalStackValue), xAxis = stackBoxProps.xAxis || chart.xAxis[0], x = pick(defaultX, xAxis.translate(this.x)) + xOffset, yZero = axis.toPixels(boxBottom ||\n (isNumber(axis.min) &&\n axis.logarithmic &&\n axis.logarithmic.lin2log(axis.min)) ||\n 0), height = Math.abs(y - yZero), inverted = chart.inverted, neg = stackItem.isNegative;\n return inverted ?\n {\n x: (neg ? y : y - height) - chart.plotLeft,\n y: xAxis.height - x - width,\n width: height,\n height: width\n } : {\n x: x + xAxis.transB - chart.plotLeft,\n y: (neg ? y - height : y) - chart.plotTop,\n width: width,\n height: height\n };\n }\n}\n/* *\n *\n * Default Export\n *\n * */\nexport default StackItem;\n/* *\n *\n * API Declarations\n *\n * */\n/**\n * Stack of data points\n *\n * @product highcharts\n *\n * @interface Highcharts.StackItemObject\n */ /**\n* Alignment settings\n* @name Highcharts.StackItemObject#alignOptions\n* @type {Highcharts.AlignObject}\n*/ /**\n* Related axis\n* @name Highcharts.StackItemObject#axis\n* @type {Highcharts.Axis}\n*/ /**\n* Cumulative value of the stacked data points\n* @name Highcharts.StackItemObject#cumulative\n* @type {number}\n*/ /**\n* True if on the negative side\n* @name Highcharts.StackItemObject#isNegative\n* @type {boolean}\n*/ /**\n* Related SVG element\n* @name Highcharts.StackItemObject#label\n* @type {Highcharts.SVGElement}\n*/ /**\n* Related stack options\n* @name Highcharts.StackItemObject#options\n* @type {Highcharts.YAxisStackLabelsOptions}\n*/ /**\n* Total value of the stacked data points\n* @name Highcharts.StackItemObject#total\n* @type {number}\n*/ /**\n* Shared x value of the stack\n* @name Highcharts.StackItemObject#x\n* @type {number}\n*/\n''; // keeps doclets above in JS file\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport A from '../../Animation/AnimationUtilities.js';\nconst { getDeferredAnimation } = A;\nimport Axis from '../Axis.js';\nimport SeriesRegistry from '../../Series/SeriesRegistry.js';\nconst { series: { prototype: seriesProto } } = SeriesRegistry;\nimport StackItem from './StackItem.js';\nimport U from '../../Utilities.js';\nconst { addEvent, correctFloat, defined, destroyObjectProperties, fireEvent, isArray, isNumber, objectEach, pick } = U;\n/* *\n *\n * Functions\n *\n * */\n/**\n * Generate stacks for each series and calculate stacks total values\n *\n * @private\n * @function Highcharts.Chart#getStacks\n */\nfunction chartGetStacks() {\n const chart = this, inverted = chart.inverted;\n // Reset stacks for each axis\n chart.axes.forEach((axis) => {\n if (axis.stacking && axis.stacking.stacks && axis.hasVisibleSeries) {\n axis.stacking.oldStacks = axis.stacking.stacks;\n }\n });\n chart.series.forEach((series) => {\n const xAxisOptions = series.xAxis && series.xAxis.options || {};\n if (series.options.stacking && series.reserveSpace()) {\n series.stackKey = [\n series.type,\n pick(series.options.stack, ''),\n inverted ? xAxisOptions.top : xAxisOptions.left,\n inverted ? xAxisOptions.height : xAxisOptions.width\n ].join(',');\n }\n });\n}\n/**\n * @private\n */\nfunction onAxisDestroy() {\n const stacking = this.stacking;\n if (stacking) {\n const stacks = stacking.stacks;\n // Destroy each stack total\n objectEach(stacks, (stack, stackKey) => {\n destroyObjectProperties(stack);\n delete stacks[stackKey];\n });\n stacking.stackTotalGroup?.destroy();\n }\n}\n/**\n * @private\n */\nfunction onAxisInit() {\n if (!this.stacking) {\n this.stacking = new AxisAdditions(this);\n }\n}\n/**\n * Get stack indicator, according to it's x-value, to determine points with the\n * same x-value\n *\n * @private\n * @function Highcharts.Series#getStackIndicator\n */\nfunction seriesGetStackIndicator(stackIndicator, x, index, key) {\n // Update stack indicator, when:\n // first point in a stack || x changed || stack type (negative vs positive)\n // changed:\n if (!defined(stackIndicator) ||\n stackIndicator.x !== x ||\n (key && stackIndicator.stackKey !== key)) {\n stackIndicator = {\n x: x,\n index: 0,\n key,\n stackKey: key\n };\n }\n else {\n stackIndicator.index++;\n }\n stackIndicator.key = [index, x, stackIndicator.index].join(',');\n return stackIndicator;\n}\n/**\n * Iterate over all stacks and compute the absolute values to percent\n *\n * @private\n * @function Highcharts.Series#modifyStacks\n */\nfunction seriesModifyStacks() {\n const series = this, yAxis = series.yAxis, stackKey = series.stackKey || '', stacks = yAxis.stacking.stacks, processedXData = series.processedXData, stacking = series.options.stacking, stacker = series[stacking + 'Stacker'];\n let stackIndicator;\n if (stacker) { // Modifier function exists (Series.percentStacker etc.)\n [stackKey, '-' + stackKey].forEach((key) => {\n let i = processedXData.length, x, stackItem, pointExtremes;\n while (i--) {\n x = processedXData[i];\n stackIndicator = series.getStackIndicator(stackIndicator, x, series.index, key);\n stackItem = stacks[key]?.[x];\n pointExtremes = stackItem?.points[stackIndicator.key || ''];\n if (pointExtremes) {\n stacker.call(series, pointExtremes, stackItem, i);\n }\n }\n });\n }\n}\n/**\n * Modifier function for percent stacks. Blows up the stack to 100%.\n *\n * @private\n * @function Highcharts.Series#percentStacker\n */\nfunction seriesPercentStacker(pointExtremes, stack, i) {\n const totalFactor = stack.total ? 100 / stack.total : 0;\n // Y bottom value\n pointExtremes[0] = correctFloat(pointExtremes[0] * totalFactor);\n // Y value\n pointExtremes[1] = correctFloat(pointExtremes[1] * totalFactor);\n this.stackedYData[i] = pointExtremes[1];\n}\n/**\n * Set grouped points in a stack-like object. When `centerInCategory` is true,\n * and `stacking` is not enabled, we need a pseudo (horizontal) stack in order\n * to handle grouping of points within the same category.\n *\n * @private\n * @function Highcharts.Series#setGroupedPoints\n * @return {void}\n */\nfunction seriesSetGroupedPoints(axis) {\n // Only series types supporting centerInCategory need to do this. That also\n // applies to resetting (#20221).\n if (this.is('column') || this.is('columnrange')) {\n if (this.options.centerInCategory &&\n // With stacking enabled, we already have stacks that we can compute\n // from\n !this.options.stacking &&\n // With only one series, we don't need to consider centerInCategory\n this.chart.series.length > 1) {\n seriesProto.setStackedPoints.call(this, axis, 'group');\n // After updating, if we now have proper stacks, we must delete the\n // group pseudo stacks (#14980)\n }\n else {\n axis.stacking.resetStacks();\n }\n }\n}\n/**\n * Adds series' points value to corresponding stack\n *\n * @private\n * @function Highcharts.Series#setStackedPoints\n */\nfunction seriesSetStackedPoints(axis, stackingParam) {\n const type = stackingParam || this.options.stacking;\n if (!type ||\n !this.reserveSpace() ||\n // Group stacks (centerInCategory) belong on the x-axis, other stacks on\n // the y-axis.\n ({ group: 'xAxis' }[type] || 'yAxis') !== axis.coll) {\n return;\n }\n const series = this, xData = series.processedXData, yData = series.processedYData, stackedYData = [], yDataLength = yData.length, seriesOptions = series.options, threshold = seriesOptions.threshold || 0, stackThreshold = seriesOptions.startFromThreshold ? threshold : 0, stackOption = seriesOptions.stack, stackKey = stackingParam ?\n `${series.type},${type}` : (series.stackKey || ''), negKey = '-' + stackKey, negStacks = series.negStacks, stacking = axis.stacking, stacks = stacking.stacks, oldStacks = stacking.oldStacks;\n let stackIndicator, isNegative, stack, other, key, pointKey, i, x, y;\n stacking.stacksTouched += 1;\n // Loop over the non-null y values and read them into a local array\n for (i = 0; i < yDataLength; i++) {\n x = xData[i];\n y = yData[i];\n stackIndicator = series.getStackIndicator(stackIndicator, x, series.index);\n pointKey = stackIndicator.key || '';\n // Read stacked values into a stack based on the x value,\n // the sign of y and the stack key. Stacking is also handled for null\n // values (#739)\n isNegative = negStacks && y < (stackThreshold ? 0 : threshold);\n key = isNegative ? negKey : stackKey;\n // Create empty object for this stack if it doesn't exist yet\n if (!stacks[key]) {\n stacks[key] = {};\n }\n // Initialize StackItem for this x\n if (!stacks[key][x]) {\n if (oldStacks[key]?.[x]) {\n stacks[key][x] = oldStacks[key][x];\n stacks[key][x].total = null;\n }\n else {\n stacks[key][x] = new StackItem(axis, axis.options.stackLabels, !!isNegative, x, stackOption);\n }\n }\n // If the StackItem doesn't exist, create it first\n stack = stacks[key][x];\n if (y !== null) {\n stack.points[pointKey] = stack.points[series.index] = [\n pick(stack.cumulative, stackThreshold)\n ];\n // Record the base of the stack\n if (!defined(stack.cumulative)) {\n stack.base = pointKey;\n }\n stack.touched = stacking.stacksTouched;\n // In area charts, if there are multiple points on the same X value,\n // let the area fill the full span of those points\n if (stackIndicator.index > 0 && series.singleStacks === false) {\n stack.points[pointKey][0] = stack.points[series.index + ',' + x + ',0'][0];\n }\n // When updating to null, reset the point stack (#7493)\n }\n else {\n delete stack.points[pointKey];\n delete stack.points[series.index];\n }\n // Add value to the stack total\n let total = stack.total || 0;\n if (type === 'percent') {\n // Percent stacked column, totals are the same for the positive and\n // negative stacks\n other = isNegative ? stackKey : negKey;\n if (negStacks && stacks[other]?.[x]) {\n other = stacks[other][x];\n total = other.total =\n Math.max(other.total || 0, total) +\n Math.abs(y) || 0;\n // Percent stacked areas\n }\n else {\n total = correctFloat(total + (Math.abs(y) || 0));\n }\n }\n else if (type === 'group') {\n if (isArray(y)) {\n y = y[0];\n }\n // In this stack, the total is the number of valid points\n if (y !== null) {\n total++;\n }\n }\n else {\n total = correctFloat(total + (y || 0));\n }\n if (type === 'group') {\n // This point's index within the stack, pushed to stack.points[1]\n stack.cumulative = (total || 1) - 1;\n }\n else {\n stack.cumulative = correctFloat(pick(stack.cumulative, stackThreshold) +\n (y || 0));\n }\n stack.total = total;\n if (y !== null) {\n stack.points[pointKey].push(stack.cumulative);\n stackedYData[i] = stack.cumulative;\n stack.hasValidPoints = true;\n }\n }\n if (type === 'percent') {\n stacking.usePercentage = true;\n }\n if (type !== 'group') {\n this.stackedYData = stackedYData; // To be used in getExtremes\n }\n // Reset old stacks\n stacking.oldStacks = {};\n}\n/* *\n *\n * Classes\n *\n * */\n/**\n * Adds stacking support to axes.\n * @private\n * @class\n */\nclass AxisAdditions {\n /* *\n *\n * Constructors\n *\n * */\n constructor(axis) {\n this.oldStacks = {};\n this.stacks = {};\n this.stacksTouched = 0;\n this.axis = axis;\n }\n /* *\n *\n * Functions\n *\n * */\n /**\n * Build the stacks from top down\n * @private\n */\n buildStacks() {\n const stacking = this, axis = stacking.axis, axisSeries = axis.series, isXAxis = axis.coll === 'xAxis', reversedStacks = axis.options.reversedStacks, len = axisSeries.length;\n let actualSeries, i;\n this.resetStacks();\n stacking.usePercentage = false;\n i = len;\n while (i--) {\n actualSeries = axisSeries[reversedStacks ? i : len - i - 1];\n if (isXAxis) {\n actualSeries.setGroupedPoints(axis);\n }\n actualSeries.setStackedPoints(axis);\n }\n // Loop up again to compute percent and stream stack\n if (!isXAxis) {\n for (i = 0; i < len; i++) {\n axisSeries[i].modifyStacks();\n }\n }\n fireEvent(axis, 'afterBuildStacks');\n }\n /**\n * @private\n */\n cleanStacks() {\n if (this.oldStacks) {\n this.stacks = this.oldStacks;\n // Reset stacks\n objectEach(this.stacks, (type) => {\n objectEach(type, (stack) => {\n stack.cumulative = stack.total;\n });\n });\n }\n }\n /**\n * Set all the stacks to initial states and destroy unused ones.\n * @private\n */\n resetStacks() {\n objectEach(this.stacks, (type) => {\n objectEach(type, (stack, x) => {\n // Clean up memory after point deletion (#1044, #4320)\n if (isNumber(stack.touched) &&\n stack.touched < this.stacksTouched) {\n stack.destroy();\n delete type[x];\n // Reset stacks\n }\n else {\n stack.total = null;\n stack.cumulative = null;\n }\n });\n });\n }\n /**\n * @private\n */\n renderStackTotals() {\n const stacking = this, axis = stacking.axis, chart = axis.chart, renderer = chart.renderer, stacks = stacking.stacks, stackLabelsAnim = axis.options.stackLabels?.animation, animationConfig = getDeferredAnimation(chart, stackLabelsAnim || false), stackTotalGroup = stacking.stackTotalGroup = (stacking.stackTotalGroup ||\n renderer\n .g('stack-labels')\n .attr({\n zIndex: 6,\n opacity: 0\n })\n .add());\n // The plotLeft/Top will change when y axis gets wider so we need to\n // translate the stackTotalGroup at every render call. See bug #506\n // and #516\n stackTotalGroup.translate(chart.plotLeft, chart.plotTop);\n // Render each stack total\n objectEach(stacks, (type) => {\n objectEach(type, (stack) => {\n stack.render(stackTotalGroup);\n });\n });\n stackTotalGroup.animate({\n opacity: 1\n }, animationConfig);\n }\n}\n/* *\n *\n * Composition\n *\n * */\nvar StackingAxis;\n(function (StackingAxis) {\n /* *\n *\n * Functions\n *\n * */\n /**\n * Extends axis with stacking support.\n * @private\n */\n function compose(AxisClass, ChartClass, SeriesClass) {\n const chartProto = ChartClass.prototype, seriesProto = SeriesClass.prototype;\n if (!chartProto.getStacks) {\n addEvent(AxisClass, 'init', onAxisInit);\n addEvent(AxisClass, 'destroy', onAxisDestroy);\n chartProto.getStacks = chartGetStacks;\n seriesProto.getStackIndicator = seriesGetStackIndicator;\n seriesProto.modifyStacks = seriesModifyStacks;\n seriesProto.percentStacker = seriesPercentStacker;\n seriesProto.setGroupedPoints = seriesSetGroupedPoints;\n seriesProto.setStackedPoints = seriesSetStackedPoints;\n }\n }\n StackingAxis.compose = compose;\n})(StackingAxis || (StackingAxis = {}));\n/* *\n *\n * Default Export\n *\n * */\nexport default StackingAxis;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport Series from '../../Core/Series/Series.js';\nimport SeriesRegistry from '../../Core/Series/SeriesRegistry.js';\nimport U from '../../Core/Utilities.js';\nconst { defined, merge, isObject } = U;\n/* *\n *\n * Class\n *\n * */\n/**\n * The line series is the base type and is therefor the series base prototype.\n *\n * @private\n */\nclass LineSeries extends Series {\n /* *\n *\n * Functions\n *\n * */\n /**\n * Draw the graph. Called internally when rendering line-like series\n * types. The first time it generates the `series.graph` item and\n * optionally other series-wide items like `series.area` for area\n * charts. On subsequent calls these items are updated with new\n * positions and attributes.\n *\n * @function Highcharts.Series#drawGraph\n */\n drawGraph() {\n const options = this.options, graphPath = (this.gappedPath || this.getGraphPath).call(this), styledMode = this.chart.styledMode;\n // Draw the graph\n [this, ...this.zones].forEach((owner, i) => {\n let attribs, graph = owner.graph;\n const verb = graph ? 'animate' : 'attr', dashStyle = owner.dashStyle ||\n options.dashStyle;\n if (graph) {\n graph.endX = this.preventGraphAnimation ?\n null :\n graphPath.xMap;\n graph.animate({ d: graphPath });\n }\n else if (graphPath.length) { // #1487\n /**\n * SVG element of line-based charts. Can be used for styling\n * purposes. If zones are configured, this element will be\n * hidden and replaced by multiple zone lines, accessible\n * via `series.zones[i].graph`.\n *\n * @name Highcharts.Series#graph\n * @type {Highcharts.SVGElement|undefined}\n */\n owner.graph = graph = this.chart.renderer\n .path(graphPath)\n .addClass('highcharts-graph' +\n (i ? ` highcharts-zone-graph-${i - 1} ` : ' ') +\n ((i && owner.className) || ''))\n .attr({ zIndex: 1 }) // #1069\n .add(this.group);\n }\n if (graph && !styledMode) {\n attribs = {\n 'stroke': ((!i && options.lineColor) || // Series only\n owner.color ||\n this.color ||\n \"#cccccc\" /* Palette.neutralColor20 */),\n 'stroke-width': options.lineWidth || 0,\n // Polygon series use filled graph\n 'fill': (this.fillGraph && this.color) || 'none'\n };\n // Apply dash style\n if (dashStyle) {\n attribs.dashstyle = dashStyle;\n // The reason for the `else if` is that linecaps don't mix well\n // with dashstyle. The gaps get partially filled by the\n // linecap.\n }\n else if (options.linecap !== 'square') {\n attribs['stroke-linecap'] =\n attribs['stroke-linejoin'] = 'round';\n }\n graph[verb](attribs)\n // Add shadow to normal series (0) or to first\n // zone (1) #3932\n .shadow((i < 2) &&\n options.shadow &&\n // If shadow is defined, call function with\n // `filterUnits: 'userSpaceOnUse'` to avoid known\n // SVG filter bug (#19093)\n merge({ filterUnits: 'userSpaceOnUse' }, isObject(options.shadow) ? options.shadow : {}));\n }\n // Helpers for animation\n if (graph) {\n graph.startX = graphPath.xMap;\n graph.isArea = graphPath.isArea; // For arearange animation\n }\n });\n }\n // eslint-disable-next-line valid-jsdoc\n /**\n * Get the graph path.\n *\n * @private\n */\n getGraphPath(points, nullsAsZeroes, connectCliffs) {\n const series = this, options = series.options, graphPath = [], xMap = [];\n let gap, step = options.step;\n points = points || series.points;\n // Bottom of a stack is reversed\n const reversed = points.reversed;\n if (reversed) {\n points.reverse();\n }\n // Reverse the steps (#5004)\n step = {\n right: 1,\n center: 2\n }[step] || (step && 3);\n if (step && reversed) {\n step = 4 - step;\n }\n // Remove invalid points, especially in spline (#5015)\n points = this.getValidPoints(points, false, !(options.connectNulls && !nullsAsZeroes && !connectCliffs));\n // Build the line\n points.forEach(function (point, i) {\n const plotX = point.plotX, plotY = point.plotY, lastPoint = points[i - 1], isNull = point.isNull || typeof plotY !== 'number';\n // the path to this point from the previous\n let pathToPoint;\n if ((point.leftCliff || (lastPoint && lastPoint.rightCliff)) &&\n !connectCliffs) {\n gap = true; // ... and continue\n }\n // Line series, nullsAsZeroes is not handled\n if (isNull && !defined(nullsAsZeroes) && i > 0) {\n gap = !options.connectNulls;\n // Area series, nullsAsZeroes is set\n }\n else if (isNull && !nullsAsZeroes) {\n gap = true;\n }\n else {\n if (i === 0 || gap) {\n pathToPoint = [[\n 'M',\n point.plotX,\n point.plotY\n ]];\n // Generate the spline as defined in the SplineSeries object\n }\n else if (series.getPointSpline) {\n pathToPoint = [series.getPointSpline(points, point, i)];\n }\n else if (step) {\n if (step === 1) { // right\n pathToPoint = [[\n 'L',\n lastPoint.plotX,\n plotY\n ]];\n }\n else if (step === 2) { // center\n pathToPoint = [[\n 'L',\n (lastPoint.plotX + plotX) / 2,\n lastPoint.plotY\n ], [\n 'L',\n (lastPoint.plotX + plotX) / 2,\n plotY\n ]];\n }\n else {\n pathToPoint = [[\n 'L',\n plotX,\n lastPoint.plotY\n ]];\n }\n pathToPoint.push([\n 'L',\n plotX,\n plotY\n ]);\n }\n else {\n // normal line to next point\n pathToPoint = [[\n 'L',\n plotX,\n plotY\n ]];\n }\n // Prepare for animation. When step is enabled, there are\n // two path nodes for each x value.\n xMap.push(point.x);\n if (step) {\n xMap.push(point.x);\n if (step === 2) { // step = center (#8073)\n xMap.push(point.x);\n }\n }\n graphPath.push.apply(graphPath, pathToPoint);\n gap = false;\n }\n });\n graphPath.xMap = xMap;\n series.graphPath = graphPath;\n return graphPath;\n }\n}\n/* *\n *\n * Static Functions\n *\n * */\nLineSeries.defaultOptions = merge(Series.defaultOptions, \n/**\n * General options for all series types.\n *\n * @optionparent plotOptions.series\n */\n{\n legendSymbol: 'lineMarker'\n});\nSeriesRegistry.registerSeriesType('line', LineSeries);\n/* *\n *\n * Default Export\n *\n * */\nexport default LineSeries;\n/* *\n *\n * API Options\n *\n * */\n/**\n * A line series displays information as a series of data points connected by\n * straight line segments.\n *\n * @sample {highcharts} highcharts/demo/line-chart/\n * Line chart\n * @sample {highstock} stock/demo/basic-line/\n * Line chart\n *\n * @extends plotOptions.series\n * @product highcharts highstock\n * @apioption plotOptions.line\n */\n/**\n * The SVG value used for the `stroke-linecap` and `stroke-linejoin`\n * of a line graph. Round means that lines are rounded in the ends and\n * bends.\n *\n * @type {Highcharts.SeriesLinecapValue}\n * @default round\n * @since 3.0.7\n * @apioption plotOptions.line.linecap\n */\n/**\n * A `line` series. If the [type](#series.line.type) option is not\n * specified, it is inherited from [chart.type](#chart.type).\n *\n * @extends series,plotOptions.line\n * @excluding dataParser,dataURL\n * @product highcharts highstock\n * @apioption series.line\n */\n/**\n * An array of data points for the series. For the `line` series type,\n * points can be given in the following ways:\n *\n * 1. An array of numerical values. In this case, the numerical values will be\n * interpreted as `y` options. The `x` values will be automatically\n * calculated, either starting at 0 and incremented by 1, or from\n * `pointStart` and `pointInterval` given in the series options. If the axis\n * has categories, these will be used. Example:\n * ```js\n * data: [0, 5, 3, 5]\n * ```\n *\n * 2. An array of arrays with 2 values. In this case, the values correspond to\n * `x,y`. If the first value is a string, it is applied as the name of the\n * point, and the `x` value is inferred.\n * ```js\n * data: [\n * [0, 1],\n * [1, 2],\n * [2, 8]\n * ]\n * ```\n *\n * 3. An array of objects with named values. The following snippet shows only a\n * few settings, see the complete options set below. If the total number of\n * data points exceeds the series'\n * [turboThreshold](#series.line.turboThreshold),\n * this option is not available.\n * ```js\n * data: [{\n * x: 1,\n * y: 9,\n * name: \"Point2\",\n * color: \"#00FF00\"\n * }, {\n * x: 1,\n * y: 6,\n * name: \"Point1\",\n * color: \"#FF00FF\"\n * }]\n * ```\n *\n * **Note:** In TypeScript you have to extend `PointOptionsObject` with an\n * additional declaration to allow custom data types:\n * ```ts\n * declare module `highcharts` {\n * interface PointOptionsObject {\n * custom: Record;\n * }\n * }\n * ```\n *\n * @sample {highcharts} highcharts/chart/reflow-true/\n * Numerical values\n * @sample {highcharts} highcharts/series/data-array-of-arrays/\n * Arrays of numeric x and y\n * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/\n * Arrays of datetime x and y\n * @sample {highcharts} highcharts/series/data-array-of-name-value/\n * Arrays of point.name and y\n * @sample {highcharts} highcharts/series/data-array-of-objects/\n * Config objects\n *\n * @declare Highcharts.PointOptionsObject\n * @type {Array|null|*>}\n * @apioption series.line.data\n */\n/**\n * An additional, individual class name for the data point's graphic\n * representation. Changes to a point's color will also be reflected in a\n * chart's legend and tooltip.\n *\n * @sample {highcharts} highcharts/css/point-series-classname\n * Series and point class name\n *\n * @type {string}\n * @since 5.0.0\n * @product highcharts gantt\n * @apioption series.line.data.className\n */\n/**\n * Individual color for the point. By default the color is pulled from\n * the global `colors` array.\n *\n * In styled mode, the `color` option doesn't take effect. Instead, use\n * `colorIndex`.\n *\n * @sample {highcharts} highcharts/point/color/\n * Mark the highest point\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @product highcharts highstock gantt\n * @apioption series.line.data.color\n */\n/**\n * A specific color index to use for the point, so its graphic representations\n * are given the class name `highcharts-color-{n}`. In styled mode this will\n * change the color of the graphic. In non-styled mode, the color is set by the\n * `fill` attribute, so the change in class name won't have a visual effect by\n * default.\n *\n * Since v11, CSS variables on the form `--highcharts-color-{n}` make changing\n * the color scheme very convenient.\n *\n * @sample {highcharts} highcharts/css/colorindex/\n * Series and point color index\n *\n * @type {number}\n * @since 5.0.0\n * @product highcharts gantt\n * @apioption series.line.data.colorIndex\n */\n/**\n * A reserved subspace to store options and values for customized functionality.\n * Here you can add additional data for your own event callbacks and formatter\n * callbacks.\n *\n * @sample {highcharts} highcharts/point/custom/\n * Point and series with custom data\n *\n * @type {Highcharts.Dictionary<*>}\n * @apioption series.line.data.custom\n */\n/**\n * Individual data label for each point. The options are the same as\n * the ones for [plotOptions.series.dataLabels](\n * #plotOptions.series.dataLabels).\n *\n * @sample highcharts/point/datalabels/\n * Show a label for the last value\n *\n * @type {*|Array<*>}\n * @declare Highcharts.DataLabelsOptions\n * @extends plotOptions.line.dataLabels\n * @product highcharts highstock gantt\n * @apioption series.line.data.dataLabels\n */\n/**\n * A description of the point to add to the screen reader information\n * about the point.\n *\n * @type {string}\n * @since 5.0.0\n * @requires modules/accessibility\n * @apioption series.line.data.description\n */\n/**\n * An id for the point. This can be used after render time to get a\n * pointer to the point object through `chart.get()`.\n *\n * @sample {highcharts} highcharts/point/id/\n * Remove an id'd point\n *\n * @type {string}\n * @since 1.2.0\n * @product highcharts highstock gantt\n * @apioption series.line.data.id\n */\n/**\n * The rank for this point's data label in case of collision. If two\n * data labels are about to overlap, only the one with the highest `labelrank`\n * will be drawn.\n *\n * @type {number}\n * @apioption series.line.data.labelrank\n */\n/**\n * The name of the point as shown in the legend, tooltip, dataLabels, etc.\n *\n * @see [xAxis.uniqueNames](#xAxis.uniqueNames)\n *\n * @sample {highcharts} highcharts/series/data-array-of-objects/\n * Point names\n *\n * @type {string}\n * @apioption series.line.data.name\n */\n/**\n * Whether the data point is selected initially.\n *\n * @type {boolean}\n * @default false\n * @product highcharts highstock gantt\n * @apioption series.line.data.selected\n */\n/**\n * The x value of the point. For datetime axes, the X value is the timestamp\n * in milliseconds since 1970.\n *\n * @type {number}\n * @product highcharts highstock\n * @apioption series.line.data.x\n */\n/**\n * The y value of the point.\n *\n * @type {number|null}\n * @product highcharts highstock\n * @apioption series.line.data.y\n */\n/**\n * The individual point events.\n *\n * @extends plotOptions.series.point.events\n * @product highcharts highstock gantt\n * @apioption series.line.data.events\n */\n/**\n * Options for the point markers of line-like series.\n *\n * @declare Highcharts.PointMarkerOptionsObject\n * @extends plotOptions.series.marker\n * @product highcharts highstock\n * @apioption series.line.data.marker\n */\n''; // include precedent doclets in transpiled\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport SeriesRegistry from '../../Core/Series/SeriesRegistry.js';\nconst { seriesTypes: { line: LineSeries } } = SeriesRegistry;\nimport U from '../../Core/Utilities.js';\nconst { extend, merge, objectEach, pick } = U;\n/* *\n *\n * Class\n *\n * */\n/**\n * Area series type.\n *\n * @private\n * @class\n * @name AreaSeries\n *\n * @augments LineSeries\n */\nclass AreaSeries extends LineSeries {\n /* *\n *\n * Functions\n *\n * */\n /* eslint-disable valid-jsdoc */\n /**\n * Draw the graph and the underlying area. This method calls the Series\n * base function and adds the area. The areaPath is calculated in the\n * getSegmentPath method called from Series.prototype.drawGraph.\n * @private\n */\n drawGraph() {\n // Define or reset areaPath\n this.areaPath = [];\n // Call the base method\n super.drawGraph.apply(this);\n // Define local variables\n const { areaPath, options } = this;\n [this, ...this.zones].forEach((owner, i) => {\n const attribs = {}, fillColor = owner.fillColor || options.fillColor;\n let area = owner.area;\n const verb = area ? 'animate' : 'attr';\n // Create or update the area\n if (area) { // Update\n area.endX = this.preventGraphAnimation ?\n null :\n areaPath.xMap;\n area.animate({ d: areaPath });\n }\n else { // Create\n attribs.zIndex = 0; // #1069\n /**\n * SVG element of area-based charts. Can be used for styling\n * purposes. If zones are configured, this element will be\n * hidden and replaced by multiple zone areas, accessible\n * via `series.zones[i].area`.\n *\n * @name Highcharts.Series#area\n * @type {Highcharts.SVGElement|undefined}\n */\n area = owner.area = this.chart.renderer\n .path(areaPath)\n .addClass('highcharts-area' +\n (i ? ` highcharts-zone-area-${i - 1} ` : ' ') +\n ((i && owner.className) || ''))\n .add(this.group);\n area.isArea = true;\n }\n if (!this.chart.styledMode) {\n // If there is fillColor defined for the area, set it.\n // Otherwise, we set it to the zone/series color and add\n // fill-opacity (#18939).\n attribs.fill = fillColor || owner.color || this.color;\n attribs['fill-opacity'] = fillColor ?\n 1 : (options.fillOpacity ?? 0.75);\n // Allow clicking through the area if sticky tracking is true\n // (#18744)\n area.css({\n pointerEvents: this.stickyTracking ? 'none' : 'auto'\n });\n }\n area[verb](attribs);\n area.startX = areaPath.xMap;\n area.shiftUnit = options.step ? 2 : 1;\n });\n }\n /**\n * @private\n */\n getGraphPath(points) {\n const getGraphPath = LineSeries.prototype.getGraphPath, options = this.options, stacking = options.stacking, yAxis = this.yAxis, bottomPoints = [], graphPoints = [], seriesIndex = this.index, stacks = yAxis.stacking.stacks[this.stackKey], threshold = options.threshold, translatedThreshold = Math.round(// #10909\n yAxis.getThreshold(options.threshold)), connectNulls = pick(// #10574\n options.connectNulls, stacking === 'percent'), \n // To display null points in underlying stacked series, this\n // series graph must be broken, and the area also fall down to\n // fill the gap left by the null point. #2069\n addDummyPoints = function (i, otherI, side) {\n const point = points[i], stackedValues = stacking &&\n stacks[point.x].points[seriesIndex], nullVal = point[side + 'Null'] || 0, cliffVal = point[side + 'Cliff'] || 0;\n let top, bottom, isNull = true;\n if (cliffVal || nullVal) {\n top = (nullVal ?\n stackedValues[0] :\n stackedValues[1]) + cliffVal;\n bottom = stackedValues[0] + cliffVal;\n isNull = !!nullVal;\n }\n else if (!stacking &&\n points[otherI] &&\n points[otherI].isNull) {\n top = bottom = threshold;\n }\n // Add to the top and bottom line of the area\n if (typeof top !== 'undefined') {\n graphPoints.push({\n plotX: plotX,\n plotY: top === null ?\n translatedThreshold :\n yAxis.getThreshold(top),\n isNull: isNull,\n isCliff: true\n });\n bottomPoints.push({\n plotX: plotX,\n plotY: bottom === null ?\n translatedThreshold :\n yAxis.getThreshold(bottom),\n doCurve: false // #1041, gaps in areaspline areas\n });\n }\n };\n let plotX, isNull, yBottom;\n // Find what points to use\n points = points || this.points;\n // Fill in missing points\n if (stacking) {\n points = this.getStackPoints(points);\n }\n for (let i = 0, iEnd = points.length; i < iEnd; ++i) {\n // Reset after series.update of stacking property (#12033)\n if (!stacking) {\n points[i].leftCliff = points[i].rightCliff =\n points[i].leftNull = points[i].rightNull = void 0;\n }\n isNull = points[i].isNull;\n plotX = pick(points[i].rectPlotX, points[i].plotX);\n yBottom = stacking ?\n pick(points[i].yBottom, translatedThreshold) :\n translatedThreshold;\n if (!isNull || connectNulls) {\n if (!connectNulls) {\n addDummyPoints(i, i - 1, 'left');\n }\n // Skip null point when stacking is false and connectNulls\n // true\n if (!(isNull && !stacking && connectNulls)) {\n graphPoints.push(points[i]);\n bottomPoints.push({\n x: i,\n plotX: plotX,\n plotY: yBottom\n });\n }\n if (!connectNulls) {\n addDummyPoints(i, i + 1, 'right');\n }\n }\n }\n const topPath = getGraphPath.call(this, graphPoints, true, true);\n bottomPoints.reversed = true;\n const bottomPath = getGraphPath.call(this, bottomPoints, true, true);\n const firstBottomPoint = bottomPath[0];\n if (firstBottomPoint && firstBottomPoint[0] === 'M') {\n bottomPath[0] = ['L', firstBottomPoint[1], firstBottomPoint[2]];\n }\n const areaPath = topPath.concat(bottomPath);\n if (areaPath.length) {\n areaPath.push(['Z']);\n }\n // TODO: don't set leftCliff and rightCliff when connectNulls?\n const graphPath = getGraphPath\n .call(this, graphPoints, false, connectNulls);\n areaPath.xMap = topPath.xMap;\n this.areaPath = areaPath;\n return graphPath;\n }\n /**\n * Return an array of stacked points, where null and missing points are\n * replaced by dummy points in order for gaps to be drawn correctly in\n * stacks.\n * @private\n */\n getStackPoints(points) {\n const series = this, segment = [], keys = [], xAxis = this.xAxis, yAxis = this.yAxis, stack = yAxis.stacking.stacks[this.stackKey], pointMap = {}, yAxisSeries = yAxis.series, seriesLength = yAxisSeries.length, upOrDown = yAxis.options.reversedStacks ? 1 : -1, seriesIndex = yAxisSeries.indexOf(series);\n points = points || this.points;\n if (this.options.stacking) {\n for (let i = 0; i < points.length; i++) {\n // Reset after point update (#7326)\n points[i].leftNull = points[i].rightNull = void 0;\n // Create a map where we can quickly look up the points by\n // their X values.\n pointMap[points[i].x] = points[i];\n }\n // Sort the keys (#1651)\n objectEach(stack, function (stackX, x) {\n // nulled after switching between\n // grouping and not (#1651, #2336)\n if (stackX.total !== null) {\n keys.push(x);\n }\n });\n keys.sort(function (a, b) {\n return a - b;\n });\n const visibleSeries = yAxisSeries.map((s) => s.visible);\n keys.forEach(function (x, idx) {\n let y = 0, stackPoint, stackedValues;\n if (pointMap[x] && !pointMap[x].isNull) {\n segment.push(pointMap[x]);\n // Find left and right cliff. -1 goes left, 1 goes\n // right.\n [-1, 1].forEach(function (direction) {\n const nullName = direction === 1 ?\n 'rightNull' :\n 'leftNull', cliffName = direction === 1 ?\n 'rightCliff' :\n 'leftCliff', otherStack = stack[keys[idx + direction]];\n let cliff = 0;\n // If there is a stack next to this one,\n // to the left or to the right...\n if (otherStack) {\n let i = seriesIndex;\n // Can go either up or down,\n // depending on reversedStacks\n while (i >= 0 && i < seriesLength) {\n const si = yAxisSeries[i].index;\n stackPoint = otherStack.points[si];\n if (!stackPoint) {\n // If the next point in this series is\n // missing, mark the point with\n // point.leftNull or point.rightNull = true.\n if (si === series.index) {\n pointMap[x][nullName] = true;\n // If there are missing points in the next\n // stack in any of the series below this\n // one, we need to subtract the missing\n // values and add a hiatus to the left or\n // right.\n }\n else if (visibleSeries[i]) {\n stackedValues = stack[x].points[si];\n if (stackedValues) {\n cliff -= (stackedValues[1] -\n stackedValues[0]);\n }\n }\n }\n // When reversedStacks is true, loop up,\n // else loop down\n i += upOrDown;\n }\n }\n pointMap[x][cliffName] = cliff;\n });\n // There is no point for this X value in this series, so we\n // insert a dummy point in order for the areas to be drawn\n // correctly.\n }\n else {\n // Loop down the stack to find the series below this\n // one that has a value (#1991)\n let i = seriesIndex;\n while (i >= 0 && i < seriesLength) {\n const si = yAxisSeries[i].index;\n stackPoint = stack[x].points[si];\n if (stackPoint) {\n y = stackPoint[1];\n break;\n }\n // When reversedStacks is true, loop up, else loop\n // down\n i += upOrDown;\n }\n y = pick(y, 0);\n y = yAxis.translate(// #6272\n y, 0, 1, 0, 1);\n segment.push({\n isNull: true,\n plotX: xAxis.translate(// #6272\n x, 0, 0, 0, 1),\n x: x,\n plotY: y,\n yBottom: y\n });\n }\n });\n }\n return segment;\n }\n}\n/* *\n *\n * Static Properties\n *\n * */\n/**\n * The area series type.\n *\n * @sample {highcharts} highcharts/demo/area-basic/\n * Area chart\n * @sample {highstock} stock/demo/area/\n * Area chart\n *\n * @extends plotOptions.line\n * @excluding useOhlcData\n * @product highcharts highstock\n * @optionparent plotOptions.area\n */\nAreaSeries.defaultOptions = merge(LineSeries.defaultOptions, {\n /**\n * @see [fillColor](#plotOptions.area.fillColor)\n * @see [fillOpacity](#plotOptions.area.fillOpacity)\n *\n * @apioption plotOptions.area.color\n */\n /**\n * Fill color or gradient for the area. When `undefined`, the series'\n * `color` is used with the series' `fillOpacity`.\n *\n * In styled mode, the fill color can be set with the `.highcharts-area`\n * class name.\n *\n * @see [color](#plotOptions.area.color)\n * @see [fillOpacity](#plotOptions.area.fillOpacity)\n *\n * @sample {highcharts} highcharts/plotoptions/area-fillcolor-default/\n * Undefined by default\n * @sample {highcharts} highcharts/plotoptions/area-fillcolor-gradient/\n * Gradient\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @product highcharts highstock\n * @apioption plotOptions.area.fillColor\n */\n /**\n * Fill opacity for the area. When you set an explicit `fillColor`,\n * the `fillOpacity` is not applied. Instead, you should define the\n * opacity in the `fillColor` with an rgba color definition. The\n * `fillOpacity` setting, also the default setting, overrides the alpha\n * component of the `color` setting.\n *\n * In styled mode, the fill opacity can be set with the\n * `.highcharts-area` class name.\n *\n * @see [color](#plotOptions.area.color)\n * @see [fillColor](#plotOptions.area.fillColor)\n *\n * @sample {highcharts} highcharts/plotoptions/area-fillopacity/\n * Automatic fill color and fill opacity of 0.1\n *\n * @type {number}\n * @default {highcharts} 0.75\n * @default {highstock} 0.75\n * @product highcharts highstock\n * @apioption plotOptions.area.fillOpacity\n */\n /**\n * A separate color for the graph line. By default the line takes the\n * `color` of the series, but the lineColor setting allows setting a\n * separate color for the line without altering the `fillColor`.\n *\n * In styled mode, the line stroke can be set with the\n * `.highcharts-graph` class name.\n *\n * @sample {highcharts} highcharts/plotoptions/area-linecolor/\n * Dark gray line\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @product highcharts highstock\n * @apioption plotOptions.area.lineColor\n */\n /**\n * A separate color for the negative part of the area.\n *\n * In styled mode, a negative color is set with the\n * `.highcharts-negative` class name.\n *\n * @see [negativeColor](#plotOptions.area.negativeColor)\n *\n * @sample {highcharts} highcharts/css/series-negative-color/\n * Negative color in styled mode\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @since 3.0\n * @product highcharts\n * @apioption plotOptions.area.negativeFillColor\n */\n /**\n * Whether the whole area or just the line should respond to mouseover\n * tooltips and other mouse or touch events.\n *\n * @sample {highcharts|highstock} highcharts/plotoptions/area-trackbyarea/\n * Display the tooltip when the area is hovered\n *\n * @type {boolean}\n * @default false\n * @since 1.1.6\n * @product highcharts highstock\n * @apioption plotOptions.area.trackByArea\n */\n /**\n * The Y axis value to serve as the base for the area, for\n * distinguishing between values above and below a threshold. The area\n * between the graph and the threshold is filled.\n *\n * * If a number is given, the Y axis will scale to the threshold.\n * * If `null`, the scaling behaves like a line series with fill between\n * the graph and the Y axis minimum.\n * * If `Infinity` or `-Infinity`, the area between the graph and the\n * corresponding Y axis extreme is filled (since v6.1.0).\n *\n * @sample {highcharts} highcharts/plotoptions/area-threshold/\n * A threshold of 100\n * @sample {highcharts} highcharts/plotoptions/area-threshold-infinity/\n * A threshold of Infinity\n *\n * @type {number|null}\n * @since 2.0\n * @product highcharts highstock\n */\n threshold: 0,\n legendSymbol: 'areaMarker'\n});\nextend(AreaSeries.prototype, {\n singleStacks: false\n});\nSeriesRegistry.registerSeriesType('area', AreaSeries);\n/* *\n *\n * Default Export\n *\n * */\nexport default AreaSeries;\n/* *\n *\n * API Options\n *\n * */\n/**\n * A `area` series. If the [type](#series.area.type) option is not\n * specified, it is inherited from [chart.type](#chart.type).\n *\n * @extends series,plotOptions.area\n * @excluding dataParser, dataURL, useOhlcData\n * @product highcharts highstock\n * @apioption series.area\n */\n/**\n * @see [fillColor](#series.area.fillColor)\n * @see [fillOpacity](#series.area.fillOpacity)\n *\n * @apioption series.area.color\n */\n/**\n * An array of data points for the series. For the `area` series type,\n * points can be given in the following ways:\n *\n * 1. An array of numerical values. In this case, the numerical values will be\n * interpreted as `y` options. The `x` values will be automatically\n * calculated, either starting at 0 and incremented by 1, or from\n * `pointStart` * and `pointInterval` given in the series options. If the\n * axis has categories, these will be used. Example:\n * ```js\n * data: [0, 5, 3, 5]\n * ```\n *\n * 2. An array of arrays with 2 values. In this case, the values correspond to\n * `x,y`. If the first value is a string, it is applied as the name of the\n * point, and the `x` value is inferred.\n * ```js\n * data: [\n * [0, 9],\n * [1, 7],\n * [2, 6]\n * ]\n * ```\n *\n * 3. An array of objects with named values. The following snippet shows only a\n * few settings, see the complete options set below. If the total number of\n * data points exceeds the series'\n * [turboThreshold](#series.area.turboThreshold), this option is not\n * available.\n * ```js\n * data: [{\n * x: 1,\n * y: 9,\n * name: \"Point2\",\n * color: \"#00FF00\"\n * }, {\n * x: 1,\n * y: 6,\n * name: \"Point1\",\n * color: \"#FF00FF\"\n * }]\n * ```\n *\n * @sample {highcharts} highcharts/chart/reflow-true/\n * Numerical values\n * @sample {highcharts} highcharts/series/data-array-of-arrays/\n * Arrays of numeric x and y\n * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/\n * Arrays of datetime x and y\n * @sample {highcharts} highcharts/series/data-array-of-name-value/\n * Arrays of point.name and y\n * @sample {highcharts} highcharts/series/data-array-of-objects/\n * Config objects\n *\n * @type {Array|null|*>}\n * @extends series.line.data\n * @product highcharts highstock\n * @apioption series.area.data\n */\n/**\n * @see [color](#series.area.color)\n * @see [fillOpacity](#series.area.fillOpacity)\n *\n * @apioption series.area.fillColor\n */\n/**\n * @see [color](#series.area.color)\n * @see [fillColor](#series.area.fillColor)\n *\n * @default {highcharts} 0.75\n * @default {highstock} 0.75\n * @apioption series.area.fillOpacity\n */\n''; // adds doclets above to transpiled\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport SeriesRegistry from '../../Core/Series/SeriesRegistry.js';\nconst { line: LineSeries } = SeriesRegistry.seriesTypes;\nimport U from '../../Core/Utilities.js';\nconst { merge, pick } = U;\n/* *\n *\n * Class\n *\n * */\n/**\n * Spline series type.\n *\n * @private\n */\nclass SplineSeries extends LineSeries {\n /* *\n *\n * Functions\n *\n * */\n /* eslint-disable valid-jsdoc */\n /**\n * Get the spline segment from a given point's previous neighbour to the\n * given point.\n *\n * @private\n * @function Highcharts.seriesTypes.spline#getPointSpline\n */\n getPointSpline(points, point, i) {\n const \n // 1 means control points midway between points, 2 means 1/3\n // from the point, 3 is 1/4 etc\n smoothing = 1.5, denom = smoothing + 1, plotX = point.plotX || 0, plotY = point.plotY || 0, lastPoint = points[i - 1], nextPoint = points[i + 1];\n let leftContX, leftContY, rightContX, rightContY;\n /**\n * @private\n */\n function doCurve(otherPoint) {\n return otherPoint &&\n !otherPoint.isNull &&\n otherPoint.doCurve !== false &&\n // #6387, area splines next to null:\n !point.isCliff;\n }\n // Find control points\n if (doCurve(lastPoint) && doCurve(nextPoint)) {\n const lastX = lastPoint.plotX || 0, lastY = lastPoint.plotY || 0, nextX = nextPoint.plotX || 0, nextY = nextPoint.plotY || 0;\n let correction = 0;\n leftContX = (smoothing * plotX + lastX) / denom;\n leftContY = (smoothing * plotY + lastY) / denom;\n rightContX = (smoothing * plotX + nextX) / denom;\n rightContY = (smoothing * plotY + nextY) / denom;\n // Have the two control points make a straight line through main\n // point\n if (rightContX !== leftContX) { // #5016, division by zero\n correction = (((rightContY - leftContY) *\n (rightContX - plotX)) /\n (rightContX - leftContX) + plotY - rightContY);\n }\n leftContY += correction;\n rightContY += correction;\n // to prevent false extremes, check that control points are\n // between neighbouring points' y values\n if (leftContY > lastY && leftContY > plotY) {\n leftContY = Math.max(lastY, plotY);\n // mirror of left control point\n rightContY = 2 * plotY - leftContY;\n }\n else if (leftContY < lastY && leftContY < plotY) {\n leftContY = Math.min(lastY, plotY);\n rightContY = 2 * plotY - leftContY;\n }\n if (rightContY > nextY && rightContY > plotY) {\n rightContY = Math.max(nextY, plotY);\n leftContY = 2 * plotY - rightContY;\n }\n else if (rightContY < nextY && rightContY < plotY) {\n rightContY = Math.min(nextY, plotY);\n leftContY = 2 * plotY - rightContY;\n }\n // record for drawing in next point\n point.rightContX = rightContX;\n point.rightContY = rightContY;\n // Visualize control points for debugging\n /*\n if (leftContX) {\n this.chart.renderer\n .circle(\n leftContX + this.chart.plotLeft,\n leftContY + this.chart.plotTop,\n 2\n )\n .attr({\n stroke: 'red',\n 'stroke-width': 2,\n fill: 'none',\n zIndex: 9\n })\n .add();\n this.chart.renderer\n .path([['M', leftContX + this.chart.plotLeft,\n leftContY + this.chart.plotTop\n ], ['L', plotX + this.chart.plotLeft,\n plotY + this.chart.plotTop\n ]])\n .attr({\n stroke: 'red',\n 'stroke-width': 2,\n zIndex: 9\n })\n .add();\n }\n if (rightContX) {\n this.chart.renderer\n .circle(\n rightContX + this.chart.plotLeft,\n rightContY + this.chart.plotTop,\n 2\n )\n .attr({\n stroke: 'green',\n 'stroke-width': 2,\n fill: 'none',\n zIndex: 9\n })\n .add();\n this.chart.renderer\n .path([[\n 'M', rightContX + this.chart.plotLeft,\n rightContY + this.chart.plotTop\n ], [\n 'L', plotX + this.chart.plotLeft,\n plotY + this.chart.plotTop\n ]])\n .attr({\n stroke: 'green',\n 'stroke-width': 2,\n zIndex: 9\n })\n .add();\n }\n // */\n point.controlPoints = {\n low: [leftContX, leftContY],\n high: [rightContX, rightContY]\n };\n }\n const ret = [\n 'C',\n pick(lastPoint.rightContX, lastPoint.plotX, 0),\n pick(lastPoint.rightContY, lastPoint.plotY, 0),\n pick(leftContX, plotX, 0),\n pick(leftContY, plotY, 0),\n plotX,\n plotY\n ];\n // reset for updating series later\n lastPoint.rightContX = lastPoint.rightContY = void 0;\n return ret;\n }\n}\n/* *\n *\n * Static Properties\n *\n * */\n/**\n * A spline series is a special type of line series, where the segments\n * between the data points are smoothed.\n *\n * @sample {highcharts} highcharts/demo/spline-irregular-time/\n * Spline chart\n * @sample {highstock} stock/demo/spline/\n * Spline chart\n *\n * @extends plotOptions.series\n * @excluding step, boostThreshold, boostBlending\n * @product highcharts highstock\n * @optionparent plotOptions.spline\n */\nSplineSeries.defaultOptions = merge(LineSeries.defaultOptions);\nSeriesRegistry.registerSeriesType('spline', SplineSeries);\n/* *\n *\n * Default Export\n *\n * */\nexport default SplineSeries;\n/* *\n *\n * API Options\n *\n * */\n/**\n * A `spline` series. If the [type](#series.spline.type) option is\n * not specified, it is inherited from [chart.type](#chart.type).\n *\n * @extends series,plotOptions.spline\n * @excluding dataParser, dataURL, step, boostThreshold, boostBlending\n * @product highcharts highstock\n * @apioption series.spline\n */\n/**\n * An array of data points for the series. For the `spline` series type,\n * points can be given in the following ways:\n *\n * 1. An array of numerical values. In this case, the numerical values will be\n * interpreted as `y` options. The `x` values will be automatically\n * calculated, either starting at 0 and incremented by 1, or from\n * `pointStart` and `pointInterval` given in the series options. If the axis\n * has categories, these will be used. Example:\n * ```js\n * data: [0, 5, 3, 5]\n * ```\n *\n * 2. An array of arrays with 2 values. In this case, the values correspond to\n * `x,y`. If the first value is a string, it is applied as the name of the\n * point, and the `x` value is inferred.\n * ```js\n * data: [\n * [0, 9],\n * [1, 2],\n * [2, 8]\n * ]\n * ```\n *\n * 3. An array of objects with named values. The following snippet shows only a\n * few settings, see the complete options set below. If the total number of\n * data points exceeds the series'\n * [turboThreshold](#series.spline.turboThreshold),\n * this option is not available.\n * ```js\n * data: [{\n * x: 1,\n * y: 9,\n * name: \"Point2\",\n * color: \"#00FF00\"\n * }, {\n * x: 1,\n * y: 0,\n * name: \"Point1\",\n * color: \"#FF00FF\"\n * }]\n * ```\n *\n * @sample {highcharts} highcharts/chart/reflow-true/\n * Numerical values\n * @sample {highcharts} highcharts/series/data-array-of-arrays/\n * Arrays of numeric x and y\n * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/\n * Arrays of datetime x and y\n * @sample {highcharts} highcharts/series/data-array-of-name-value/\n * Arrays of point.name and y\n * @sample {highcharts} highcharts/series/data-array-of-objects/\n * Config objects\n *\n * @type {Array|null|*>}\n * @extends series.line.data\n * @product highcharts highstock\n * @apioption series.spline.data\n */\n''; // adds doclets above intro transpiled\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport SplineSeries from '../Spline/SplineSeries.js';\nimport SeriesRegistry from '../../Core/Series/SeriesRegistry.js';\nconst { area: AreaSeries, area: { prototype: areaProto } } = SeriesRegistry.seriesTypes;\nimport U from '../../Core/Utilities.js';\nconst { extend, merge } = U;\n/* *\n *\n * Class\n *\n * */\n/**\n * AreaSpline series type.\n *\n * @private\n * @class\n * @name Highcharts.seriesTypes.areaspline\n *\n * @augments Highcharts.Series\n */\nclass AreaSplineSeries extends SplineSeries {\n}\n/* *\n *\n * Static Properties\n *\n * */\nAreaSplineSeries.defaultOptions = merge(SplineSeries.defaultOptions, AreaSeries.defaultOptions);\nextend(AreaSplineSeries.prototype, {\n getGraphPath: areaProto.getGraphPath,\n getStackPoints: areaProto.getStackPoints,\n drawGraph: areaProto.drawGraph\n});\nSeriesRegistry.registerSeriesType('areaspline', AreaSplineSeries);\n/* *\n *\n * Default Export\n *\n * */\nexport default AreaSplineSeries;\n/* *\n *\n * API Options\n *\n * */\n/**\n * The area spline series is an area series where the graph between the\n * points is smoothed into a spline.\n *\n * @sample {highcharts} highcharts/demo/areaspline/\n * Area spline chart\n * @sample {highstock} stock/demo/areaspline/\n * Area spline chart\n *\n * @extends plotOptions.area\n * @excluding step, boostThreshold, boostBlending\n * @product highcharts highstock\n * @apioption plotOptions.areaspline\n */\n/**\n * @see [fillColor](#plotOptions.areaspline.fillColor)\n * @see [fillOpacity](#plotOptions.areaspline.fillOpacity)\n *\n * @apioption plotOptions.areaspline.color\n */\n/**\n * @see [color](#plotOptions.areaspline.color)\n * @see [fillOpacity](#plotOptions.areaspline.fillOpacity)\n *\n * @apioption plotOptions.areaspline.fillColor\n */\n/**\n * @see [color](#plotOptions.areaspline.color)\n * @see [fillColor](#plotOptions.areaspline.fillColor)\n *\n * @default 0.75\n * @apioption plotOptions.areaspline.fillOpacity\n */\n/**\n * A `areaspline` series. If the [type](#series.areaspline.type) option\n * is not specified, it is inherited from [chart.type](#chart.type).\n *\n *\n * @extends series,plotOptions.areaspline\n * @excluding dataParser, dataURL, step, boostThreshold, boostBlending\n * @product highcharts highstock\n * @apioption series.areaspline\n */\n/**\n * @see [fillColor](#series.areaspline.fillColor)\n * @see [fillOpacity](#series.areaspline.fillOpacity)\n *\n * @apioption series.areaspline.color\n */\n/**\n * An array of data points for the series. For the `areaspline` series\n * type, points can be given in the following ways:\n *\n * 1. An array of numerical values. In this case, the numerical values will be\n * interpreted as `y` options. The `x` values will be automatically\n * calculated, either starting at 0 and incremented by 1, or from\n * `pointStart` and `pointInterval` given in the series options. If the axis\n * has categories, these will be used. Example:\n * ```js\n * data: [0, 5, 3, 5]\n * ```\n *\n * 2. An array of arrays with 2 values. In this case, the values correspond to\n * `x,y`. If the first value is a string, it is applied as the name of the\n * point, and the `x` value is inferred.\n * ```js\n * data: [\n * [0, 10],\n * [1, 9],\n * [2, 3]\n * ]\n * ```\n *\n * 3. An array of objects with named values. The following snippet shows only a\n * few settings, see the complete options set below. If the total number of\n * data points exceeds the series'\n * [turboThreshold](#series.areaspline.turboThreshold), this option is not\n * available.\n * ```js\n * data: [{\n * x: 1,\n * y: 4,\n * name: \"Point2\",\n * color: \"#00FF00\"\n * }, {\n * x: 1,\n * y: 4,\n * name: \"Point1\",\n * color: \"#FF00FF\"\n * }]\n * ```\n *\n * @sample {highcharts} highcharts/chart/reflow-true/\n * Numerical values\n * @sample {highcharts} highcharts/series/data-array-of-arrays/\n * Arrays of numeric x and y\n * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/\n * Arrays of datetime x and y\n * @sample {highcharts} highcharts/series/data-array-of-name-value/\n * Arrays of point.name and y\n * @sample {highcharts} highcharts/series/data-array-of-objects/\n * Config objects\n *\n * @type {Array|null|*>}\n * @extends series.line.data\n * @product highcharts highstock\n * @apioption series.areaspline.data\n */\n/**\n * @see [color](#series.areaspline.color)\n * @see [fillOpacity](#series.areaspline.fillOpacity)\n *\n * @apioption series.areaspline.fillColor\n */\n/**\n * @see [color](#series.areaspline.color)\n * @see [fillColor](#series.areaspline.fillColor)\n *\n * @default 0.75\n * @apioption series.areaspline.fillOpacity\n */\n''; // adds doclets above into transpiled\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\n/* *\n *\n * API Options\n *\n * */\n/**\n * Column series display one column per value along an X axis.\n *\n * @sample {highcharts} highcharts/demo/column-basic/\n * Column chart\n * @sample {highstock} stock/demo/column/\n * Column chart\n *\n * @extends plotOptions.line\n * @excluding connectEnds, connectNulls, gapSize, gapUnit, linecap,\n * lineWidth, marker, step, useOhlcData\n * @product highcharts highstock\n * @optionparent plotOptions.column\n */\nconst ColumnSeriesDefaults = {\n /**\n * The corner radius of the border surrounding each column or bar. A number\n * signifies pixels. A percentage string, like for example `50%`, signifies\n * a relative size. For columns this is relative to the column width, for\n * pies it is relative to the radius and the inner radius.\n *\n * @sample {highcharts} highcharts/plotoptions/column-borderradius/\n * Rounded columns\n * @sample highcharts/plotoptions/series-border-radius\n * Column and pie with rounded border\n *\n * @type {number|string|Highcharts.BorderRadiusOptionsObject}\n * @product highcharts highstock gantt\n */\n borderRadius: 3,\n /**\n * When using automatic point colors pulled from the global\n * [colors](colors) or series-specific\n * [plotOptions.column.colors](series.colors) collections, this option\n * determines whether the chart should receive one color per series or\n * one color per point.\n *\n * In styled mode, the `colors` or `series.colors` arrays are not\n * supported, and instead this option gives the points individual color\n * class names on the form `highcharts-color-{n}`.\n *\n * @see [series colors](#plotOptions.column.colors)\n *\n * @sample {highcharts} highcharts/plotoptions/column-colorbypoint-false/\n * False by default\n * @sample {highcharts} highcharts/plotoptions/column-colorbypoint-true/\n * True\n *\n * @type {boolean}\n * @default false\n * @since 2.0\n * @product highcharts highstock gantt\n * @apioption plotOptions.column.colorByPoint\n */\n /**\n * A series specific or series type specific color set to apply instead\n * of the global [colors](#colors) when [colorByPoint](\n * #plotOptions.column.colorByPoint) is true.\n *\n * @type {Array}\n * @since 3.0\n * @product highcharts highstock gantt\n * @apioption plotOptions.column.colors\n */\n /**\n * When `true`, the columns will center in the category, ignoring null\n * or missing points. When `false`, space will be reserved for null or\n * missing points.\n *\n * @sample {highcharts} highcharts/series-column/centerincategory/\n * Center in category\n *\n * @since 8.0.1\n * @product highcharts highstock gantt\n */\n centerInCategory: false,\n /**\n * Padding between each value groups, in x axis units.\n *\n * @sample {highcharts} highcharts/plotoptions/column-grouppadding-default/\n * 0.2 by default\n * @sample {highcharts} highcharts/plotoptions/column-grouppadding-none/\n * No group padding - all columns are evenly spaced\n *\n * @product highcharts highstock gantt\n */\n groupPadding: 0.2,\n /**\n * Whether to group non-stacked columns or to let them render\n * independent of each other. Non-grouped columns will be laid out\n * individually and overlap each other.\n *\n * @sample {highcharts} highcharts/plotoptions/column-grouping-false/\n * Grouping disabled\n * @sample {highstock} highcharts/plotoptions/column-grouping-false/\n * Grouping disabled\n *\n * @type {boolean}\n * @default true\n * @since 2.3.0\n * @product highcharts highstock gantt\n * @apioption plotOptions.column.grouping\n */\n /** @ignore-option */\n marker: null,\n /**\n * The maximum allowed pixel width for a column, translated to the\n * height of a bar in a bar chart. This prevents the columns from\n * becoming too wide when there is a small number of points in the\n * chart.\n *\n * @see [pointWidth](#plotOptions.column.pointWidth)\n *\n * @sample {highcharts} highcharts/plotoptions/column-maxpointwidth-20/\n * Limited to 50\n * @sample {highstock} highcharts/plotoptions/column-maxpointwidth-20/\n * Limited to 50\n *\n * @type {number}\n * @since 4.1.8\n * @product highcharts highstock gantt\n * @apioption plotOptions.column.maxPointWidth\n */\n /**\n * Padding between each column or bar, in x axis units.\n *\n * @sample {highcharts} highcharts/plotoptions/column-pointpadding-default/\n * 0.1 by default\n * @sample {highcharts} highcharts/plotoptions/column-pointpadding-025/\n * 0.25\n * @sample {highcharts} highcharts/plotoptions/column-pointpadding-none/\n * 0 for tightly packed columns\n *\n * @product highcharts highstock gantt\n */\n pointPadding: 0.1,\n /**\n * A pixel value specifying a fixed width for each column or bar point.\n * When set to `undefined`, the width is calculated from the\n * `pointPadding` and `groupPadding`. The width effects the dimension\n * that is not based on the point value. For column series it is the\n * horizontal length and for bar series it is the vertical length.\n *\n * @see [maxPointWidth](#plotOptions.column.maxPointWidth)\n *\n * @sample {highcharts} highcharts/plotoptions/column-pointwidth-20/\n * 20px wide columns regardless of chart width or the amount of\n * data points\n *\n * @type {number}\n * @since 1.2.5\n * @product highcharts highstock gantt\n * @apioption plotOptions.column.pointWidth\n */\n /**\n * A pixel value specifying a fixed width for the column or bar.\n * Overrides pointWidth on the series.\n *\n * @see [series.pointWidth](#plotOptions.column.pointWidth)\n *\n * @type {number}\n * @default undefined\n * @since 7.0.0\n * @product highcharts highstock gantt\n * @apioption series.column.data.pointWidth\n */\n /**\n * The minimal height for a column or width for a bar. By default,\n * 0 values are not shown. To visualize a 0 (or close to zero) point,\n * set the minimal point length to a pixel value like 3\\. In stacked\n * column charts, minPointLength might not be respected for tightly\n * packed values.\n *\n * @sample {highcharts} highcharts/plotoptions/column-minpointlength/\n * Zero base value\n * @sample {highcharts} highcharts/plotoptions/column-minpointlength-pos-and-neg/\n * Positive and negative close to zero values\n *\n * @product highcharts highstock gantt\n */\n minPointLength: 0,\n /**\n * When the series contains less points than the crop threshold, all\n * points are drawn, event if the points fall outside the visible plot\n * area at the current zoom. The advantage of drawing all points\n * (including markers and columns), is that animation is performed on\n * updates. On the other hand, when the series contains more points than\n * the crop threshold, the series data is cropped to only contain points\n * that fall within the plot area. The advantage of cropping away\n * invisible points is to increase performance on large series.\n *\n * @product highcharts highstock gantt\n */\n cropThreshold: 50,\n /**\n * The X axis range that each point is valid for. This determines the\n * width of the column. On a categorized axis, the range will be 1\n * by default (one category unit). On linear and datetime axes, the\n * range will be computed as the distance between the two closest data\n * points.\n *\n * The default `null` means it is computed automatically, but this\n * option can be used to override the automatic value.\n *\n * This option is set by default to 1 if data sorting is enabled.\n *\n * @sample {highcharts} highcharts/plotoptions/column-pointrange/\n * Set the point range to one day on a data set with one week\n * between the points\n *\n * @type {number|null}\n * @since 2.3\n * @product highcharts highstock gantt\n */\n pointRange: null,\n states: {\n /**\n * Options for the hovered point. These settings override the normal\n * state options when a point is moused over or touched.\n *\n * @extends plotOptions.series.states.hover\n * @excluding halo, lineWidth, lineWidthPlus, marker\n * @product highcharts highstock gantt\n */\n hover: {\n /** @ignore-option */\n halo: false,\n /**\n * A specific border color for the hovered point. Defaults to\n * inherit the normal state border color.\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @product highcharts gantt\n * @apioption plotOptions.column.states.hover.borderColor\n */\n /**\n * A specific color for the hovered point.\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @product highcharts gantt\n * @apioption plotOptions.column.states.hover.color\n */\n /**\n * How much to brighten the point on interaction. Requires the\n * main color to be defined in hex or rgb(a) format.\n *\n * In styled mode, the hover brightening is by default replaced\n * with a fill-opacity set in the `.highcharts-point:hover`\n * rule.\n *\n * @sample {highcharts} highcharts/plotoptions/column-states-hover-brightness/\n * Brighten by 0.5\n *\n * @product highcharts highstock gantt\n */\n brightness: 0.1\n },\n /**\n * Options for the selected point. These settings override the\n * normal state options when a point is selected.\n *\n * @extends plotOptions.series.states.select\n * @excluding halo, lineWidth, lineWidthPlus, marker\n * @product highcharts highstock gantt\n */\n select: {\n /**\n * A specific color for the selected point.\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @default #cccccc\n * @product highcharts highstock gantt\n */\n color: \"#cccccc\" /* Palette.neutralColor20 */,\n /**\n * A specific border color for the selected point.\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @default #000000\n * @product highcharts highstock gantt\n */\n borderColor: \"#000000\" /* Palette.neutralColor100 */\n }\n },\n dataLabels: {\n align: void 0,\n verticalAlign: void 0,\n /**\n * The y position offset of the label relative to the point in\n * pixels.\n *\n * @type {number}\n */\n y: void 0\n },\n // false doesn't work well: https://jsfiddle.net/highcharts/hz8fopan/14/\n /** @ignore-option */\n startFromThreshold: true,\n stickyTracking: false,\n tooltip: {\n distance: 6\n },\n /**\n * The Y axis value to serve as the base for the columns, for\n * distinguishing between values above and below a threshold. If `null`,\n * the columns extend from the padding Y axis minimum.\n *\n * @type {number|null}\n * @since 2.0\n * @product highcharts\n */\n threshold: 0,\n /**\n * The width of the border surrounding each column or bar. Defaults to\n * `1` when there is room for a border, but to `0` when the columns are\n * so dense that a border would cover the next column.\n *\n * In styled mode, the stroke width can be set with the\n * `.highcharts-point` rule.\n *\n * @sample {highcharts} highcharts/plotoptions/column-borderwidth/\n * 2px black border\n *\n * @type {number}\n * @default undefined\n * @product highcharts highstock gantt\n * @apioption plotOptions.column.borderWidth\n */\n /**\n * The color of the border surrounding each column or bar.\n *\n * In styled mode, the border stroke can be set with the\n * `.highcharts-point` rule.\n *\n * @sample {highcharts} highcharts/plotoptions/column-bordercolor/\n * Dark gray border\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @default #ffffff\n * @product highcharts highstock gantt\n */\n borderColor: \"#ffffff\" /* Palette.backgroundColor */\n};\n/**\n * A `column` series. If the [type](#series.column.type) option is\n * not specified, it is inherited from [chart.type](#chart.type).\n *\n * @extends series,plotOptions.column\n * @excluding connectNulls, dataParser, dataURL, gapSize, gapUnit, linecap,\n * lineWidth, marker, connectEnds, step\n * @product highcharts highstock\n * @apioption series.column\n */\n/**\n * An array of data points for the series. For the `column` series type,\n * points can be given in the following ways:\n *\n * 1. An array of numerical values. In this case, the numerical values will be\n * interpreted as `y` options. The `x` values will be automatically\n * calculated, either starting at 0 and incremented by 1, or from\n * `pointStart` and `pointInterval` given in the series options. If the axis\n * has categories, these will be used. Example:\n * ```js\n * data: [0, 5, 3, 5]\n * ```\n *\n * 2. An array of arrays with 2 values. In this case, the values correspond to\n * `x,y`. If the first value is a string, it is applied as the name of the\n * point, and the `x` value is inferred.\n * ```js\n * data: [\n * [0, 6],\n * [1, 2],\n * [2, 6]\n * ]\n * ```\n *\n * 3. An array of objects with named values. The following snippet shows only a\n * few settings, see the complete options set below. If the total number of\n * data points exceeds the series'\n * [turboThreshold](#series.column.turboThreshold), this option is not\n * available.\n * ```js\n * data: [{\n * x: 1,\n * y: 9,\n * name: \"Point2\",\n * color: \"#00FF00\"\n * }, {\n * x: 1,\n * y: 6,\n * name: \"Point1\",\n * color: \"#FF00FF\"\n * }]\n * ```\n *\n * @sample {highcharts} highcharts/chart/reflow-true/\n * Numerical values\n * @sample {highcharts} highcharts/series/data-array-of-arrays/\n * Arrays of numeric x and y\n * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/\n * Arrays of datetime x and y\n * @sample {highcharts} highcharts/series/data-array-of-name-value/\n * Arrays of point.name and y\n * @sample {highcharts} highcharts/series/data-array-of-objects/\n * Config objects\n *\n * @type {Array|null|*>}\n * @extends series.line.data\n * @excluding marker\n * @product highcharts highstock\n * @apioption series.column.data\n */\n/**\n * The color of the border surrounding the column or bar.\n *\n * In styled mode, the border stroke can be set with the `.highcharts-point`\n * rule.\n *\n * @sample {highcharts} highcharts/plotoptions/column-bordercolor/\n * Dark gray border\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @product highcharts highstock\n * @apioption series.column.data.borderColor\n */\n/**\n * The width of the border surrounding the column or bar.\n *\n * In styled mode, the stroke width can be set with the `.highcharts-point`\n * rule.\n *\n * @sample {highcharts} highcharts/plotoptions/column-borderwidth/\n * 2px black border\n *\n * @type {number}\n * @product highcharts highstock\n * @apioption series.column.data.borderWidth\n */\n/**\n * A name for the dash style to use for the column or bar. Overrides\n * dashStyle on the series.\n *\n * In styled mode, the stroke dash-array can be set with the same classes as\n * listed under [data.color](#series.column.data.color).\n *\n * @see [series.pointWidth](#plotOptions.column.dashStyle)\n *\n * @type {Highcharts.DashStyleValue}\n * @apioption series.column.data.dashStyle\n */\n/**\n * A pixel value specifying a fixed width for the column or bar. Overrides\n * pointWidth on the series. The width effects the dimension that is not based\n * on the point value.\n *\n * @see [series.pointWidth](#plotOptions.column.pointWidth)\n *\n * @type {number}\n * @apioption series.column.data.pointWidth\n */\n/**\n * @excluding halo, lineWidth, lineWidthPlus, marker\n * @product highcharts highstock\n * @apioption series.column.states.hover\n */\n/**\n * @excluding halo, lineWidth, lineWidthPlus, marker\n * @product highcharts highstock\n * @apioption series.column.states.select\n */\n''; // keeps doclets above in JS file\n/* *\n *\n * Default Export\n *\n * */\nexport default ColumnSeriesDefaults;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport A from '../../Core/Animation/AnimationUtilities.js';\nconst { animObject } = A;\nimport Color from '../../Core/Color/Color.js';\nconst { parse: color } = Color;\nimport ColumnSeriesDefaults from './ColumnSeriesDefaults.js';\nimport H from '../../Core/Globals.js';\nconst { noop } = H;\nimport Series from '../../Core/Series/Series.js';\nimport SeriesRegistry from '../../Core/Series/SeriesRegistry.js';\nimport U from '../../Core/Utilities.js';\nconst { clamp, defined, extend, fireEvent, isArray, isNumber, merge, pick, objectEach } = U;\n/* *\n *\n * Class\n *\n * */\n/**\n * The column series type.\n *\n * @private\n * @class\n * @name Highcharts.seriesTypes.column\n *\n * @augments Highcharts.Series\n */\nclass ColumnSeries extends Series {\n /* *\n *\n * Functions\n *\n * */\n /* eslint-disable valid-jsdoc */\n /**\n * Animate the column heights one by one from zero.\n *\n * @private\n * @function Highcharts.seriesTypes.column#animate\n *\n * @param {boolean} init\n * Whether to initialize the animation or run it\n */\n animate(init) {\n const series = this, yAxis = this.yAxis, yAxisPos = yAxis.pos, options = series.options, inverted = this.chart.inverted, attr = {}, translateProp = inverted ?\n 'translateX' :\n 'translateY';\n let translateStart, translatedThreshold;\n if (init) {\n attr.scaleY = 0.001;\n translatedThreshold = clamp(yAxis.toPixels(options.threshold), yAxisPos, yAxisPos + yAxis.len);\n if (inverted) {\n attr.translateX = translatedThreshold - yAxis.len;\n }\n else {\n attr.translateY = translatedThreshold;\n }\n // apply final clipping (used in Highcharts Stock) (#7083)\n // animation is done by scaleY, so clipping is for panes\n if (series.clipBox) {\n series.setClip();\n }\n series.group.attr(attr);\n }\n else { // run the animation\n translateStart = Number(series.group.attr(translateProp));\n series.group.animate({ scaleY: 1 }, extend(animObject(series.options.animation), {\n // Do the scale synchronously to ensure smooth\n // updating (#5030, #7228)\n step: function (val, fx) {\n if (series.group) {\n attr[translateProp] = translateStart +\n fx.pos * (yAxisPos - translateStart);\n series.group.attr(attr);\n }\n }\n }));\n }\n }\n /**\n * Initialize the series. Extends the basic Series.init method by\n * marking other series of the same type as dirty.\n *\n * @private\n * @function Highcharts.seriesTypes.column#init\n */\n init(chart, \n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n options) {\n super.init.apply(this, arguments);\n const series = this;\n chart = series.chart;\n // if the series is added dynamically, force redraw of other\n // series affected by a new column\n if (chart.hasRendered) {\n chart.series.forEach(function (otherSeries) {\n if (otherSeries.type === series.type) {\n otherSeries.isDirty = true;\n }\n });\n }\n }\n /**\n * Return the width and x offset of the columns adjusted for grouping,\n * groupPadding, pointPadding, pointWidth etc.\n *\n * @private\n * @function Highcharts.seriesTypes.column#getColumnMetrics\n */\n getColumnMetrics() {\n const series = this, options = series.options, xAxis = series.xAxis, yAxis = series.yAxis, reversedStacks = xAxis.options.reversedStacks, \n // Keep backward compatibility: reversed xAxis had reversed\n // stacks\n reverseStacks = (xAxis.reversed && !reversedStacks) ||\n (!xAxis.reversed && reversedStacks), stackGroups = {};\n let stackKey, columnCount = 0;\n // Get the total number of column type series. This is called on\n // every series. Consider moving this logic to a chart.orderStacks()\n // function and call it on init, addSeries and removeSeries\n if (options.grouping === false) {\n columnCount = 1;\n }\n else {\n series.chart.series.forEach(function (otherSeries) {\n const otherYAxis = otherSeries.yAxis, otherOptions = otherSeries.options;\n let columnIndex;\n if (otherSeries.type === series.type &&\n otherSeries.reserveSpace() &&\n yAxis.len === otherYAxis.len &&\n yAxis.pos === otherYAxis.pos) { // #642, #2086\n if (otherOptions.stacking &&\n otherOptions.stacking !== 'group') {\n stackKey = otherSeries.stackKey;\n if (typeof stackGroups[stackKey] ===\n 'undefined') {\n stackGroups[stackKey] = columnCount++;\n }\n columnIndex = stackGroups[stackKey];\n }\n else if (otherOptions.grouping !== false) { // #1162\n columnIndex = columnCount++;\n }\n otherSeries.columnIndex = columnIndex;\n }\n });\n }\n const categoryWidth = Math.min(Math.abs(xAxis.transA) * ((!xAxis.brokenAxis?.hasBreaks && xAxis.ordinal?.slope) ||\n options.pointRange ||\n xAxis.closestPointRange ||\n xAxis.tickInterval ||\n 1), // #2610\n xAxis.len // #1535\n ), groupPadding = categoryWidth * options.groupPadding, groupWidth = categoryWidth - 2 * groupPadding, pointOffsetWidth = groupWidth / (columnCount || 1), pointWidth = Math.min(options.maxPointWidth || xAxis.len, pick(options.pointWidth, pointOffsetWidth * (1 - 2 * options.pointPadding))), pointPadding = (pointOffsetWidth - pointWidth) / 2, \n // #1251, #3737\n colIndex = (series.columnIndex || 0) + (reverseStacks ? 1 : 0), pointXOffset = pointPadding +\n (groupPadding +\n colIndex * pointOffsetWidth -\n (categoryWidth / 2)) * (reverseStacks ? -1 : 1);\n // Save it for reading in linked series (Error bars particularly)\n series.columnMetrics = {\n width: pointWidth,\n offset: pointXOffset,\n paddedWidth: pointOffsetWidth,\n columnCount\n };\n return series.columnMetrics;\n }\n /**\n * Make the columns crisp. The edges are rounded to the nearest full\n * pixel.\n *\n * @private\n * @function Highcharts.seriesTypes.column#crispCol\n */\n crispCol(x, y, w, h) {\n const borderWidth = this.borderWidth, xCrisp = -(borderWidth % 2 ? 0.5 : 0);\n let right, yCrisp = borderWidth % 2 ? 0.5 : 1;\n // Horizontal. We need to first compute the exact right edge, then\n // round it and compute the width from there.\n if (this.options.crisp) {\n right = Math.round(x + w) + xCrisp;\n x = Math.round(x) + xCrisp;\n w = right - x;\n }\n // Vertical\n const bottom = Math.round(y + h) + yCrisp, fromTop = Math.abs(y) <= 0.5 && bottom > 0.5; // #4504, #4656\n y = Math.round(y) + yCrisp;\n h = bottom - y;\n // Top edges are exceptions\n if (fromTop && h) { // #5146\n y -= 1;\n h += 1;\n }\n return {\n x: x,\n y: y,\n width: w,\n height: h\n };\n }\n /**\n * Adjust for missing columns, according to the `centerInCategory`\n * option. Missing columns are either single points or stacks where the\n * point or points are either missing or null.\n *\n * @private\n * @function Highcharts.seriesTypes.column#adjustForMissingColumns\n * @param {number} x\n * The x coordinate of the column, left side\n *\n * @param {number} pointWidth\n * The pointWidth, already computed upstream\n *\n * @param {Highcharts.ColumnPoint} point\n * The point instance\n *\n * @param {Highcharts.ColumnMetricsObject} metrics\n * The series-wide column metrics\n *\n * @return {number}\n * The adjusted x position, or the original if not adjusted\n */\n adjustForMissingColumns(x, pointWidth, point, metrics) {\n if (!point.isNull && metrics.columnCount > 1) {\n const visibleSeries = this.xAxis.series\n .filter((s) => s.visible)\n .map((s) => s.index);\n let indexInCategory = 0, totalInCategory = 0;\n // Loop over all the stacks on the Y axis. When stacking is enabled,\n // these are real point stacks. When stacking is not enabled, but\n // `centerInCategory` is true, there is one stack handling the\n // grouping of points in each category. This is done in the\n // `setGroupedPoints` function.\n objectEach(this.xAxis.stacking?.stacks, (stack) => {\n if (typeof point.x === 'number') {\n const stackItem = stack[point.x.toString()];\n if (stackItem) {\n const pointValues = stackItem.points[this.index];\n // Look for the index\n if (isArray(pointValues)) {\n // If there are multiple points with the same X\n // then gather all series in category, and\n // assign index\n const seriesIndexes = Object\n .keys(stackItem.points)\n .filter((pointKey) => \n // Filter out duplicate X's\n !pointKey.match(',') &&\n // Filter out null points\n stackItem.points[pointKey] &&\n stackItem.points[pointKey].length > 1)\n .map(parseFloat)\n .filter((index) => visibleSeries.indexOf(index) !== -1)\n .sort((a, b) => b - a);\n indexInCategory = seriesIndexes.indexOf(this.index);\n totalInCategory = seriesIndexes.length;\n }\n }\n }\n });\n indexInCategory = this.xAxis.reversed ?\n totalInCategory - 1 - indexInCategory : indexInCategory;\n // Compute the adjusted x position\n const boxWidth = (totalInCategory - 1) * metrics.paddedWidth +\n pointWidth;\n x = (point.plotX || 0) + boxWidth / 2 - pointWidth -\n indexInCategory * metrics.paddedWidth;\n }\n return x;\n }\n /**\n * Translate each point to the plot area coordinate system and find\n * shape positions\n *\n * @private\n * @function Highcharts.seriesTypes.column#translate\n */\n translate() {\n const series = this, chart = series.chart, options = series.options, dense = series.dense =\n series.closestPointRange * series.xAxis.transA < 2, borderWidth = series.borderWidth = pick(options.borderWidth, dense ? 0 : 1 // #3635\n ), xAxis = series.xAxis, yAxis = series.yAxis, threshold = options.threshold, minPointLength = pick(options.minPointLength, 5), metrics = series.getColumnMetrics(), seriesPointWidth = metrics.width, seriesXOffset = series.pointXOffset = metrics.offset, dataMin = series.dataMin, dataMax = series.dataMax;\n // postprocessed for border width\n let seriesBarW = series.barW =\n Math.max(seriesPointWidth, 1 + 2 * borderWidth), translatedThreshold = series.translatedThreshold =\n yAxis.getThreshold(threshold);\n if (chart.inverted) {\n translatedThreshold -= 0.5; // #3355\n }\n // When the pointPadding is 0, we want the columns to be packed\n // tightly, so we allow individual columns to have individual sizes.\n // When pointPadding is greater, we strive for equal-width columns\n // (#2694).\n if (options.pointPadding) {\n seriesBarW = Math.ceil(seriesBarW);\n }\n Series.prototype.translate.apply(series);\n // Record the new values\n series.points.forEach(function (point) {\n const yBottom = pick(point.yBottom, translatedThreshold), safeDistance = 999 + Math.abs(yBottom), plotX = point.plotX || 0, \n // Don't draw too far outside plot area (#1303, #2241,\n // #4264)\n plotY = clamp(point.plotY, -safeDistance, yAxis.len + safeDistance);\n let up, barY = Math.min(plotY, yBottom), barH = Math.max(plotY, yBottom) - barY, pointWidth = seriesPointWidth, barX = plotX + seriesXOffset, barW = seriesBarW;\n // Handle options.minPointLength\n if (minPointLength && Math.abs(barH) < minPointLength) {\n barH = minPointLength;\n up = (!yAxis.reversed && !point.negative) ||\n (yAxis.reversed && point.negative);\n // Reverse zeros if there's no positive value in the series\n // in visible range (#7046)\n if (isNumber(threshold) &&\n isNumber(dataMax) &&\n point.y === threshold &&\n dataMax <= threshold &&\n // and if there's room for it (#7311)\n (yAxis.min || 0) < threshold &&\n // if all points are the same value (i.e zero) not draw\n // as negative points (#10646), but only if there's room\n // for it (#14876)\n (dataMin !== dataMax || (yAxis.max || 0) <= threshold)) {\n up = !up;\n point.negative = !point.negative;\n }\n // If stacked...\n barY = (Math.abs(barY - translatedThreshold) > minPointLength ?\n // ...keep position\n yBottom - minPointLength :\n // #1485, #4051\n translatedThreshold -\n (up ? minPointLength : 0));\n }\n // Handle point.options.pointWidth\n // @todo Handle grouping/stacking too. Calculate offset properly\n if (defined(point.options.pointWidth)) {\n pointWidth = barW =\n Math.ceil(point.options.pointWidth);\n barX -= Math.round((pointWidth - seriesPointWidth) / 2);\n }\n // Adjust for null or missing points\n if (options.centerInCategory && !options.stacking) {\n barX = series.adjustForMissingColumns(barX, pointWidth, point, metrics);\n }\n // Cache for access in polar\n point.barX = barX;\n point.pointWidth = pointWidth;\n // Fix the tooltip on center of grouped columns (#1216, #424,\n // #3648)\n point.tooltipPos = chart.inverted ?\n [\n clamp(yAxis.len + yAxis.pos - chart.plotLeft - plotY, yAxis.pos - chart.plotLeft, yAxis.len + yAxis.pos - chart.plotLeft),\n xAxis.len + xAxis.pos - chart.plotTop - barX - barW / 2,\n barH\n ] :\n [\n xAxis.left - chart.plotLeft + barX + barW / 2,\n clamp(plotY + yAxis.pos -\n chart.plotTop, yAxis.pos - chart.plotTop, yAxis.len + yAxis.pos - chart.plotTop),\n barH\n ];\n // Register shape type and arguments to be used in drawPoints. Allow\n // `shapeType` defined on `pointClass` level.\n point.shapeType = series.pointClass.prototype.shapeType ||\n 'roundedRect';\n point.shapeArgs = series.crispCol(barX, \n // #3169, drilldown from null must have a position to work from.\n // #6585, dataLabel should be placed on xAxis, not floating in\n // the middle of the chart.\n point.isNull ? translatedThreshold : barY, barW, point.isNull ? 0 : barH);\n });\n // Fire a specific event after column translate. We could instead apply\n // all the column logic in an `afterTranslate` event handler, but there\n // are so many other series types that use the column translation, that\n // it is more convenient to have a specific event for it.\n fireEvent(this, 'afterColumnTranslate');\n }\n /**\n * Columns have no graph\n *\n * @private\n * @function Highcharts.seriesTypes.column#drawGraph\n */\n drawGraph() {\n this.group[this.dense ? 'addClass' : 'removeClass']('highcharts-dense-data');\n }\n /**\n * Get presentational attributes\n *\n * @private\n * @function Highcharts.seriesTypes.column#pointAttribs\n */\n pointAttribs(point, state) {\n const options = this.options, p2o = this.pointAttrToOptions || {}, strokeOption = p2o.stroke || 'borderColor', strokeWidthOption = p2o['stroke-width'] || 'borderWidth';\n let stateOptions, zone, brightness, fill = (point && point.color) || this.color, \n // set to fill when borderColor null:\n stroke = ((point && point[strokeOption]) ||\n options[strokeOption] ||\n fill), dashstyle = (point && point.options.dashStyle) || options.dashStyle, strokeWidth = (point && point[strokeWidthOption]) ||\n options[strokeWidthOption] ||\n this[strokeWidthOption] || 0, opacity = pick(point && point.opacity, options.opacity, 1);\n // Handle zone colors\n if (point && this.zones.length) {\n zone = point.getZone();\n // When zones are present, don't use point.color (#4267).\n // Changed order (#6527), added support for colorAxis (#10670)\n fill = (point.options.color ||\n (zone && (zone.color || point.nonZonedColor)) ||\n this.color);\n if (zone) {\n stroke = zone.borderColor || stroke;\n dashstyle = zone.dashStyle || dashstyle;\n strokeWidth = zone.borderWidth || strokeWidth;\n }\n }\n // Select or hover states\n if (state && point) {\n stateOptions = merge(options.states[state], \n // #6401\n point.options.states &&\n point.options.states[state] ||\n {});\n brightness = stateOptions.brightness;\n fill =\n stateOptions.color || (typeof brightness !== 'undefined' &&\n color(fill)\n .brighten(stateOptions.brightness)\n .get()) || fill;\n stroke = stateOptions[strokeOption] || stroke;\n strokeWidth =\n stateOptions[strokeWidthOption] || strokeWidth;\n dashstyle = stateOptions.dashStyle || dashstyle;\n opacity = pick(stateOptions.opacity, opacity);\n }\n const ret = {\n fill: fill,\n stroke: stroke,\n 'stroke-width': strokeWidth,\n opacity: opacity\n };\n if (dashstyle) {\n ret.dashstyle = dashstyle;\n }\n return ret;\n }\n /**\n * Draw the columns. For bars, the series.group is rotated, so the same\n * coordinates apply for columns and bars. This method is inherited by\n * scatter series.\n *\n * @private\n * @function Highcharts.seriesTypes.column#drawPoints\n */\n drawPoints(points = this.points) {\n const series = this, chart = this.chart, options = series.options, renderer = chart.renderer, animationLimit = options.animationLimit || 250;\n let shapeArgs;\n // draw the columns\n points.forEach(function (point) {\n const plotY = point.plotY;\n let graphic = point.graphic, hasGraphic = !!graphic, verb = graphic && chart.pointCount < animationLimit ?\n 'animate' : 'attr';\n if (isNumber(plotY) && point.y !== null) {\n shapeArgs = point.shapeArgs;\n // When updating a series between 2d and 3d or cartesian and\n // polar, the shape type changes.\n if (graphic && point.hasNewShapeType()) {\n graphic = graphic.destroy();\n }\n // Set starting position for point sliding animation.\n if (series.enabledDataSorting) {\n point.startXPos = series.xAxis.reversed ?\n -(shapeArgs ? (shapeArgs.width || 0) : 0) :\n series.xAxis.width;\n }\n if (!graphic) {\n point.graphic = graphic =\n renderer[point.shapeType](shapeArgs)\n .add(point.group || series.group);\n if (graphic &&\n series.enabledDataSorting &&\n chart.hasRendered &&\n chart.pointCount < animationLimit) {\n graphic.attr({\n x: point.startXPos\n });\n hasGraphic = true;\n verb = 'animate';\n }\n }\n if (graphic && hasGraphic) { // update\n graphic[verb](merge(shapeArgs));\n }\n // Presentational\n if (!chart.styledMode) {\n graphic[verb](series.pointAttribs(point, (point.selected && 'select')))\n .shadow(point.allowShadow !== false && options.shadow);\n }\n if (graphic) {\n graphic.addClass(point.getClassName(), true);\n graphic.attr({\n visibility: point.visible ? 'inherit' : 'hidden'\n });\n }\n }\n else if (graphic) {\n point.graphic = graphic.destroy(); // #1269\n }\n });\n }\n /**\n * Draw the tracker for a point.\n * @private\n */\n drawTracker(points = this.points) {\n const series = this, chart = series.chart, pointer = chart.pointer, onMouseOver = function (e) {\n const point = pointer?.getPointFromEvent(e);\n // Undefined on graph in scatterchart\n if (pointer &&\n point &&\n series.options.enableMouseTracking) {\n pointer.isDirectTouch = true;\n point.onMouseOver(e);\n }\n };\n let dataLabels;\n // Add reference to the point\n points.forEach(function (point) {\n dataLabels = (isArray(point.dataLabels) ?\n point.dataLabels :\n (point.dataLabel ? [point.dataLabel] : []));\n if (point.graphic) {\n point.graphic.element.point = point;\n }\n dataLabels.forEach(function (dataLabel) {\n (dataLabel.div || dataLabel.element).point = point;\n });\n });\n // Add the event listeners, we need to do this only once\n if (!series._hasTracking) {\n series.trackerGroups.forEach(function (key) {\n if (series[key]) {\n // we don't always have dataLabelsGroup\n series[key]\n .addClass('highcharts-tracker')\n .on('mouseover', onMouseOver)\n .on('mouseout', function (e) {\n pointer?.onTrackerMouseOut(e);\n })\n .on('touchstart', onMouseOver);\n if (!chart.styledMode && series.options.cursor) {\n series[key]\n .css({ cursor: series.options.cursor });\n }\n }\n });\n series._hasTracking = true;\n }\n fireEvent(this, 'afterDrawTracker');\n }\n /**\n * Remove this series from the chart\n *\n * @private\n * @function Highcharts.seriesTypes.column#remove\n */\n remove() {\n const series = this, chart = series.chart;\n // column and bar series affects other series of the same type\n // as they are either stacked or grouped\n if (chart.hasRendered) {\n chart.series.forEach(function (otherSeries) {\n if (otherSeries.type === series.type) {\n otherSeries.isDirty = true;\n }\n });\n }\n Series.prototype.remove.apply(series, arguments);\n }\n}\n/* *\n *\n * Static Properties\n *\n * */\nColumnSeries.defaultOptions = merge(Series.defaultOptions, ColumnSeriesDefaults);\nextend(ColumnSeries.prototype, {\n // When tooltip is not shared, this series (and derivatives) requires\n // direct touch/hover. KD-tree does not apply.\n directTouch: true,\n getSymbol: noop,\n // Use separate negative stacks, unlike area stacks where a negative\n // point is subtracted from previous (#1910)\n negStacks: true,\n trackerGroups: ['group', 'dataLabelsGroup']\n});\nSeriesRegistry.registerSeriesType('column', ColumnSeries);\n/* *\n *\n * Default Export\n *\n * */\nexport default ColumnSeries;\n/* *\n *\n * API Declarations\n *\n * */\n/**\n * Adjusted width and x offset of the columns for grouping.\n *\n * @private\n * @interface Highcharts.ColumnMetricsObject\n */ /**\n* Width of the columns.\n* @name Highcharts.ColumnMetricsObject#width\n* @type {number}\n*/ /**\n* Offset of the columns.\n* @name Highcharts.ColumnMetricsObject#offset\n* @type {number}\n*/\n''; // detach doclets above\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport A from '../Animation/AnimationUtilities.js';\nconst { getDeferredAnimation } = A;\nimport F from '../Templating.js';\nconst { format } = F;\nimport U from '../Utilities.js';\nconst { defined, extend, fireEvent, isArray, isString, merge, objectEach, pick, pInt, splat } = U;\n/* *\n *\n * Composition\n *\n * */\nvar DataLabel;\n(function (DataLabel) {\n /* *\n *\n * Declarations\n *\n * */\n /* *\n *\n * Functions\n *\n * */\n /**\n * Check if this series has data labels, either a series-level setting, or\n * individual. In case of individual point labels, this method is overridden\n * to always return true.\n * @private\n */\n function hasDataLabels() {\n return mergedDataLabelOptions(this)\n .some((o) => o?.enabled);\n }\n /**\n * Align each individual data label.\n * @private\n */\n function alignDataLabel(point, dataLabel, options, alignTo, isNew) {\n const series = this, chart = this.chart, inverted = this.isCartesian && chart.inverted, enabledDataSorting = this.enabledDataSorting, plotX = point.plotX, plotY = point.plotY, rotation = options.rotation || 0, isInsidePlot = defined(plotX) &&\n defined(plotY) &&\n chart.isInsidePlot(plotX, Math.round(plotY), {\n inverted,\n paneCoordinates: true,\n series\n }), setStartPos = (alignOptions) => {\n if (enabledDataSorting && series.xAxis && !justify) {\n series.setDataLabelStartPos(point, dataLabel, isNew, isInsidePlot, alignOptions);\n }\n }, justify = rotation === 0 ? pick(options.overflow, (enabledDataSorting ? 'none' : 'justify')) === 'justify' : false;\n // Math.round for rounding errors (#2683), alignTo to allow column\n // labels (#2700)\n let visible = this.visible &&\n point.visible !== false &&\n defined(plotX) &&\n (point.series.forceDL ||\n (enabledDataSorting && !justify) ||\n isInsidePlot ||\n (\n // If the data label is inside the align box, it is\n // enough that parts of the align box is inside the\n // plot area (#12370). When stacking, it is always\n // inside regardless of the option (#15148).\n pick(options.inside, !!this.options.stacking) &&\n alignTo &&\n chart.isInsidePlot(plotX, inverted ?\n alignTo.x + 1 :\n alignTo.y + alignTo.height - 1, {\n inverted,\n paneCoordinates: true,\n series\n })));\n const pos = point.pos();\n if (visible && pos) {\n const bBox = dataLabel.getBBox(), unrotatedbBox = dataLabel.getBBox(void 0, 0), alignFactor = {\n 'right': 1,\n 'center': 0.5\n }[options.align || 0] || 0, verticalAlignFactor = {\n 'bottom': 1,\n 'middle': 0.5\n }[options.verticalAlign || 0] || 0;\n // The alignment box is a singular point\n alignTo = extend({\n x: pos[0],\n y: Math.round(pos[1]),\n width: 0,\n height: 0\n }, alignTo || {});\n // Add the text size for alignment calculation\n extend(options, {\n width: bBox.width,\n height: bBox.height\n });\n setStartPos(alignTo); // Data sorting\n // Align the label to the adjusted box with for unrotated bBox due\n // to rotationOrigin, which is based on unrotated label\n dataLabel.align(merge(options, {\n width: unrotatedbBox.width,\n height: unrotatedbBox.height\n }), false, alignTo, false);\n dataLabel.alignAttr.x += alignFactor *\n (unrotatedbBox.width - bBox.width);\n dataLabel.alignAttr.y += verticalAlignFactor *\n (unrotatedbBox.height - bBox.height);\n dataLabel[dataLabel.placed ? 'animate' : 'attr']({\n x: dataLabel.alignAttr.x +\n (bBox.width - unrotatedbBox.width) / 2,\n y: dataLabel.alignAttr.y +\n (bBox.height - unrotatedbBox.height) / 2,\n rotationOriginX: (dataLabel.width || 0) / 2,\n rotationOriginY: (dataLabel.height || 0) / 2\n });\n // Uncomment this block to visualize the bounding boxes used for\n // determining visibility\n // chart.renderer.rect(\n // (dataLabel.alignAttr.x || 0) + chart.plotLeft,\n // (dataLabel.alignAttr.y || 0) + chart.plotTop,\n // bBox.width,\n // bBox.height\n // ).attr({\n // stroke: 'rgba(0, 0, 0, 0.3)',\n // 'stroke-width': 1,\n // zIndex: 20\n // }).add();\n // chart.renderer.circle(\n // chart.plotLeft + pick(dataLabel.alignAttr.x, 0),\n // chart.plotTop + pick(dataLabel.alignAttr.y, 0),\n // 2\n // ).attr({\n // fill: 'red',\n // zIndex: 20\n // }).add();\n if (justify && alignTo.height >= 0) { // #8830\n this.justifyDataLabel(dataLabel, options, dataLabel.alignAttr, bBox, alignTo, isNew);\n }\n else if (pick(options.crop, true)) {\n const { x, y } = dataLabel.alignAttr, correction = 1;\n // Check if the dataLabel should be visible.\n visible =\n chart.isInsidePlot(x, y, {\n paneCoordinates: true,\n series\n }) &&\n chart.isInsidePlot(x + bBox.width - correction, y + bBox.height - correction, {\n paneCoordinates: true,\n series\n });\n }\n // When we're using a shape, make it possible with a connector or an\n // arrow pointing to this point\n if (options.shape && !rotation) {\n dataLabel[isNew ? 'attr' : 'animate']({\n anchorX: pos[0],\n anchorY: pos[1]\n });\n }\n }\n // To use alignAttr property in hideOverlappingLabels\n if (isNew && enabledDataSorting) {\n dataLabel.placed = false;\n }\n // Show or hide based on the final aligned position\n if (!visible && (!enabledDataSorting || justify)) {\n dataLabel.hide();\n dataLabel.placed = false; // Don't animate back in\n }\n else {\n dataLabel.show();\n dataLabel.placed = true; // Flag for overlapping logic\n }\n }\n /**\n * Handle the dataLabels.filter option.\n * @private\n */\n function applyFilter(point, options) {\n const filter = options.filter;\n if (filter) {\n const op = filter.operator, prop = point[filter.property], val = filter.value;\n if ((op === '>' && prop > val) ||\n (op === '<' && prop < val) ||\n (op === '>=' && prop >= val) ||\n (op === '<=' && prop <= val) ||\n (op === '==' && prop == val) || // eslint-disable-line eqeqeq\n (op === '===' && prop === val) ||\n (op === '!=' && prop != val) || // eslint-disable-line eqeqeq\n (op === '!==' && prop !== val)) {\n return true;\n }\n return false;\n }\n return true;\n }\n /**\n * @private\n */\n function compose(SeriesClass) {\n const seriesProto = SeriesClass.prototype;\n if (!seriesProto.initDataLabels) {\n seriesProto.initDataLabels = initDataLabels;\n seriesProto.initDataLabelsGroup = initDataLabelsGroup;\n seriesProto.alignDataLabel = alignDataLabel;\n seriesProto.drawDataLabels = drawDataLabels;\n seriesProto.justifyDataLabel = justifyDataLabel;\n seriesProto.setDataLabelStartPos = setDataLabelStartPos;\n seriesProto.hasDataLabels = hasDataLabels;\n }\n }\n DataLabel.compose = compose;\n /**\n * Create the SVGElement group for dataLabels\n * @private\n */\n function initDataLabelsGroup() {\n return this.plotGroup('dataLabelsGroup', 'data-labels', this.hasRendered ? 'inherit' : 'hidden', // #5133, #10220\n this.options.dataLabels.zIndex || 6);\n }\n /**\n * Init the data labels with the correct animation\n * @private\n */\n function initDataLabels(animationConfig) {\n const series = this, hasRendered = series.hasRendered || 0;\n // Create a separate group for the data labels to avoid rotation\n const dataLabelsGroup = this.initDataLabelsGroup()\n .attr({ opacity: +hasRendered }); // #3300\n if (!hasRendered && dataLabelsGroup) {\n if (series.visible) { // #2597, #3023, #3024\n dataLabelsGroup.show();\n }\n if (series.options.animation) {\n dataLabelsGroup.animate({ opacity: 1 }, animationConfig);\n }\n else {\n dataLabelsGroup.attr({ opacity: 1 });\n }\n }\n return dataLabelsGroup;\n }\n /**\n * Draw the data labels\n * @private\n */\n function drawDataLabels(points) {\n points = points || this.points;\n const series = this, chart = series.chart, seriesOptions = series.options, renderer = chart.renderer, { backgroundColor, plotBackgroundColor } = chart.options.chart, contrastColor = renderer.getContrast((isString(plotBackgroundColor) && plotBackgroundColor) ||\n (isString(backgroundColor) && backgroundColor) ||\n \"#000000\" /* Palette.neutralColor100 */), seriesDlOptions = mergedDataLabelOptions(series);\n let pointOptions, dataLabelsGroup;\n // Resolve the animation\n const { animation, defer } = seriesDlOptions[0], animationConfig = defer ?\n getDeferredAnimation(chart, animation, series) :\n { defer: 0, duration: 0 };\n fireEvent(this, 'drawDataLabels');\n if (series.hasDataLabels?.()) {\n dataLabelsGroup = this.initDataLabels(animationConfig);\n // Make the labels for each point\n points.forEach((point) => {\n const dataLabels = point.dataLabels || [];\n // Merge in series options for the point.\n // @note dataLabelAttribs (like pointAttribs) would eradicate\n // the need for dlOptions, and simplify the section below.\n pointOptions = splat(mergeArrays(seriesDlOptions, \n // The dlOptions prop is used in treemaps\n point.dlOptions || point.options?.dataLabels));\n // Handle each individual data label for this point\n pointOptions.forEach((labelOptions, i) => {\n // Options for one datalabel\n const labelEnabled = (labelOptions.enabled &&\n (point.visible || point.dataLabelOnHidden) &&\n // #2282, #4641, #7112, #10049\n (!point.isNull || point.dataLabelOnNull) &&\n applyFilter(point, labelOptions)), { backgroundColor, borderColor, distance, style = {} } = labelOptions;\n let labelConfig, formatString, labelText, rotation, attr = {}, dataLabel = dataLabels[i], isNew = !dataLabel, labelBgColor;\n if (labelEnabled) {\n // Create individual options structure that can be\n // extended without affecting others\n formatString = pick(labelOptions[point.formatPrefix + 'Format'], labelOptions.format);\n labelConfig = point.getLabelConfig();\n labelText = defined(formatString) ?\n format(formatString, labelConfig, chart) :\n (labelOptions[point.formatPrefix + 'Formatter'] ||\n labelOptions.formatter).call(labelConfig, labelOptions);\n rotation = labelOptions.rotation;\n if (!chart.styledMode) {\n // Determine the color\n style.color = pick(labelOptions.color, style.color, isString(series.color) ? series.color : void 0, \"#000000\" /* Palette.neutralColor100 */);\n // Get automated contrast color\n if (style.color === 'contrast') {\n if (backgroundColor !== 'none') {\n labelBgColor = backgroundColor;\n }\n point.contrastColor = renderer.getContrast(labelBgColor !== 'auto' && labelBgColor ||\n (point.color || series.color));\n style.color = (labelBgColor || // #20007\n (!defined(distance) &&\n labelOptions.inside) ||\n pInt(distance || 0) < 0 ||\n seriesOptions.stacking) ?\n point.contrastColor :\n contrastColor;\n }\n else {\n delete point.contrastColor;\n }\n if (seriesOptions.cursor) {\n style.cursor = seriesOptions.cursor;\n }\n }\n attr = {\n r: labelOptions.borderRadius || 0,\n rotation,\n padding: labelOptions.padding,\n zIndex: 1\n };\n if (!chart.styledMode) {\n attr.fill = backgroundColor === 'auto' ?\n point.color :\n backgroundColor;\n attr.stroke = borderColor === 'auto' ?\n point.color :\n borderColor;\n attr['stroke-width'] = labelOptions.borderWidth;\n }\n // Remove unused attributes (#947)\n objectEach(attr, (val, name) => {\n if (typeof val === 'undefined') {\n delete attr[name];\n }\n });\n }\n // If the point is outside the plot area, or the label\n // changes properties that we cannot change, destroy it and\n // build a new one below. #678, #820.\n if (dataLabel && (!labelEnabled ||\n !defined(labelText) ||\n !!dataLabel.div !== !!labelOptions.useHTML ||\n (\n // Change from no rotation to rotation and\n // vice versa. Don't use defined() because\n // rotation = 0 means also rotation = undefined\n (!dataLabel.rotation ||\n !labelOptions.rotation) &&\n dataLabel.rotation !== labelOptions.rotation))) {\n dataLabel = void 0;\n isNew = true;\n }\n // Individual labels are disabled if the are explicitly\n // disabled in the point options, or if they fall outside\n // the plot area.\n if (labelEnabled && defined(labelText)) {\n if (!dataLabel) {\n // Create new label element\n dataLabel = renderer.label(labelText, 0, 0, labelOptions.shape, void 0, void 0, labelOptions.useHTML, void 0, 'data-label');\n dataLabel.addClass(' highcharts-data-label-color-' +\n point.colorIndex +\n ' ' + (labelOptions.className || '') +\n ( // #3398\n labelOptions.useHTML ?\n ' highcharts-tracker' :\n ''));\n }\n else {\n // Use old element and just update text\n attr.text = labelText;\n }\n // Store data label options for later access\n if (dataLabel) {\n dataLabel.options = labelOptions;\n dataLabel.attr(attr);\n if (!chart.styledMode) {\n // Styles must be applied before add in order to\n // read text bounding box\n dataLabel.css(style).shadow(labelOptions.shadow);\n }\n const textPathOptions = labelOptions[point.formatPrefix + 'TextPath'] || labelOptions.textPath;\n if (textPathOptions && !labelOptions.useHTML) {\n dataLabel.setTextPath(point.getDataLabelPath?.(dataLabel) ||\n point.graphic, textPathOptions);\n if (point.dataLabelPath &&\n !textPathOptions.enabled) {\n // clean the DOM\n point.dataLabelPath = (point.dataLabelPath.destroy());\n }\n }\n if (!dataLabel.added) {\n dataLabel.add(dataLabelsGroup);\n }\n // Now the data label is created and placed at 0,0,\n // so we need to align it\n series.alignDataLabel(point, dataLabel, labelOptions, void 0, isNew);\n dataLabel.isActive = true;\n if (dataLabels[i] && dataLabels[i] !== dataLabel) {\n dataLabels[i].destroy();\n }\n dataLabels[i] = dataLabel;\n }\n }\n });\n // Destroy and remove the inactive ones\n let j = dataLabels.length;\n while (j--) {\n // The item can be undefined if a disabled data label is\n // succeeded by an enabled one (#19457)\n if (!dataLabels[j] || !dataLabels[j].isActive) {\n dataLabels[j]?.destroy();\n dataLabels.splice(j, 1);\n }\n else {\n dataLabels[j].isActive = false;\n }\n }\n // Write back\n point.dataLabel = dataLabels[0];\n point.dataLabels = dataLabels;\n });\n }\n fireEvent(this, 'afterDrawDataLabels');\n }\n /**\n * If data labels fall partly outside the plot area, align them back in, in\n * a way that doesn't hide the point.\n * @private\n */\n function justifyDataLabel(dataLabel, options, alignAttr, bBox, alignTo, isNew) {\n const chart = this.chart, align = options.align, verticalAlign = options.verticalAlign, padding = dataLabel.box ? 0 : (dataLabel.padding || 0);\n let { x = 0, y = 0 } = options, off, justified;\n // Off left\n off = (alignAttr.x || 0) + padding;\n if (off < 0) {\n if (align === 'right' && x >= 0) {\n options.align = 'left';\n options.inside = true;\n }\n else {\n x -= off;\n }\n justified = true;\n }\n // Off right\n off = (alignAttr.x || 0) + bBox.width - padding;\n if (off > chart.plotWidth) {\n if (align === 'left' && x <= 0) {\n options.align = 'right';\n options.inside = true;\n }\n else {\n x += chart.plotWidth - off;\n }\n justified = true;\n }\n // Off top\n off = alignAttr.y + padding;\n if (off < 0) {\n if (verticalAlign === 'bottom' && y >= 0) {\n options.verticalAlign = 'top';\n options.inside = true;\n }\n else {\n y -= off;\n }\n justified = true;\n }\n // Off bottom\n off = (alignAttr.y || 0) + bBox.height - padding;\n if (off > chart.plotHeight) {\n if (verticalAlign === 'top' && y <= 0) {\n options.verticalAlign = 'bottom';\n options.inside = true;\n }\n else {\n y += chart.plotHeight - off;\n }\n justified = true;\n }\n if (justified) {\n options.x = x;\n options.y = y;\n dataLabel.placed = !isNew;\n dataLabel.align(options, void 0, alignTo);\n }\n return justified;\n }\n /**\n * Merge two objects that can be arrays. If one of them is an array, the\n * other is merged into each element. If both are arrays, each element is\n * merged by index. If neither are arrays, we use normal merge.\n * @private\n */\n function mergeArrays(one, two) {\n let res = [], i;\n if (isArray(one) && !isArray(two)) {\n res = one.map(function (el) {\n return merge(el, two);\n });\n }\n else if (isArray(two) && !isArray(one)) {\n res = two.map(function (el) {\n return merge(one, el);\n });\n }\n else if (!isArray(one) && !isArray(two)) {\n res = merge(one, two);\n }\n else if (isArray(one) && isArray(two)) {\n i = Math.max(one.length, two.length);\n while (i--) {\n res[i] = merge(one[i], two[i]);\n }\n }\n return res;\n }\n /**\n * Merge plotOptions and series options for dataLabels.\n * @private\n */\n function mergedDataLabelOptions(series) {\n const plotOptions = series.chart.options.plotOptions;\n return splat(mergeArrays(mergeArrays(plotOptions?.series?.dataLabels, plotOptions?.[series.type]?.dataLabels), series.options.dataLabels));\n }\n /**\n * Set starting position for data label sorting animation.\n * @private\n */\n function setDataLabelStartPos(point, dataLabel, isNew, isInside, alignOptions) {\n const chart = this.chart, inverted = chart.inverted, xAxis = this.xAxis, reversed = xAxis.reversed, labelCenter = ((inverted ? dataLabel.height : dataLabel.width) || 0) / 2, pointWidth = point.pointWidth, halfWidth = pointWidth ? pointWidth / 2 : 0;\n dataLabel.startXPos = inverted ?\n alignOptions.x :\n (reversed ?\n -labelCenter - halfWidth :\n xAxis.width - labelCenter + halfWidth);\n dataLabel.startYPos = inverted ?\n (reversed ?\n this.yAxis.height - labelCenter + halfWidth :\n -labelCenter - halfWidth) : alignOptions.y;\n // We need to handle visibility in case of sorting point outside plot\n // area\n if (!isInside) {\n dataLabel\n .attr({ opacity: 1 })\n .animate({ opacity: 0 }, void 0, dataLabel.hide);\n }\n else if (dataLabel.visibility === 'hidden') {\n dataLabel.show();\n dataLabel\n .attr({ opacity: 0 })\n .animate({ opacity: 1 });\n }\n // Save start position on first render, but do not change position\n if (!chart.hasRendered) {\n return;\n }\n // Set start position\n if (isNew) {\n dataLabel.attr({ x: dataLabel.startXPos, y: dataLabel.startYPos });\n }\n dataLabel.placed = true;\n }\n})(DataLabel || (DataLabel = {}));\n/* *\n *\n * Default Export\n *\n * */\nexport default DataLabel;\n/* *\n *\n * API Declarations\n *\n * */\n/**\n * Callback JavaScript function to format the data label as a string. Note that\n * if a `format` is defined, the format takes precedence and the formatter is\n * ignored.\n *\n * @callback Highcharts.DataLabelsFormatterCallbackFunction\n *\n * @param {Highcharts.PointLabelObject} this\n * Data label context to format\n *\n * @param {Highcharts.DataLabelsOptions} options\n * [API options](/highcharts/plotOptions.series.dataLabels) of the data label\n *\n * @return {number|string|null|undefined}\n * Formatted data label text\n */\n/**\n * Values for handling data labels that flow outside the plot area.\n *\n * @typedef {\"allow\"|\"justify\"} Highcharts.DataLabelsOverflowValue\n */\n''; // keeps doclets above in JS file\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport DataLabel from '../../Core/Series/DataLabel.js';\nimport H from '../../Core/Globals.js';\nconst { composed } = H;\nimport SeriesRegistry from '../../Core/Series/SeriesRegistry.js';\nconst { series: Series } = SeriesRegistry;\nimport U from '../../Core/Utilities.js';\nconst { merge, pick, pushUnique } = U;\n/* *\n *\n * Composition\n *\n * */\nvar ColumnDataLabel;\n(function (ColumnDataLabel) {\n /* *\n *\n * Functions\n *\n * */\n /**\n * Override the basic data label alignment by adjusting for the position of\n * the column.\n * @private\n */\n function alignDataLabel(point, dataLabel, options, alignTo, isNew) {\n const inverted = this.chart.inverted, series = point.series, xLen = (series.xAxis ? series.xAxis.len : this.chart.plotSizeX) || 0, yLen = (series.yAxis ? series.yAxis.len : this.chart.plotSizeY) || 0, \n // Data label box for alignment\n dlBox = point.dlBox || point.shapeArgs, below = pick(point.below, // Range series\n point.plotY >\n pick(this.translatedThreshold, yLen)), \n // Draw it inside the box?\n inside = pick(options.inside, !!this.options.stacking);\n // Align to the column itself, or the top of it\n if (dlBox) { // Area range uses this method but not alignTo\n alignTo = merge(dlBox);\n // Check for specific overflow and crop conditions (#13240)\n if (!(options.overflow === 'allow' && options.crop === false)) {\n if (alignTo.y < 0) {\n alignTo.height += alignTo.y;\n alignTo.y = 0;\n }\n // If parts of the box overshoots outside the plot area, modify\n // the box to center the label inside\n const overshoot = alignTo.y + alignTo.height - yLen;\n if (overshoot > 0 && overshoot < alignTo.height) {\n alignTo.height -= overshoot;\n }\n }\n if (inverted) {\n alignTo = {\n x: yLen - alignTo.y - alignTo.height,\n y: xLen - alignTo.x - alignTo.width,\n width: alignTo.height,\n height: alignTo.width\n };\n }\n // Compute the alignment box\n if (!inside) {\n if (inverted) {\n alignTo.x += below ? 0 : alignTo.width;\n alignTo.width = 0;\n }\n else {\n alignTo.y += below ? alignTo.height : 0;\n alignTo.height = 0;\n }\n }\n }\n // When alignment is undefined (typically columns and bars), display the\n // individual point below or above the point depending on the threshold\n options.align = pick(options.align, !inverted || inside ? 'center' : below ? 'right' : 'left');\n options.verticalAlign = pick(options.verticalAlign, inverted || inside ? 'middle' : below ? 'top' : 'bottom');\n // Call the parent method\n Series.prototype.alignDataLabel.call(this, point, dataLabel, options, alignTo, isNew);\n // If label was justified and we have contrast, set it:\n if (options.inside && point.contrastColor) {\n dataLabel.css({\n color: point.contrastColor\n });\n }\n }\n /** @private */\n function compose(ColumnSeriesClass) {\n DataLabel.compose(Series);\n if (pushUnique(composed, 'ColumnDataLabel')) {\n ColumnSeriesClass.prototype.alignDataLabel = alignDataLabel;\n }\n }\n ColumnDataLabel.compose = compose;\n})(ColumnDataLabel || (ColumnDataLabel = {}));\n/* *\n *\n * Default Export\n *\n * */\nexport default ColumnDataLabel;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport ColumnSeries from '../Column/ColumnSeries.js';\nimport SeriesRegistry from '../../Core/Series/SeriesRegistry.js';\nimport U from '../../Core/Utilities.js';\nconst { extend, merge } = U;\n/* *\n *\n * Class\n *\n * */\n/**\n * Bar series type.\n *\n * @private\n * @class\n * @name Highcharts.seriesTypes.bar\n *\n * @augments Highcharts.Series\n */\nclass BarSeries extends ColumnSeries {\n}\n/* *\n *\n * Static Properties\n *\n * */\n/**\n * A bar series is a special type of column series where the columns are\n * horizontal.\n *\n * @sample highcharts/demo/bar-basic/\n * Bar chart\n *\n * @extends plotOptions.column\n * @product highcharts\n * @optionparent plotOptions.bar\n */\nBarSeries.defaultOptions = merge(ColumnSeries.defaultOptions, {\n// nothing here yet\n});\nextend(BarSeries.prototype, {\n inverted: true\n});\nSeriesRegistry.registerSeriesType('bar', BarSeries);\n/* *\n *\n * Default Export\n *\n * */\nexport default BarSeries;\n/* *\n *\n * API Options\n *\n * */\n/**\n * A `bar` series. If the [type](#series.bar.type) option is not specified,\n * it is inherited from [chart.type](#chart.type).\n *\n * @extends series,plotOptions.bar\n * @excluding connectNulls, dashStyle, dataParser, dataURL, gapSize, gapUnit,\n * linecap, lineWidth, marker, connectEnds, step\n * @product highcharts\n * @apioption series.bar\n */\n/**\n * An array of data points for the series. For the `bar` series type,\n * points can be given in the following ways:\n *\n * 1. An array of numerical values. In this case, the numerical values will be\n * interpreted as `y` options. The `x` values will be automatically\n * calculated, either starting at 0 and incremented by 1, or from\n * `pointStart` and `pointInterval` given in the series options. If the axis\n * has categories, these will be used. Example:\n * ```js\n * data: [0, 5, 3, 5]\n * ```\n *\n * 2. An array of arrays with 2 values. In this case, the values correspond to\n * `x,y`. If the first value is a string, it is applied as the name of the\n * point, and the `x` value is inferred.\n * ```js\n * data: [\n * [0, 5],\n * [1, 10],\n * [2, 3]\n * ]\n * ```\n *\n * 3. An array of objects with named values. The following snippet shows only a\n * few settings, see the complete options set below. If the total number of\n * data points exceeds the series'\n * [turboThreshold](#series.bar.turboThreshold), this option is not\n * available.\n * ```js\n * data: [{\n * x: 1,\n * y: 1,\n * name: \"Point2\",\n * color: \"#00FF00\"\n * }, {\n * x: 1,\n * y: 10,\n * name: \"Point1\",\n * color: \"#FF00FF\"\n * }]\n * ```\n *\n * @sample {highcharts} highcharts/chart/reflow-true/\n * Numerical values\n * @sample {highcharts} highcharts/series/data-array-of-arrays/\n * Arrays of numeric x and y\n * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/\n * Arrays of datetime x and y\n * @sample {highcharts} highcharts/series/data-array-of-name-value/\n * Arrays of point.name and y\n * @sample {highcharts} highcharts/series/data-array-of-objects/\n * Config objects\n *\n * @type {Array|null|*>}\n * @extends series.column.data\n * @product highcharts\n * @apioption series.bar.data\n */\n/**\n * @excluding halo,lineWidth,lineWidthPlus,marker\n * @product highcharts highstock\n * @apioption series.bar.states.hover\n */\n/**\n * @excluding halo,lineWidth,lineWidthPlus,marker\n * @product highcharts highstock\n * @apioption series.bar.states.select\n */\n''; // gets doclets above into transpiled\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\n/* *\n *\n * API Options\n *\n * */\n/**\n * A scatter plot uses cartesian coordinates to display values for two\n * variables for a set of data.\n *\n * @sample {highcharts} highcharts/demo/scatter/\n * Scatter plot\n *\n * @extends plotOptions.line\n * @excluding cropThreshold, pointPlacement, shadow, useOhlcData\n * @product highcharts highstock\n * @optionparent plotOptions.scatter\n */\nconst ScatterSeriesDefaults = {\n /**\n * The width of the line connecting the data points.\n *\n * @sample {highcharts} highcharts/plotoptions/scatter-linewidth-none/\n * 0 by default\n * @sample {highcharts} highcharts/plotoptions/scatter-linewidth-1/\n * 1px\n *\n * @product highcharts highstock\n */\n lineWidth: 0,\n findNearestPointBy: 'xy',\n /**\n * Apply a jitter effect for the rendered markers. When plotting\n * discrete values, a little random noise may help telling the points\n * apart. The jitter setting applies a random displacement of up to `n`\n * axis units in either direction. So for example on a horizontal X\n * axis, setting the `jitter.x` to 0.24 will render the point in a\n * random position between 0.24 units to the left and 0.24 units to the\n * right of the true axis position. On a category axis, setting it to\n * 0.5 will fill up the bin and make the data appear continuous.\n *\n * When rendered on top of a box plot or a column series, a jitter value\n * of 0.24 will correspond to the underlying series' default\n * [groupPadding](\n * https://api.highcharts.com/highcharts/plotOptions.column.groupPadding)\n * and [pointPadding](\n * https://api.highcharts.com/highcharts/plotOptions.column.pointPadding)\n * settings.\n *\n * **Note:** With boost mode enabled, the jitter effect is not supported.\n *\n * @sample {highcharts} highcharts/demo/scatter-jitter\n * Jitter on a scatter plot\n *\n * @sample {highcharts} highcharts/series-scatter/jitter-boxplot\n * Jittered scatter plot on top of a box plot\n *\n * @product highcharts highstock\n * @since 7.0.2\n */\n jitter: {\n /**\n * The maximal X offset for the random jitter effect.\n */\n x: 0,\n /**\n * The maximal Y offset for the random jitter effect.\n */\n y: 0\n },\n marker: {\n enabled: true // Overrides auto-enabling in line series (#3647)\n },\n /**\n * Sticky tracking of mouse events. When true, the `mouseOut` event\n * on a series isn't triggered until the mouse moves over another\n * series, or out of the plot area. When false, the `mouseOut` event on\n * a series is triggered when the mouse leaves the area around the\n * series' graph or markers. This also implies the tooltip. When\n * `stickyTracking` is false and `tooltip.shared` is false, the tooltip\n * will be hidden when moving the mouse between series.\n *\n * @type {boolean}\n * @default false\n * @product highcharts highstock highmaps\n * @apioption plotOptions.scatter.stickyTracking\n */\n /**\n * A configuration object for the tooltip rendering of each single\n * series. Properties are inherited from [tooltip](#tooltip).\n * Overridable properties are `headerFormat`, `pointFormat`,\n * `yDecimals`, `xDateFormat`, `yPrefix` and `ySuffix`. Unlike other\n * series, in a scatter plot the series.name by default shows in the\n * headerFormat and point.x and point.y in the pointFormat.\n *\n * @product highcharts highstock highmaps\n */\n tooltip: {\n /**\n * @product highcharts highstock\n */\n headerFormat: '\\u25CF ' +\n ' {series.name}
',\n pointFormat: 'x: {point.x}
y: {point.y}
'\n }\n};\n/**\n * A `scatter` series. If the [type](#series.scatter.type) option is\n * not specified, it is inherited from [chart.type](#chart.type).\n *\n * @extends series,plotOptions.scatter\n * @excluding cropThreshold, dataParser, dataURL, useOhlcData\n * @product highcharts highstock\n * @apioption series.scatter\n */\n/**\n * An array of data points for the series. For the `scatter` series\n * type, points can be given in the following ways:\n *\n * 1. An array of numerical values. In this case, the numerical values will be\n * interpreted as `y` options. The `x` values will be automatically\n * calculated, either starting at 0 and incremented by 1, or from\n * `pointStart` and `pointInterval` given in the series options. If the axis\n * has categories, these will be used. Example:\n * ```js\n * data: [0, 5, 3, 5]\n * ```\n *\n * 2. An array of arrays with 2 values. In this case, the values correspond to\n * `x,y`. If the first value is a string, it is applied as the name of the\n * point, and the `x` value is inferred.\n * ```js\n * data: [\n * [0, 0],\n * [1, 8],\n * [2, 9]\n * ]\n * ```\n *\n * 3. An array of objects with named values. The following snippet shows only a\n * few settings, see the complete options set below. If the total number of\n * data points exceeds the series'\n * [turboThreshold](#series.scatter.turboThreshold), this option is not\n * available.\n * ```js\n * data: [{\n * x: 1,\n * y: 2,\n * name: \"Point2\",\n * color: \"#00FF00\"\n * }, {\n * x: 1,\n * y: 4,\n * name: \"Point1\",\n * color: \"#FF00FF\"\n * }]\n * ```\n *\n * @sample {highcharts} highcharts/chart/reflow-true/\n * Numerical values\n * @sample {highcharts} highcharts/series/data-array-of-arrays/\n * Arrays of numeric x and y\n * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/\n * Arrays of datetime x and y\n * @sample {highcharts} highcharts/series/data-array-of-name-value/\n * Arrays of point.name and y\n * @sample {highcharts} highcharts/series/data-array-of-objects/\n * Config objects\n *\n * @type {Array|null|*>}\n * @extends series.line.data\n * @product highcharts highstock\n * @apioption series.scatter.data\n */\n''; // keeps doclets above in JS file\n/* *\n *\n * Default Export\n *\n * */\nexport default ScatterSeriesDefaults;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport ScatterSeriesDefaults from './ScatterSeriesDefaults.js';\nimport SeriesRegistry from '../../Core/Series/SeriesRegistry.js';\nconst { column: ColumnSeries, line: LineSeries } = SeriesRegistry.seriesTypes;\nimport U from '../../Core/Utilities.js';\nconst { addEvent, extend, merge } = U;\n/* *\n *\n * Class\n *\n * */\n/**\n * Scatter series type.\n *\n * @private\n */\nclass ScatterSeries extends LineSeries {\n /* *\n *\n * Functions\n *\n * */\n /* eslint-disable valid-jsdoc */\n /**\n * Optionally add the jitter effect.\n * @private\n */\n applyJitter() {\n const series = this, jitter = this.options.jitter, len = this.points.length;\n /**\n * Return a repeatable, pseudo-random number based on an integer\n * seed.\n * @private\n */\n function unrandom(seed) {\n const rand = Math.sin(seed) * 10000;\n return rand - Math.floor(rand);\n }\n if (jitter) {\n this.points.forEach(function (point, i) {\n ['x', 'y'].forEach(function (dim, j) {\n let axis, plotProp = 'plot' + dim.toUpperCase(), min, max, translatedJitter;\n if (jitter[dim] && !point.isNull) {\n axis = series[dim + 'Axis'];\n translatedJitter =\n jitter[dim] * axis.transA;\n if (axis && !axis.isLog) {\n // Identify the outer bounds of the jitter range\n min = Math.max(0, point[plotProp] - translatedJitter);\n max = Math.min(axis.len, point[plotProp] + translatedJitter);\n // Find a random position within this range\n point[plotProp] = min +\n (max - min) * unrandom(i + j * len);\n // Update clientX for the tooltip k-d-tree\n if (dim === 'x') {\n point.clientX = point.plotX;\n }\n }\n }\n });\n });\n }\n }\n /**\n * @private\n */\n drawGraph() {\n if (this.options.lineWidth) {\n super.drawGraph();\n }\n else if (this.graph) {\n this.graph = this.graph.destroy();\n }\n }\n}\n/* *\n *\n * Static Properties\n *\n * */\nScatterSeries.defaultOptions = merge(LineSeries.defaultOptions, ScatterSeriesDefaults);\nextend(ScatterSeries.prototype, {\n drawTracker: ColumnSeries.prototype.drawTracker,\n sorted: false,\n requireSorting: false,\n noSharedTooltip: true,\n trackerGroups: ['group', 'markerGroup', 'dataLabelsGroup']\n});\n/* *\n *\n * Events\n *\n * */\n/* eslint-disable no-invalid-this */\naddEvent(ScatterSeries, 'afterTranslate', function () {\n this.applyJitter();\n});\nSeriesRegistry.registerSeriesType('scatter', ScatterSeries);\n/* *\n *\n * Default Export\n *\n * */\nexport default ScatterSeries;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport H from '../Core/Globals.js';\nconst { deg2rad } = H;\nimport Series from '../Core/Series/Series.js';\nimport U from '../Core/Utilities.js';\nconst { fireEvent, isNumber, pick, relativeLength } = U;\n/**\n * @private\n */\nvar CenteredUtilities;\n(function (CenteredUtilities) {\n /* *\n *\n * Declarations\n *\n * */\n /* *\n *\n * Functions\n *\n * */\n /* eslint-disable valid-jsdoc */\n /**\n * Get the center of the pie based on the size and center options relative\n * to the plot area. Borrowed by the polar and gauge series types.\n *\n * @private\n * @function Highcharts.CenteredSeriesMixin.getCenter\n */\n function getCenter() {\n const options = this.options, chart = this.chart, slicingRoom = 2 * (options.slicedOffset || 0), plotWidth = chart.plotWidth - 2 * slicingRoom, plotHeight = chart.plotHeight - 2 * slicingRoom, centerOption = options.center, smallestSize = Math.min(plotWidth, plotHeight), thickness = options.thickness;\n let handleSlicingRoom, size = options.size, innerSize = options.innerSize || 0, i, value;\n if (typeof size === 'string') {\n size = parseFloat(size);\n }\n if (typeof innerSize === 'string') {\n innerSize = parseFloat(innerSize);\n }\n const positions = [\n pick(centerOption[0], '50%'),\n pick(centerOption[1], '50%'),\n // Prevent from negative values\n pick(size && size < 0 ? void 0 : options.size, '100%'),\n pick(innerSize && innerSize < 0 ? void 0 : options.innerSize || 0, '0%')\n ];\n // No need for inner size in angular (gauges) series but still required\n // for pie series\n if (chart.angular && !(this instanceof Series)) {\n positions[3] = 0;\n }\n for (i = 0; i < 4; ++i) {\n value = positions[i];\n handleSlicingRoom = i < 2 || (i === 2 && /%$/.test(value));\n // i == 0: centerX, relative to width\n // i == 1: centerY, relative to height\n // i == 2: size, relative to smallestSize\n // i == 3: innerSize, relative to size\n positions[i] = relativeLength(value, [plotWidth, plotHeight, smallestSize, positions[2]][i]) + (handleSlicingRoom ? slicingRoom : 0);\n }\n // innerSize cannot be larger than size (#3632)\n if (positions[3] > positions[2]) {\n positions[3] = positions[2];\n }\n // thickness overrides innerSize, need to be less than pie size (#6647)\n if (isNumber(thickness) &&\n thickness * 2 < positions[2] && thickness > 0) {\n positions[3] = positions[2] - thickness * 2;\n }\n fireEvent(this, 'afterGetCenter', { positions });\n return positions;\n }\n CenteredUtilities.getCenter = getCenter;\n /**\n * getStartAndEndRadians - Calculates start and end angles in radians.\n * Used in series types such as pie and sunburst.\n *\n * @private\n * @function Highcharts.CenteredSeriesMixin.getStartAndEndRadians\n *\n * @param {number} [start]\n * Start angle in degrees.\n *\n * @param {number} [end]\n * Start angle in degrees.\n *\n * @return {Highcharts.RadianAngles}\n * Returns an object containing start and end angles as radians.\n */\n function getStartAndEndRadians(start, end) {\n const startAngle = isNumber(start) ? start : 0, // must be a number\n endAngle = ((isNumber(end) && // must be a number\n end > startAngle && // must be larger than the start angle\n // difference must be less than 360 degrees\n (end - startAngle) < 360) ?\n end :\n startAngle + 360), correction = -90;\n return {\n start: deg2rad * (startAngle + correction),\n end: deg2rad * (endAngle + correction)\n };\n }\n CenteredUtilities.getStartAndEndRadians = getStartAndEndRadians;\n})(CenteredUtilities || (CenteredUtilities = {}));\n/* *\n *\n * Default Export\n *\n * */\nexport default CenteredUtilities;\n/* *\n *\n * API Declarations\n *\n * */\n/**\n * @private\n * @interface Highcharts.RadianAngles\n */ /**\n* @name Highcharts.RadianAngles#end\n* @type {number}\n*/ /**\n* @name Highcharts.RadianAngles#start\n* @type {number}\n*/\n''; // keeps doclets above in JS file\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport A from '../../Core/Animation/AnimationUtilities.js';\nconst { setAnimation } = A;\nimport Point from '../../Core/Series/Point.js';\nimport U from '../../Core/Utilities.js';\nconst { addEvent, defined, extend, isNumber, pick, relativeLength } = U;\n/* *\n *\n * Class\n *\n * */\nclass PiePoint extends Point {\n /* *\n *\n * Functions\n *\n * */\n /* eslint-disable valid-jsdoc */\n /**\n * Extendable method for getting the path of the connector between the\n * data label and the pie slice.\n * @private\n */\n getConnectorPath(dataLabel) {\n const labelPosition = dataLabel.dataLabelPosition, options = (dataLabel.options || {}), connectorShape = options.connectorShape, shapeFunc = (this.connectorShapes[connectorShape] || connectorShape);\n return labelPosition && shapeFunc.call(this, {\n // Pass simplified label position object for user's convenience\n ...labelPosition.computed,\n alignment: labelPosition.alignment\n }, labelPosition.connectorPosition, options) || [];\n }\n /**\n * @private\n */\n getTranslate() {\n return this.sliced && this.slicedTranslation || {\n translateX: 0,\n translateY: 0\n };\n }\n /**\n * @private\n */\n haloPath(size) {\n const shapeArgs = this.shapeArgs;\n return this.sliced || !this.visible ?\n [] :\n this.series.chart.renderer.symbols.arc(shapeArgs.x, shapeArgs.y, shapeArgs.r + size, shapeArgs.r + size, {\n // Substract 1px to ensure the background is not bleeding\n // through between the halo and the slice (#7495).\n innerR: shapeArgs.r - 1,\n start: shapeArgs.start,\n end: shapeArgs.end,\n borderRadius: shapeArgs.borderRadius\n });\n }\n /**\n * Initialize the pie slice.\n * @private\n */\n constructor(series, options, x) {\n super(series, options, x);\n this.half = 0;\n this.name ?? (this.name = 'Slice');\n // Add event listener for select\n const toggleSlice = (e) => {\n this.slice(e.type === 'select');\n };\n addEvent(this, 'select', toggleSlice);\n addEvent(this, 'unselect', toggleSlice);\n }\n /**\n * Negative points are not valid (#1530, #3623, #5322)\n * @private\n */\n isValid() {\n return isNumber(this.y) && this.y >= 0;\n }\n /**\n * Toggle the visibility of a pie slice or other data point. Note that this\n * method is available only for some series, like pie, treemap and sunburst.\n *\n * @function Highcharts.Point#setVisible\n *\n * @param {boolean} [vis]\n * True to show the pie slice or other data point, false to hide. If\n * undefined, the visibility is toggled.\n *\n * @param {boolean} [redraw] Whether to redraw the chart after the point is\n * altered. If doing more operations on the chart, it is a good idea to set\n * redraw to false and call {@link Chart#redraw|chart.redraw()} after.\n *\n */\n setVisible(vis, redraw = true) {\n if (vis !== this.visible) {\n // If called without an argument, toggle visibility\n this.update({\n visible: vis ?? !this.visible\n }, redraw, void 0, false);\n }\n }\n /**\n * Set or toggle whether the slice is cut out from the pie.\n * @private\n *\n * @param {boolean} sliced\n * When undefined, the slice state is toggled.\n *\n * @param {boolean} [redraw]\n * Whether to redraw the chart. True by default.\n *\n * @param {boolean|Partial} [animation]\n * Animation options.\n */\n slice(sliced, redraw, animation) {\n const series = this.series, chart = series.chart;\n setAnimation(animation, chart);\n // redraw is true by default\n redraw = pick(redraw, true);\n /**\n * Pie series only. Whether to display a slice offset from the\n * center.\n * @name Highcharts.Point#sliced\n * @type {boolean|undefined}\n */\n // if called without an argument, toggle\n this.sliced = this.options.sliced = sliced =\n defined(sliced) ? sliced : !this.sliced;\n // update userOptions.data\n series.options.data[series.data.indexOf(this)] =\n this.options;\n if (this.graphic) {\n this.graphic.animate(this.getTranslate());\n }\n }\n}\nextend(PiePoint.prototype, {\n connectorShapes: {\n // only one available before v7.0.0\n fixedOffset: function (labelPosition, connectorPosition, options) {\n const breakAt = connectorPosition.breakAt, touchingSliceAt = connectorPosition.touchingSliceAt, lineSegment = options.softConnector ? [\n 'C',\n // 1st control point (of the curve)\n labelPosition.x +\n // 5 gives the connector a little horizontal bend\n (labelPosition.alignment === 'left' ? -5 : 5),\n labelPosition.y,\n 2 * breakAt.x - touchingSliceAt.x,\n 2 * breakAt.y - touchingSliceAt.y,\n breakAt.x,\n breakAt.y //\n ] : [\n 'L',\n breakAt.x,\n breakAt.y\n ];\n // assemble the path\n return ([\n ['M', labelPosition.x, labelPosition.y],\n lineSegment,\n ['L', touchingSliceAt.x, touchingSliceAt.y]\n ]);\n },\n straight: function (labelPosition, connectorPosition) {\n const touchingSliceAt = connectorPosition.touchingSliceAt;\n // direct line to the slice\n return [\n ['M', labelPosition.x, labelPosition.y],\n ['L', touchingSliceAt.x, touchingSliceAt.y]\n ];\n },\n crookedLine: function (labelPosition, connectorPosition, options) {\n const { breakAt, touchingSliceAt } = connectorPosition, { series } = this, [cx, cy, diameter] = series.center, r = diameter / 2, { plotLeft, plotWidth } = series.chart, leftAligned = labelPosition.alignment === 'left', { x, y } = labelPosition;\n let crookX = breakAt.x;\n if (options.crookDistance) {\n const crookDistance = relativeLength(// % to fraction\n options.crookDistance, 1);\n crookX = leftAligned ?\n cx +\n r +\n (plotWidth + plotLeft - cx - r) * (1 - crookDistance) :\n plotLeft + (cx - r) * crookDistance;\n // When the crookDistance option is undefined, make the bend in the\n // intersection between the radial line in the middle of the slice,\n // and the extension of the label position.\n }\n else {\n crookX = cx + (cy - y) * Math.tan((this.angle || 0) - Math.PI / 2);\n }\n const path = [['M', x, y]];\n // The crookedLine formula doesn't make sense if the path overlaps\n // the label - use straight line instead in that case\n if (leftAligned ?\n (crookX <= x && crookX >= breakAt.x) :\n (crookX >= x && crookX <= breakAt.x)) {\n path.push(['L', crookX, y]);\n }\n path.push(['L', breakAt.x, breakAt.y], ['L', touchingSliceAt.x, touchingSliceAt.y]);\n return path;\n }\n }\n});\n/* *\n *\n * Default Export\n *\n * */\nexport default PiePoint;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\n/* *\n *\n * API Options\n *\n * */\n/**\n * A pie chart is a circular graphic which is divided into slices to\n * illustrate numerical proportion.\n *\n * @sample highcharts/demo/pie-chart/\n * Pie chart\n *\n * @extends plotOptions.line\n * @excluding animationLimit, boostThreshold, connectEnds, connectNulls,\n * cropThreshold, dashStyle, dataSorting, dragDrop,\n * findNearestPointBy, getExtremesFromAll, label, lineWidth,\n * linkedTo, marker, negativeColor, pointInterval,\n * pointIntervalUnit, pointPlacement, pointStart,\n * softThreshold, stacking, step, threshold, turboThreshold,\n * zoneAxis, zones, dataSorting, boostBlending\n * @product highcharts highmaps\n * @optionparent plotOptions.pie\n *\n * @private\n */\nconst PieSeriesDefaults = {\n /**\n * The corner radius of the border surrounding each slice. A number\n * signifies pixels. A percentage string, like for example `50%`, signifies\n * a size relative to the radius and the inner radius.\n *\n * @sample highcharts/plotoptions/series-border-radius\n * Column and pie with rounded border\n *\n * @since 11.0.0\n *\n * @type {number|string|Highcharts.BorderRadiusOptionsObject}\n */\n borderRadius: 3,\n /**\n * @excluding legendItemClick\n * @apioption plotOptions.pie.events\n */\n /**\n * Fires when the checkbox next to the point name in the legend is\n * clicked. One parameter, event, is passed to the function. The state\n * of the checkbox is found by event.checked. The checked item is found\n * by event.item. Return false to prevent the default action which is to\n * toggle the select state of the series.\n *\n * @sample {highcharts} highcharts/plotoptions/series-events-checkboxclick/\n * Alert checkbox status\n *\n * @type {Function}\n * @since 1.2.0\n * @product highcharts highmaps\n * @context Highcharts.Point\n * @apioption plotOptions.pie.events.checkboxClick\n */\n /**\n * Fires when the legend item belonging to the pie point (slice) is\n * clicked. The `this` keyword refers to the point itself. One\n * parameter, `event`, is passed to the function, containing common\n * event information. The default action is to toggle the visibility of\n * the point. This can be prevented by calling `event.preventDefault()`.\n *\n * @sample {highcharts} highcharts/plotoptions/pie-point-events-legenditemclick/\n * Confirm toggle visibility\n *\n * @type {Highcharts.PointLegendItemClickCallbackFunction}\n * @since 1.2.0\n * @product highcharts highmaps\n * @apioption plotOptions.pie.point.events.legendItemClick\n */\n /**\n * The center of the pie chart relative to the plot area. Can be\n * percentages or pixel values. The default behaviour (as of 3.0) is to\n * center the pie so that all slices and data labels are within the plot\n * area. As a consequence, the pie may actually jump around in a chart\n * with dynamic values, as the data labels move. In that case, the\n * center should be explicitly set, for example to `[\"50%\", \"50%\"]`.\n *\n * @sample {highcharts} highcharts/plotoptions/pie-center/\n * Centered at 100, 100\n *\n * @type {Array<(number|string|null),(number|string|null)>}\n * @default [null, null]\n * @product highcharts highmaps\n *\n * @private\n */\n center: [null, null],\n /**\n * The color of the pie series. A pie series is represented as an empty\n * circle if the total sum of its values is 0. Use this property to\n * define the color of its border.\n *\n * In styled mode, the color can be defined by the\n * [colorIndex](#plotOptions.series.colorIndex) option. Also, the series\n * color can be set with the `.highcharts-series`,\n * `.highcharts-color-{n}`, `.highcharts-{type}-series` or\n * `.highcharts-series-{n}` class, or individual classes given by the\n * `className` option.\n *\n * @sample {highcharts} highcharts/plotoptions/pie-emptyseries/\n * Empty pie series\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @default ${palette.neutralColor20}\n * @apioption plotOptions.pie.color\n */\n /**\n * @product highcharts\n *\n * @private\n */\n clip: false,\n /**\n * @ignore-option\n *\n * @private\n */\n colorByPoint: true,\n /**\n * A series specific or series type specific color set to use instead\n * of the global [colors](#colors).\n *\n * @sample {highcharts} highcharts/demo/pie-monochrome/\n * Set default colors for all pies\n *\n * @type {Array}\n * @since 3.0\n * @product highcharts highmaps\n * @apioption plotOptions.pie.colors\n */\n /**\n * @declare Highcharts.SeriesPieDataLabelsOptionsObject\n * @extends plotOptions.series.dataLabels\n * @excluding align, allowOverlap, inside, staggerLines, step\n * @private\n */\n dataLabels: {\n /**\n * Alignment method for data labels. Possible values are:\n *\n * - `plotEdges`: Each label touches the nearest vertical edge of\n * the plot area.\n *\n * - `connectors`: Connectors have the same x position and the\n * widest label of each half (left & right) touches the nearest\n * vertical edge of the plot area.\n *\n * @sample {highcharts} highcharts/plotoptions/pie-datalabels-alignto-connectors/\n * alignTo: connectors\n * @sample {highcharts} highcharts/plotoptions/pie-datalabels-alignto-plotedges/\n * alignTo: plotEdges\n *\n * @type {string}\n * @since 7.0.0\n * @product highcharts highmaps\n * @apioption plotOptions.pie.dataLabels.alignTo\n */\n /**\n * The color of the line connecting the data label to the pie slice.\n * The default color is the same as the point's color.\n *\n * In styled mode, the connector stroke is given in the\n * `.highcharts-data-label-connector` class.\n *\n * @sample {highcharts} highcharts/plotoptions/pie-datalabels-connectorcolor/\n * Blue connectors\n * @sample {highcharts} highcharts/css/pie-point/\n * Styled connectors\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @since 2.1\n * @product highcharts highmaps\n * @apioption plotOptions.pie.dataLabels.connectorColor\n */\n /**\n * The distance from the data label to the connector. Note that\n * data labels also have a default `padding`, so in order for the\n * connector to touch the text, the `padding` must also be 0.\n *\n * @sample {highcharts} highcharts/plotoptions/pie-datalabels-connectorpadding/\n * No padding\n *\n * @since 2.1\n * @product highcharts highmaps\n */\n connectorPadding: 5,\n /**\n * Specifies the method that is used to generate the connector path.\n * Highcharts provides 3 built-in connector shapes: `'crookedLine'`\n * (default since v11), `'fixedOffset'` and `'straight'`.\n *\n * Users can provide their own method by passing a function instead of a\n * string. Three arguments are passed to the callback:\n *\n * - An object that holds the information about the coordinates of the\n * label (`x` & `y` properties) and how the label is located in\n * relation to the pie (`alignment` property). `alignment` can by one\n * of the following: `'left'` (pie on the left side of the data\n * label), `'right'` (pie on the right side of the data label) or\n * `'center'` (data label overlaps the pie).\n *\n * - An object that holds the information about the position of the\n * connector. Its `touchingSliceAt` porperty tells the position of\n * the place where the connector touches the slice.\n *\n * - Data label options\n *\n * The function has to return an SVG path definition in array form (see\n * the example).\n *\n * @sample {highcharts}\n * highcharts/plotoptions/pie-datalabels-connectorshape-string/\n * connectorShape is a String\n * @sample {highcharts}\n * highcharts/plotoptions/pie-datalabels-connectorshape-function/\n * connectorShape is a function\n *\n * @type {string|Function}\n * @since 7.0.0\n * @product highcharts highmaps\n */\n connectorShape: 'crookedLine',\n /**\n * The width of the line connecting the data label to the pie slice.\n *\n * In styled mode, the connector stroke width is given in the\n * `.highcharts-data-label-connector` class.\n *\n * @sample {highcharts} highcharts/plotoptions/pie-datalabels-connectorwidth-disabled/\n * Disable the connector\n * @sample {highcharts} highcharts/css/pie-point/\n * Styled connectors\n *\n * @type {number}\n * @default 1\n * @since 2.1\n * @product highcharts highmaps\n * @apioption plotOptions.pie.dataLabels.connectorWidth\n */\n /**\n * Works only if `connectorShape` is `'crookedLine'`. It defines how\n * far from the vertical plot edge the coonnector path should be\n * crooked. With the default, `undefined`, the crook is placed so that\n * the horizontal line from the label intersects with the radial line\n * extending through the center of the pie slice.\n *\n * @sample {highcharts} highcharts/plotoptions/pie-datalabels-crookdistance/\n * crookDistance set to 90%\n *\n * @since 7.0.0\n * @product highcharts highmaps\n */\n crookDistance: void 0,\n /**\n * The distance of the data label from the pie's edge. Negative\n * numbers put the data label on top of the pie slices. Can also be\n * defined as a percentage of pie's radius. Connectors are only\n * shown for data labels outside the pie.\n *\n * @sample {highcharts} highcharts/plotoptions/pie-datalabels-distance/\n * Data labels on top of the pie\n *\n * @type {number|string}\n * @since 2.1\n * @product highcharts highmaps\n */\n distance: 30,\n enabled: true,\n /**\n * A\n * [format string](https://www.highcharts.com/docs/chart-concepts/labels-and-string-formatting)\n * for the data label. Available variables are the same as for\n * `formatter`.\n *\n * @sample {highcharts} highcharts/plotoptions/series-datalabels-format/\n * Add a unit\n *\n * @type {string}\n * @default undefined\n * @since 3.0\n * @apioption plotOptions.pie.dataLabels.format\n */\n // eslint-disable-next-line valid-jsdoc\n /**\n * Callback JavaScript function to format the data label. Note that\n * if a `format` is defined, the format takes precedence and the\n * formatter is ignored.\n *\n * @type {Highcharts.DataLabelsFormatterCallbackFunction}\n * @default function () { return this.point.isNull ? void 0 : this.point.name; }\n */\n formatter: function () {\n return this.point.isNull ? void 0 : this.point.name;\n },\n /**\n * Whether to render the connector as a soft arc or a line with a sharp\n * break. Works only if `connectorShape` equals to `fixedOffset`.\n *\n * @sample {highcharts}\n * highcharts/plotoptions/pie-datalabels-softconnector-true/\n * Soft\n * @sample {highcharts}\n * highcharts/plotoptions/pie-datalabels-softconnector-false/\n * Non soft\n *\n * @since 2.1.7\n * @product highcharts highmaps\n */\n softConnector: true,\n /**\n * @sample {highcharts} highcharts/plotoptions/pie-datalabels-overflow\n * Long labels truncated with an ellipsis\n * @sample {highcharts} highcharts/plotoptions/pie-datalabels-overflow-wrap\n * Long labels are wrapped\n *\n * @type {Highcharts.CSSObject}\n * @apioption plotOptions.pie.dataLabels.style\n */\n x: 0\n },\n /**\n * If the total sum of the pie's values is 0, the series is represented\n * as an empty circle . The `fillColor` option defines the color of that\n * circle. Use [pie.borderWidth](#plotOptions.pie.borderWidth) to set\n * the border thickness.\n *\n * @sample {highcharts} highcharts/plotoptions/pie-emptyseries/\n * Empty pie series\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @private\n */\n fillColor: void 0,\n /**\n * The end angle of the pie in degrees where 0 is top and 90 is right.\n * Defaults to `startAngle` plus 360.\n *\n * @sample {highcharts} highcharts/demo/pie-semi-circle/\n * Semi-circle donut\n *\n * @type {number}\n * @since 1.3.6\n * @product highcharts highmaps\n * @apioption plotOptions.pie.endAngle\n */\n /**\n * Thickness describing the ring size for a donut type chart,\n * overriding [innerSize](#plotOptions.pie.innerSize).\n *\n * @type {number}\n * @default undefined\n * @product highcharts\n * @since 10.1.0\n * @apioption plotOptions.pie.thickness\n * @private\n */\n /**\n * Equivalent to [chart.ignoreHiddenSeries](#chart.ignoreHiddenSeries),\n * this option tells whether the series shall be redrawn as if the\n * hidden point were `null`.\n *\n * The default value changed from `false` to `true` with Highcharts\n * 3.0.\n *\n * @sample {highcharts} highcharts/plotoptions/pie-ignorehiddenpoint/\n * True, the hiddden point is ignored\n *\n * @since 2.3.0\n * @product highcharts highmaps\n *\n * @private\n */\n ignoreHiddenPoint: true,\n /**\n * @default true\n * @extends plotOptions.series.inactiveOtherPoints\n * @private\n */\n inactiveOtherPoints: true,\n /**\n * The size of the inner diameter for the pie. A size greater than 0\n * renders a donut chart. Can be a percentage or pixel value.\n * Percentages are relative to the pie size. Pixel values are given as\n * integers. Setting overridden by thickness.\n *\n *\n * Note: in Highcharts < 4.1.2, the percentage was relative to the plot\n * area, not the pie size.\n *\n * @sample {highcharts} highcharts/plotoptions/pie-innersize-80px/\n * 80px inner size\n * @sample {highcharts} highcharts/plotoptions/pie-innersize-50percent/\n * 50% of the plot area\n * @sample {highcharts} highcharts/demo/3d-pie-donut/\n * 3D donut\n *\n * @type {number|string}\n * @default 0\n * @since 2.0\n * @product highcharts highmaps\n * @apioption plotOptions.pie.innerSize\n */\n /**\n * @ignore-option\n *\n * @private\n */\n legendType: 'point',\n /**\n * @ignore-option\n *\n * @private\n */\n marker: null,\n /**\n * The minimum size for a pie in response to auto margins. The pie will\n * try to shrink to make room for data labels in side the plot area,\n * but only to this size.\n *\n * @type {number|string}\n * @default 80\n * @since 3.0\n * @product highcharts highmaps\n * @apioption plotOptions.pie.minSize\n */\n /**\n * The diameter of the pie relative to the plot area. Can be a\n * percentage or pixel value. Pixel values are given as integers. The\n * default behaviour (as of 3.0) is to scale to the plot area and give\n * room for data labels within the plot area.\n * [slicedOffset](#plotOptions.pie.slicedOffset) is also included in the\n * default size calculation. As a consequence, the size of the pie may\n * vary when points are updated and data labels more around. In that\n * case it is best to set a fixed value, for example `\"75%\"`.\n *\n * @sample {highcharts} highcharts/plotoptions/pie-size/\n * Smaller pie\n *\n * @type {number|string|null}\n * @product highcharts highmaps\n *\n * @private\n */\n size: null,\n /**\n * Whether to display this particular series or series type in the\n * legend. Since 2.1, pies are not shown in the legend by default.\n *\n * @sample {highcharts} highcharts/plotoptions/series-showinlegend/\n * One series in the legend, one hidden\n *\n * @product highcharts highmaps\n *\n * @private\n */\n showInLegend: false,\n /**\n * If a point is sliced, moved out from the center, how many pixels\n * should it be moved?.\n *\n * @sample {highcharts} highcharts/plotoptions/pie-slicedoffset-20/\n * 20px offset\n *\n * @product highcharts highmaps\n *\n * @private\n */\n slicedOffset: 10,\n /**\n * The start angle of the pie slices in degrees where 0 is top and 90\n * right.\n *\n * @sample {highcharts} highcharts/plotoptions/pie-startangle-90/\n * Start from right\n *\n * @type {number}\n * @default 0\n * @since 2.3.4\n * @product highcharts highmaps\n * @apioption plotOptions.pie.startAngle\n */\n /**\n * Sticky tracking of mouse events. When true, the `mouseOut` event\n * on a series isn't triggered until the mouse moves over another\n * series, or out of the plot area. When false, the `mouseOut` event on\n * a series is triggered when the mouse leaves the area around the\n * series' graph or markers. This also implies the tooltip. When\n * `stickyTracking` is false and `tooltip.shared` is false, the tooltip\n * will be hidden when moving the mouse between series.\n *\n * @product highcharts highmaps\n *\n * @private\n */\n stickyTracking: false,\n tooltip: {\n followPointer: true\n },\n /**\n * The color of the border surrounding each slice. When `null`, the\n * border takes the same color as the slice fill. This can be used\n * together with a `borderWidth` to fill drawing gaps created by\n * antialiazing artefacts in borderless pies.\n *\n * In styled mode, the border stroke is given in the `.highcharts-point`\n * class.\n *\n * @sample {highcharts} highcharts/plotoptions/pie-bordercolor-black/\n * Black border\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @default #ffffff\n * @product highcharts highmaps\n *\n * @private\n */\n borderColor: \"#ffffff\" /* Palette.backgroundColor */,\n /**\n * The width of the border surrounding each slice.\n *\n * When setting the border width to 0, there may be small gaps between\n * the slices due to SVG antialiasing artefacts. To work around this,\n * keep the border width at 0.5 or 1, but set the `borderColor` to\n * `null` instead.\n *\n * In styled mode, the border stroke width is given in the\n * `.highcharts-point` class.\n *\n * @sample {highcharts} highcharts/plotoptions/pie-borderwidth/\n * 3px border\n *\n * @product highcharts highmaps\n *\n * @private\n */\n borderWidth: 1,\n /**\n * @ignore-option\n * @private\n */\n lineWidth: void 0,\n states: {\n /**\n * @extends plotOptions.series.states.hover\n * @excluding marker, lineWidth, lineWidthPlus\n * @product highcharts highmaps\n */\n hover: {\n /**\n * How much to brighten the point on interaction. Requires the\n * main color to be defined in hex or rgb(a) format.\n *\n * In styled mode, the hover brightness is by default replaced\n * by a fill-opacity given in the `.highcharts-point-hover`\n * class.\n *\n * @sample {highcharts} highcharts/plotoptions/pie-states-hover-brightness/\n * Brightened by 0.5\n *\n * @product highcharts highmaps\n */\n brightness: 0.1\n }\n }\n};\n/**\n * A `pie` series. If the [type](#series.pie.type) option is not specified,\n * it is inherited from [chart.type](#chart.type).\n *\n * @extends series,plotOptions.pie\n * @excluding cropThreshold, dataParser, dataURL, linkedTo, stack, xAxis, yAxis,\n * dataSorting, step, boostThreshold, boostBlending\n * @product highcharts highmaps\n * @apioption series.pie\n */\n/**\n * An array of data points for the series. For the `pie` series type,\n * points can be given in the following ways:\n *\n * 1. An array of numerical values. In this case, the numerical values will be\n * interpreted as `y` options. Example:\n * ```js\n * data: [0, 5, 3, 5]\n * ```\n *\n * 2. An array of objects with named values. The following snippet shows only a\n * few settings, see the complete options set below. If the total number of\n * data points exceeds the series'\n * [turboThreshold](#series.pie.turboThreshold),\n * this option is not available.\n * ```js\n * data: [{\n * y: 1,\n * name: \"Point2\",\n * color: \"#00FF00\"\n * }, {\n * y: 7,\n * name: \"Point1\",\n * color: \"#FF00FF\"\n * }]\n * ```\n *\n * @sample {highcharts} highcharts/chart/reflow-true/\n * Numerical values\n * @sample {highcharts} highcharts/series/data-array-of-arrays/\n * Arrays of numeric x and y\n * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/\n * Arrays of datetime x and y\n * @sample {highcharts} highcharts/series/data-array-of-name-value/\n * Arrays of point.name and y\n * @sample {highcharts} highcharts/series/data-array-of-objects/\n * Config objects\n *\n * @type {Array|null|*>}\n * @extends series.line.data\n * @excluding marker, x\n * @product highcharts highmaps\n * @apioption series.pie.data\n */\n/**\n * @type {Highcharts.SeriesPieDataLabelsOptionsObject}\n * @product highcharts highmaps\n * @apioption series.pie.data.dataLabels\n */\n/**\n * The sequential index of the data point in the legend.\n *\n * @type {number}\n * @product highcharts highmaps\n * @apioption series.pie.data.legendIndex\n */\n/**\n * Whether to display a slice offset from the center.\n *\n * @sample {highcharts} highcharts/point/sliced/\n * One sliced point\n *\n * @type {boolean}\n * @product highcharts highmaps\n * @apioption series.pie.data.sliced\n */\n/**\n * @extends plotOptions.pie.dataLabels\n * @excluding align, allowOverlap, inside, staggerLines, step\n * @product highcharts highmaps\n * @apioption series.pie.dataLabels\n */\n/**\n * @excluding legendItemClick\n * @product highcharts highmaps\n * @apioption series.pie.events\n */\n''; // placeholder for transpiled doclets above\n/* *\n *\n * Default Export\n *\n * */\nexport default PieSeriesDefaults;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport CU from '../CenteredUtilities.js';\nconst { getStartAndEndRadians } = CU;\nimport ColumnSeries from '../Column/ColumnSeries.js';\nimport H from '../../Core/Globals.js';\nconst { noop } = H;\nimport PiePoint from './PiePoint.js';\nimport PieSeriesDefaults from './PieSeriesDefaults.js';\nimport Series from '../../Core/Series/Series.js';\nimport SeriesRegistry from '../../Core/Series/SeriesRegistry.js';\nimport Symbols from '../../Core/Renderer/SVG/Symbols.js';\nimport U from '../../Core/Utilities.js';\nconst { clamp, extend, fireEvent, merge, pick } = U;\n/* *\n *\n * Class\n *\n * */\n/**\n * Pie series type.\n *\n * @private\n * @class\n * @name Highcharts.seriesTypes.pie\n *\n * @augments Highcharts.Series\n */\nclass PieSeries extends Series {\n /* *\n *\n * Functions\n *\n * */\n /* eslint-disable valid-jsdoc */\n /**\n * Animates the pies in.\n * @private\n */\n animate(init) {\n const series = this, points = series.points, startAngleRad = series.startAngleRad;\n if (!init) {\n points.forEach(function (point) {\n const graphic = point.graphic, args = point.shapeArgs;\n if (graphic && args) {\n // start values\n graphic.attr({\n // animate from inner radius (#779)\n r: pick(point.startR, (series.center && series.center[3] / 2)),\n start: startAngleRad,\n end: startAngleRad\n });\n // animate\n graphic.animate({\n r: args.r,\n start: args.start,\n end: args.end\n }, series.options.animation);\n }\n });\n }\n }\n /**\n * Called internally to draw auxiliary graph in pie-like series in\n * situtation when the default graph is not sufficient enough to present\n * the data well. Auxiliary graph is saved in the same object as\n * regular graph.\n * @private\n */\n drawEmpty() {\n const start = this.startAngleRad, end = this.endAngleRad, options = this.options;\n let centerX, centerY;\n // Draw auxiliary graph if there're no visible points.\n if (this.total === 0 && this.center) {\n centerX = this.center[0];\n centerY = this.center[1];\n if (!this.graph) {\n this.graph = this.chart.renderer\n .arc(centerX, centerY, this.center[1] / 2, 0, start, end)\n .addClass('highcharts-empty-series')\n .add(this.group);\n }\n this.graph.attr({\n d: Symbols.arc(centerX, centerY, this.center[2] / 2, 0, {\n start,\n end,\n innerR: this.center[3] / 2\n })\n });\n if (!this.chart.styledMode) {\n this.graph.attr({\n 'stroke-width': options.borderWidth,\n fill: options.fillColor || 'none',\n stroke: options.color || \"#cccccc\" /* Palette.neutralColor20 */\n });\n }\n }\n else if (this.graph) { // Destroy the graph object.\n this.graph = this.graph.destroy();\n }\n }\n /**\n * Slices in pie chart are initialized in DOM, but it's shapes and\n * animations are normally run in `drawPoints()`.\n * @private\n */\n drawPoints() {\n const renderer = this.chart.renderer;\n this.points.forEach(function (point) {\n // When updating a series between 2d and 3d or cartesian and\n // polar, the shape type changes.\n if (point.graphic && point.hasNewShapeType()) {\n point.graphic = point.graphic.destroy();\n }\n if (!point.graphic) {\n point.graphic = renderer[point.shapeType](point.shapeArgs)\n .add(point.series.group);\n point.delayedRendering = true;\n }\n });\n }\n /**\n * Extend the generatePoints method by adding total and percentage\n * properties to each point\n * @private\n */\n generatePoints() {\n super.generatePoints();\n this.updateTotals();\n }\n /**\n * Utility for getting the x value from a given y, used for anticollision\n * logic in data labels.\n * @private\n */\n getX(y, left, point, dataLabel) {\n const center = this.center, \n // Variable pie has individual radius\n radius = this.radii ?\n this.radii[point.index] || 0 :\n center[2] / 2, labelPosition = dataLabel.dataLabelPosition, distance = labelPosition?.distance || 0;\n const angle = Math.asin(clamp((y - center[1]) / (radius + distance), -1, 1));\n const x = center[0] +\n (left ? -1 : 1) *\n (Math.cos(angle) * (radius + distance)) +\n (distance > 0 ?\n (left ? -1 : 1) * (dataLabel.padding || 0) :\n 0);\n return x;\n }\n /**\n * Define hasData function for non-cartesian series. Returns true if the\n * series has points at all.\n * @private\n */\n hasData() {\n return !!this.processedXData.length; // != 0\n }\n /**\n * Draw the data points\n * @private\n */\n redrawPoints() {\n const series = this, chart = series.chart;\n let groupTranslation, graphic, pointAttr, shapeArgs;\n this.drawEmpty();\n // Apply the drop-shadow to the group because otherwise each element\n // would cast a shadow on others\n if (series.group && !chart.styledMode) {\n series.group.shadow(series.options.shadow);\n }\n // draw the slices\n series.points.forEach(function (point) {\n const animateTo = {};\n graphic = point.graphic;\n if (!point.isNull && graphic) {\n shapeArgs = point.shapeArgs;\n // If the point is sliced, use special translation, else use\n // plot area translation\n groupTranslation = point.getTranslate();\n if (!chart.styledMode) {\n pointAttr = series.pointAttribs(point, (point.selected && 'select'));\n }\n // Draw the slice\n if (!point.delayedRendering) {\n graphic\n .setRadialReference(series.center);\n if (!chart.styledMode) {\n merge(true, animateTo, pointAttr);\n }\n merge(true, animateTo, shapeArgs, groupTranslation);\n graphic.animate(animateTo);\n }\n else {\n graphic\n .setRadialReference(series.center)\n .attr(shapeArgs)\n .attr(groupTranslation);\n if (!chart.styledMode) {\n graphic\n .attr(pointAttr)\n .attr({ 'stroke-linejoin': 'round' });\n }\n point.delayedRendering = false;\n }\n graphic\n .attr({\n visibility: point.visible ? 'inherit' : 'hidden'\n });\n graphic.addClass(point.getClassName(), true);\n }\n else if (graphic) {\n point.graphic = graphic.destroy();\n }\n });\n }\n /**\n * Utility for sorting data labels.\n * @private\n */\n sortByAngle(points, sign) {\n points.sort(function (a, b) {\n return ((typeof a.angle !== 'undefined') &&\n (b.angle - a.angle) * sign);\n });\n }\n /**\n * Do translation for pie slices\n * @private\n */\n translate(positions) {\n fireEvent(this, 'translate');\n this.generatePoints();\n const series = this, precision = 1000, // issue #172\n options = series.options, slicedOffset = options.slicedOffset, radians = getStartAndEndRadians(options.startAngle, options.endAngle), startAngleRad = series.startAngleRad = radians.start, endAngleRad = series.endAngleRad = radians.end, circ = endAngleRad - startAngleRad, // 2 * Math.PI,\n points = series.points, ignoreHiddenPoint = options.ignoreHiddenPoint, len = points.length;\n let start, end, angle, \n // The x component of the radius vector for a given point\n radiusX, radiusY, i, point, cumulative = 0;\n // Get positions - either an integer or a percentage string must be\n // given. If positions are passed as a parameter, we're in a\n // recursive loop for adjusting space for data labels.\n if (!positions) {\n /**\n * The series center position, read only. This applies only to\n * circular chart types like pie and sunburst. It is an array of\n * `[centerX, centerY, diameter, innerDiameter]`.\n *\n * @name Highcharts.Series#center\n * @type {Array}\n */\n series.center = positions = series.getCenter();\n }\n // Calculate the geometry for each point\n for (i = 0; i < len; i++) {\n point = points[i];\n // Set start and end angle\n start = startAngleRad + (cumulative * circ);\n if (point.isValid() &&\n (!ignoreHiddenPoint || point.visible)) {\n cumulative += point.percentage / 100;\n }\n end = startAngleRad + (cumulative * circ);\n // Set the shape\n const shapeArgs = {\n x: positions[0],\n y: positions[1],\n r: positions[2] / 2,\n innerR: positions[3] / 2,\n start: Math.round(start * precision) / precision,\n end: Math.round(end * precision) / precision\n };\n point.shapeType = 'arc';\n point.shapeArgs = shapeArgs;\n // The angle must stay within -90 and 270 (#2645)\n angle = (end + start) / 2;\n if (angle > 1.5 * Math.PI) {\n angle -= 2 * Math.PI;\n }\n else if (angle < -Math.PI / 2) {\n angle += 2 * Math.PI;\n }\n // Center for the sliced out slice\n point.slicedTranslation = {\n translateX: Math.round(Math.cos(angle) * slicedOffset),\n translateY: Math.round(Math.sin(angle) * slicedOffset)\n };\n // Set the anchor point for tooltips\n radiusX = Math.cos(angle) * positions[2] / 2;\n radiusY = Math.sin(angle) * positions[2] / 2;\n point.tooltipPos = [\n positions[0] + radiusX * 0.7,\n positions[1] + radiusY * 0.7\n ];\n point.half = angle < -Math.PI / 2 || angle > Math.PI / 2 ?\n 1 :\n 0;\n point.angle = angle;\n }\n fireEvent(series, 'afterTranslate');\n }\n /**\n * Recompute total chart sum and update percentages of points.\n * @private\n */\n updateTotals() {\n const points = this.points, len = points.length, ignoreHiddenPoint = this.options.ignoreHiddenPoint;\n let i, point, total = 0;\n // Get the total sum\n for (i = 0; i < len; i++) {\n point = points[i];\n if (point.isValid() &&\n (!ignoreHiddenPoint || point.visible)) {\n total += point.y;\n }\n }\n this.total = total;\n // Set each point's properties\n for (i = 0; i < len; i++) {\n point = points[i];\n point.percentage =\n (total > 0 && (point.visible || !ignoreHiddenPoint)) ?\n point.y / total * 100 :\n 0;\n point.total = total;\n }\n }\n}\n/* *\n *\n * Static Properties\n *\n * */\nPieSeries.defaultOptions = merge(Series.defaultOptions, PieSeriesDefaults);\nextend(PieSeries.prototype, {\n axisTypes: [],\n directTouch: true,\n drawGraph: void 0,\n drawTracker: ColumnSeries.prototype.drawTracker,\n getCenter: CU.getCenter,\n getSymbol: noop,\n invertible: false,\n isCartesian: false,\n noSharedTooltip: true,\n pointAttribs: ColumnSeries.prototype.pointAttribs,\n pointClass: PiePoint,\n requireSorting: false,\n searchPoint: noop,\n trackerGroups: ['group', 'dataLabelsGroup']\n});\nSeriesRegistry.registerSeriesType('pie', PieSeries);\n/* *\n *\n * Default Export\n *\n * */\nexport default PieSeries;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport DataLabel from '../../Core/Series/DataLabel.js';\nimport H from '../../Core/Globals.js';\nconst { composed, noop } = H;\nimport R from '../../Core/Renderer/RendererUtilities.js';\nconst { distribute } = R;\nimport SeriesRegistry from '../../Core/Series/SeriesRegistry.js';\nconst { series: Series } = SeriesRegistry;\nimport U from '../../Core/Utilities.js';\nconst { arrayMax, clamp, defined, pick, pushUnique, relativeLength } = U;\n/* *\n *\n * Composition\n *\n * */\nvar ColumnDataLabel;\n(function (ColumnDataLabel) {\n /* *\n *\n * Constants\n *\n * */\n const dataLabelPositioners = {\n // Based on the value computed in Highcharts' distribute algorithm.\n radialDistributionY: function (point, dataLabel) {\n return (dataLabel.dataLabelPosition?.top || 0) +\n point.distributeBox.pos;\n },\n // Get the x - use the natural x position for labels near the top and\n // bottom, to prevent the top and botton slice connectors from touching\n // each other on either side. Based on the value computed in Highcharts'\n // distribute algorithm.\n radialDistributionX: function (series, point, y, naturalY, dataLabel) {\n const pos = dataLabel.dataLabelPosition;\n return series.getX(y < (pos?.top || 0) + 2 || y > (pos?.bottom || 0) - 2 ?\n naturalY :\n y, point.half, point, dataLabel);\n },\n // The dataLabels.distance determines the x position of the label\n justify: function (point, dataLabel, radius, seriesCenter) {\n return seriesCenter[0] + (point.half ? -1 : 1) *\n (radius + (dataLabel.dataLabelPosition?.distance || 0));\n },\n // Left edges of the left-half labels touch the left edge of the plot\n // area. Right edges of the right-half labels touch the right edge of\n // the plot area.\n alignToPlotEdges: function (dataLabel, half, plotWidth, plotLeft) {\n const dataLabelWidth = dataLabel.getBBox().width;\n return half ? dataLabelWidth + plotLeft :\n plotWidth - dataLabelWidth - plotLeft;\n },\n // Connectors of each side end in the same x position. Labels are\n // aligned to them. Left edge of the widest left-half label touches the\n // left edge of the plot area. Right edge of the widest right-half label\n // touches the right edge of the plot area.\n alignToConnectors: function (points, half, plotWidth, plotLeft) {\n let maxDataLabelWidth = 0, dataLabelWidth;\n // find widest data label\n points.forEach(function (point) {\n dataLabelWidth = point.dataLabel.getBBox().width;\n if (dataLabelWidth > maxDataLabelWidth) {\n maxDataLabelWidth = dataLabelWidth;\n }\n });\n return half ? maxDataLabelWidth + plotLeft :\n plotWidth - maxDataLabelWidth - plotLeft;\n }\n };\n /* *\n *\n * Functions\n *\n * */\n /** @private */\n function compose(PieSeriesClass) {\n DataLabel.compose(Series);\n if (pushUnique(composed, 'PieDataLabel')) {\n const pieProto = PieSeriesClass.prototype;\n pieProto.dataLabelPositioners = dataLabelPositioners;\n pieProto.alignDataLabel = noop;\n pieProto.drawDataLabels = drawDataLabels;\n pieProto.getDataLabelPosition = getDataLabelPosition;\n pieProto.placeDataLabels = placeDataLabels;\n pieProto.verifyDataLabelOverflow = verifyDataLabelOverflow;\n }\n }\n ColumnDataLabel.compose = compose;\n /** @private */\n function getDataLabelPosition(point, distance) {\n const { center, options } = this, r = center[2] / 2, angle = point.angle || 0, cosAngle = Math.cos(angle), sinAngle = Math.sin(angle), x = center[0] + cosAngle * r, y = center[1] + sinAngle * r, finalConnectorOffset = Math.min((options.slicedOffset || 0) + (options.borderWidth || 0), distance / 5); // #1678\n return {\n natural: {\n // Initial position of the data label - it's utilized for\n // finding the final position for the label\n x: x + cosAngle * distance,\n y: y + sinAngle * distance\n },\n computed: {\n // Used for generating connector path - initialized later in\n // drawDataLabels function x: undefined, y: undefined\n },\n // Left - pie on the left side of the data label\n // Right - pie on the right side of the data label\n // Center - data label overlaps the pie\n alignment: distance < 0 ? 'center' : point.half ? 'right' : 'left',\n connectorPosition: {\n breakAt: {\n x: x + cosAngle * finalConnectorOffset,\n y: y + sinAngle * finalConnectorOffset\n },\n touchingSliceAt: {\n x,\n y\n }\n },\n distance\n };\n }\n /**\n * Override the base drawDataLabels method by pie specific functionality\n * @private\n */\n function drawDataLabels() {\n const series = this, points = series.points, chart = series.chart, plotWidth = chart.plotWidth, plotHeight = chart.plotHeight, plotLeft = chart.plotLeft, maxWidth = Math.round(chart.chartWidth / 3), seriesCenter = series.center, radius = seriesCenter[2] / 2, centerY = seriesCenter[1], halves = [\n [],\n [] // Left\n ], overflow = [0, 0, 0, 0], // Top, right, bottom, left\n dataLabelPositioners = series.dataLabelPositioners;\n let connector, dataLabelWidth, labelHeight, maxLabelDistance = 0;\n // Get out if not enabled\n if (!series.visible || !series.hasDataLabels?.()) {\n return;\n }\n // Reset all labels that have been shortened\n points.forEach((point) => {\n (point.dataLabels || []).forEach((dataLabel) => {\n if (dataLabel.shortened) {\n dataLabel\n .attr({\n width: 'auto'\n }).css({\n width: 'auto',\n textOverflow: 'clip'\n });\n dataLabel.shortened = false;\n }\n });\n });\n // Run parent method\n Series.prototype.drawDataLabels.apply(series);\n points.forEach((point) => {\n (point.dataLabels || []).forEach((dataLabel, i) => {\n const r = seriesCenter[2] / 2, dataLabelOptions = dataLabel.options, distance = relativeLength(dataLabelOptions?.distance || 0, r);\n // Arrange points for collision detection\n if (i === 0) {\n halves[point.half].push(point);\n }\n // Avoid long labels squeezing the pie size too far down\n if (!defined(dataLabelOptions?.style?.width)) {\n if (dataLabel.getBBox().width > maxWidth) {\n dataLabel.css({\n // Use a fraction of the maxWidth to avoid wrapping\n // close to the end of the string.\n width: Math.round(maxWidth * 0.7) + 'px'\n });\n dataLabel.shortened = true;\n }\n }\n dataLabel.dataLabelPosition = this.getDataLabelPosition(point, distance);\n maxLabelDistance = Math.max(maxLabelDistance, distance);\n });\n });\n /* Loop over the points in each half, starting from the top and bottom\n * of the pie to detect overlapping labels.\n */\n halves.forEach((points, halfIdx) => {\n const length = points.length, positions = [];\n let top, bottom, size = 0, distributionLength;\n if (!length) {\n return;\n }\n // Sort by angle\n series.sortByAngle(points, halfIdx - 0.5);\n // Only do anti-collision when we have dataLabels outside the pie\n // and have connectors. (#856)\n if (maxLabelDistance > 0) {\n top = Math.max(0, centerY - radius - maxLabelDistance);\n bottom = Math.min(centerY + radius + maxLabelDistance, chart.plotHeight);\n points.forEach((point) => {\n // Check if specific points' label is outside the pie\n (point.dataLabels || []).forEach((dataLabel) => {\n const labelPosition = dataLabel.dataLabelPosition;\n if (labelPosition &&\n labelPosition.distance > 0) {\n // The point.top depends on point.labelDistance\n // value. Used for calculation of y value in getX\n // method\n labelPosition.top = Math.max(0, centerY - radius - labelPosition.distance);\n labelPosition.bottom = Math.min(centerY + radius + labelPosition.distance, chart.plotHeight);\n size = dataLabel.getBBox().height || 21;\n point.distributeBox = {\n target: ((dataLabel.dataLabelPosition\n ?.natural.y || 0) -\n labelPosition.top +\n size / 2),\n size,\n rank: point.y\n };\n positions.push(point.distributeBox);\n }\n });\n });\n distributionLength = bottom + size - top;\n distribute(positions, distributionLength, distributionLength / 5);\n }\n // Now the used slots are sorted, fill them up sequentially\n points.forEach((point) => {\n (point.dataLabels || []).forEach((dataLabel) => {\n const dataLabelOptions = (dataLabel.options || {}), distributeBox = point.distributeBox, labelPosition = dataLabel.dataLabelPosition, naturalY = labelPosition?.natural.y || 0, connectorPadding = dataLabelOptions\n .connectorPadding || 0;\n let x = 0, y = naturalY, visibility = 'inherit';\n if (labelPosition) {\n if (positions &&\n defined(distributeBox) &&\n labelPosition.distance > 0) {\n if (typeof distributeBox.pos === 'undefined') {\n visibility = 'hidden';\n }\n else {\n labelHeight = distributeBox.size;\n // Find label's y position\n y = dataLabelPositioners\n .radialDistributionY(point, dataLabel);\n }\n }\n // Find label's x position. The justify option is\n // undocumented in the API - preserve support for it\n if (dataLabelOptions.justify) {\n x = dataLabelPositioners.justify(point, dataLabel, radius, seriesCenter);\n }\n else {\n switch (dataLabelOptions.alignTo) {\n case 'connectors':\n x = dataLabelPositioners.alignToConnectors(points, halfIdx, plotWidth, plotLeft);\n break;\n case 'plotEdges':\n x = dataLabelPositioners.alignToPlotEdges(dataLabel, halfIdx, plotWidth, plotLeft);\n break;\n default:\n x = dataLabelPositioners.radialDistributionX(series, point, y, naturalY, dataLabel);\n }\n }\n // Record the placement and visibility\n labelPosition.attribs = {\n visibility,\n align: labelPosition.alignment\n };\n labelPosition.posAttribs = {\n x: x +\n (dataLabelOptions.x || 0) + // (#12985)\n ({\n left: connectorPadding,\n right: -connectorPadding\n }[labelPosition.alignment] || 0),\n y: y +\n (dataLabelOptions.y || 0) - // (#12985)\n // Vertically center\n dataLabel.getBBox().height / 2\n };\n labelPosition.computed.x = x;\n labelPosition.computed.y = y;\n // Detect overflowing data labels\n if (pick(dataLabelOptions.crop, true)) {\n dataLabelWidth = dataLabel.getBBox().width;\n let sideOverflow;\n // Overflow left\n if (x - dataLabelWidth < connectorPadding &&\n halfIdx === 1 // Left half\n ) {\n sideOverflow = Math.round(dataLabelWidth - x + connectorPadding);\n overflow[3] = Math.max(sideOverflow, overflow[3]);\n // Overflow right\n }\n else if (x + dataLabelWidth >\n plotWidth - connectorPadding &&\n halfIdx === 0 // Right half\n ) {\n sideOverflow = Math.round(x +\n dataLabelWidth -\n plotWidth +\n connectorPadding);\n overflow[1] = Math.max(sideOverflow, overflow[1]);\n }\n // Overflow top\n if (y - labelHeight / 2 < 0) {\n overflow[0] = Math.max(Math.round(-y + labelHeight / 2), overflow[0]);\n // Overflow left\n }\n else if (y + labelHeight / 2 > plotHeight) {\n overflow[2] = Math.max(Math.round(y + labelHeight / 2 - plotHeight), overflow[2]);\n }\n labelPosition.sideOverflow = sideOverflow;\n }\n }\n }); // For each data label of the point\n }); // For each point\n }); // For each half\n // Do not apply the final placement and draw the connectors until we\n // have verified that labels are not spilling over.\n if (arrayMax(overflow) === 0 ||\n this.verifyDataLabelOverflow(overflow)) {\n // Place the labels in the final position\n this.placeDataLabels();\n this.points.forEach((point) => {\n (point.dataLabels || []).forEach((dataLabel) => {\n // #8864: every connector can have individual options\n const { connectorColor, connectorWidth = 1 } = (dataLabel.options || {}), labelPosition = dataLabel.dataLabelPosition;\n // Draw the connector\n if (connectorWidth) {\n let isNew;\n connector = dataLabel.connector;\n if (labelPosition && labelPosition.distance > 0) {\n isNew = !connector;\n if (!connector) {\n dataLabel.connector = connector = chart.renderer\n .path()\n .addClass('highcharts-data-label-connector ' +\n ' highcharts-color-' +\n point.colorIndex +\n (point.className ?\n ' ' + point.className :\n ''))\n .add(series.dataLabelsGroup);\n }\n if (!chart.styledMode) {\n connector.attr({\n 'stroke-width': connectorWidth,\n 'stroke': (connectorColor ||\n point.color ||\n \"#666666\" /* Palette.neutralColor60 */)\n });\n }\n connector[isNew ? 'attr' : 'animate']({\n d: point.getConnectorPath(dataLabel)\n });\n connector.attr({\n visibility: labelPosition.attribs?.visibility\n });\n }\n else if (connector) {\n dataLabel.connector = connector.destroy();\n }\n }\n });\n });\n }\n }\n /**\n * Perform the final placement of the data labels after we have verified\n * that they fall within the plot area.\n * @private\n */\n function placeDataLabels() {\n this.points.forEach((point) => {\n (point.dataLabels || []).forEach((dataLabel) => {\n const labelPosition = dataLabel.dataLabelPosition;\n if (labelPosition) {\n // Shorten data labels with ellipsis if they still overflow\n // after the pie has reached minSize (#223).\n if (labelPosition.sideOverflow) {\n dataLabel.css({\n width: (Math.max(dataLabel.getBBox().width -\n labelPosition.sideOverflow, 0)) + 'px',\n textOverflow: ((dataLabel.options?.style || {})\n .textOverflow ||\n 'ellipsis')\n });\n dataLabel.shortened = true;\n }\n dataLabel.attr(labelPosition.attribs);\n dataLabel[dataLabel.moved ? 'animate' : 'attr'](labelPosition.posAttribs);\n dataLabel.moved = true;\n }\n else if (dataLabel) {\n dataLabel.attr({ y: -9999 });\n }\n });\n // Clear for update\n delete point.distributeBox;\n }, this);\n }\n /**\n * Verify whether the data labels are allowed to draw, or we should run more\n * translation and data label positioning to keep them inside the plot area.\n * Returns true when data labels are ready to draw.\n * @private\n */\n function verifyDataLabelOverflow(overflow) {\n let center = this.center, options = this.options, centerOption = options.center, minSize = options.minSize || 80, newSize = minSize, \n // If a size is set, return true and don't try to shrink the pie\n // to fit the labels.\n ret = options.size !== null;\n if (!ret) {\n // Handle horizontal size and center\n if (centerOption[0] !== null) { // Fixed center\n newSize = Math.max(center[2] -\n Math.max(overflow[1], overflow[3]), minSize);\n }\n else { // Auto center\n newSize = Math.max(\n // horizontal overflow\n center[2] - overflow[1] - overflow[3], minSize);\n // horizontal center\n center[0] += (overflow[3] - overflow[1]) / 2;\n }\n // Handle vertical size and center\n if (centerOption[1] !== null) { // Fixed center\n newSize = clamp(newSize, minSize, center[2] - Math.max(overflow[0], overflow[2]));\n }\n else { // Auto center\n newSize = clamp(newSize, minSize, \n // vertical overflow\n center[2] - overflow[0] - overflow[2]);\n // vertical center\n center[1] += (overflow[0] - overflow[2]) / 2;\n }\n // If the size must be decreased, we need to run translate and\n // drawDataLabels again\n if (newSize < center[2]) {\n center[2] = newSize;\n center[3] = Math.min(// #3632\n options.thickness ?\n Math.max(0, newSize - options.thickness * 2) :\n Math.max(0, relativeLength(options.innerSize || 0, newSize)), newSize); // #6647\n this.translate(center);\n if (this.drawDataLabels) {\n this.drawDataLabels();\n }\n // Else, return true to indicate that the pie and its labels is\n // within the plot area\n }\n else {\n ret = true;\n }\n }\n return ret;\n }\n})(ColumnDataLabel || (ColumnDataLabel = {}));\n/* *\n *\n * Default Export\n *\n * */\nexport default ColumnDataLabel;\n", "/* *\n *\n * Highcharts module to hide overlapping data labels.\n * This module is included in Highcharts.\n *\n * (c) 2009-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport U from '../Core/Utilities.js';\nconst { addEvent, fireEvent, objectEach, pick } = U;\n/* *\n *\n * Functions\n *\n * */\n/**\n * Hide overlapping labels. Labels are moved and faded in and out on zoom to\n * provide a smooth visual impression.\n *\n * @requires modules/overlapping-datalabels\n *\n * @private\n * @function Highcharts.Chart#hideOverlappingLabels\n * @param {Array} labels\n * Rendered data labels\n */\nfunction chartHideOverlappingLabels(labels) {\n const chart = this, len = labels.length, isIntersectRect = (box1, box2) => !(box2.x >= box1.x + box1.width ||\n box2.x + box2.width <= box1.x ||\n box2.y >= box1.y + box1.height ||\n box2.y + box2.height <= box1.y);\n /**\n * Get the box with its position inside the chart, as opposed to getBBox\n * that only reports the position relative to the parent.\n */\n function getAbsoluteBox(label) {\n if (label && (!label.alignAttr || label.placed)) {\n const padding = label.box ? 0 : (label.padding || 0), pos = label.alignAttr || {\n x: label.attr('x'),\n y: label.attr('y')\n }, bBox = label.getBBox();\n label.width = bBox.width;\n label.height = bBox.height;\n return {\n x: pos.x + (label.parentGroup?.translateX || 0) + padding,\n y: pos.y + (label.parentGroup?.translateY || 0) + padding,\n width: (label.width || 0) - 2 * padding,\n height: (label.height || 0) - 2 * padding\n };\n }\n }\n let label, label1, label2, box1, box2, isLabelAffected = false;\n for (let i = 0; i < len; i++) {\n label = labels[i];\n if (label) {\n // Mark with initial opacity\n label.oldOpacity = label.opacity;\n label.newOpacity = 1;\n label.absoluteBox = getAbsoluteBox(label);\n }\n }\n // Prevent a situation in a gradually rising slope, that each label will\n // hide the previous one because the previous one always has lower rank.\n labels.sort((a, b) => (b.labelrank || 0) - (a.labelrank || 0));\n // Detect overlapping labels\n for (let i = 0; i < len; ++i) {\n label1 = labels[i];\n box1 = label1 && label1.absoluteBox;\n for (let j = i + 1; j < len; ++j) {\n label2 = labels[j];\n box2 = label2 && label2.absoluteBox;\n if (box1 &&\n box2 &&\n label1 !== label2 && // #6465, polar chart with connectEnds\n label1.newOpacity !== 0 &&\n label2.newOpacity !== 0 &&\n // #15863 dataLabels are no longer hidden by translation\n label1.visibility !== 'hidden' &&\n label2.visibility !== 'hidden') {\n if (isIntersectRect(box1, box2)) {\n (label1.labelrank < label2.labelrank ? label1 : label2)\n .newOpacity = 0;\n }\n }\n }\n }\n // Hide or show\n for (const label of labels) {\n if (hideOrShow(label, chart)) {\n isLabelAffected = true;\n }\n }\n if (isLabelAffected) {\n fireEvent(chart, 'afterHideAllOverlappingLabels');\n }\n}\n/** @private */\nfunction compose(ChartClass) {\n const chartProto = ChartClass.prototype;\n if (!chartProto.hideOverlappingLabels) {\n chartProto.hideOverlappingLabels = chartHideOverlappingLabels;\n addEvent(ChartClass, 'render', onChartRender);\n }\n}\n/**\n * Hide or show labels based on opacity.\n *\n * @private\n * @function hideOrShow\n * @param {Highcharts.SVGElement} label\n * The label.\n * @param {Highcharts.Chart} chart\n * The chart that contains the label.\n * @return {boolean}\n * Whether label is affected\n */\nfunction hideOrShow(label, chart) {\n let complete, newOpacity, isLabelAffected = false;\n if (label) {\n newOpacity = label.newOpacity;\n if (label.oldOpacity !== newOpacity) {\n // Toggle data labels\n if (label.hasClass('highcharts-data-label')) {\n // Make sure the label is completely hidden to avoid catching\n // clicks (#4362)\n label[newOpacity ? 'removeClass' : 'addClass']('highcharts-data-label-hidden');\n complete = function () {\n if (!chart.styledMode) {\n label.css({\n pointerEvents: newOpacity ? 'auto' : 'none'\n });\n }\n };\n isLabelAffected = true;\n // Animate or set the opacity\n label[label.isOld ? 'animate' : 'attr']({ opacity: newOpacity }, void 0, complete);\n fireEvent(chart, 'afterHideOverlappingLabel');\n // Toggle other labels, tick labels\n }\n else {\n label.attr({\n opacity: newOpacity\n });\n }\n }\n label.isOld = true;\n }\n return isLabelAffected;\n}\n/**\n * Collect potential overlapping data labels. Stack labels probably don't need\n * to be considered because they are usually accompanied by data labels that lie\n * inside the columns.\n * @private\n */\nfunction onChartRender() {\n const chart = this;\n let labels = [];\n // Consider external label collectors\n for (const collector of (chart.labelCollectors || [])) {\n labels = labels.concat(collector());\n }\n for (const yAxis of (chart.yAxis || [])) {\n if (yAxis.stacking &&\n yAxis.options.stackLabels &&\n !yAxis.options.stackLabels.allowOverlap) {\n objectEach(yAxis.stacking.stacks, (stack) => {\n objectEach(stack, (stackItem) => {\n if (stackItem.label) {\n labels.push(stackItem.label);\n }\n });\n });\n }\n }\n for (const series of (chart.series || [])) {\n if (series.visible && series.hasDataLabels?.()) { // #3866\n const push = (points) => {\n for (const point of points) {\n if (point.visible) {\n (point.dataLabels || []).forEach((label) => {\n const options = label.options || {};\n label.labelrank = pick(options.labelrank, point.labelrank, point.shapeArgs?.height); // #4118\n // Allow overlap if the option is explicitly true\n if (\n // #13449\n options.allowOverlap ??\n // Pie labels outside have a separate placement\n // logic, skip the overlap logic\n Number(options.distance) > 0) {\n label.oldOpacity = label.opacity;\n label.newOpacity = 1;\n hideOrShow(label, chart);\n // Do not allow overlap\n }\n else {\n labels.push(label);\n }\n });\n }\n }\n };\n push(series.nodes || []);\n push(series.points);\n }\n }\n this.hideOverlappingLabels(labels);\n}\n/* *\n *\n * Default Export\n *\n * */\nconst OverlappingDataLabels = {\n compose\n};\nexport default OverlappingDataLabels;\n", "/* *\n *\n * Highcharts Border Radius module\n *\n * Author: Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport D from '../Core/Defaults.js';\nconst { defaultOptions } = D;\nimport H from '../Core/Globals.js';\nconst { noop } = H;\nimport U from '../Core/Utilities.js';\nconst { addEvent, extend, isObject, merge, relativeLength } = U;\n/* *\n *\n * Constants\n *\n * */\nconst defaultBorderRadiusOptions = {\n radius: 0,\n scope: 'stack',\n where: void 0\n};\n/* *\n *\n * Variables\n *\n * */\nlet oldArc = noop;\nlet oldRoundedRect = noop;\n/* *\n *\n * Functions\n *\n * */\n/**\n * @private\n */\nfunction applyBorderRadius(path, i, r) {\n const a = path[i];\n let b = path[i + 1];\n if (b[0] === 'Z') {\n b = path[0];\n }\n let line, arc, fromLineToArc;\n // From straight line to arc\n if ((a[0] === 'M' || a[0] === 'L') && b[0] === 'A') {\n line = a;\n arc = b;\n fromLineToArc = true;\n // From arc to straight line\n }\n else if (a[0] === 'A' && (b[0] === 'M' || b[0] === 'L')) {\n line = b;\n arc = a;\n }\n if (line && arc && arc.params) {\n const bigR = arc[1], \n // In our use cases, outer pie slice arcs are clockwise and inner\n // arcs (donut/sunburst etc) are anti-clockwise\n clockwise = arc[5], params = arc.params, { start, end, cx, cy } = params;\n // Some geometric constants\n const relativeR = clockwise ? (bigR - r) : (bigR + r), \n // The angle, on the big arc, that the border radius arc takes up\n angleOfBorderRadius = relativeR ? Math.asin(r / relativeR) : 0, angleOffset = clockwise ?\n angleOfBorderRadius :\n -angleOfBorderRadius, \n // The distance along the radius of the big arc to the starting\n // point of the small border radius arc\n distanceBigCenterToStartArc = (Math.cos(angleOfBorderRadius) *\n relativeR);\n // From line to arc\n if (fromLineToArc) {\n // Update the cache\n params.start = start + angleOffset;\n // First move to the start position at the radial line. We want to\n // start one borderRadius closer to the center.\n line[1] = cx + distanceBigCenterToStartArc * Math.cos(start);\n line[2] = cy + distanceBigCenterToStartArc * Math.sin(start);\n // Now draw an arc towards the point where the small circle touches\n // the great circle.\n path.splice(i + 1, 0, [\n 'A',\n r,\n r,\n 0,\n 0,\n 1,\n cx + bigR * Math.cos(params.start),\n cy + bigR * Math.sin(params.start)\n ]);\n // From arc to line\n }\n else {\n // Update the cache\n params.end = end - angleOffset;\n // End the big arc a bit earlier\n arc[6] = cx + bigR * Math.cos(params.end);\n arc[7] = cy + bigR * Math.sin(params.end);\n // Draw a small arc towards a point on the end angle, but one\n // borderRadius closer to the center relative to the perimeter.\n path.splice(i + 1, 0, [\n 'A',\n r,\n r,\n 0,\n 0,\n 1,\n cx + distanceBigCenterToStartArc * Math.cos(end),\n cy + distanceBigCenterToStartArc * Math.sin(end)\n ]);\n }\n // Long or short arc must be reconsidered because we have modified the\n // start and end points\n arc[4] = Math.abs(params.end - params.start) < Math.PI ? 0 : 1;\n }\n}\n/**\n * Extend arc with borderRadius.\n * @private\n */\nfunction arc(x, y, w, h, options = {}) {\n const path = oldArc(x, y, w, h, options), { innerR = 0, r = w, start = 0, end = 0 } = options;\n if (options.open || !options.borderRadius) {\n return path;\n }\n const alpha = end - start, sinHalfAlpha = Math.sin(alpha / 2), borderRadius = Math.max(Math.min(relativeLength(options.borderRadius || 0, r - innerR), \n // Cap to half the sector radius\n (r - innerR) / 2, \n // For smaller pie slices, cap to the largest small circle that\n // can be fitted within the sector\n (r * sinHalfAlpha) / (1 + sinHalfAlpha)), 0), \n // For the inner radius, we need an extra cap because the inner arc\n // is shorter than the outer arc\n innerBorderRadius = Math.min(borderRadius, 2 * (alpha / Math.PI) * innerR);\n // Apply turn-by-turn border radius. Start at the end since we're\n // splicing in arc segments.\n let i = path.length - 1;\n while (i--) {\n applyBorderRadius(path, i, i > 1 ? innerBorderRadius : borderRadius);\n }\n return path;\n}\n/** @private */\nfunction seriesOnAfterColumnTranslate() {\n if (this.options.borderRadius &&\n !(this.chart.is3d && this.chart.is3d())) {\n const { options, yAxis } = this, percent = options.stacking === 'percent', seriesDefault = defaultOptions.plotOptions?.[this.type]\n ?.borderRadius, borderRadius = optionsToObject(options.borderRadius, isObject(seriesDefault) ? seriesDefault : {}), reversed = yAxis.options.reversed;\n for (const point of this.points) {\n const { shapeArgs } = point;\n if (point.shapeType === 'roundedRect' && shapeArgs) {\n const { width = 0, height = 0, y = 0 } = shapeArgs;\n let brBoxY = y, brBoxHeight = height;\n // It would be nice to refactor StackItem.getStackBox/\n // setOffset so that we could get a reliable box out of\n // it. Currently it is close if we remove the label\n // offset, but we still need to run crispCol and also\n // flip it if inverted, so atm it is simpler to do it\n // like the below.\n if (borderRadius.scope === 'stack' &&\n point.stackTotal) {\n const stackEnd = yAxis.translate(percent ? 100 : point.stackTotal, false, true, false, true), stackThreshold = yAxis.translate(options.threshold || 0, false, true, false, true), box = this.crispCol(0, Math.min(stackEnd, stackThreshold), 0, Math.abs(stackEnd - stackThreshold));\n brBoxY = box.y;\n brBoxHeight = box.height;\n }\n const flip = (point.negative ? -1 : 1) *\n (reversed ? -1 : 1) === -1;\n // Handle the where option\n let where = borderRadius.where;\n // Waterfall, hanging columns should have rounding on\n // all sides\n if (!where &&\n this.is('waterfall') &&\n Math.abs((point.yBottom || 0) -\n (this.translatedThreshold || 0)) > this.borderWidth) {\n where = 'all';\n }\n if (!where) {\n where = 'end';\n }\n // Get the radius\n const r = Math.min(relativeLength(borderRadius.radius, width), width / 2, \n // Cap to the height, but not if where is `end`\n where === 'all' ? height / 2 : Infinity) || 0;\n // If the `where` option is 'end', cut off the\n // rectangles by making the border-radius box one r\n // greater, so that the imaginary radius falls outside\n // the rectangle.\n if (where === 'end') {\n if (flip) {\n brBoxY -= r;\n brBoxHeight += r;\n }\n else {\n brBoxHeight += r;\n }\n }\n extend(shapeArgs, { brBoxHeight, brBoxY, r });\n }\n }\n }\n}\n/** @private */\nfunction compose(SeriesClass, SVGElementClass, SVGRendererClass) {\n const PieSeriesClass = SeriesClass.types.pie;\n if (!SVGElementClass.symbolCustomAttribs.includes('borderRadius')) {\n const symbols = SVGRendererClass.prototype.symbols;\n addEvent(SeriesClass, 'afterColumnTranslate', seriesOnAfterColumnTranslate, {\n // After columnrange and polar column modifications\n order: 9\n });\n addEvent(PieSeriesClass, 'afterTranslate', pieSeriesOnAfterTranslate);\n SVGElementClass.symbolCustomAttribs.push('borderRadius', 'brBoxHeight', 'brBoxY');\n oldArc = symbols.arc;\n oldRoundedRect = symbols.roundedRect;\n symbols.arc = arc;\n symbols.roundedRect = roundedRect;\n }\n}\n/** @private */\nfunction optionsToObject(options, seriesBROptions) {\n if (!isObject(options)) {\n options = { radius: options || 0 };\n }\n return merge(defaultBorderRadiusOptions, seriesBROptions, options);\n}\n/** @private */\nfunction pieSeriesOnAfterTranslate() {\n const borderRadius = optionsToObject(this.options.borderRadius);\n for (const point of this.points) {\n const shapeArgs = point.shapeArgs;\n if (shapeArgs) {\n shapeArgs.borderRadius = relativeLength(borderRadius.radius, (shapeArgs.r || 0) - ((shapeArgs.innerR) || 0));\n }\n }\n}\n/**\n * Extend roundedRect with individual cutting through rOffset.\n * @private\n */\nfunction roundedRect(x, y, width, height, options = {}) {\n const path = oldRoundedRect(x, y, width, height, options), { r = 0, brBoxHeight = height, brBoxY = y } = options, brOffsetTop = y - brBoxY, brOffsetBtm = (brBoxY + brBoxHeight) - (y + height), \n // When the distance to the border-radius box is greater than the r\n // itself, it means no border radius. The -0.1 accounts for float\n // rounding errors.\n rTop = (brOffsetTop - r) > -0.1 ? 0 : r, rBtm = (brOffsetBtm - r) > -0.1 ? 0 : r, cutTop = Math.max(rTop && brOffsetTop, 0), cutBtm = Math.max(rBtm && brOffsetBtm, 0);\n /*\n\n The naming of control points:\n\n / a -------- b \\\n / \\\n h c\n | |\n | |\n | |\n g d\n \\ /\n \\ f -------- e /\n\n */\n const a = [x + rTop, y], b = [x + width - rTop, y], c = [x + width, y + rTop], d = [\n x + width, y + height - rBtm\n ], e = [\n x + width - rBtm,\n y + height\n ], f = [x + rBtm, y + height], g = [x, y + height - rBtm], h = [x, y + rTop];\n const applyPythagoras = (r, altitude) => Math.sqrt(Math.pow(r, 2) - Math.pow(altitude, 2));\n // Inside stacks, cut off part of the top\n if (cutTop) {\n const base = applyPythagoras(rTop, rTop - cutTop);\n a[0] -= base;\n b[0] += base;\n c[1] = h[1] = y + rTop - cutTop;\n }\n // Column is lower than the radius. Cut off bottom inside the top\n // radius.\n if (height < rTop - cutTop) {\n const base = applyPythagoras(rTop, rTop - cutTop - height);\n c[0] = d[0] = x + width - rTop + base;\n e[0] = Math.min(c[0], e[0]);\n f[0] = Math.max(d[0], f[0]);\n g[0] = h[0] = x + rTop - base;\n c[1] = h[1] = y + height;\n }\n // Inside stacks, cut off part of the bottom\n if (cutBtm) {\n const base = applyPythagoras(rBtm, rBtm - cutBtm);\n e[0] += base;\n f[0] -= base;\n d[1] = g[1] = y + height - rBtm + cutBtm;\n }\n // Cut off top inside the bottom radius\n if (height < rBtm - cutBtm) {\n const base = applyPythagoras(rBtm, rBtm - cutBtm - height);\n c[0] = d[0] = x + width - rBtm + base;\n b[0] = Math.min(c[0], b[0]);\n a[0] = Math.max(d[0], a[0]);\n g[0] = h[0] = x + rBtm - base;\n d[1] = g[1] = y;\n }\n // Preserve the box for data labels\n path.length = 0;\n path.push(['M', ...a], \n // top side\n ['L', ...b], \n // top right corner\n ['A', rTop, rTop, 0, 0, 1, ...c], \n // right side\n ['L', ...d], \n // bottom right corner\n ['A', rBtm, rBtm, 0, 0, 1, ...e], \n // bottom side\n ['L', ...f], \n // bottom left corner\n ['A', rBtm, rBtm, 0, 0, 1, ...g], \n // left side\n ['L', ...h], \n // top left corner\n ['A', rTop, rTop, 0, 0, 1, ...a], ['Z']);\n return path;\n}\n/* *\n *\n * Default Export\n *\n * */\nconst BorderRadius = {\n compose,\n optionsToObject\n};\nexport default BorderRadius;\n/* *\n *\n * API Declarations\n *\n * */\n/**\n * Detailed options for border radius.\n *\n * @sample {highcharts} highcharts/plotoptions/column-borderradius/\n * Rounded columns\n * @sample highcharts/plotoptions/series-border-radius\n * Column and pie with rounded border\n *\n * @interface Highcharts.BorderRadiusOptionsObject\n */ /**\n* The border radius. A number signifies pixels. A percentage string, like for\n* example `50%`, signifies a relative size. For columns this is relative to the\n* column width, for pies it is relative to the radius and the inner radius.\n*\n* @name Highcharts.BorderRadiusOptionsObject#radius\n* @type {string|number}\n*/ /**\n* The scope of the rounding for column charts. In a stacked column chart, the\n* value `point` means each single point will get rounded corners. The value\n* `stack` means the rounding will apply to the full stack, so that only points\n* close to the top or bottom will receive rounding.\n*\n* @name Highcharts.BorderRadiusOptionsObject#scope\n* @validvalue [\"point\", \"stack\"]\n* @type {string}\n*/ /**\n* For column charts, where in the point or stack to apply rounding. The `end`\n* value means only those corners at the point value will be rounded, leaving\n* the corners at the base or threshold unrounded. This is the most intuitive\n* behaviour. The `all` value means also the base will be rounded.\n*\n* @name Highcharts.BorderRadiusOptionsObject#where\n* @validvalue [\"all\", \"end\"]\n* @type {string}\n* @default end\n*/\n(''); // keeps doclets above in JS file\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport U from './Utilities.js';\nconst { diffObjects, extend, find, merge, pick, uniqueKey } = U;\n/* *\n *\n * Composition\n *\n * */\nvar Responsive;\n(function (Responsive) {\n /* *\n *\n * Declarations\n *\n * */\n /* *\n *\n * Functions\n *\n * */\n /**\n * @private\n */\n function compose(ChartClass) {\n const chartProto = ChartClass.prototype;\n if (!chartProto.matchResponsiveRule) {\n extend(chartProto, {\n matchResponsiveRule,\n setResponsive\n });\n }\n return ChartClass;\n }\n Responsive.compose = compose;\n /**\n * Handle a single responsiveness rule.\n *\n * @private\n * @function Highcharts.Chart#matchResponsiveRule\n * @param {Highcharts.ResponsiveRulesOptions} rule\n * @param {Array} matches\n */\n function matchResponsiveRule(rule, matches) {\n const condition = rule.condition, fn = condition.callback || function () {\n return (this.chartWidth <= pick(condition.maxWidth, Number.MAX_VALUE) &&\n this.chartHeight <= pick(condition.maxHeight, Number.MAX_VALUE) &&\n this.chartWidth >= pick(condition.minWidth, 0) &&\n this.chartHeight >= pick(condition.minHeight, 0));\n };\n if (fn.call(this)) {\n matches.push(rule._id);\n }\n }\n /**\n * Update the chart based on the current chart/document size and options\n * for responsiveness.\n *\n * @private\n * @function Highcharts.Chart#setResponsive\n * @param {boolean} [redraw=true]\n * @param {boolean} [reset=false]\n * Reset by un-applying all rules. Chart.update resets all rules before\n * applying updated options.\n */\n function setResponsive(redraw, reset) {\n const options = this.options.responsive, currentResponsive = this.currentResponsive;\n let ruleIds = [], undoOptions;\n if (!reset && options && options.rules) {\n options.rules.forEach((rule) => {\n if (typeof rule._id === 'undefined') {\n rule._id = uniqueKey();\n }\n this.matchResponsiveRule(rule, ruleIds /* , redraw */);\n }, this);\n }\n // Merge matching rules\n const mergedOptions = merge(...ruleIds\n .map((ruleId) => find((options || {}).rules || [], (rule) => (rule._id === ruleId)))\n .map((rule) => (rule && rule.chartOptions)));\n mergedOptions.isResponsiveOptions = true;\n // Stringified key for the rules that currently apply.\n ruleIds = (ruleIds.toString() || void 0);\n const currentRuleIds = (currentResponsive && currentResponsive.ruleIds);\n // Changes in what rules apply\n if (ruleIds !== currentRuleIds) {\n // Undo previous rules. Before we apply a new set of rules, we\n // need to roll back completely to base options (#6291).\n if (currentResponsive) {\n this.update(currentResponsive.undoOptions, redraw, true);\n }\n if (ruleIds) {\n // Get undo-options for matching rules. The `undoOptions``\n // hold the current values before they are changed by the\n // `mergedOptions`.\n undoOptions = diffObjects(mergedOptions, this.options, true, this.collectionsWithUpdate);\n undoOptions.isResponsiveOptions = true;\n this.currentResponsive = {\n ruleIds: ruleIds,\n mergedOptions: mergedOptions,\n undoOptions: undoOptions\n };\n this.update(mergedOptions, redraw, true);\n }\n else {\n this.currentResponsive = void 0;\n }\n }\n }\n})(Responsive || (Responsive = {}));\n/* *\n *\n * Default Export\n *\n * */\nexport default Responsive;\n/* *\n *\n * API Declarations\n *\n * */\n/**\n * A callback function to gain complete control on when the responsive rule\n * applies.\n *\n * @callback Highcharts.ResponsiveCallbackFunction\n *\n * @param {Highcharts.Chart} this\n * Chart context.\n *\n * @return {boolean}\n * Return `true` if it applies.\n */\n(''); // keeps doclets above in JS file\n/* *\n *\n * API Options\n *\n * */\n/**\n * Allows setting a set of rules to apply for different screen or chart\n * sizes. Each rule specifies additional chart options.\n *\n * @sample {highstock} stock/demo/responsive/\n * Stock chart\n * @sample highcharts/responsive/axis/\n * Axis\n * @sample highcharts/responsive/legend/\n * Legend\n * @sample highcharts/responsive/classname/\n * Class name\n *\n * @since 5.0.0\n * @apioption responsive\n */\n/**\n * A set of rules for responsive settings. The rules are executed from\n * the top down.\n *\n * @sample {highcharts} highcharts/responsive/axis/\n * Axis changes\n * @sample {highstock} highcharts/responsive/axis/\n * Axis changes\n * @sample {highmaps} highcharts/responsive/axis/\n * Axis changes\n *\n * @type {Array<*>}\n * @since 5.0.0\n * @apioption responsive.rules\n */\n/**\n * A full set of chart options to apply as overrides to the general\n * chart options. The chart options are applied when the given rule\n * is active.\n *\n * A special case is configuration objects that take arrays, for example\n * [xAxis](#xAxis), [yAxis](#yAxis) or [series](#series). For these\n * collections, an `id` option is used to map the new option set to\n * an existing object. If an existing object of the same id is not found,\n * the item of the same index updated. So for example, setting `chartOptions`\n * with two series items without an `id`, will cause the existing chart's\n * two series to be updated with respective options.\n *\n * @sample {highstock} stock/demo/responsive/\n * Stock chart\n * @sample highcharts/responsive/axis/\n * Axis\n * @sample highcharts/responsive/legend/\n * Legend\n * @sample highcharts/responsive/classname/\n * Class name\n *\n * @type {Highcharts.Options}\n * @since 5.0.0\n * @apioption responsive.rules.chartOptions\n */\n/**\n * Under which conditions the rule applies.\n *\n * @since 5.0.0\n * @apioption responsive.rules.condition\n */\n/**\n * A callback function to gain complete control on when the responsive\n * rule applies. Return `true` if it applies. This opens for checking\n * against other metrics than the chart size, for example the document\n * size or other elements.\n *\n * @type {Highcharts.ResponsiveCallbackFunction}\n * @since 5.0.0\n * @context Highcharts.Chart\n * @apioption responsive.rules.condition.callback\n */\n/**\n * The responsive rule applies if the chart height is less than this.\n *\n * @type {number}\n * @since 5.0.0\n * @apioption responsive.rules.condition.maxHeight\n */\n/**\n * The responsive rule applies if the chart width is less than this.\n *\n * @sample highcharts/responsive/axis/\n * Max width is 500\n *\n * @type {number}\n * @since 5.0.0\n * @apioption responsive.rules.condition.maxWidth\n */\n/**\n * The responsive rule applies if the chart height is greater than this.\n *\n * @type {number}\n * @default 0\n * @since 5.0.0\n * @apioption responsive.rules.condition.minHeight\n */\n/**\n * The responsive rule applies if the chart width is greater than this.\n *\n * @type {number}\n * @default 0\n * @since 5.0.0\n * @apioption responsive.rules.condition.minWidth\n */\n(''); // keeps doclets above in JS file\n", "/**\n * @license Highcharts JS v@product.version@ (@product.date@)\n * @module highcharts/highcharts\n *\n * (c) 2009-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n */\n'use strict';\nimport Highcharts from '../Core/Globals.js';\nimport Utilities from '../Core/Utilities.js';\nimport Defaults from '../Core/Defaults.js';\nimport Fx from '../Core/Animation/Fx.js';\nimport Animation from '../Core/Animation/AnimationUtilities.js';\nimport AST from '../Core/Renderer/HTML/AST.js';\nimport Templating from '../Core/Templating.js';\nimport RendererRegistry from '../Core/Renderer/RendererRegistry.js';\nimport RendererUtilities from '../Core/Renderer/RendererUtilities.js';\nimport SVGElement from '../Core/Renderer/SVG/SVGElement.js';\nimport SVGRenderer from '../Core/Renderer/SVG/SVGRenderer.js';\nimport HTMLElement from '../Core/Renderer/HTML/HTMLElement.js';\nimport Axis from '../Core/Axis/Axis.js';\nimport DateTimeAxis from '../Core/Axis/DateTimeAxis.js';\nimport LogarithmicAxis from '../Core/Axis/LogarithmicAxis.js';\nimport PlotLineOrBand from '../Core/Axis/PlotLineOrBand/PlotLineOrBand.js';\nimport Tick from '../Core/Axis/Tick.js';\nimport Tooltip from '../Core/Tooltip.js';\nimport Point from '../Core/Series/Point.js';\nimport Pointer from '../Core/Pointer.js';\nimport Legend from '../Core/Legend/Legend.js';\nimport LegendSymbol from '../Core/Legend/LegendSymbol.js';\nimport Chart from '../Core/Chart/Chart.js';\nimport ScrollablePlotArea from '../Extensions/ScrollablePlotArea.js';\nimport StackingAxis from '../Core/Axis/Stacking/StackingAxis.js';\nimport StackItem from '../Core/Axis/Stacking/StackItem.js';\nimport Series from '../Core/Series/Series.js';\nimport SeriesRegistry from '../Core/Series/SeriesRegistry.js';\nimport '../Series/Line/LineSeries.js';\nimport '../Series/Area/AreaSeries.js';\nimport '../Series/Spline/SplineSeries.js';\nimport '../Series/AreaSpline/AreaSplineSeries.js';\nimport '../Series/Column/ColumnSeries.js';\nimport ColumnDataLabel from '../Series/Column/ColumnDataLabel.js';\nimport '../Series/Bar/BarSeries.js';\nimport '../Series/Scatter/ScatterSeries.js';\nimport '../Series/Pie/PieSeries.js';\nimport PieDataLabel from '../Series/Pie/PieDataLabel.js';\nimport DataLabel from '../Core/Series/DataLabel.js';\nimport OverlappingDataLabels from '../Extensions/OverlappingDataLabels.js';\nimport BorderRadius from '../Extensions/BorderRadius.js';\nimport Responsive from '../Core/Responsive.js';\nimport Color from '../Core/Color/Color.js';\nimport Time from '../Core/Time.js';\nconst G = Highcharts;\n// Classes\nG.AST = AST;\nG.Axis = Axis;\nG.Chart = Chart;\nG.Color = Color;\nG.DataLabel = DataLabel;\nG.Fx = Fx;\nG.HTMLElement = HTMLElement;\nG.Legend = Legend;\nG.LegendSymbol = LegendSymbol;\nG.OverlappingDataLabels = G.OverlappingDataLabels || OverlappingDataLabels;\nG.PlotLineOrBand = PlotLineOrBand;\nG.Point = Point;\nG.Pointer = Pointer;\nG.RendererRegistry = RendererRegistry;\nG.Series = Series;\nG.SeriesRegistry = SeriesRegistry;\nG.StackItem = StackItem;\nG.SVGElement = SVGElement;\nG.SVGRenderer = SVGRenderer;\nG.Templating = Templating;\nG.Tick = Tick;\nG.Time = Time;\nG.Tooltip = Tooltip;\n// Utilities\nG.animate = Animation.animate;\nG.animObject = Animation.animObject;\nG.chart = Chart.chart;\nG.color = Color.parse;\nG.dateFormat = Templating.dateFormat;\nG.defaultOptions = Defaults.defaultOptions;\nG.distribute = RendererUtilities.distribute;\nG.format = Templating.format;\nG.getDeferredAnimation = Animation.getDeferredAnimation;\nG.getOptions = Defaults.getOptions;\nG.numberFormat = Templating.numberFormat;\nG.seriesType = SeriesRegistry.seriesType;\nG.setAnimation = Animation.setAnimation;\nG.setOptions = Defaults.setOptions;\nG.stop = Animation.stop;\nG.time = Defaults.defaultTime;\nG.timers = Fx.timers;\n// Compositions\nBorderRadius.compose(G.Series, G.SVGElement, G.SVGRenderer);\nColumnDataLabel.compose(G.Series.types.column);\nDataLabel.compose(G.Series);\nDateTimeAxis.compose(G.Axis);\nHTMLElement.compose(G.SVGRenderer);\nLegend.compose(G.Chart);\nLogarithmicAxis.compose(G.Axis);\nOverlappingDataLabels.compose(G.Chart);\nPieDataLabel.compose(G.Series.types.pie);\nPlotLineOrBand.compose(G.Axis);\nPointer.compose(G.Chart);\nResponsive.compose(G.Chart);\nScrollablePlotArea.compose(G.Axis, G.Chart, G.Series);\nStackingAxis.compose(G.Axis, G.Chart, G.Series);\nTooltip.compose(G.Pointer);\nUtilities.extend(G, Utilities);\n// Default Export\nexport default G;\n", "/* *\n *\n * Imports\n *\n * */\nimport U from '../../Core/Utilities.js';\nconst { addEvent, correctFloat, defined, pick } = U;\n/* *\n *\n * Functions\n *\n * */\n/** @private */\nfunction chartGetHoverPane(eventArgs) {\n const chart = this;\n let hoverPane;\n if (eventArgs) {\n chart.pane.forEach((pane) => {\n const x = eventArgs.chartX - chart.plotLeft, y = eventArgs.chartY - chart.plotTop;\n if (isInsidePane(x, y, pane.center)) {\n hoverPane = pane;\n }\n });\n }\n return hoverPane;\n}\n/** @private */\nfunction compose(ChartClass, PointerClass) {\n const chartProto = ChartClass.prototype;\n if (!chartProto.getHoverPane) {\n chartProto.collectionsWithUpdate.push('pane');\n chartProto.getHoverPane = chartGetHoverPane;\n addEvent(ChartClass, 'afterIsInsidePlot', onChartAfterIsInsiderPlot);\n addEvent(PointerClass, 'afterGetHoverData', onPointerAfterGetHoverData);\n addEvent(PointerClass, 'beforeGetHoverData', onPointerBeforeGetHoverData);\n }\n}\n/**\n * Check whether element is inside or outside pane.\n * @private\n * @param {number} x\n * Element's x coordinate\n * @param {number} y\n * Element's y coordinate\n * @param {Array} center\n * Pane's center (x, y) and diameter\n * @param {number} startAngle\n * Pane's normalized start angle in radians (<-PI, PI>)\n * @param {number} endAngle\n * Pane's normalized end angle in radians (<-PI, PI>)\n */\nfunction isInsidePane(x, y, center, startAngle, endAngle) {\n let insideSlice = true;\n const cx = center[0], cy = center[1];\n const distance = Math.sqrt(Math.pow(x - cx, 2) + Math.pow(y - cy, 2));\n if (defined(startAngle) && defined(endAngle)) {\n // Round angle to N-decimals to avoid numeric errors\n const angle = Math.atan2(correctFloat(y - cy, 8), correctFloat(x - cx, 8));\n // Ignore full circle panes:\n if (endAngle !== startAngle) {\n // If normalized start angle is bigger than normalized end,\n // it means angles have different signs. In such situation we\n // check the <-PI, startAngle> and ranges.\n if (startAngle > endAngle) {\n insideSlice = (angle >= startAngle &&\n angle <= Math.PI) || (angle <= endAngle &&\n angle >= -Math.PI);\n }\n else {\n // In this case, we simple check if angle is within the\n // range\n insideSlice = angle >= startAngle &&\n angle <= correctFloat(endAngle, 8);\n }\n }\n }\n // Round up radius because x and y values are rounded\n return distance <= Math.ceil(center[2] / 2) && insideSlice;\n}\n/**\n * Check if (x, y) position is within pane for polar.\n * @private\n */\nfunction onChartAfterIsInsiderPlot(e) {\n const chart = this;\n if (chart.polar) {\n if (e.options.inverted) {\n [e.x, e.y] = [e.y, e.x];\n }\n e.isInsidePlot = chart.pane.some((pane) => isInsidePane(e.x, e.y, pane.center, pane.axis && pane.axis.normalizedStartAngleRad, pane.axis && pane.axis.normalizedEndAngleRad));\n }\n}\nfunction onPointerAfterGetHoverData(eventArgs) {\n const chart = this.chart;\n if (eventArgs.hoverPoint &&\n eventArgs.hoverPoint.plotX &&\n eventArgs.hoverPoint.plotY &&\n chart.hoverPane &&\n !isInsidePane(eventArgs.hoverPoint.plotX, eventArgs.hoverPoint.plotY, chart.hoverPane.center)) {\n eventArgs.hoverPoint = void 0;\n }\n}\n/** @private */\nfunction onPointerBeforeGetHoverData(eventArgs) {\n const chart = this.chart;\n if (chart.polar) {\n // Find pane we are currently hovering over.\n chart.hoverPane = chart.getHoverPane(eventArgs);\n // Edit filter method to handle polar\n eventArgs.filter = function (s) {\n return (s.visible &&\n !(!eventArgs.shared && s.directTouch) && // #3821\n pick(s.options.enableMouseTracking, true) &&\n (!chart.hoverPane || s.xAxis.pane === chart.hoverPane));\n };\n }\n else {\n chart.hoverPane = void 0;\n }\n}\n/* *\n *\n * Default Export\n *\n * */\nconst PaneComposition = {\n compose\n};\nexport default PaneComposition;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\n/* *\n *\n * API Options\n *\n * */\n/**\n * An array of background items for the pane.\n *\n * @sample {highcharts} highcharts/demo/gauge-speedometer/\n * Speedometer gauge with multiple backgrounds\n *\n * @type {Array<*>}\n * @optionparent pane.background\n */\nconst background = {\n /**\n * The class name for this background.\n *\n * @sample {highcharts} highcharts/css/pane/\n * Panes styled by CSS\n * @sample {highstock} highcharts/css/pane/\n * Panes styled by CSS\n * @sample {highmaps} highcharts/css/pane/\n * Panes styled by CSS\n *\n * @type {string}\n * @default highcharts-pane\n * @since 5.0.0\n * @apioption pane.background.className\n */\n /**\n * The shape of the pane background. When `solid`, the background\n * is circular. When `arc`, the background extends only from the min\n * to the max of the value axis.\n *\n * @type {Highcharts.PaneBackgroundShapeValue}\n * @since 2.3.0\n * @product highcharts\n */\n shape: 'circle',\n /**\n * The pixel border width of the pane background.\n *\n * @since 2.3.0\n * @product highcharts\n */\n borderWidth: 1,\n /**\n * The pane background border color.\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @since 2.3.0\n * @product highcharts\n */\n borderColor: \"#cccccc\" /* Palette.neutralColor20 */,\n /**\n * The background color or gradient for the pane.\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @default { linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, stops: [[0, #ffffff], [1, #e6e6e6]] }\n * @since 2.3.0\n * @product highcharts\n */\n backgroundColor: {\n /** @ignore-option */\n linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },\n /** @ignore-option */\n stops: [\n [0, \"#ffffff\" /* Palette.backgroundColor */],\n [1, \"#e6e6e6\" /* Palette.neutralColor10 */]\n ]\n },\n /** @ignore-option */\n from: -Number.MAX_VALUE,\n /**\n * The inner radius of the pane background. Can be either numeric\n * (pixels) or a percentage string.\n *\n * @type {number|string}\n * @since 2.3.0\n * @product highcharts\n */\n innerRadius: 0,\n /** @ignore-option */\n to: Number.MAX_VALUE,\n /**\n * The outer radius of the circular pane background. Can be either\n * numeric (pixels) or a percentage string.\n *\n * @type {number|string}\n * @since 2.3.0\n * @product highcharts\n */\n outerRadius: '105%'\n};\n/**\n * The pane serves as a container for axes and backgrounds for circular\n * gauges and polar charts.\n *\n * @since 2.3.0\n * @product highcharts\n * @requires highcharts-more\n * @optionparent pane\n */\nconst pane = {\n /**\n * The end angle of the polar X axis or gauge value axis, given in\n * degrees where 0 is north. Defaults to [startAngle](#pane.startAngle)\n * + 360.\n *\n * @sample {highcharts} highcharts/demo/gauge-vu-meter/\n * VU-meter with custom start and end angle\n *\n * @type {number}\n * @since 2.3.0\n * @product highcharts\n * @apioption pane.endAngle\n */\n /**\n * The center of a polar chart or angular gauge, given as an array\n * of [x, y] positions. Positions can be given as integers that\n * transform to pixels, or as percentages of the plot area size.\n *\n * @sample {highcharts} highcharts/demo/gauge-vu-meter/\n * Two gauges with different center\n *\n * @type {Array}\n * @default [\"50%\", \"50%\"]\n * @since 2.3.0\n * @product highcharts\n */\n center: ['50%', '50%'],\n /**\n * The size of the pane, either as a number defining pixels, or a\n * percentage defining a percentage of the available plot area (the\n * smallest of the plot height or plot width).\n *\n * @sample {highcharts} highcharts/demo/gauge-vu-meter/\n * Smaller size\n *\n * @type {number|string}\n * @product highcharts\n */\n size: '85%',\n /**\n * The inner size of the pane, either as a number defining pixels, or a\n * percentage defining a percentage of the pane's size.\n *\n * @sample {highcharts} highcharts/series-polar/column-inverted-inner\n * The inner size set to 20%\n *\n * @type {number|string}\n * @product highcharts\n */\n innerSize: '0%',\n /**\n * The start angle of the polar X axis or gauge axis, given in degrees\n * where 0 is north. Defaults to 0.\n *\n * @sample {highcharts} highcharts/demo/gauge-vu-meter/\n * VU-meter with custom start and end angle\n *\n * @since 2.3.0\n * @product highcharts\n */\n startAngle: 0\n};\n/* *\n *\n * Default Export\n *\n * */\nconst PaneDefaults = {\n pane,\n background\n};\nexport default PaneDefaults;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport CU from '../../Series/CenteredUtilities.js';\nimport PaneComposition from './PaneComposition.js';\nimport PaneDefaults from './PaneDefaults.js';\nimport U from '../../Core/Utilities.js';\nconst { extend, merge, splat } = U;\n/* *\n *\n * Class\n *\n * */\n/**\n * The Pane object allows options that are common to a set of X and Y axes.\n *\n * In the future, this can be extended to basic Highcharts and Highcharts Stock.\n *\n * @private\n * @class\n * @name Highcharts.Pane\n * @param {Highcharts.PaneOptions} options\n * @param {Highcharts.Chart} chart\n */\nclass Pane {\n /* *\n *\n * Constructor\n *\n * */\n constructor(options, chart) {\n this.coll = 'pane'; // Member of chart.pane\n this.init(options, chart);\n }\n /* *\n *\n * Functions\n *\n * */\n /**\n * Initialize the Pane object\n *\n * @private\n * @function Highcharts.Pane#init\n *\n * @param {Highcharts.PaneOptions} options\n *\n * @param {Highcharts.Chart} chart\n */\n init(options, chart) {\n this.chart = chart;\n this.background = [];\n chart.pane.push(this);\n this.setOptions(options);\n }\n /**\n * @private\n * @function Highcharts.Pane#setOptions\n *\n * @param {Highcharts.PaneOptions} options\n */\n setOptions(options) {\n // Set options. Angular charts have a default background (#3318)\n this.options = options = merge(PaneDefaults.pane, this.chart.angular ? { background: {} } : void 0, options);\n }\n /**\n * Render the pane with its backgrounds.\n *\n * @private\n * @function Highcharts.Pane#render\n */\n render() {\n const options = this.options, renderer = this.chart.renderer;\n if (!this.group) {\n this.group = renderer.g('pane-group')\n .attr({ zIndex: options.zIndex || 0 })\n .add();\n }\n this.updateCenter();\n let backgroundOption = this.options.background;\n // Render the backgrounds\n if (backgroundOption) {\n backgroundOption = splat(backgroundOption);\n const len = Math.max(backgroundOption.length, this.background.length || 0);\n for (let i = 0; i < len; i++) {\n // #6641 - if axis exists, chart is circular and apply\n // background\n if (backgroundOption[i] && this.axis) {\n this.renderBackground(merge(PaneDefaults.background, backgroundOption[i]), i);\n }\n else if (this.background[i]) {\n this.background[i] = this.background[i].destroy();\n this.background.splice(i, 1);\n }\n }\n }\n }\n /**\n * Render an individual pane background.\n *\n * @private\n * @function Highcharts.Pane#renderBackground\n *\n * @param {Highcharts.PaneBackgroundOptions} backgroundOptions\n * Background options\n *\n * @param {number} i\n * The index of the background in this.backgrounds\n */\n renderBackground(backgroundOptions, i) {\n const attribs = {\n 'class': 'highcharts-pane ' + (backgroundOptions.className || '')\n };\n let method = 'animate';\n if (!this.chart.styledMode) {\n extend(attribs, {\n 'fill': backgroundOptions.backgroundColor,\n 'stroke': backgroundOptions.borderColor,\n 'stroke-width': backgroundOptions.borderWidth\n });\n }\n if (!this.background[i]) {\n this.background[i] = this.chart.renderer\n .path()\n .add(this.group);\n method = 'attr';\n }\n this.background[i][method]({\n 'd': this.axis.getPlotBandPath(backgroundOptions.from, backgroundOptions.to, backgroundOptions)\n }).attr(attribs);\n }\n /**\n * Gets the center for the pane and its axis.\n *\n * @private\n * @function Highcharts.Pane#updateCenter\n * @param {Highcharts.Axis} [axis]\n */\n updateCenter(axis) {\n this.center = (axis ||\n this.axis ||\n {}).center = CU.getCenter.call(this);\n }\n /**\n * Destroy the pane item\n *\n * @ignore\n * @private\n * @function Highcharts.Pane#destroy\n * /\n destroy: function () {\n erase(this.chart.pane, this);\n this.background.forEach(function (background) {\n background.destroy();\n });\n this.background.length = 0;\n this.group = this.group.destroy();\n },\n */\n /**\n * Update the pane item with new options\n *\n * @private\n * @function Highcharts.Pane#update\n * @param {Highcharts.PaneOptions} options\n * New pane options\n * @param {boolean} [redraw]\n */\n update(options, redraw) {\n merge(true, this.options, options);\n this.setOptions(this.options);\n this.render();\n this.chart.axes.forEach(function (axis) {\n if (axis.pane === this) {\n axis.pane = null;\n axis.update({}, redraw);\n }\n }, this);\n }\n}\n/* *\n *\n * Static Properties\n *\n * */\nPane.compose = PaneComposition.compose;\n/* *\n *\n * Default Export\n *\n * */\nexport default Pane;\n/* *\n *\n * API Declarations\n *\n * */\n/**\n * @typedef {\"arc\"|\"circle\"|\"solid\"} Highcharts.PaneBackgroundShapeValue\n */\n''; // keeps doclets above in JS file\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport SeriesRegistry from '../../Core/Series/SeriesRegistry.js';\nconst { area: { prototype: { pointClass: AreaPoint, pointClass: { prototype: areaProto } } } } = SeriesRegistry.seriesTypes;\nimport U from '../../Core/Utilities.js';\nconst { defined, isNumber } = U;\n/* *\n *\n * Class\n *\n * */\nclass AreaRangePoint extends AreaPoint {\n /**\n * Range series only. The high or maximum value for each data point.\n * @name Highcharts.Point#high\n * @type {number|undefined}\n */\n /**\n * Range series only. The low or minimum value for each data point.\n * @name Highcharts.Point#low\n * @type {number|undefined}\n */\n /* *\n *\n * Functions\n *\n * */\n /**\n * @private\n */\n setState() {\n const prevState = this.state, series = this.series, isPolar = series.chart.polar;\n if (!defined(this.plotHigh)) {\n // Boost doesn't calculate plotHigh\n this.plotHigh = series.yAxis.toPixels(this.high, true);\n }\n if (!defined(this.plotLow)) {\n // Boost doesn't calculate plotLow\n this.plotLow = this.plotY = series.yAxis.toPixels(this.low, true);\n }\n series.lowerStateMarkerGraphic = series.stateMarkerGraphic;\n series.stateMarkerGraphic = series.upperStateMarkerGraphic;\n // Change state also for the top marker\n this.graphic = this.graphics && this.graphics[1];\n this.plotY = this.plotHigh;\n if (isPolar && isNumber(this.plotHighX)) {\n this.plotX = this.plotHighX;\n }\n // Top state:\n areaProto.setState.apply(this, arguments);\n this.state = prevState;\n // Now restore defaults\n this.plotY = this.plotLow;\n this.graphic = this.graphics && this.graphics[0];\n if (isPolar && isNumber(this.plotLowX)) {\n this.plotX = this.plotLowX;\n }\n series.upperStateMarkerGraphic = series.stateMarkerGraphic;\n series.stateMarkerGraphic = series.lowerStateMarkerGraphic;\n // Lower marker is stored at stateMarkerGraphic\n // to avoid reference duplication (#7021)\n series.lowerStateMarkerGraphic = void 0;\n const originalSettings = series.modifyMarkerSettings();\n // Bottom state\n areaProto.setState.apply(this, arguments);\n // Restore previous state\n series.restoreMarkerSettings(originalSettings);\n }\n haloPath() {\n const isPolar = this.series.chart.polar;\n let path = [];\n // Bottom halo\n this.plotY = this.plotLow;\n if (isPolar && isNumber(this.plotLowX)) {\n this.plotX = this.plotLowX;\n }\n if (this.isInside) {\n path = areaProto.haloPath.apply(this, arguments);\n }\n // Top halo\n this.plotY = this.plotHigh;\n if (isPolar && isNumber(this.plotHighX)) {\n this.plotX = this.plotHighX;\n }\n if (this.isTopInside) {\n path = path.concat(areaProto.haloPath.apply(this, arguments));\n }\n return path;\n }\n isValid() {\n return isNumber(this.low) && isNumber(this.high);\n }\n}\n/* *\n *\n * Default Export\n *\n * */\nexport default AreaRangePoint;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport AreaRangePoint from './AreaRangePoint.js';\nimport H from '../../Core/Globals.js';\nconst { noop } = H;\nimport SeriesRegistry from '../../Core/Series/SeriesRegistry.js';\nconst { area: AreaSeries, area: { prototype: areaProto }, column: { prototype: columnProto } } = SeriesRegistry.seriesTypes;\nimport U from '../../Core/Utilities.js';\nconst { addEvent, defined, extend, isArray, isNumber, pick, merge } = U;\n/* *\n *\n * Constants\n *\n * */\n/**\n * The area range series is a carteseian series with higher and lower values for\n * each point along an X axis, where the area between the values is shaded.\n *\n * @sample {highcharts} highcharts/demo/arearange/\n * Area range chart\n * @sample {highstock} stock/demo/arearange/\n * Area range chart\n *\n * @extends plotOptions.area\n * @product highcharts highstock\n * @excluding stack, stacking\n * @requires highcharts-more\n * @optionparent plotOptions.arearange\n *\n * @private\n */\nconst areaRangeSeriesOptions = {\n /**\n * @see [fillColor](#plotOptions.arearange.fillColor)\n * @see [fillOpacity](#plotOptions.arearange.fillOpacity)\n *\n * @apioption plotOptions.arearange.color\n */\n /**\n * @default low\n * @apioption plotOptions.arearange.colorKey\n */\n /**\n * @see [color](#plotOptions.arearange.color)\n * @see [fillOpacity](#plotOptions.arearange.fillOpacity)\n *\n * @apioption plotOptions.arearange.fillColor\n */\n /**\n * @see [color](#plotOptions.arearange.color)\n * @see [fillColor](#plotOptions.arearange.fillColor)\n *\n * @default {highcharts} 0.75\n * @default {highstock} 0.75\n * @apioption plotOptions.arearange.fillOpacity\n */\n /**\n * Whether to apply a drop shadow to the graph line. Since 2.3 the\n * shadow can be an object configuration containing `color`, `offsetX`,\n * `offsetY`, `opacity` and `width`.\n *\n * @type {boolean|Highcharts.ShadowOptionsObject}\n * @product highcharts\n * @apioption plotOptions.arearange.shadow\n */\n /**\n * Pixel width of the arearange graph line.\n *\n * @since 2.3.0\n *\n * @private\n */\n lineWidth: 1,\n /**\n * @type {number|null}\n */\n threshold: null,\n tooltip: {\n pointFormat: '\\u25CF ' +\n '{series.name}: {point.low} - {point.high}
'\n },\n /**\n * Whether the whole area or just the line should respond to mouseover\n * tooltips and other mouse or touch events.\n *\n * @since 2.3.0\n *\n * @private\n */\n trackByArea: true,\n /**\n * Extended data labels for range series types. Range series data\n * labels use no `x` and `y` options. Instead, they have `xLow`,\n * `xHigh`, `yLow` and `yHigh` options to allow the higher and lower\n * data label sets individually.\n *\n * @declare Highcharts.SeriesAreaRangeDataLabelsOptionsObject\n * @exclude x, y\n * @since 2.3.0\n * @product highcharts highstock\n *\n * @private\n */\n dataLabels: {\n align: void 0,\n verticalAlign: void 0,\n /**\n * X offset of the lower data labels relative to the point value.\n *\n * @sample highcharts/plotoptions/arearange-datalabels/\n * Data labels on range series\n * @sample highcharts/plotoptions/arearange-datalabels/\n * Data labels on range series\n */\n xLow: 0,\n /**\n * X offset of the higher data labels relative to the point value.\n *\n * @sample highcharts/plotoptions/arearange-datalabels/\n * Data labels on range series\n */\n xHigh: 0,\n /**\n * Y offset of the lower data labels relative to the point value.\n *\n * @sample highcharts/plotoptions/arearange-datalabels/\n * Data labels on range series\n */\n yLow: 0,\n /**\n * Y offset of the higher data labels relative to the point value.\n *\n * @sample highcharts/plotoptions/arearange-datalabels/\n * Data labels on range series\n */\n yHigh: 0\n }\n};\n/* *\n *\n * Class\n *\n * */\n/**\n * The AreaRange series type.\n *\n * @private\n * @class\n * @name Highcharts.seriesTypes.arearange\n *\n * @augments Highcharts.Series\n */\nclass AreaRangeSeries extends AreaSeries {\n /* *\n *\n * Functions\n *\n * */\n toYData(point) {\n return [point.low, point.high];\n }\n /**\n * Translate a point's plotHigh from the internal angle and radius measures\n * to true plotHigh coordinates. This is an addition of the toXY method\n * found in Polar.js, because it runs too early for arearanges to be\n * considered (#3419).\n * @private\n */\n highToXY(point) {\n // Find the polar plotX and plotY\n const chart = this.chart, xy = this.xAxis.postTranslate(point.rectPlotX || 0, this.yAxis.len - (point.plotHigh || 0));\n point.plotHighX = xy.x - chart.plotLeft;\n point.plotHigh = xy.y - chart.plotTop;\n point.plotLowX = point.plotX;\n }\n /**\n * Extend the line series' getSegmentPath method by applying the segment\n * path to both lower and higher values of the range.\n * @private\n */\n getGraphPath(points) {\n const highPoints = [], highAreaPoints = [], getGraphPath = areaProto.getGraphPath, options = this.options, polar = this.chart.polar, connectEnds = polar && options.connectEnds !== false, connectNulls = options.connectNulls;\n let i, point, pointShim, step = options.step;\n points = points || this.points;\n // Create the top line and the top part of the area fill. The area fill\n // compensates for null points by drawing down to the lower graph,\n // moving across the null gap and starting again at the lower graph.\n i = points.length;\n while (i--) {\n point = points[i];\n // Support for polar\n const highAreaPoint = polar ? {\n plotX: point.rectPlotX,\n plotY: point.yBottom,\n doCurve: false // #5186, gaps in areasplinerange fill\n } : {\n plotX: point.plotX,\n plotY: point.plotY,\n doCurve: false // #5186, gaps in areasplinerange fill\n };\n if (!point.isNull &&\n !connectEnds &&\n !connectNulls &&\n (!points[i + 1] || points[i + 1].isNull)) {\n highAreaPoints.push(highAreaPoint);\n }\n pointShim = {\n polarPlotY: point.polarPlotY,\n rectPlotX: point.rectPlotX,\n yBottom: point.yBottom,\n // plotHighX is for polar charts\n plotX: pick(point.plotHighX, point.plotX),\n plotY: point.plotHigh,\n isNull: point.isNull\n };\n highAreaPoints.push(pointShim);\n highPoints.push(pointShim);\n if (!point.isNull &&\n !connectEnds &&\n !connectNulls &&\n (!points[i - 1] || points[i - 1].isNull)) {\n highAreaPoints.push(highAreaPoint);\n }\n }\n // Get the paths\n const lowerPath = getGraphPath.call(this, points);\n if (step) {\n if (step === true) {\n step = 'left';\n }\n options.step = {\n left: 'right',\n center: 'center',\n right: 'left'\n }[step]; // swap for reading in getGraphPath\n }\n const higherPath = getGraphPath.call(this, highPoints);\n const higherAreaPath = getGraphPath.call(this, highAreaPoints);\n options.step = step;\n // Create a line on both top and bottom of the range\n const linePath = [].concat(lowerPath, higherPath);\n // For the area path, we need to change the 'move' statement into\n // 'lineTo'\n if (!this.chart.polar &&\n higherAreaPath[0] &&\n higherAreaPath[0][0] === 'M') {\n // This probably doesn't work for spline\n higherAreaPath[0] = [\n 'L',\n higherAreaPath[0][1],\n higherAreaPath[0][2]\n ];\n }\n this.graphPath = linePath;\n this.areaPath = lowerPath.concat(higherAreaPath);\n // Prepare for sideways animation\n linePath.isArea = true;\n linePath.xMap = lowerPath.xMap;\n this.areaPath.xMap = lowerPath.xMap;\n return linePath;\n }\n /**\n * Extend the basic drawDataLabels method by running it for both lower and\n * higher values.\n * @private\n */\n drawDataLabels() {\n const data = this.points, length = data.length, originalDataLabels = [], dataLabelOptions = this.options.dataLabels, inverted = this.chart.inverted;\n let i, point, up, upperDataLabelOptions, lowerDataLabelOptions;\n if (dataLabelOptions) {\n // Split into upper and lower options. If data labels is an array,\n // the first element is the upper label, the second is the lower.\n //\n // TODO: We want to change this and allow multiple labels for both\n // upper and lower values in the future - introducing some options\n // for which point value to use as Y for the dataLabel, so that this\n // could be handled in Series.drawDataLabels. This would also\n // improve performance since we now have to loop over all the points\n // multiple times to work around the data label logic.\n if (isArray(dataLabelOptions)) {\n upperDataLabelOptions = dataLabelOptions[0] || {\n enabled: false\n };\n lowerDataLabelOptions = dataLabelOptions[1] || {\n enabled: false\n };\n }\n else {\n // Make copies\n upperDataLabelOptions = extend({}, dataLabelOptions);\n upperDataLabelOptions.x = dataLabelOptions.xHigh;\n upperDataLabelOptions.y = dataLabelOptions.yHigh;\n lowerDataLabelOptions = extend({}, dataLabelOptions);\n lowerDataLabelOptions.x = dataLabelOptions.xLow;\n lowerDataLabelOptions.y = dataLabelOptions.yLow;\n }\n // Draw upper labels\n if (upperDataLabelOptions.enabled || this.hasDataLabels?.()) {\n // Set preliminary values for plotY and dataLabel\n // and draw the upper labels\n i = length;\n while (i--) {\n point = data[i];\n if (point) {\n const { plotHigh = 0, plotLow = 0 } = point;\n up = upperDataLabelOptions.inside ?\n plotHigh < plotLow :\n plotHigh > plotLow;\n point.y = point.high;\n point._plotY = point.plotY;\n point.plotY = plotHigh;\n // Store original data labels and set preliminary label\n // objects to be picked up in the uber method\n originalDataLabels[i] = point.dataLabel;\n point.dataLabel = point.dataLabelUpper;\n // Set the default offset\n point.below = up;\n if (inverted) {\n if (!upperDataLabelOptions.align) {\n upperDataLabelOptions.align = up ?\n 'right' : 'left';\n }\n }\n else {\n if (!upperDataLabelOptions.verticalAlign) {\n upperDataLabelOptions.verticalAlign = up ?\n 'top' :\n 'bottom';\n }\n }\n }\n }\n this.options.dataLabels = upperDataLabelOptions;\n if (areaProto.drawDataLabels) {\n // #1209:\n areaProto.drawDataLabels.apply(this, arguments);\n }\n // Reset state after the upper labels were created. Move\n // it to point.dataLabelUpper and reassign the originals.\n // We do this here to support not drawing a lower label.\n i = length;\n while (i--) {\n point = data[i];\n if (point) {\n point.dataLabelUpper = point.dataLabel;\n point.dataLabel = originalDataLabels[i];\n delete point.dataLabels;\n point.y = point.low;\n point.plotY = point._plotY;\n }\n }\n }\n // Draw lower labels\n if (lowerDataLabelOptions.enabled || this.hasDataLabels?.()) {\n i = length;\n while (i--) {\n point = data[i];\n if (point) {\n const { plotHigh = 0, plotLow = 0 } = point;\n up = lowerDataLabelOptions.inside ?\n plotHigh < plotLow :\n plotHigh > plotLow;\n // Set the default offset\n point.below = !up;\n if (inverted) {\n if (!lowerDataLabelOptions.align) {\n lowerDataLabelOptions.align = up ?\n 'left' : 'right';\n }\n }\n else {\n if (!lowerDataLabelOptions.verticalAlign) {\n lowerDataLabelOptions.verticalAlign = up ?\n 'bottom' :\n 'top';\n }\n }\n }\n }\n this.options.dataLabels = lowerDataLabelOptions;\n if (areaProto.drawDataLabels) {\n areaProto.drawDataLabels.apply(this, arguments);\n }\n }\n // Merge upper and lower into point.dataLabels for later destroying\n if (upperDataLabelOptions.enabled) {\n i = length;\n while (i--) {\n point = data[i];\n if (point) {\n point.dataLabels = [\n point.dataLabelUpper,\n point.dataLabel\n ].filter(function (label) {\n return !!label;\n });\n }\n }\n }\n // Reset options\n this.options.dataLabels = dataLabelOptions;\n }\n }\n alignDataLabel() {\n columnProto.alignDataLabel.apply(this, arguments);\n }\n modifyMarkerSettings() {\n const series = this, originalMarkerSettings = {\n marker: series.options.marker,\n symbol: series.symbol\n };\n if (series.options.lowMarker) {\n const { options: { marker, lowMarker } } = series;\n series.options.marker = merge(marker, lowMarker);\n if (lowMarker.symbol) {\n series.symbol = lowMarker.symbol;\n }\n }\n return originalMarkerSettings;\n }\n restoreMarkerSettings(originalSettings) {\n const series = this;\n series.options.marker = originalSettings.marker;\n series.symbol = originalSettings.symbol;\n }\n drawPoints() {\n const series = this, pointLength = series.points.length;\n let i, point;\n const originalSettings = series.modifyMarkerSettings();\n // Draw bottom points\n areaProto.drawPoints.apply(series, arguments);\n // Restore previous state\n series.restoreMarkerSettings(originalSettings);\n // Prepare drawing top points\n i = 0;\n while (i < pointLength) {\n point = series.points[i];\n /**\n * Array for multiple SVG graphics representing the point in the\n * chart. Only used in cases where the point can not be represented\n * by a single graphic.\n *\n * @see Highcharts.Point#graphic\n *\n * @name Highcharts.Point#graphics\n * @type {Array|undefined}\n */\n point.graphics = point.graphics || [];\n // Save original props to be overridden by temporary props for top\n // points\n point.origProps = {\n plotY: point.plotY,\n plotX: point.plotX,\n isInside: point.isInside,\n negative: point.negative,\n zone: point.zone,\n y: point.y\n };\n if (point.graphic || point.graphics[0]) {\n point.graphics[0] = point.graphic;\n }\n point.graphic = point.graphics[1];\n point.plotY = point.plotHigh;\n if (defined(point.plotHighX)) {\n point.plotX = point.plotHighX;\n }\n point.y = pick(point.high, point.origProps.y); // #15523\n point.negative = point.y < (series.options.threshold || 0);\n if (series.zones.length) {\n point.zone = point.getZone();\n }\n if (!series.chart.polar) {\n point.isInside = point.isTopInside = (typeof point.plotY !== 'undefined' &&\n point.plotY >= 0 &&\n point.plotY <= series.yAxis.len && // #3519\n point.plotX >= 0 &&\n point.plotX <= series.xAxis.len);\n }\n i++;\n }\n // Draw top points\n areaProto.drawPoints.apply(series, arguments);\n // Reset top points preliminary modifications\n i = 0;\n while (i < pointLength) {\n point = series.points[i];\n point.graphics = point.graphics || [];\n if (point.graphic || point.graphics[1]) {\n point.graphics[1] = point.graphic;\n }\n point.graphic = point.graphics[0];\n if (point.origProps) {\n extend(point, point.origProps);\n delete point.origProps;\n }\n i++;\n }\n }\n hasMarkerChanged(options, oldOptions) {\n const lowMarker = options.lowMarker, oldMarker = oldOptions.lowMarker || {};\n return (lowMarker && (lowMarker.enabled === false ||\n oldMarker.symbol !== lowMarker.symbol || // #10870, #15946\n oldMarker.height !== lowMarker.height || // #16274\n oldMarker.width !== lowMarker.width // #16274\n )) || super.hasMarkerChanged(options, oldOptions);\n }\n}\n/**\n *\n * Static Properties\n *\n */\nAreaRangeSeries.defaultOptions = merge(AreaSeries.defaultOptions, areaRangeSeriesOptions);\naddEvent(AreaRangeSeries, 'afterTranslate', function () {\n // Set plotLow and plotHigh\n // Rules out lollipop, but lollipop should not inherit range series in the\n // first place\n if (this.pointArrayMap.join(',') === 'low,high') {\n this.points.forEach((point) => {\n const high = point.high, plotY = point.plotY;\n if (point.isNull) {\n point.plotY = void 0;\n }\n else {\n point.plotLow = plotY;\n // Calculate plotHigh value based on each yAxis scale (#15752)\n point.plotHigh = isNumber(high) ? this.yAxis.translate(this.dataModify ?\n this.dataModify.modifyValue(high) : high, false, true, void 0, true) : void 0;\n if (this.dataModify) {\n point.yBottom = point.plotHigh;\n }\n }\n });\n }\n}, { order: 0 });\naddEvent(AreaRangeSeries, 'afterTranslate', function () {\n this.points.forEach((point) => {\n // Postprocessing after the PolarComposition's afterTranslate\n if (this.chart.polar) {\n this.highToXY(point);\n point.plotLow = point.plotY;\n point.tooltipPos = [\n ((point.plotHighX || 0) + (point.plotLowX || 0)) / 2,\n ((point.plotHigh || 0) + (point.plotLow || 0)) / 2\n ];\n // Put the tooltip in the middle of the range\n }\n else {\n const tooltipPos = point.pos(false, point.plotLow), posHigh = point.pos(false, point.plotHigh);\n if (tooltipPos && posHigh) {\n tooltipPos[0] = (tooltipPos[0] + posHigh[0]) / 2;\n tooltipPos[1] = (tooltipPos[1] + posHigh[1]) / 2;\n }\n point.tooltipPos = tooltipPos;\n }\n });\n}, { order: 3 });\nextend(AreaRangeSeries.prototype, {\n deferTranslatePolar: true,\n pointArrayMap: ['low', 'high'],\n pointClass: AreaRangePoint,\n pointValKey: 'low',\n setStackedPoints: noop\n});\nSeriesRegistry.registerSeriesType('arearange', AreaRangeSeries);\n/* *\n *\n * Default Export\n *\n * */\nexport default AreaRangeSeries;\n/* *\n *\n * API Options\n *\n * */\n/**\n * A `arearange` series. If the [type](#series.arearange.type) option is not\n * specified, it is inherited from [chart.type](#chart.type).\n *\n *\n * @extends series,plotOptions.arearange\n * @excluding dataParser, dataURL, stack, stacking\n * @product highcharts highstock\n * @requires highcharts-more\n * @apioption series.arearange\n */\n/**\n * @see [fillColor](#series.arearange.fillColor)\n * @see [fillOpacity](#series.arearange.fillOpacity)\n *\n * @apioption series.arearange.color\n */\n/**\n * An array of data points for the series. For the `arearange` series type,\n * points can be given in the following ways:\n *\n * 1. An array of arrays with 3 or 2 values. In this case, the values\n * correspond to `x,low,high`. If the first value is a string, it is\n * applied as the name of the point, and the `x` value is inferred.\n * The `x` value can also be omitted, in which case the inner arrays\n * should be of length 2\\. Then the `x` value is automatically calculated,\n * either starting at 0 and incremented by 1, or from `pointStart`\n * and `pointInterval` given in the series options.\n * ```js\n * data: [\n * [0, 8, 3],\n * [1, 1, 1],\n * [2, 6, 8]\n * ]\n * ```\n *\n * 2. An array of objects with named values. The following snippet shows only a\n * few settings, see the complete options set below. If the total number of\n * data points exceeds the series'\n * [turboThreshold](#series.arearange.turboThreshold),\n * this option is not available.\n * ```js\n * data: [{\n * x: 1,\n * low: 9,\n * high: 0,\n * name: \"Point2\",\n * color: \"#00FF00\"\n * }, {\n * x: 1,\n * low: 3,\n * high: 4,\n * name: \"Point1\",\n * color: \"#FF00FF\"\n * }]\n * ```\n *\n * @sample {highcharts} highcharts/series/data-array-of-arrays/\n * Arrays of numeric x and y\n * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/\n * Arrays of datetime x and y\n * @sample {highcharts} highcharts/series/data-array-of-name-value/\n * Arrays of point.name and y\n * @sample {highcharts} highcharts/series/data-array-of-objects/\n * Config objects\n *\n * @type {Array|Array<(number|string),number,number>|*>}\n * @extends series.line.data\n * @excluding marker, y\n * @product highcharts highstock\n * @apioption series.arearange.data\n */\n/**\n * @extends series.arearange.dataLabels\n * @product highcharts highstock\n * @apioption series.arearange.data.dataLabels\n */\n/**\n * @see [color](#series.arearange.color)\n * @see [fillOpacity](#series.arearange.fillOpacity)\n *\n * @apioption series.arearange.fillColor\n */\n/**\n * @see [color](#series.arearange.color)\n * @see [fillColor](#series.arearange.fillColor)\n *\n * @default {highcharts} 0.75\n * @default {highstock} 0.75\n * @apioption series.arearange.fillOpacity\n */\n/**\n * Options for the lower markers of the arearange-like series. When `lowMarker`\n * is not defined, options inherit form the marker.\n *\n * @see [marker](#series.arearange.marker)\n *\n * @declare Highcharts.PointMarkerOptionsObject\n * @extends plotOptions.series.marker\n * @default undefined\n * @product highcharts highstock\n * @apioption plotOptions.arearange.lowMarker\n */\n/**\n *\n * @sample {highcharts} highcharts/series-arearange/lowmarker/\n * Area range chart with `lowMarker` option\n *\n * @declare Highcharts.PointMarkerOptionsObject\n * @extends plotOptions.series.marker.symbol\n * @product highcharts highstock\n * @apioption plotOptions.arearange.lowMarker.symbol\n */\n/**\n * The high or maximum value for each data point.\n *\n * @type {number}\n * @product highcharts highstock\n * @apioption series.arearange.data.high\n */\n/**\n * The low or minimum value for each data point.\n *\n * @type {number}\n * @product highcharts highstock\n * @apioption series.arearange.data.low\n */\n''; // adds doclets above to transpiled file\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport AreaRangeSeries from '../AreaRange/AreaRangeSeries.js';\nimport SeriesRegistry from '../../Core/Series/SeriesRegistry.js';\nconst { spline: { prototype: splineProto } } = SeriesRegistry.seriesTypes;\nimport U from '../../Core/Utilities.js';\nconst { merge, extend } = U;\n/* *\n *\n * Class\n *\n * */\n/**\n * The areasplinerange series type.\n *\n * @private\n * @class\n * @name Highcharts.seriesTypes.areasplinerange\n *\n * @augments Highcharts.Series\n */\nclass AreaSplineRangeSeries extends AreaRangeSeries {\n}\n/* *\n *\n * Static Properties\n *\n * */\nAreaSplineRangeSeries.defaultOptions = merge(AreaRangeSeries.defaultOptions);\nextend(AreaSplineRangeSeries.prototype, {\n getPointSpline: splineProto.getPointSpline\n});\nSeriesRegistry.registerSeriesType('areasplinerange', AreaSplineRangeSeries);\n/* *\n *\n * Default Export\n *\n * */\nexport default AreaSplineRangeSeries;\n/* *\n *\n * API Options\n *\n * */\n/**\n * The area spline range is a cartesian series type with higher and\n * lower Y values along an X axis. The area inside the range is colored, and\n * the graph outlining the area is a smoothed spline.\n *\n * @sample {highstock|highstock} stock/demo/areasplinerange/\n * Area spline range\n *\n * @extends plotOptions.arearange\n * @since 2.3.0\n * @excluding step, boostThreshold, boostBlending\n * @product highcharts highstock\n * @requires highcharts-more\n * @apioption plotOptions.areasplinerange\n */\n/**\n * @see [fillColor](#plotOptions.areasplinerange.fillColor)\n * @see [fillOpacity](#plotOptions.areasplinerange.fillOpacity)\n *\n * @apioption plotOptions.areasplinerange.color\n */\n/**\n * @see [color](#plotOptions.areasplinerange.color)\n * @see [fillOpacity](#plotOptions.areasplinerange.fillOpacity)\n *\n * @apioption plotOptions.areasplinerange.fillColor\n */\n/**\n * @see [color](#plotOptions.areasplinerange.color)\n * @see [fillColor](#plotOptions.areasplinerange.fillColor)\n *\n * @default 0.75\n * @apioption plotOptions.areasplinerange.fillOpacity\n */\n/**\n * A `areasplinerange` series. If the [type](#series.areasplinerange.type)\n * option is not specified, it is inherited from [chart.type](#chart.type).\n *\n * @extends series,plotOptions.areasplinerange\n * @excluding dataParser, dataURL, stack, step, boostThreshold, boostBlending\n * @product highcharts highstock\n * @requires highcharts-more\n * @apioption series.areasplinerange\n */\n/**\n * @see [fillColor](#series.areasplinerange.fillColor)\n * @see [fillOpacity](#series.areasplinerange.fillOpacity)\n *\n * @apioption series.areasplinerange.color\n */\n/**\n * An array of data points for the series. For the `areasplinerange`\n * series type, points can be given in the following ways:\n *\n * 1. An array of arrays with 3 or 2 values. In this case, the values correspond\n * to `x,low,high`. If the first value is a string, it is applied as the name\n * of the point, and the `x` value is inferred. The `x` value can also be\n * omitted, in which case the inner arrays should be of length 2\\. Then the\n * `x` value is automatically calculated, either starting at 0 and\n * incremented by 1, or from `pointStart` and `pointInterval` given in the\n * series options.\n * ```js\n * data: [\n * [0, 0, 5],\n * [1, 9, 1],\n * [2, 5, 2]\n * ]\n * ```\n *\n * 2. An array of objects with named values. The following snippet shows only a\n * few settings, see the complete options set below. If the total number of\n * data points exceeds the series'\n * [turboThreshold](#series.areasplinerange.turboThreshold), this option is\n * not available.\n * ```js\n * data: [{\n * x: 1,\n * low: 5,\n * high: 0,\n * name: \"Point2\",\n * color: \"#00FF00\"\n * }, {\n * x: 1,\n * low: 4,\n * high: 1,\n * name: \"Point1\",\n * color: \"#FF00FF\"\n * }]\n * ```\n *\n * @sample {highcharts} highcharts/series/data-array-of-arrays/\n * Arrays of numeric x and y\n * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/\n * Arrays of datetime x and y\n * @sample {highcharts} highcharts/series/data-array-of-name-value/\n * Arrays of point.name and y\n * @sample {highcharts} highcharts/series/data-array-of-objects/\n * Config objects\n *\n * @type {Array|Array<(number|string),number,number>|*>}\n * @extends series.arearange.data\n * @product highcharts highstock\n * @apioption series.areasplinerange.data\n */\n/**\n * @see [color](#series.areasplinerange.color)\n * @see [fillOpacity](#series.areasplinerange.fillOpacity)\n *\n * @apioption series.areasplinerange.fillColor\n */\n/**\n * @see [color](#series.areasplinerange.color)\n * @see [fillColor](#series.areasplinerange.fillColor)\n *\n * @default 0.75\n * @apioption series.areasplinerange.fillOpacity\n */\n''; // adds doclets above to transpiled file\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\n/* *\n *\n * API Options\n *\n * */\n/**\n * A box plot is a convenient way of depicting groups of data through their\n * five-number summaries: the smallest observation (sample minimum), lower\n * quartile (Q1), median (Q2), upper quartile (Q3), and largest observation\n * (sample maximum).\n *\n * @sample highcharts/demo/box-plot/\n * Box plot\n * @sample {highcharts} highcharts/css/boxplot/\n * Box plot in styled mode\n * @sample {highcharts} highcharts/series-scatter/jitter-boxplot\n * Jittered scatter plot on top of a box plot\n *\n * @extends plotOptions.column\n * @excluding borderColor, borderRadius, borderWidth, groupZPadding,\n * states, boostThreshold, boostBlending\n * @product highcharts\n * @requires highcharts-more\n * @optionparent plotOptions.boxplot\n */\nconst BoxPlotSeriesDefaults = {\n /**\n * @type {number|null}\n */\n threshold: null,\n tooltip: {\n pointFormat: '\\u25CF ' +\n '{series.name}
' +\n 'Maximum: {point.high}
' +\n 'Upper quartile: {point.q3}
' +\n 'Median: {point.median}
' +\n 'Lower quartile: {point.q1}
' +\n 'Minimum: {point.low}
'\n },\n /**\n * The length of the whiskers, the horizontal lines marking low and\n * high values. It can be a numerical pixel value, or a percentage\n * value of the box width. Set `0` to disable whiskers.\n *\n * @sample {highcharts} highcharts/plotoptions/box-plot-styling/\n * True by default\n *\n * @type {number|string}\n * @since 3.0\n * @product highcharts\n */\n whiskerLength: '50%',\n /**\n * The fill color of the box.\n *\n * In styled mode, the fill color can be set with the\n * `.highcharts-boxplot-box` class.\n *\n * @sample {highcharts} highcharts/plotoptions/box-plot-styling/\n * Box plot styling\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @default #ffffff\n * @since 3.0\n * @product highcharts\n */\n fillColor: \"#ffffff\" /* Palette.backgroundColor */,\n /**\n * The width of the line surrounding the box. If any of\n * [stemWidth](#plotOptions.boxplot.stemWidth),\n * [medianWidth](#plotOptions.boxplot.medianWidth)\n * or [whiskerWidth](#plotOptions.boxplot.whiskerWidth) are `null`,\n * the lineWidth also applies to these lines.\n *\n * @sample {highcharts} highcharts/plotoptions/box-plot-styling/\n * Box plot styling\n * @sample {highcharts} highcharts/plotoptions/error-bar-styling/\n * Error bar styling\n *\n * @since 3.0\n * @product highcharts\n */\n lineWidth: 1,\n /**\n * The color of the median line. If `undefined`, the general series\n * color applies.\n *\n * In styled mode, the median stroke width can be set with the\n * `.highcharts-boxplot-median` class.\n *\n * @sample {highcharts} highcharts/plotoptions/box-plot-styling/\n * Box plot styling\n * @sample {highcharts} highcharts/css/boxplot/\n * Box plot in styled mode\n * @sample {highcharts} highcharts/plotoptions/error-bar-styling/\n * Error bar styling\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject}\n * @since 3.0\n * @product highcharts\n * @apioption plotOptions.boxplot.medianColor\n */\n /**\n * The pixel width of the median line. If `null`, the\n * [lineWidth](#plotOptions.boxplot.lineWidth) is used.\n *\n * In styled mode, the median stroke width can be set with the\n * `.highcharts-boxplot-median` class.\n *\n * @sample {highcharts} highcharts/plotoptions/box-plot-styling/\n * Box plot styling\n * @sample {highcharts} highcharts/css/boxplot/\n * Box plot in styled mode\n *\n * @type {number|null}\n * @since 3.0\n * @product highcharts\n */\n medianWidth: 2,\n /*\n // States are not working and are removed from docs.\n // Refer to: #2340\n states: {\n hover: {\n brightness: -0.3\n }\n },\n */\n /**\n * The color of the stem, the vertical line extending from the box to\n * the whiskers. If `undefined`, the series color is used.\n *\n * In styled mode, the stem stroke can be set with the\n * `.highcharts-boxplot-stem` class.\n *\n * @sample {highcharts} highcharts/plotoptions/box-plot-styling/\n * Box plot styling\n * @sample {highcharts} highcharts/css/boxplot/\n * Box plot in styled mode\n * @sample {highcharts} highcharts/plotoptions/error-bar-styling/\n * Error bar styling\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @since 3.0\n * @product highcharts\n * @apioption plotOptions.boxplot.stemColor\n */\n /**\n * The dash style of the box.\n *\n * @sample {highcharts} highcharts/plotoptions/box-plot-styling/\n * Box plot styling\n * @sample {highcharts} highcharts/css/boxplot/\n * Box plot in styled mode\n *\n * @type {Highcharts.DashStyleValue}\n * @default Solid\n * @since 8.1.0\n * @product highcharts\n * @apioption plotOptions.boxplot.boxDashStyle\n */\n /**\n * The dash style of the median.\n *\n * @sample {highcharts} highcharts/plotoptions/box-plot-styling/\n * Box plot styling\n * @sample {highcharts} highcharts/css/boxplot/\n * Box plot in styled mode\n *\n * @type {Highcharts.DashStyleValue}\n * @default Solid\n * @since 8.1.0\n * @product highcharts\n * @apioption plotOptions.boxplot.medianDashStyle\n */\n /**\n * The dash style of the stem, the vertical line extending from the\n * box to the whiskers.\n *\n * @sample {highcharts} highcharts/plotoptions/box-plot-styling/\n * Box plot styling\n * @sample {highcharts} highcharts/css/boxplot/\n * Box plot in styled mode\n * @sample {highcharts} highcharts/plotoptions/error-bar-styling/\n * Error bar styling\n *\n * @type {Highcharts.DashStyleValue}\n * @default Solid\n * @since 3.0\n * @product highcharts\n * @apioption plotOptions.boxplot.stemDashStyle\n */\n /**\n * The dash style of the whiskers.\n *\n * @sample {highcharts} highcharts/plotoptions/box-plot-styling/\n * Box plot styling\n * @sample {highcharts} highcharts/css/boxplot/\n * Box plot in styled mode\n *\n * @type {Highcharts.DashStyleValue}\n * @default Solid\n * @since 8.1.0\n * @product highcharts\n * @apioption plotOptions.boxplot.whiskerDashStyle\n */\n /**\n * The width of the stem, the vertical line extending from the box to\n * the whiskers. If `undefined`, the width is inherited from the\n * [lineWidth](#plotOptions.boxplot.lineWidth) option.\n *\n * In styled mode, the stem stroke width can be set with the\n * `.highcharts-boxplot-stem` class.\n *\n * @sample {highcharts} highcharts/plotoptions/box-plot-styling/\n * Box plot styling\n * @sample {highcharts} highcharts/css/boxplot/\n * Box plot in styled mode\n * @sample {highcharts} highcharts/plotoptions/error-bar-styling/\n * Error bar styling\n *\n * @type {number}\n * @since 3.0\n * @product highcharts\n * @apioption plotOptions.boxplot.stemWidth\n */\n /**\n * @default high\n * @apioption plotOptions.boxplot.colorKey\n */\n /**\n * The color of the whiskers, the horizontal lines marking low and high\n * values. When `undefined`, the general series color is used.\n *\n * In styled mode, the whisker stroke can be set with the\n * `.highcharts-boxplot-whisker` class .\n *\n * @sample {highcharts} highcharts/plotoptions/box-plot-styling/\n * Box plot styling\n * @sample {highcharts} highcharts/css/boxplot/\n * Box plot in styled mode\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @since 3.0\n * @product highcharts\n * @apioption plotOptions.boxplot.whiskerColor\n */\n /**\n * The line width of the whiskers, the horizontal lines marking low and\n * high values. When `undefined`, the general\n * [lineWidth](#plotOptions.boxplot.lineWidth) applies.\n *\n * In styled mode, the whisker stroke width can be set with the\n * `.highcharts-boxplot-whisker` class.\n *\n * @sample {highcharts} highcharts/plotoptions/box-plot-styling/\n * Box plot styling\n * @sample {highcharts} highcharts/css/boxplot/\n * Box plot in styled mode\n *\n * @since 3.0\n * @product highcharts\n */\n whiskerWidth: 2\n};\n/**\n * A `boxplot` series. If the [type](#series.boxplot.type) option is\n * not specified, it is inherited from [chart.type](#chart.type).\n *\n * @extends series,plotOptions.boxplot\n * @excluding dataParser, dataURL, marker, stack, stacking, states,\n * boostThreshold, boostBlending\n * @product highcharts\n * @requires highcharts-more\n * @apioption series.boxplot\n */\n/**\n * An array of data points for the series. For the `boxplot` series\n * type, points can be given in the following ways:\n *\n * 1. An array of arrays with 6 or 5 values. In this case, the values correspond\n * to `x,low,q1,median,q3,high`. If the first value is a string, it is\n * applied as the name of the point, and the `x` value is inferred. The `x`\n * value can also be omitted, in which case the inner arrays should be of\n * length 5. Then the `x` value is automatically calculated, either starting\n * at 0 and incremented by 1, or from `pointStart` and `pointInterval` given\n * in the series options.\n * ```js\n * data: [\n * [0, 3, 0, 10, 3, 5],\n * [1, 7, 8, 7, 2, 9],\n * [2, 6, 9, 5, 1, 3]\n * ]\n * ```\n *\n * 2. An array of objects with named values. The following snippet shows only a\n * few settings, see the complete options set below. If the total number of\n * data points exceeds the series'\n * [turboThreshold](#series.boxplot.turboThreshold), this option is not\n * available.\n * ```js\n * data: [{\n * x: 1,\n * low: 4,\n * q1: 9,\n * median: 9,\n * q3: 1,\n * high: 10,\n * name: \"Point2\",\n * color: \"#00FF00\"\n * }, {\n * x: 1,\n * low: 5,\n * q1: 7,\n * median: 3,\n * q3: 6,\n * high: 2,\n * name: \"Point1\",\n * color: \"#FF00FF\"\n * }]\n * ```\n *\n * @sample {highcharts} highcharts/series/data-array-of-arrays/\n * Arrays of numeric x and y\n * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/\n * Arrays of datetime x and y\n * @sample {highcharts} highcharts/series/data-array-of-name-value/\n * Arrays of point.name and y\n * @sample {highcharts} highcharts/series/data-array-of-objects/\n * Config objects\n *\n * @type {Array|Array<(number|string),number,number,number,number,number>|*>}\n * @extends series.line.data\n * @excluding marker\n * @product highcharts\n * @apioption series.boxplot.data\n */\n/**\n * The `high` value for each data point, signifying the highest value\n * in the sample set. The top whisker is drawn here.\n *\n * @type {number}\n * @product highcharts\n * @apioption series.boxplot.data.high\n */\n/**\n * The `low` value for each data point, signifying the lowest value\n * in the sample set. The bottom whisker is drawn here.\n *\n * @type {number}\n * @product highcharts\n * @apioption series.boxplot.data.low\n */\n/**\n * The median for each data point. This is drawn as a line through the\n * middle area of the box.\n *\n * @type {number}\n * @product highcharts\n * @apioption series.boxplot.data.median\n */\n/**\n * The lower quartile for each data point. This is the bottom of the\n * box.\n *\n * @type {number}\n * @product highcharts\n * @apioption series.boxplot.data.q1\n */\n/**\n * The higher quartile for each data point. This is the top of the box.\n *\n * @type {number}\n * @product highcharts\n * @apioption series.boxplot.data.q3\n */\n/**\n * The dash style of the box.\n *\n * @sample {highcharts} highcharts/plotoptions/box-plot-styling/\n * Box plot styling\n * @sample {highcharts} highcharts/css/boxplot/\n * Box plot in styled mode\n *\n * @type {Highcharts.DashStyleValue}\n * @default Solid\n * @since 8.1.0\n * @product highcharts\n * @apioption series.boxplot.data.boxDashStyle\n */\n/**\n * The dash style of the median.\n *\n * @sample {highcharts} highcharts/plotoptions/box-plot-styling/\n * Box plot styling\n * @sample {highcharts} highcharts/css/boxplot/\n * Box plot in styled mode\n *\n * @type {Highcharts.DashStyleValue}\n * @default Solid\n * @since 8.1.0\n * @product highcharts\n * @apioption series.boxplot.data.medianDashStyle\n */\n/**\n * The dash style of the stem.\n *\n * @sample {highcharts} highcharts/plotoptions/box-plot-styling/\n * Box plot styling\n * @sample {highcharts} highcharts/css/boxplot/\n * Box plot in styled mode\n *\n * @type {Highcharts.DashStyleValue}\n * @default Solid\n * @since 8.1.0\n * @product highcharts\n * @apioption series.boxplot.data.stemDashStyle\n */\n/**\n * The dash style of the whiskers.\n *\n * @sample {highcharts} highcharts/plotoptions/box-plot-styling/\n * Box plot styling\n * @sample {highcharts} highcharts/css/boxplot/\n * Box plot in styled mode\n *\n * @type {Highcharts.DashStyleValue}\n * @default Solid\n * @since 8.1.0\n * @product highcharts\n * @apioption series.boxplot.data.whiskerDashStyle\n */\n''; // keeps doclets above separate\n/* *\n *\n * Default Export\n *\n * */\nexport default BoxPlotSeriesDefaults;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport BoxPlotSeriesDefaults from './BoxPlotSeriesDefaults.js';\nimport ColumnSeries from '../Column/ColumnSeries.js';\nimport H from '../../Core/Globals.js';\nconst { noop } = H;\nimport SeriesRegistry from '../../Core/Series/SeriesRegistry.js';\nimport U from '../../Core/Utilities.js';\nconst { extend, merge, pick } = U;\n/* *\n *\n * Class\n *\n * */\n/**\n * The boxplot series type.\n *\n * @private\n * @class\n * @name Highcharts.seriesTypes#boxplot\n *\n * @augments Highcharts.Series\n */\nclass BoxPlotSeries extends ColumnSeries {\n /* *\n *\n * Functions\n *\n * */\n // Get presentational attributes\n pointAttribs() {\n // No attributes should be set on point.graphic which is the group\n return {};\n }\n // Translate data points from raw values x and y to plotX and plotY\n translate() {\n const series = this, yAxis = series.yAxis, pointArrayMap = series.pointArrayMap;\n super.translate.apply(series);\n // do the translation on each point dimension\n series.points.forEach(function (point) {\n pointArrayMap.forEach(function (key) {\n if (point[key] !== null) {\n point[key + 'Plot'] = yAxis.translate(point[key], 0, 1, 0, 1);\n }\n });\n point.plotHigh = point.highPlot; // For data label validation\n });\n }\n /**\n * Draw the data points\n * @private\n */\n drawPoints() {\n const series = this, points = series.points, options = series.options, chart = series.chart, renderer = chart.renderer, \n // error bar inherits this series type but doesn't do quartiles\n doQuartiles = series.doQuartiles !== false, whiskerLength = series.options.whiskerLength;\n let q1Plot, q3Plot, highPlot, lowPlot, medianPlot, medianPath, crispCorr, crispX = 0, boxPath, graphic, width, left, right, halfWidth, pointWiskerLength;\n for (const point of points) {\n graphic = point.graphic;\n const verb = graphic ? 'animate' : 'attr', shapeArgs = point.shapeArgs, boxAttr = {}, stemAttr = {}, whiskersAttr = {}, medianAttr = {}, color = point.color || series.color;\n if (typeof point.plotY !== 'undefined') {\n // crisp vector coordinates\n width = Math.round(shapeArgs.width);\n left = Math.floor(shapeArgs.x);\n right = left + width;\n halfWidth = Math.round(width / 2);\n q1Plot = Math.floor(doQuartiles ? point.q1Plot : point.lowPlot);\n q3Plot = Math.floor(doQuartiles ? point.q3Plot : point.lowPlot);\n highPlot = Math.floor(point.highPlot);\n lowPlot = Math.floor(point.lowPlot);\n if (!graphic) {\n point.graphic = graphic = renderer.g('point')\n .add(series.group);\n point.stem = renderer.path()\n .addClass('highcharts-boxplot-stem')\n .add(graphic);\n if (whiskerLength) {\n point.whiskers = renderer.path()\n .addClass('highcharts-boxplot-whisker')\n .add(graphic);\n }\n if (doQuartiles) {\n point.box = renderer.path(boxPath)\n .addClass('highcharts-boxplot-box')\n .add(graphic);\n }\n point.medianShape = renderer.path(medianPath)\n .addClass('highcharts-boxplot-median')\n .add(graphic);\n }\n if (!chart.styledMode) {\n // Stem attributes\n stemAttr.stroke =\n point.stemColor || options.stemColor || color;\n stemAttr['stroke-width'] = pick(point.stemWidth, options.stemWidth, options.lineWidth);\n stemAttr.dashstyle = (point.stemDashStyle ||\n options.stemDashStyle ||\n options.dashStyle);\n point.stem.attr(stemAttr);\n // Whiskers attributes\n if (whiskerLength) {\n whiskersAttr.stroke = (point.whiskerColor ||\n options.whiskerColor ||\n color);\n whiskersAttr['stroke-width'] = pick(point.whiskerWidth, options.whiskerWidth, options.lineWidth);\n whiskersAttr.dashstyle = (point.whiskerDashStyle ||\n options.whiskerDashStyle ||\n options.dashStyle);\n point.whiskers.attr(whiskersAttr);\n }\n if (doQuartiles) {\n boxAttr.fill = (point.fillColor ||\n options.fillColor ||\n color);\n boxAttr.stroke = options.lineColor || color;\n boxAttr['stroke-width'] = options.lineWidth || 0;\n boxAttr.dashstyle = (point.boxDashStyle ||\n options.boxDashStyle ||\n options.dashStyle);\n point.box.attr(boxAttr);\n }\n // Median attributes\n medianAttr.stroke = (point.medianColor ||\n options.medianColor ||\n color);\n medianAttr['stroke-width'] = pick(point.medianWidth, options.medianWidth, options.lineWidth);\n medianAttr.dashstyle = (point.medianDashStyle ||\n options.medianDashStyle ||\n options.dashStyle);\n point.medianShape.attr(medianAttr);\n }\n let d;\n // The stem\n crispCorr = (point.stem.strokeWidth() % 2) / 2;\n crispX = left + halfWidth + crispCorr;\n d = [\n // stem up\n ['M', crispX, q3Plot],\n ['L', crispX, highPlot],\n // stem down\n ['M', crispX, q1Plot],\n ['L', crispX, lowPlot]\n ];\n point.stem[verb]({ d });\n // The box\n if (doQuartiles) {\n crispCorr = (point.box.strokeWidth() % 2) / 2;\n q1Plot = Math.floor(q1Plot) + crispCorr;\n q3Plot = Math.floor(q3Plot) + crispCorr;\n left += crispCorr;\n right += crispCorr;\n d = [\n ['M', left, q3Plot],\n ['L', left, q1Plot],\n ['L', right, q1Plot],\n ['L', right, q3Plot],\n ['L', left, q3Plot],\n ['Z']\n ];\n point.box[verb]({ d });\n }\n // The whiskers\n if (whiskerLength) {\n crispCorr = (point.whiskers.strokeWidth() % 2) / 2;\n highPlot = highPlot + crispCorr;\n lowPlot = lowPlot + crispCorr;\n pointWiskerLength = (/%$/).test(whiskerLength) ?\n halfWidth * parseFloat(whiskerLength) / 100 :\n whiskerLength / 2;\n d = [\n // High whisker\n ['M', crispX - pointWiskerLength, highPlot],\n ['L', crispX + pointWiskerLength, highPlot],\n // Low whisker\n ['M', crispX - pointWiskerLength, lowPlot],\n ['L', crispX + pointWiskerLength, lowPlot]\n ];\n point.whiskers[verb]({ d });\n }\n // The median\n medianPlot = Math.round(point.medianPlot);\n crispCorr = (point.medianShape.strokeWidth() % 2) / 2;\n medianPlot = medianPlot + crispCorr;\n d = [\n ['M', left, medianPlot],\n ['L', right, medianPlot]\n ];\n point.medianShape[verb]({ d });\n }\n }\n }\n // return a plain array for speedy calculation\n toYData(point) {\n return [point.low, point.q1, point.median, point.q3, point.high];\n }\n}\n/* *\n *\n * Static Properties\n *\n * */\nBoxPlotSeries.defaultOptions = merge(ColumnSeries.defaultOptions, BoxPlotSeriesDefaults);\nextend(BoxPlotSeries.prototype, {\n // array point configs are mapped to this\n pointArrayMap: ['low', 'q1', 'median', 'q3', 'high'],\n // defines the top of the tracker\n pointValKey: 'high',\n // Disable data labels for box plot\n drawDataLabels: noop,\n setStackedPoints: noop // #3890\n});\nSeriesRegistry.registerSeriesType('boxplot', BoxPlotSeries);\n/* *\n *\n * Default Export\n *\n * */\nexport default BoxPlotSeries;\n", "/* *\n *\n * (c) 2010-2024 Highsoft AS\n *\n * Author: Pawe\u0142 Potaczek\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\n/* *\n *\n * Constants\n *\n * */\n/**\n * The bubble legend is an additional element in legend which\n * presents the scale of the bubble series. Individual bubble ranges\n * can be defined by user or calculated from series. In the case of\n * automatically calculated ranges, a 1px margin of error is\n * permitted.\n *\n * @since 7.0.0\n * @product highcharts highstock highmaps\n * @requires highcharts-more\n * @optionparent legend.bubbleLegend\n */\nconst BubbleLegendDefaults = {\n /**\n * The color of the ranges borders, can be also defined for an\n * individual range.\n *\n * @sample highcharts/bubble-legend/similartoseries/\n * Similar look to the bubble series\n * @sample highcharts/bubble-legend/bordercolor/\n * Individual bubble border color\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n */\n borderColor: void 0,\n /**\n * The width of the ranges borders in pixels, can be also\n * defined for an individual range.\n */\n borderWidth: 2,\n /**\n * An additional class name to apply to the bubble legend'\n * circle graphical elements. This option does not replace\n * default class names of the graphical element.\n *\n * @sample {highcharts} highcharts/css/bubble-legend/\n * Styling by CSS\n *\n * @type {string}\n */\n className: void 0,\n /**\n * The main color of the bubble legend. Applies to ranges, if\n * individual color is not defined.\n *\n * @sample highcharts/bubble-legend/similartoseries/\n * Similar look to the bubble series\n * @sample highcharts/bubble-legend/color/\n * Individual bubble color\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n */\n color: void 0,\n /**\n * An additional class name to apply to the bubble legend's\n * connector graphical elements. This option does not replace\n * default class names of the graphical element.\n *\n * @sample {highcharts} highcharts/css/bubble-legend/\n * Styling by CSS\n *\n * @type {string}\n */\n connectorClassName: void 0,\n /**\n * The color of the connector, can be also defined\n * for an individual range.\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n */\n connectorColor: void 0,\n /**\n * The length of the connectors in pixels. If labels are\n * centered, the distance is reduced to 0.\n *\n * @sample highcharts/bubble-legend/connectorandlabels/\n * Increased connector length\n */\n connectorDistance: 60,\n /**\n * The width of the connectors in pixels.\n *\n * @sample highcharts/bubble-legend/connectorandlabels/\n * Increased connector width\n */\n connectorWidth: 1,\n /**\n * Enable or disable the bubble legend.\n */\n enabled: false,\n /**\n * Options for the bubble legend labels.\n */\n labels: {\n /**\n * An additional class name to apply to the bubble legend\n * label graphical elements. This option does not replace\n * default class names of the graphical element.\n *\n * @sample {highcharts} highcharts/css/bubble-legend/\n * Styling by CSS\n *\n * @type {string}\n */\n className: void 0,\n /**\n * Whether to allow data labels to overlap.\n */\n allowOverlap: false,\n /**\n * A format string for the bubble legend labels. Available\n * variables are the same as for `formatter`.\n *\n * @sample highcharts/bubble-legend/format/\n * Add a unit\n *\n * @type {string}\n */\n format: '',\n /**\n * Available `this` properties are:\n *\n * - `this.value`: The bubble value.\n *\n * - `this.radius`: The radius of the bubble range.\n *\n * - `this.center`: The center y position of the range.\n *\n * @type {Highcharts.FormatterCallbackFunction}\n */\n formatter: void 0,\n /**\n * The alignment of the labels compared to the bubble\n * legend. Can be one of `left`, `center` or `right`.\n *\n * @sample highcharts/bubble-legend/connectorandlabels/\n * Labels on left\n *\n * @type {Highcharts.AlignValue}\n */\n align: 'right',\n /**\n * CSS styles for the labels.\n *\n * @type {Highcharts.CSSObject}\n */\n style: {\n /** @ignore-option */\n fontSize: '0.9em',\n /** @ignore-option */\n color: \"#000000\" /* Palette.neutralColor100 */\n },\n /**\n * The x position offset of the label relative to the\n * connector.\n */\n x: 0,\n /**\n * The y position offset of the label relative to the\n * connector.\n */\n y: 0\n },\n /**\n * Maximum bubble legend range size. If values for ranges are\n * not specified, the `minSize` and the `maxSize` are calculated\n * from bubble series.\n */\n maxSize: 60,\n /**\n * Minimum bubble legend range size. If values for ranges are\n * not specified, the `minSize` and the `maxSize` are calculated\n * from bubble series.\n */\n minSize: 10,\n /**\n * The position of the bubble legend in the legend.\n * @sample highcharts/bubble-legend/connectorandlabels/\n * Bubble legend as last item in legend\n */\n legendIndex: 0,\n /**\n * Options for specific range. One range consists of bubble,\n * label and connector.\n *\n * @sample highcharts/bubble-legend/ranges/\n * Manually defined ranges\n * @sample highcharts/bubble-legend/autoranges/\n * Auto calculated ranges\n *\n * @type {Array<*>}\n */\n ranges: {\n /**\n * Range size value, similar to bubble Z data.\n * @type {number}\n */\n value: void 0,\n /**\n * The color of the border for individual range.\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n */\n borderColor: void 0,\n /**\n * The color of the bubble for individual range.\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n */\n color: void 0,\n /**\n * The color of the connector for individual range.\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n */\n connectorColor: void 0\n },\n /**\n * Whether the bubble legend range value should be represented\n * by the area or the width of the bubble. The default, area,\n * corresponds best to the human perception of the size of each\n * bubble.\n *\n * @sample highcharts/bubble-legend/ranges/\n * Size by width\n *\n * @type {Highcharts.BubbleSizeByValue}\n */\n sizeBy: 'area',\n /**\n * When this is true, the absolute value of z determines the\n * size of the bubble. This means that with the default\n * zThreshold of 0, a bubble of value -1 will have the same size\n * as a bubble of value 1, while a bubble of value 0 will have a\n * smaller size according to minSize.\n */\n sizeByAbsoluteValue: false,\n /**\n * Define the visual z index of the bubble legend.\n */\n zIndex: 1,\n /**\n * Ranges with lower value than zThreshold are skipped.\n */\n zThreshold: 0\n};\n/* *\n *\n * Default Export\n *\n * */\nexport default BubbleLegendDefaults;\n", "/* *\n *\n * (c) 2010-2024 Highsoft AS\n *\n * Author: Pawe\u0142 Potaczek\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport Color from '../../Core/Color/Color.js';\nconst { parse: color } = Color;\nimport F from '../../Core/Templating.js';\nimport H from '../../Core/Globals.js';\nconst { noop } = H;\nimport U from '../../Core/Utilities.js';\nconst { arrayMax, arrayMin, isNumber, merge, pick, stableSort } = U;\n/* *\n *\n * Class\n *\n * */\n/**\n * BubbleLegend class.\n *\n * @private\n * @class\n * @name Highcharts.BubbleLegend\n * @param {Highcharts.LegendBubbleLegendOptions} options\n * Options of BubbleLegendItem.\n *\n * @param {Highcharts.Legend} legend\n * Legend of item.\n */\nclass BubbleLegendItem {\n /* *\n *\n * Constructor\n *\n * */\n constructor(options, legend) {\n this.setState = noop;\n this.init(options, legend);\n }\n /* *\n *\n * Functions\n *\n * */\n /**\n * Create basic bubbleLegend properties similar to item in legend.\n * @private\n */\n init(options, legend) {\n this.options = options;\n this.visible = true;\n this.chart = legend.chart;\n this.legend = legend;\n }\n /**\n * Depending on the position option, add bubbleLegend to legend items.\n *\n * @private\n *\n * @param {Array<(Highcharts.Point|Highcharts.Series)>} items\n * All legend items\n */\n addToLegend(items) {\n // Insert bubbleLegend into legend items\n items.splice(this.options.legendIndex, 0, this);\n }\n /**\n * Calculate ranges, sizes and call the next steps of bubbleLegend\n * creation.\n *\n * @private\n *\n * @param {Highcharts.Legend} legend\n * Legend instance\n */\n drawLegendSymbol(legend) {\n const itemDistance = pick(legend.options.itemDistance, 20), legendItem = this.legendItem || {}, options = this.options, ranges = options.ranges, connectorDistance = options.connectorDistance;\n let connectorSpace;\n // Do not create bubbleLegend now if ranges or ranges values are not\n // specified or if are empty array.\n if (!ranges || !ranges.length || !isNumber(ranges[0].value)) {\n legend.options.bubbleLegend.autoRanges = true;\n return;\n }\n // Sort ranges to right render order\n stableSort(ranges, function (a, b) {\n return b.value - a.value;\n });\n this.ranges = ranges;\n this.setOptions();\n this.render();\n // Get max label size\n const maxLabel = this.getMaxLabelSize(), radius = this.ranges[0].radius, size = radius * 2;\n // Space for connectors and labels.\n connectorSpace =\n connectorDistance - radius + maxLabel.width;\n connectorSpace = connectorSpace > 0 ? connectorSpace : 0;\n this.maxLabel = maxLabel;\n this.movementX = options.labels.align === 'left' ?\n connectorSpace : 0;\n legendItem.labelWidth = size + connectorSpace + itemDistance;\n legendItem.labelHeight = size + maxLabel.height / 2;\n }\n /**\n * Set style options for each bubbleLegend range.\n * @private\n */\n setOptions() {\n const ranges = this.ranges, options = this.options, series = this.chart.series[options.seriesIndex], baseline = this.legend.baseline, bubbleAttribs = {\n zIndex: options.zIndex,\n 'stroke-width': options.borderWidth\n }, connectorAttribs = {\n zIndex: options.zIndex,\n 'stroke-width': options.connectorWidth\n }, labelAttribs = {\n align: (this.legend.options.rtl ||\n options.labels.align === 'left') ? 'right' : 'left',\n zIndex: options.zIndex\n }, fillOpacity = series.options.marker.fillOpacity, styledMode = this.chart.styledMode;\n // Allow to parts of styles be used individually for range\n ranges.forEach(function (range, i) {\n if (!styledMode) {\n bubbleAttribs.stroke = pick(range.borderColor, options.borderColor, series.color);\n bubbleAttribs.fill = pick(range.color, options.color, fillOpacity !== 1 ?\n color(series.color).setOpacity(fillOpacity)\n .get('rgba') :\n series.color);\n connectorAttribs.stroke = pick(range.connectorColor, options.connectorColor, series.color);\n }\n // Set options needed for rendering each range\n ranges[i].radius = this.getRangeRadius(range.value);\n ranges[i] = merge(ranges[i], {\n center: (ranges[0].radius - ranges[i].radius +\n baseline)\n });\n if (!styledMode) {\n merge(true, ranges[i], {\n bubbleAttribs: merge(bubbleAttribs),\n connectorAttribs: merge(connectorAttribs),\n labelAttribs: labelAttribs\n });\n }\n }, this);\n }\n /**\n * Calculate radius for each bubble range,\n * used code from BubbleSeries.js 'getRadius' method.\n *\n * @private\n *\n * @param {number} value\n * Range value\n *\n * @return {number|null}\n * Radius for one range\n */\n getRangeRadius(value) {\n const options = this.options, seriesIndex = this.options.seriesIndex, bubbleSeries = this.chart.series[seriesIndex], zMax = options.ranges[0].value, zMin = options.ranges[options.ranges.length - 1].value, minSize = options.minSize, maxSize = options.maxSize;\n return bubbleSeries.getRadius.call(this, zMin, zMax, minSize, maxSize, value);\n }\n /**\n * Render the legendItem group.\n * @private\n */\n render() {\n const legendItem = this.legendItem || {}, renderer = this.chart.renderer, zThreshold = this.options.zThreshold;\n if (!this.symbols) {\n this.symbols = {\n connectors: [],\n bubbleItems: [],\n labels: []\n };\n }\n // Nesting SVG groups to enable handleOverflow\n legendItem.symbol = renderer.g('bubble-legend');\n legendItem.label = renderer.g('bubble-legend-item')\n .css(this.legend.itemStyle || {});\n // To enable default 'hideOverlappingLabels' method\n legendItem.symbol.translateX = 0;\n legendItem.symbol.translateY = 0;\n // To use handleOverflow method\n legendItem.symbol.add(legendItem.label);\n legendItem.label.add(legendItem.group);\n for (const range of this.ranges) {\n if (range.value >= zThreshold) {\n this.renderRange(range);\n }\n }\n this.hideOverlappingLabels();\n }\n /**\n * Render one range, consisting of bubble symbol, connector and label.\n *\n * @private\n *\n * @param {Highcharts.LegendBubbleLegendRangesOptions} range\n * Range options\n */\n renderRange(range) {\n const mainRange = this.ranges[0], legend = this.legend, options = this.options, labelsOptions = options.labels, chart = this.chart, bubbleSeries = chart.series[options.seriesIndex], renderer = chart.renderer, symbols = this.symbols, labels = symbols.labels, elementCenter = range.center, absoluteRadius = Math.abs(range.radius), connectorDistance = options.connectorDistance || 0, labelsAlign = labelsOptions.align, rtl = legend.options.rtl, borderWidth = options.borderWidth, connectorWidth = options.connectorWidth, posX = mainRange.radius || 0, posY = elementCenter - absoluteRadius -\n borderWidth / 2 + connectorWidth / 2, crispMovement = (posY % 1 ? 1 : 0.5) -\n (connectorWidth % 2 ? 0 : 0.5), styledMode = renderer.styledMode;\n let connectorLength = rtl || labelsAlign === 'left' ?\n -connectorDistance : connectorDistance;\n // Set options for centered labels\n if (labelsAlign === 'center') {\n connectorLength = 0; // do not use connector\n options.connectorDistance = 0;\n range.labelAttribs.align = 'center';\n }\n // Render bubble symbol\n symbols.bubbleItems.push(renderer\n .circle(posX, elementCenter + crispMovement, absoluteRadius)\n .attr(styledMode ? {} : range.bubbleAttribs)\n .addClass((styledMode ?\n 'highcharts-color-' +\n bubbleSeries.colorIndex + ' ' :\n '') +\n 'highcharts-bubble-legend-symbol ' +\n (options.className || '')).add(this.legendItem.symbol));\n // Render connector\n symbols.connectors.push(renderer\n .path(renderer.crispLine([\n ['M', posX, posY],\n ['L', posX + connectorLength, posY]\n ], options.connectorWidth))\n .attr((styledMode ? {} : range.connectorAttribs))\n .addClass((styledMode ?\n 'highcharts-color-' +\n this.options.seriesIndex + ' ' : '') +\n 'highcharts-bubble-legend-connectors ' +\n (options.connectorClassName || '')).add(this.legendItem.symbol));\n // Render label\n const label = renderer\n .text(this.formatLabel(range))\n .attr((styledMode ? {} : range.labelAttribs))\n .css(styledMode ? {} : labelsOptions.style)\n .addClass('highcharts-bubble-legend-labels ' +\n (options.labels.className || '')).add(this.legendItem.symbol);\n // Now that the label is added we can read the bounding box and\n // vertically align\n const position = {\n x: posX + connectorLength + options.labels.x,\n y: posY + options.labels.y + label.getBBox().height * 0.4\n };\n label.attr(position);\n labels.push(label);\n // To enable default 'hideOverlappingLabels' method\n label.placed = true;\n label.alignAttr = position;\n }\n /**\n * Get the label which takes up the most space.\n * @private\n */\n getMaxLabelSize() {\n const labels = this.symbols.labels;\n let maxLabel, labelSize;\n labels.forEach(function (label) {\n labelSize = label.getBBox(true);\n if (maxLabel) {\n maxLabel = labelSize.width > maxLabel.width ?\n labelSize : maxLabel;\n }\n else {\n maxLabel = labelSize;\n }\n });\n return maxLabel || {};\n }\n /**\n * Get formatted label for range.\n *\n * @private\n *\n * @param {Highcharts.LegendBubbleLegendRangesOptions} range\n * Range options\n *\n * @return {string}\n * Range label text\n */\n formatLabel(range) {\n const options = this.options, formatter = options.labels.formatter, format = options.labels.format;\n const { numberFormatter } = this.chart;\n return format ? F.format(format, range) :\n formatter ? formatter.call(range) :\n numberFormatter(range.value, 1);\n }\n /**\n * By using default chart 'hideOverlappingLabels' method, hide or show\n * labels and connectors.\n * @private\n */\n hideOverlappingLabels() {\n const chart = this.chart, allowOverlap = this.options.labels.allowOverlap, symbols = this.symbols;\n if (!allowOverlap && symbols) {\n chart.hideOverlappingLabels(symbols.labels);\n // Hide or show connectors\n symbols.labels.forEach(function (label, index) {\n if (!label.newOpacity) {\n symbols.connectors[index].hide();\n }\n else if (label.newOpacity !== label.oldOpacity) {\n symbols.connectors[index].show();\n }\n });\n }\n }\n /**\n * Calculate ranges from created series.\n *\n * @private\n *\n * @return {Array}\n * Array of range objects\n */\n getRanges() {\n const bubbleLegend = this.legend.bubbleLegend, series = bubbleLegend.chart.series, rangesOptions = bubbleLegend.options.ranges;\n let ranges, zData, minZ = Number.MAX_VALUE, maxZ = -Number.MAX_VALUE;\n series.forEach(function (s) {\n // Find the min and max Z, like in bubble series\n if (s.isBubble && !s.ignoreSeries) {\n zData = s.zData.filter(isNumber);\n if (zData.length) {\n minZ = pick(s.options.zMin, Math.min(minZ, Math.max(arrayMin(zData), s.options.displayNegative === false ?\n s.options.zThreshold :\n -Number.MAX_VALUE)));\n maxZ = pick(s.options.zMax, Math.max(maxZ, arrayMax(zData)));\n }\n }\n });\n // Set values for ranges\n if (minZ === maxZ) {\n // Only one range if min and max values are the same.\n ranges = [{ value: maxZ }];\n }\n else {\n ranges = [\n { value: minZ },\n { value: (minZ + maxZ) / 2 },\n { value: maxZ, autoRanges: true }\n ];\n }\n // Prevent reverse order of ranges after redraw\n if (rangesOptions.length && rangesOptions[0].radius) {\n ranges.reverse();\n }\n // Merge ranges values with user options\n ranges.forEach(function (range, i) {\n if (rangesOptions && rangesOptions[i]) {\n ranges[i] = merge(rangesOptions[i], range);\n }\n });\n return ranges;\n }\n /**\n * Calculate bubble legend sizes from rendered series.\n *\n * @private\n *\n * @return {Array}\n * Calculated min and max bubble sizes\n */\n predictBubbleSizes() {\n const chart = this.chart, legendOptions = chart.legend.options, floating = legendOptions.floating, horizontal = legendOptions.layout === 'horizontal', lastLineHeight = horizontal ? chart.legend.lastLineHeight : 0, plotSizeX = chart.plotSizeX, plotSizeY = chart.plotSizeY, bubbleSeries = chart.series[this.options.seriesIndex], pxSizes = bubbleSeries.getPxExtremes(), minSize = Math.ceil(pxSizes.minPxSize), maxPxSize = Math.ceil(pxSizes.maxPxSize), plotSize = Math.min(plotSizeY, plotSizeX);\n let calculatedSize, maxSize = bubbleSeries.options.maxSize;\n // Calculate predicted max size of bubble\n if (floating || !(/%$/.test(maxSize))) {\n calculatedSize = maxPxSize;\n }\n else {\n maxSize = parseFloat(maxSize);\n calculatedSize = ((plotSize + lastLineHeight) * maxSize / 100) /\n (maxSize / 100 + 1);\n // Get maxPxSize from bubble series if calculated bubble legend\n // size will not affect to bubbles series.\n if ((horizontal && plotSizeY - calculatedSize >=\n plotSizeX) || (!horizontal && plotSizeX -\n calculatedSize >= plotSizeY)) {\n calculatedSize = maxPxSize;\n }\n }\n return [minSize, Math.ceil(calculatedSize)];\n }\n /**\n * Correct ranges with calculated sizes.\n * @private\n */\n updateRanges(min, max) {\n const bubbleLegendOptions = this.legend.options.bubbleLegend;\n bubbleLegendOptions.minSize = min;\n bubbleLegendOptions.maxSize = max;\n bubbleLegendOptions.ranges = this.getRanges();\n }\n /**\n * Because of the possibility of creating another legend line, predicted\n * bubble legend sizes may differ by a few pixels, so it is necessary to\n * correct them.\n * @private\n */\n correctSizes() {\n const legend = this.legend, chart = this.chart, bubbleSeries = chart.series[this.options.seriesIndex], pxSizes = bubbleSeries.getPxExtremes(), bubbleSeriesSize = pxSizes.maxPxSize, bubbleLegendSize = this.options.maxSize;\n if (Math.abs(Math.ceil(bubbleSeriesSize) - bubbleLegendSize) >\n 1) {\n this.updateRanges(this.options.minSize, pxSizes.maxPxSize);\n legend.render();\n }\n }\n}\n/* *\n *\n * Default Export\n *\n * */\nexport default BubbleLegendItem;\n/* *\n *\n * API Declarations\n *\n * */\n/**\n * @interface Highcharts.BubbleLegendFormatterContextObject\n */ /**\n* The center y position of the range.\n* @name Highcharts.BubbleLegendFormatterContextObject#center\n* @type {number}\n*/ /**\n* The radius of the bubble range.\n* @name Highcharts.BubbleLegendFormatterContextObject#radius\n* @type {number}\n*/ /**\n* The bubble value.\n* @name Highcharts.BubbleLegendFormatterContextObject#value\n* @type {number}\n*/\n''; // detach doclets above\n", "/* *\n *\n * (c) 2010-2024 Highsoft AS\n *\n * Author: Pawe\u0142 Potaczek\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport BubbleLegendDefaults from './BubbleLegendDefaults.js';\nimport BubbleLegendItem from './BubbleLegendItem.js';\nimport D from '../../Core/Defaults.js';\nconst { setOptions } = D;\nimport H from '../../Core/Globals.js';\nconst { composed } = H;\nimport U from '../../Core/Utilities.js';\nconst { addEvent, objectEach, pushUnique, wrap } = U;\n/* *\n *\n * Functions\n *\n * */\n/**\n * If ranges are not specified, determine ranges from rendered bubble series\n * and render legend again.\n */\nfunction chartDrawChartBox(proceed, options, callback) {\n const chart = this, legend = chart.legend, bubbleSeries = getVisibleBubbleSeriesIndex(chart) >= 0;\n let bubbleLegendOptions, bubbleSizes, legendItem;\n if (legend && legend.options.enabled && legend.bubbleLegend &&\n legend.options.bubbleLegend.autoRanges && bubbleSeries) {\n bubbleLegendOptions = legend.bubbleLegend.options;\n bubbleSizes = legend.bubbleLegend.predictBubbleSizes();\n legend.bubbleLegend.updateRanges(bubbleSizes[0], bubbleSizes[1]);\n // Disable animation on init\n if (!bubbleLegendOptions.placed) {\n legend.group.placed = false;\n legend.allItems.forEach((item) => {\n legendItem = item.legendItem || {};\n if (legendItem.group) {\n legendItem.group.translateY = void 0;\n }\n });\n }\n // Create legend with bubbleLegend\n legend.render();\n chart.getMargins();\n chart.axes.forEach(function (axis) {\n if (axis.visible) { // #11448\n axis.render();\n }\n if (!bubbleLegendOptions.placed) {\n axis.setScale();\n axis.updateNames();\n // Disable axis animation on init\n objectEach(axis.ticks, function (tick) {\n tick.isNew = true;\n tick.isNewLabel = true;\n });\n }\n });\n bubbleLegendOptions.placed = true;\n // After recalculate axes, calculate margins again.\n chart.getMargins();\n // Call default 'drawChartBox' method.\n proceed.call(chart, options, callback);\n // Check bubble legend sizes and correct them if necessary.\n legend.bubbleLegend.correctSizes();\n // Correct items positions with different dimensions in legend.\n retranslateItems(legend, getLinesHeights(legend));\n }\n else {\n proceed.call(chart, options, callback);\n // Allow color change on static bubble legend after click on legend\n if (legend && legend.options.enabled && legend.bubbleLegend) {\n legend.render();\n retranslateItems(legend, getLinesHeights(legend));\n }\n }\n}\n/**\n * Compose classes for use with Bubble series.\n * @private\n *\n * @param {Highcharts.Chart} ChartClass\n * Core chart class to use with Bubble series.\n *\n * @param {Highcharts.Legend} LegendClass\n * Core legend class to use with Bubble series.\n *\n * @param {Highcharts.Series} SeriesClass\n * Core series class to use with Bubble series.\n */\nfunction compose(ChartClass, LegendClass, SeriesClass) {\n if (pushUnique(composed, 'Series.BubbleLegend')) {\n setOptions({\n // Set default bubble legend options\n legend: {\n bubbleLegend: BubbleLegendDefaults\n }\n });\n wrap(ChartClass.prototype, 'drawChartBox', chartDrawChartBox);\n addEvent(LegendClass, 'afterGetAllItems', onLegendAfterGetAllItems);\n addEvent(SeriesClass, 'legendItemClick', onSeriesLegendItemClick);\n }\n}\n/**\n * Check if there is at least one visible bubble series.\n *\n * @private\n * @function getVisibleBubbleSeriesIndex\n * @param {Highcharts.Chart} chart\n * Chart to check.\n * @return {number}\n * First visible bubble series index\n */\nfunction getVisibleBubbleSeriesIndex(chart) {\n const series = chart.series;\n let i = 0;\n while (i < series.length) {\n if (series[i] &&\n series[i].isBubble &&\n series[i].visible &&\n series[i].zData.length) {\n return i;\n }\n i++;\n }\n return -1;\n}\n/**\n * Calculate height for each row in legend.\n *\n * @private\n * @function getLinesHeights\n *\n * @param {Highcharts.Legend} legend\n * Legend to calculate from.\n *\n * @return {Array>}\n * Informations about line height and items amount\n */\nfunction getLinesHeights(legend) {\n const items = legend.allItems, lines = [], length = items.length;\n let lastLine, legendItem, legendItem2, i = 0, j = 0;\n for (i = 0; i < length; i++) {\n legendItem = items[i].legendItem || {};\n legendItem2 = (items[i + 1] || {}).legendItem || {};\n if (legendItem.labelHeight) {\n // for bubbleLegend\n items[i].itemHeight = legendItem.labelHeight;\n }\n if ( // Line break\n items[i] === items[length - 1] ||\n legendItem.y !== legendItem2.y) {\n lines.push({ height: 0 });\n lastLine = lines[lines.length - 1];\n // Find the highest item in line\n for (j; j <= i; j++) {\n if (items[j].itemHeight > lastLine.height) {\n lastLine.height = items[j].itemHeight;\n }\n }\n lastLine.step = i;\n }\n }\n return lines;\n}\n/**\n * Start the bubble legend creation process.\n */\nfunction onLegendAfterGetAllItems(e) {\n const legend = this, bubbleLegend = legend.bubbleLegend, legendOptions = legend.options, options = legendOptions.bubbleLegend, bubbleSeriesIndex = getVisibleBubbleSeriesIndex(legend.chart);\n // Remove unnecessary element\n if (bubbleLegend && bubbleLegend.ranges && bubbleLegend.ranges.length) {\n // Allow change the way of calculating ranges in update\n if (options.ranges.length) {\n options.autoRanges =\n !!options.ranges[0].autoRanges;\n }\n // Update bubbleLegend dimensions in each redraw\n legend.destroyItem(bubbleLegend);\n }\n // Create bubble legend\n if (bubbleSeriesIndex >= 0 &&\n legendOptions.enabled &&\n options.enabled) {\n options.seriesIndex = bubbleSeriesIndex;\n legend.bubbleLegend = new BubbleLegendItem(options, legend);\n legend.bubbleLegend.addToLegend(e.allItems);\n }\n}\n/**\n * Toggle bubble legend depending on the visible status of bubble series.\n */\nfunction onSeriesLegendItemClick(e) {\n // #14080 don't fire this code if click function is prevented\n if (e.defaultPrevented) {\n return false;\n }\n const series = this, chart = series.chart, visible = series.visible, legend = series.chart.legend;\n let status;\n if (legend && legend.bubbleLegend) {\n // Temporary correct 'visible' property\n series.visible = !visible;\n // Save future status for getRanges method\n series.ignoreSeries = visible;\n // Check if at lest one bubble series is visible\n status = getVisibleBubbleSeriesIndex(chart) >= 0;\n // Hide bubble legend if all bubble series are disabled\n if (legend.bubbleLegend.visible !== status) {\n // Show or hide bubble legend\n legend.update({\n bubbleLegend: { enabled: status }\n });\n legend.bubbleLegend.visible = status; // Restore default status\n }\n series.visible = visible;\n }\n}\n/**\n * Correct legend items translation in case of different elements heights.\n *\n * @private\n * @function Highcharts.Legend#retranslateItems\n *\n * @param {Highcharts.Legend} legend\n * Legend to translate in.\n *\n * @param {Array>} lines\n * Informations about line height and items amount\n */\nfunction retranslateItems(legend, lines) {\n const items = legend.allItems, rtl = legend.options.rtl;\n let orgTranslateX, orgTranslateY, movementX, legendItem, actualLine = 0;\n items.forEach((item, index) => {\n legendItem = item.legendItem || {};\n if (!legendItem.group) {\n return;\n }\n orgTranslateX = legendItem.group.translateX || 0;\n orgTranslateY = legendItem.y || 0;\n movementX = item.movementX;\n if (movementX || (rtl && item.ranges)) {\n movementX = rtl ?\n orgTranslateX - item.options.maxSize / 2 :\n orgTranslateX + movementX;\n legendItem.group.attr({ translateX: movementX });\n }\n if (index > lines[actualLine].step) {\n actualLine++;\n }\n legendItem.group.attr({\n translateY: Math.round(orgTranslateY + lines[actualLine].height / 2)\n });\n legendItem.y = orgTranslateY + lines[actualLine].height / 2;\n });\n}\n/* *\n *\n * Default Export\n *\n * */\nconst BubbleLegendComposition = {\n compose\n};\nexport default BubbleLegendComposition;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport Point from '../../Core/Series/Point.js';\nimport SeriesRegistry from '../../Core/Series/SeriesRegistry.js';\nconst { seriesTypes: { scatter: { prototype: { pointClass: ScatterPoint } } } } = SeriesRegistry;\nimport U from '../../Core/Utilities.js';\nconst { extend } = U;\n/* *\n *\n * Class\n *\n * */\nclass BubblePoint extends ScatterPoint {\n /* *\n *\n * Functions\n *\n * */\n /* eslint-disable valid-jsdoc */\n /**\n * @private\n */\n haloPath(size) {\n return Point.prototype.haloPath.call(this, \n // #6067\n size === 0 ? 0 : (this.marker ? this.marker.radius || 0 : 0) + size);\n }\n}\n/* *\n *\n * Class Prototype\n *\n * */\nextend(BubblePoint.prototype, {\n ttBelow: false\n});\n/* *\n *\n * Default Export\n *\n * */\nexport default BubblePoint;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport BubbleLegendComposition from './BubbleLegendComposition.js';\nimport BubblePoint from './BubblePoint.js';\nimport Color from '../../Core/Color/Color.js';\nconst { parse: color } = Color;\nimport H from '../../Core/Globals.js';\nconst { composed, noop } = H;\nimport SeriesRegistry from '../../Core/Series/SeriesRegistry.js';\nconst { series: Series, seriesTypes: { column: { prototype: columnProto }, scatter: ScatterSeries } } = SeriesRegistry;\nimport U from '../../Core/Utilities.js';\nconst { addEvent, arrayMax, arrayMin, clamp, extend, isNumber, merge, pick, pushUnique } = U;\n/* *\n *\n * Functions\n *\n * */\n/**\n * Add logic to pad each axis with the amount of pixels necessary to avoid the\n * bubbles to overflow.\n */\nfunction onAxisFoundExtremes() {\n const axisLength = this.len, { coll, isXAxis, min } = this, dataKey = isXAxis ? 'xData' : 'yData', range = (this.max || 0) - (min || 0);\n let pxMin = 0, pxMax = axisLength, transA = axisLength / range, hasActiveSeries;\n if (coll !== 'xAxis' && coll !== 'yAxis') {\n return;\n }\n // Handle padding on the second pass, or on redraw\n this.series.forEach((series) => {\n if (series.bubblePadding && series.reserveSpace()) {\n // Correction for #1673\n this.allowZoomOutside = true;\n hasActiveSeries = true;\n const data = series[dataKey];\n if (isXAxis) {\n (series.onPoint || series).getRadii(0, 0, series);\n if (series.onPoint) {\n series.radii = series.onPoint.radii;\n }\n }\n if (range > 0) {\n let i = data.length;\n while (i--) {\n if (isNumber(data[i]) &&\n this.dataMin <= data[i] &&\n data[i] <= this.max) {\n const radius = series.radii && series.radii[i] || 0;\n pxMin = Math.min(((data[i] - min) * transA) - radius, pxMin);\n pxMax = Math.max(((data[i] - min) * transA) + radius, pxMax);\n }\n }\n }\n }\n });\n // Apply the padding to the min and max properties\n if (hasActiveSeries && range > 0 && !this.logarithmic) {\n pxMax -= axisLength;\n transA *= (axisLength +\n Math.max(0, pxMin) - // #8901\n Math.min(pxMax, axisLength)) / axisLength;\n [\n ['min', 'userMin', pxMin],\n ['max', 'userMax', pxMax]\n ].forEach((keys) => {\n if (typeof pick(this.options[keys[0]], this[keys[1]]) === 'undefined') {\n this[keys[0]] += keys[2] / transA;\n }\n });\n }\n}\n/* *\n *\n * Class\n *\n * */\nclass BubbleSeries extends ScatterSeries {\n /* *\n *\n * Static Functions\n *\n * */\n static compose(AxisClass, ChartClass, LegendClass, SeriesClass) {\n BubbleLegendComposition.compose(ChartClass, LegendClass, SeriesClass);\n if (pushUnique(composed, 'Series.Bubble')) {\n addEvent(AxisClass, 'foundExtremes', onAxisFoundExtremes);\n }\n }\n /* *\n *\n * Functions\n *\n * */\n /**\n * Perform animation on the bubbles\n * @private\n */\n animate(init) {\n if (!init &&\n this.points.length < this.options.animationLimit // #8099\n ) {\n this.points.forEach(function (point) {\n const { graphic } = point;\n if (graphic && graphic.width) { // URL symbols don't have width\n // Start values\n if (!this.hasRendered) {\n graphic.attr({\n x: point.plotX,\n y: point.plotY,\n width: 1,\n height: 1\n });\n }\n // Run animation\n graphic.animate(this.markerAttribs(point), this.options.animation);\n }\n }, this);\n }\n }\n /**\n * Get the radius for each point based on the minSize, maxSize and each\n * point's Z value. This must be done prior to Series.translate because\n * the axis needs to add padding in accordance with the point sizes.\n * @private\n */\n getRadii() {\n const zData = this.zData, yData = this.yData, radii = [];\n let len, i, value, zExtremes = this.chart.bubbleZExtremes;\n const { minPxSize, maxPxSize } = this.getPxExtremes();\n // Get the collective Z extremes of all bubblish series. The chart-level\n // `bubbleZExtremes` are only computed once, and reset on `updatedData`\n // in any member series.\n if (!zExtremes) {\n let zMin = Number.MAX_VALUE;\n let zMax = -Number.MAX_VALUE;\n let valid;\n this.chart.series.forEach((otherSeries) => {\n if (otherSeries.bubblePadding && otherSeries.reserveSpace()) {\n const zExtremes = (otherSeries.onPoint || otherSeries).getZExtremes();\n if (zExtremes) {\n // Changed '||' to 'pick' because min or max can be 0.\n // #17280\n zMin = Math.min(pick(zMin, zExtremes.zMin), zExtremes.zMin);\n zMax = Math.max(pick(zMax, zExtremes.zMax), zExtremes.zMax);\n valid = true;\n }\n }\n });\n if (valid) {\n zExtremes = { zMin, zMax };\n this.chart.bubbleZExtremes = zExtremes;\n }\n else {\n zExtremes = { zMin: 0, zMax: 0 };\n }\n }\n // Set the shape type and arguments to be picked up in drawPoints\n for (i = 0, len = zData.length; i < len; i++) {\n value = zData[i];\n // Separate method to get individual radius for bubbleLegend\n radii.push(this.getRadius(zExtremes.zMin, zExtremes.zMax, minPxSize, maxPxSize, value, yData && yData[i]));\n }\n this.radii = radii;\n }\n /**\n * Get the individual radius for one point.\n * @private\n */\n getRadius(zMin, zMax, minSize, maxSize, value, yValue) {\n const options = this.options, sizeByArea = options.sizeBy !== 'width', zThreshold = options.zThreshold;\n let zRange = zMax - zMin, pos = 0.5;\n // #8608 - bubble should be visible when z is undefined\n if (yValue === null || value === null) {\n return null;\n }\n if (isNumber(value)) {\n // When sizing by threshold, the absolute value of z determines\n // the size of the bubble.\n if (options.sizeByAbsoluteValue) {\n value = Math.abs(value - zThreshold);\n zMax = zRange = Math.max(zMax - zThreshold, Math.abs(zMin - zThreshold));\n zMin = 0;\n }\n // Issue #4419 - if value is less than zMin, push a radius that's\n // always smaller than the minimum size\n if (value < zMin) {\n return minSize / 2 - 1;\n }\n // Relative size, a number between 0 and 1\n if (zRange > 0) {\n pos = (value - zMin) / zRange;\n }\n }\n if (sizeByArea && pos >= 0) {\n pos = Math.sqrt(pos);\n }\n return Math.ceil(minSize + pos * (maxSize - minSize)) / 2;\n }\n /**\n * Define hasData function for non-cartesian series.\n * Returns true if the series has points at all.\n * @private\n */\n hasData() {\n return !!this.processedXData.length; // != 0\n }\n /**\n * @private\n */\n pointAttribs(point, state) {\n const markerOptions = this.options.marker, fillOpacity = markerOptions.fillOpacity, attr = Series.prototype.pointAttribs.call(this, point, state);\n if (fillOpacity !== 1) {\n attr.fill = color(attr.fill)\n .setOpacity(fillOpacity)\n .get('rgba');\n }\n return attr;\n }\n /**\n * Extend the base translate method to handle bubble size\n * @private\n */\n translate() {\n // Run the parent method\n super.translate.call(this);\n this.getRadii();\n this.translateBubble();\n }\n translateBubble() {\n const { data, options, radii } = this, { minPxSize } = this.getPxExtremes();\n // Set the shape type and arguments to be picked up in drawPoints\n let i = data.length;\n while (i--) {\n const point = data[i];\n const radius = radii ? radii[i] : 0; // #1737\n // Negative points means negative z values (#9728)\n if (this.zoneAxis === 'z') {\n point.negative = (point.z || 0) < (options.zThreshold || 0);\n }\n if (isNumber(radius) && radius >= minPxSize / 2) {\n // Shape arguments\n point.marker = extend(point.marker, {\n radius,\n width: 2 * radius,\n height: 2 * radius\n });\n // Alignment box for the data label\n point.dlBox = {\n x: point.plotX - radius,\n y: point.plotY - radius,\n width: 2 * radius,\n height: 2 * radius\n };\n }\n else { // below zThreshold\n // #1691\n point.shapeArgs = point.plotY = point.dlBox = void 0;\n point.isInside = false; // #17281\n }\n }\n }\n getPxExtremes() {\n const smallestSize = Math.min(this.chart.plotWidth, this.chart.plotHeight);\n const getPxSize = (length) => {\n let isPercent;\n if (typeof length === 'string') {\n isPercent = /%$/.test(length);\n length = parseInt(length, 10);\n }\n return isPercent ? smallestSize * length / 100 : length;\n };\n const minPxSize = getPxSize(pick(this.options.minSize, 8));\n // Prioritize min size if conflict to make sure bubbles are\n // always visible. #5873\n const maxPxSize = Math.max(getPxSize(pick(this.options.maxSize, '20%')), minPxSize);\n return { minPxSize, maxPxSize };\n }\n getZExtremes() {\n const options = this.options, zData = (this.zData || []).filter(isNumber);\n if (zData.length) {\n const zMin = pick(options.zMin, clamp(arrayMin(zData), options.displayNegative === false ?\n (options.zThreshold || 0) :\n -Number.MAX_VALUE, Number.MAX_VALUE));\n const zMax = pick(options.zMax, arrayMax(zData));\n if (isNumber(zMin) && isNumber(zMax)) {\n return { zMin, zMax };\n }\n }\n }\n}\n/* *\n *\n * Static Properties\n *\n * */\n/**\n * A bubble series is a three dimensional series type where each point\n * renders an X, Y and Z value. Each points is drawn as a bubble where the\n * position along the X and Y axes mark the X and Y values, and the size of\n * the bubble relates to the Z value.\n *\n * @sample {highcharts} highcharts/demo/bubble/\n * Bubble chart\n *\n * @extends plotOptions.scatter\n * @excluding cluster\n * @product highcharts highstock\n * @requires highcharts-more\n * @optionparent plotOptions.bubble\n */\nBubbleSeries.defaultOptions = merge(ScatterSeries.defaultOptions, {\n dataLabels: {\n formatter: function () {\n const { numberFormatter } = this.series.chart;\n const { z } = this.point;\n return isNumber(z) ? numberFormatter(z, -1) : '';\n },\n inside: true,\n verticalAlign: 'middle'\n },\n /**\n * If there are more points in the series than the `animationLimit`, the\n * animation won't run. Animation affects overall performance and\n * doesn't work well with heavy data series.\n *\n * @since 6.1.0\n */\n animationLimit: 250,\n /**\n * Whether to display negative sized bubbles. The threshold is given\n * by the [zThreshold](#plotOptions.bubble.zThreshold) option, and negative\n * bubbles can be visualized by setting\n * [negativeColor](#plotOptions.bubble.negativeColor).\n *\n * @sample {highcharts} highcharts/plotoptions/bubble-negative/\n * Negative bubbles\n *\n * @type {boolean}\n * @default true\n * @since 3.0\n * @apioption plotOptions.bubble.displayNegative\n */\n /**\n * @extends plotOptions.series.marker\n * @excluding enabled, enabledThreshold, height, radius, width\n */\n marker: {\n lineColor: null,\n lineWidth: 1,\n /**\n * The fill opacity of the bubble markers.\n */\n fillOpacity: 0.5,\n /**\n * In bubble charts, the radius is overridden and determined based\n * on the point's data value.\n *\n * @ignore-option\n */\n radius: null,\n states: {\n hover: {\n radiusPlus: 0\n }\n },\n /**\n * A predefined shape or symbol for the marker. Possible values are\n * \"circle\", \"square\", \"diamond\", \"triangle\" and \"triangle-down\".\n *\n * Additionally, the URL to a graphic can be given on the form\n * `url(graphic.png)`. Note that for the image to be applied to\n * exported charts, its URL needs to be accessible by the export\n * server.\n *\n * Custom callbacks for symbol path generation can also be added to\n * `Highcharts.SVGRenderer.prototype.symbols`. The callback is then\n * used by its method name, as shown in the demo.\n *\n * @sample {highcharts} highcharts/plotoptions/bubble-symbol/\n * Bubble chart with various symbols\n * @sample {highcharts} highcharts/plotoptions/series-marker-symbol/\n * General chart with predefined, graphic and custom markers\n *\n * @type {Highcharts.SymbolKeyValue|string}\n * @since 5.0.11\n */\n symbol: 'circle'\n },\n /**\n * Minimum bubble size. Bubbles will automatically size between the\n * `minSize` and `maxSize` to reflect the `z` value of each bubble.\n * Can be either pixels (when no unit is given), or a percentage of\n * the smallest one of the plot width and height.\n *\n * @sample {highcharts} highcharts/plotoptions/bubble-size/\n * Bubble size\n *\n * @type {number|string}\n * @since 3.0\n * @product highcharts highstock\n */\n minSize: 8,\n /**\n * Maximum bubble size. Bubbles will automatically size between the\n * `minSize` and `maxSize` to reflect the `z` value of each bubble.\n * Can be either pixels (when no unit is given), or a percentage of\n * the smallest one of the plot width and height.\n *\n * @sample {highcharts} highcharts/plotoptions/bubble-size/\n * Bubble size\n *\n * @type {number|string}\n * @since 3.0\n * @product highcharts highstock\n */\n maxSize: '20%',\n /**\n * When a point's Z value is below the\n * [zThreshold](#plotOptions.bubble.zThreshold)\n * setting, this color is used.\n *\n * @sample {highcharts} highcharts/plotoptions/bubble-negative/\n * Negative bubbles\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @since 3.0\n * @product highcharts\n * @apioption plotOptions.bubble.negativeColor\n */\n /**\n * Whether the bubble's value should be represented by the area or the\n * width of the bubble. The default, `area`, corresponds best to the\n * human perception of the size of each bubble.\n *\n * @sample {highcharts} highcharts/plotoptions/bubble-sizeby/\n * Comparison of area and size\n *\n * @type {Highcharts.BubbleSizeByValue}\n * @default area\n * @since 3.0.7\n * @apioption plotOptions.bubble.sizeBy\n */\n /**\n * When this is true, the absolute value of z determines the size of\n * the bubble. This means that with the default `zThreshold` of 0, a\n * bubble of value -1 will have the same size as a bubble of value 1,\n * while a bubble of value 0 will have a smaller size according to\n * `minSize`.\n *\n * @sample {highcharts} highcharts/plotoptions/bubble-sizebyabsolutevalue/\n * Size by absolute value, various thresholds\n *\n * @type {boolean}\n * @default false\n * @since 4.1.9\n * @product highcharts\n * @apioption plotOptions.bubble.sizeByAbsoluteValue\n */\n /**\n * When this is true, the series will not cause the Y axis to cross\n * the zero plane (or [threshold](#plotOptions.series.threshold) option)\n * unless the data actually crosses the plane.\n *\n * For example, if `softThreshold` is `false`, a series of 0, 1, 2,\n * 3 will make the Y axis show negative values according to the\n * `minPadding` option. If `softThreshold` is `true`, the Y axis starts\n * at 0.\n *\n * @since 4.1.9\n * @product highcharts\n */\n softThreshold: false,\n states: {\n hover: {\n halo: {\n size: 5\n }\n }\n },\n tooltip: {\n pointFormat: '({point.x}, {point.y}), Size: {point.z}'\n },\n turboThreshold: 0,\n /**\n * The minimum for the Z value range. Defaults to the highest Z value\n * in the data.\n *\n * @see [zMin](#plotOptions.bubble.zMin)\n *\n * @sample {highcharts} highcharts/plotoptions/bubble-zmin-zmax/\n * Z has a possible range of 0-100\n *\n * @type {number}\n * @since 4.0.3\n * @product highcharts\n * @apioption plotOptions.bubble.zMax\n */\n /**\n * @default z\n * @apioption plotOptions.bubble.colorKey\n */\n /**\n * The minimum for the Z value range. Defaults to the lowest Z value\n * in the data.\n *\n * @see [zMax](#plotOptions.bubble.zMax)\n *\n * @sample {highcharts} highcharts/plotoptions/bubble-zmin-zmax/\n * Z has a possible range of 0-100\n *\n * @type {number}\n * @since 4.0.3\n * @product highcharts\n * @apioption plotOptions.bubble.zMin\n */\n /**\n * When [displayNegative](#plotOptions.bubble.displayNegative) is `false`,\n * bubbles with lower Z values are skipped. When `displayNegative`\n * is `true` and a [negativeColor](#plotOptions.bubble.negativeColor)\n * is given, points with lower Z is colored.\n *\n * @sample {highcharts} highcharts/plotoptions/bubble-negative/\n * Negative bubbles\n *\n * @since 3.0\n * @product highcharts\n */\n zThreshold: 0,\n zoneAxis: 'z'\n});\nextend(BubbleSeries.prototype, {\n alignDataLabel: columnProto.alignDataLabel,\n applyZones: noop,\n bubblePadding: true,\n isBubble: true,\n pointArrayMap: ['y', 'z'],\n pointClass: BubblePoint,\n parallelArrays: ['x', 'y', 'z'],\n trackerGroups: ['group', 'dataLabelsGroup'],\n specialGroup: 'group',\n zoneAxis: 'z'\n});\n// On updated data in any series, delete the chart-level Z extremes cache\naddEvent(BubbleSeries, 'updatedData', (e) => {\n delete e.target.chart.bubbleZExtremes;\n});\n// After removing series, delete the chart-level Z extremes cache, #17502.\naddEvent(BubbleSeries, 'remove', (e) => {\n delete e.target.chart.bubbleZExtremes;\n});\nSeriesRegistry.registerSeriesType('bubble', BubbleSeries);\n/* *\n *\n * Default Export\n *\n * */\nexport default BubbleSeries;\n/* *\n *\n * API Declarations\n *\n * */\n/**\n * @typedef {\"area\"|\"width\"} Highcharts.BubbleSizeByValue\n */\n''; // detach doclets above\n/* *\n *\n * API Options\n *\n * */\n/**\n * A `bubble` series. If the [type](#series.bubble.type) option is\n * not specified, it is inherited from [chart.type](#chart.type).\n *\n * @extends series,plotOptions.bubble\n * @excluding dataParser, dataURL, stack\n * @product highcharts highstock\n * @requires highcharts-more\n * @apioption series.bubble\n */\n/**\n * An array of data points for the series. For the `bubble` series type,\n * points can be given in the following ways:\n *\n * 1. An array of arrays with 3 or 2 values. In this case, the values correspond\n * to `x,y,z`. If the first value is a string, it is applied as the name of\n * the point, and the `x` value is inferred. The `x` value can also be\n * omitted, in which case the inner arrays should be of length 2\\. Then the\n * `x` value is automatically calculated, either starting at 0 and\n * incremented by 1, or from `pointStart` and `pointInterval` given in the\n * series options.\n * ```js\n * data: [\n * [0, 1, 2],\n * [1, 5, 5],\n * [2, 0, 2]\n * ]\n * ```\n *\n * 2. An array of objects with named values. The following snippet shows only a\n * few settings, see the complete options set below. If the total number of\n * data points exceeds the series'\n * [turboThreshold](#series.bubble.turboThreshold), this option is not\n * available.\n * ```js\n * data: [{\n * x: 1,\n * y: 1,\n * z: 1,\n * name: \"Point2\",\n * color: \"#00FF00\"\n * }, {\n * x: 1,\n * y: 5,\n * z: 4,\n * name: \"Point1\",\n * color: \"#FF00FF\"\n * }]\n * ```\n *\n * @sample {highcharts} highcharts/series/data-array-of-arrays/\n * Arrays of numeric x and y\n * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/\n * Arrays of datetime x and y\n * @sample {highcharts} highcharts/series/data-array-of-name-value/\n * Arrays of point.name and y\n * @sample {highcharts} highcharts/series/data-array-of-objects/\n * Config objects\n *\n * @type {Array|Array<(number|string),number,number>|*>}\n * @extends series.line.data\n * @product highcharts\n * @apioption series.bubble.data\n */\n/**\n * @extends series.line.data.marker\n * @excluding enabledThreshold, height, radius, width\n * @product highcharts\n * @apioption series.bubble.data.marker\n */\n/**\n * The size value for each bubble. The bubbles' diameters are computed\n * based on the `z`, and controlled by series options like `minSize`,\n * `maxSize`, `sizeBy`, `zMin` and `zMax`.\n *\n * @type {number|null}\n * @product highcharts\n * @apioption series.bubble.data.z\n */\n/**\n * @excluding enabled, enabledThreshold, height, radius, width\n * @apioption series.bubble.marker\n */\n''; // adds doclets above to transpiled file\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport SeriesRegistry from '../../Core/Series/SeriesRegistry.js';\nconst { seriesTypes: { column: { prototype: { pointClass: { prototype: columnProto } } }, arearange: { prototype: { pointClass: AreaRangePoint } } } } = SeriesRegistry;\nimport U from '../../Core/Utilities.js';\nconst { extend, isNumber } = U;\n/* *\n *\n * Class\n *\n * */\nclass ColumnRangePoint extends AreaRangePoint {\n /* *\n *\n * Functions\n *\n * */\n isValid() {\n return isNumber(this.low);\n }\n}\nextend(ColumnRangePoint.prototype, {\n setState: columnProto.setState\n});\n/* *\n *\n * Default Export\n *\n * */\nexport default ColumnRangePoint;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport ColumnRangePoint from './ColumnRangePoint.js';\nimport H from '../../Core/Globals.js';\nconst { noop } = H;\nimport SeriesRegistry from '../../Core/Series/SeriesRegistry.js';\nconst { seriesTypes: { arearange: AreaRangeSeries, column: ColumnSeries, column: { prototype: columnProto } } } = SeriesRegistry;\nimport U from '../../Core/Utilities.js';\nconst { addEvent, clamp, extend, isNumber, merge, pick } = U;\n/* *\n *\n * Constants\n *\n * */\n/**\n * The column range is a cartesian series type with higher and lower\n * Y values along an X axis. To display horizontal bars, set\n * [chart.inverted](#chart.inverted) to `true`.\n *\n * @sample {highcharts|highstock} highcharts/demo/columnrange/\n * Inverted column range\n *\n * @extends plotOptions.column\n * @since 2.3.0\n * @excluding negativeColor, stacking, softThreshold, threshold\n * @product highcharts highstock\n * @requires highcharts-more\n * @optionparent plotOptions.columnrange\n */\nconst columnRangeOptions = {\n borderRadius: {\n where: 'all'\n },\n /**\n * Extended data labels for range series types. Range series data labels\n * have no `x` and `y` options. Instead, they have `xLow`, `xHigh`,\n * `yLow` and `yHigh` options to allow the higher and lower data label\n * sets individually.\n *\n * @declare Highcharts.SeriesAreaRangeDataLabelsOptionsObject\n * @extends plotOptions.arearange.dataLabels\n * @since 2.3.0\n * @product highcharts highstock\n * @apioption plotOptions.columnrange.dataLabels\n */\n pointRange: null,\n legendSymbol: 'rectangle',\n /** @ignore-option */\n marker: null,\n states: {\n hover: {\n /** @ignore-option */\n halo: false\n }\n }\n};\n/* *\n *\n * Class\n *\n * */\n/**\n * The ColumnRangeSeries class\n *\n * @private\n * @class\n * @name Highcharts.seriesTypes.columnrange\n *\n * @augments Highcharts.Series\n */\nclass ColumnRangeSeries extends AreaRangeSeries {\n /* *\n *\n * Functions\n *\n * */\n setOptions() {\n // #14359 Prevent side-effect from stacking.\n merge(true, arguments[0], { stacking: void 0 });\n return AreaRangeSeries.prototype.setOptions.apply(this, arguments);\n }\n // Overrides from modules that may be loaded after this module\n // @todo move to compositions\n translate() {\n return columnProto.translate.apply(this);\n }\n // public crispCol(): BBoxObject {\n // return columnProto.crispCol.apply(this, arguments as any);\n // }\n // public drawPoints(): void {\n // return columnProto.drawPoints.apply(this, arguments as any);\n // }\n // public drawTracker(): void {\n // return columnProto.drawTracker.apply(this, arguments as any);\n // }\n // public getColumnMetrics(): ColumnMetricsObject {\n // return columnProto.getColumnMetrics.apply(this, arguments as any);\n // }\n pointAttribs() {\n return columnProto.pointAttribs.apply(this, arguments);\n }\n // public adjustForMissingColumns(): number {\n // return columnProto.adjustForMissingColumns.apply(this, arguments);\n // }\n // public animate(): void {\n // return columnProto.animate.apply(this, arguments as any);\n // }\n translate3dPoints() {\n return columnProto.translate3dPoints.apply(this, arguments);\n }\n translate3dShapes() {\n return columnProto.translate3dShapes.apply(this, arguments);\n }\n afterColumnTranslate() {\n /**\n * Translate data points from raw values x and y to plotX and plotY\n * @private\n */\n const yAxis = this.yAxis, xAxis = this.xAxis, startAngleRad = xAxis.startAngleRad, chart = this.chart, isRadial = this.xAxis.isRadial, safeDistance = Math.max(chart.chartWidth, chart.chartHeight) + 999;\n let height, heightDifference, start, y;\n // eslint-disable-next-line valid-jsdoc\n /**\n * Don't draw too far outside plot area (#6835)\n * @private\n */\n function safeBounds(pixelPos) {\n return clamp(pixelPos, -safeDistance, safeDistance);\n }\n // Set plotLow and plotHigh\n this.points.forEach((point) => {\n const shapeArgs = point.shapeArgs || {}, minPointLength = this.options.minPointLength, plotY = point.plotY, plotHigh = yAxis.translate(point.high, 0, 1, 0, 1);\n if (isNumber(plotHigh) && isNumber(plotY)) {\n point.plotHigh = safeBounds(plotHigh);\n point.plotLow = safeBounds(plotY);\n // adjust shape\n y = point.plotHigh;\n height = pick(point.rectPlotY, point.plotY) - point.plotHigh;\n // Adjust for minPointLength\n if (Math.abs(height) < minPointLength) {\n heightDifference = (minPointLength - height);\n height += heightDifference;\n y -= heightDifference / 2;\n // Adjust for negative ranges or reversed Y axis (#1457)\n }\n else if (height < 0) {\n height *= -1;\n y -= height;\n }\n if (isRadial && this.polar) {\n start = point.barX + startAngleRad;\n point.shapeType = 'arc';\n point.shapeArgs = this.polar.arc(y + height, y, start, start + point.pointWidth);\n }\n else {\n shapeArgs.height = height;\n shapeArgs.y = y;\n const { x = 0, width = 0 } = shapeArgs;\n // #17912, aligning column range points\n // merge if shapeArgs contains more properties e.g. for 3d\n point.shapeArgs = merge(point.shapeArgs, this.crispCol(x, y, width, height));\n point.tooltipPos = chart.inverted ?\n [\n yAxis.len + yAxis.pos - chart.plotLeft - y -\n height / 2,\n xAxis.len + xAxis.pos - chart.plotTop - x -\n width / 2,\n height\n ] : [\n xAxis.left - chart.plotLeft + x + width / 2,\n yAxis.pos - chart.plotTop + y + height / 2,\n height\n ]; // don't inherit from column tooltip position - #3372\n }\n }\n });\n }\n}\n/* *\n *\n * Static Properties\n *\n * */\nColumnRangeSeries.defaultOptions = merge(ColumnSeries.defaultOptions, AreaRangeSeries.defaultOptions, columnRangeOptions);\naddEvent(ColumnRangeSeries, 'afterColumnTranslate', function () {\n ColumnRangeSeries.prototype.afterColumnTranslate.apply(this);\n}, { order: 5 });\nextend(ColumnRangeSeries.prototype, {\n directTouch: true,\n pointClass: ColumnRangePoint,\n trackerGroups: ['group', 'dataLabelsGroup'],\n adjustForMissingColumns: columnProto.adjustForMissingColumns,\n animate: columnProto.animate,\n crispCol: columnProto.crispCol,\n drawGraph: noop,\n drawPoints: columnProto.drawPoints,\n getSymbol: noop,\n drawTracker: columnProto.drawTracker,\n getColumnMetrics: columnProto.getColumnMetrics\n // pointAttribs: columnProto.pointAttribs,\n // polarArc: columnProto.polarArc\n // translate3dPoints: columnProto.translate3dPoints,\n // translate3dShapes: columnProto.translate3dShapes\n});\nSeriesRegistry.registerSeriesType('columnrange', ColumnRangeSeries);\n/* *\n *\n * Default Export\n *\n * */\nexport default ColumnRangeSeries;\n/* *\n *\n * API Options\n *\n * */\n/**\n * A `columnrange` series. If the [type](#series.columnrange.type)\n * option is not specified, it is inherited from\n * [chart.type](#chart.type).\n *\n * @extends series,plotOptions.columnrange\n * @excluding dataParser, dataURL, stack, stacking\n * @product highcharts highstock\n * @requires highcharts-more\n * @apioption series.columnrange\n */\n/**\n * An array of data points for the series. For the `columnrange` series\n * type, points can be given in the following ways:\n *\n * 1. An array of arrays with 3 or 2 values. In this case, the values correspond\n * to `x,low,high`. If the first value is a string, it is applied as the name\n * of the point, and the `x` value is inferred. The `x` value can also be\n * omitted, in which case the inner arrays should be of length 2\\. Then the\n * `x` value is automatically calculated, either starting at 0 and\n * incremented by 1, or from `pointStart` and `pointInterval` given in the\n * series options.\n * ```js\n * data: [\n * [0, 4, 2],\n * [1, 2, 1],\n * [2, 9, 10]\n * ]\n * ```\n *\n * 2. An array of objects with named values. The following snippet shows only a\n * few settings, see the complete options set below. If the total number of\n * data points exceeds the series'\n * [turboThreshold](#series.columnrange.turboThreshold), this option is not\n * available.\n * ```js\n * data: [{\n * x: 1,\n * low: 0,\n * high: 4,\n * name: \"Point2\",\n * color: \"#00FF00\"\n * }, {\n * x: 1,\n * low: 5,\n * high: 3,\n * name: \"Point1\",\n * color: \"#FF00FF\"\n * }]\n * ```\n *\n * @sample {highcharts} highcharts/series/data-array-of-arrays/\n * Arrays of numeric x and y\n * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/\n * Arrays of datetime x and y\n * @sample {highcharts} highcharts/series/data-array-of-name-value/\n * Arrays of point.name and y\n * @sample {highcharts} highcharts/series/data-array-of-objects/\n * Config objects\n *\n * @type {Array|Array<(number|string),number,number>|*>}\n * @extends series.arearange.data\n * @excluding marker\n * @product highcharts highstock\n * @apioption series.columnrange.data\n */\n/**\n * @extends series.columnrange.dataLabels\n * @product highcharts highstock\n * @apioption series.columnrange.data.dataLabels\n */\n/**\n * @excluding halo, lineWidth, lineWidthPlus, marker\n * @product highcharts highstock\n * @apioption series.columnrange.states.hover\n */\n/**\n * @excluding halo, lineWidth, lineWidthPlus, marker\n * @product highcharts highstock\n * @apioption series.columnrange.states.select\n */\n''; // adds doclets above into transpiled\n", "/* *\n *\n * (c) 2010-2024 Sebastian Bochan\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\n/* *\n *\n * API Options\n *\n * */\n/**\n * Column pyramid series display one pyramid per value along an X axis.\n * To display horizontal pyramids, set [chart.inverted](#chart.inverted) to\n * `true`.\n *\n * @sample {highcharts|highstock} highcharts/demo/column-pyramid/\n * Column pyramid\n * @sample {highcharts|highstock} highcharts/plotoptions/columnpyramid-stacked/\n * Column pyramid stacked\n * @sample {highcharts|highstock} highcharts/plotoptions/columnpyramid-inverted/\n * Column pyramid inverted\n *\n * @extends plotOptions.column\n * @since 7.0.0\n * @product highcharts highstock\n * @excluding boostThreshold, borderRadius, crisp, depth, edgeColor,\n * edgeWidth, groupZPadding, negativeColor, softThreshold,\n * threshold, zoneAxis, zones, boostBlending\n * @requires highcharts-more\n * @optionparent plotOptions.columnpyramid\n */\nconst ColumnPyramidSeriesDefaults = {};\n/**\n * A `columnpyramid` series. If the [type](#series.columnpyramid.type) option is\n * not specified, it is inherited from [chart.type](#chart.type).\n *\n * @extends series,plotOptions.columnpyramid\n * @excluding connectEnds, connectNulls, dashStyle, dataParser, dataURL,\n * gapSize, gapUnit, linecap, lineWidth, marker, step,\n * boostThreshold, boostBlending\n * @product highcharts highstock\n * @requires highcharts-more\n * @apioption series.columnpyramid\n */\n/**\n * @excluding halo, lineWidth, lineWidthPlus, marker\n * @product highcharts highstock\n * @apioption series.columnpyramid.states.hover\n */\n/**\n * @excluding halo, lineWidth, lineWidthPlus, marker\n * @product highcharts highstock\n * @apioption series.columnpyramid.states.select\n */\n/**\n * An array of data points for the series. For the `columnpyramid` series type,\n * points can be given in the following ways:\n *\n * 1. An array of numerical values. In this case, the numerical values will be\n * interpreted as `y` options. The `x` values will be automatically\n * calculated, either starting at 0 and incremented by 1, or from\n * `pointStart` and `pointInterval` given in the series options. If the axis\n * has categories, these will be used. Example:\n * ```js\n * data: [0, 5, 3, 5]\n * ```\n *\n * 2. An array of arrays with 2 values. In this case, the values correspond to\n * `x,y`. If the first value is a string, it is applied as the name of the\n * point, and the `x` value is inferred.\n * ```js\n * data: [\n * [0, 6],\n * [1, 2],\n * [2, 6]\n * ]\n * ```\n *\n * 3. An array of objects with named values. The objects are point configuration\n * objects as seen below. If the total number of data points exceeds the\n * series' [turboThreshold](#series.columnpyramid.turboThreshold), this\n * option is not available.\n * ```js\n * data: [{\n * x: 1,\n * y: 9,\n * name: \"Point2\",\n * color: \"#00FF00\"\n * }, {\n * x: 1,\n * y: 6,\n * name: \"Point1\",\n * color: \"#FF00FF\"\n * }]\n * ```\n *\n * @sample {highcharts} highcharts/chart/reflow-true/\n * Numerical values\n * @sample {highcharts} highcharts/series/data-array-of-arrays/\n * Arrays of numeric x and y\n * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/\n * Arrays of datetime x and y\n * @sample {highcharts} highcharts/series/data-array-of-name-value/\n * Arrays of point.name and y\n * @sample {highcharts} highcharts/series/data-array-of-objects/\n * Config objects\n *\n * @type {Array|null|*>}\n * @extends series.line.data\n * @excluding marker\n * @product highcharts highstock\n * @apioption series.columnpyramid.data\n */\n''; // keeps doclets above separate\n/* *\n *\n * Default Export\n *\n * */\nexport default ColumnPyramidSeriesDefaults;\n", "/* *\n *\n * (c) 2010-2024 Sebastian Bochan\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport ColumnPyramidSeriesDefaults from './ColumnPyramidSeriesDefaults.js';\nimport SeriesRegistry from '../../Core/Series/SeriesRegistry.js';\nconst { column: ColumnSeries } = SeriesRegistry.seriesTypes;\nimport U from '../../Core/Utilities.js';\nconst { clamp, merge, pick } = U;\n/* *\n *\n * Class\n *\n * */\n/**\n * The ColumnPyramidSeries class\n *\n * @private\n * @class\n * @name Highcharts.seriesTypes.columnpyramid\n *\n * @augments Highcharts.Series\n */\nclass ColumnPyramidSeries extends ColumnSeries {\n /* *\n *\n * Functions\n *\n * */\n /**\n * Overrides the column translate method\n * @private\n */\n translate() {\n const series = this, chart = series.chart, options = series.options, dense = series.dense =\n series.closestPointRange * series.xAxis.transA < 2, borderWidth = series.borderWidth = pick(options.borderWidth, dense ? 0 : 1 // #3635\n ), yAxis = series.yAxis, threshold = options.threshold, minPointLength = pick(options.minPointLength, 5), metrics = series.getColumnMetrics(), pointWidth = metrics.width, pointXOffset = series.pointXOffset = metrics.offset;\n let translatedThreshold = series.translatedThreshold =\n yAxis.getThreshold(threshold), \n // postprocessed for border width\n seriesBarW = series.barW =\n Math.max(pointWidth, 1 + 2 * borderWidth);\n if (chart.inverted) {\n translatedThreshold -= 0.5; // #3355\n }\n // When the pointPadding is 0,\n // we want the pyramids to be packed tightly,\n // so we allow individual pyramids to have individual sizes.\n // When pointPadding is greater,\n // we strive for equal-width columns (#2694).\n if (options.pointPadding) {\n seriesBarW = Math.ceil(seriesBarW);\n }\n super.translate();\n // Record the new values\n for (const point of series.points) {\n const yBottom = pick(point.yBottom, translatedThreshold), safeDistance = 999 + Math.abs(yBottom), plotY = clamp(point.plotY, -safeDistance, yAxis.len + safeDistance), \n // Don't draw too far outside plot area\n // (#1303, #2241, #4264)\n barW = seriesBarW / 2, barY = Math.min(plotY, yBottom), barH = Math.max(plotY, yBottom) - barY;\n let barX = point.plotX + pointXOffset, stackTotal, stackHeight, topPointY, topXwidth, bottomXwidth, invBarPos, x1, x2, x3, x4, y1, y2;\n // Adjust for null or missing points\n if (options.centerInCategory) {\n barX = series.adjustForMissingColumns(barX, pointWidth, point, metrics);\n }\n point.barX = barX;\n point.pointWidth = pointWidth;\n // Fix the tooltip on center of grouped pyramids\n // (#1216, #424, #3648)\n point.tooltipPos = chart.inverted ?\n [\n yAxis.len + yAxis.pos - chart.plotLeft - plotY,\n series.xAxis.len - barX - barW,\n barH\n ] :\n [\n barX + barW,\n plotY + yAxis.pos - chart.plotTop,\n barH\n ];\n stackTotal =\n threshold + (point.total || point.y);\n // overwrite stacktotal (always 100 / -100)\n if (options.stacking === 'percent') {\n stackTotal =\n threshold + (point.y < 0) ?\n -100 :\n 100;\n }\n // get the highest point (if stack, extract from total)\n topPointY = yAxis.toPixels((stackTotal), true);\n // calculate height of stack (in pixels)\n stackHeight =\n chart.plotHeight - topPointY -\n (chart.plotHeight - translatedThreshold);\n // topXwidth and bottomXwidth = width of lines from the center\n // calculated from tanges proportion.\n // Cannot be a NaN #12514\n topXwidth = stackHeight ?\n (barW * (barY - topPointY)) / stackHeight : 0;\n // like topXwidth, but with height of point\n bottomXwidth = stackHeight ?\n (barW * (barY + barH - topPointY)) / stackHeight :\n 0;\n /*\n /\\\n / \\\n x1,y1,------ x2,y1\n / \\\n -----------\n x4,y2 x3,y2\n */\n x1 = barX - topXwidth + barW;\n x2 = barX + topXwidth + barW;\n x3 = barX + bottomXwidth + barW;\n x4 = barX - bottomXwidth + barW;\n y1 = barY - minPointLength;\n y2 = barY + barH;\n if (point.y < 0) {\n y1 = barY;\n y2 = barY + barH + minPointLength;\n }\n // inverted chart\n if (chart.inverted) {\n invBarPos = yAxis.width - barY;\n stackHeight =\n topPointY - (yAxis.width - translatedThreshold);\n // proportion tanges\n topXwidth = (barW *\n (topPointY - invBarPos)) / stackHeight;\n bottomXwidth = (barW *\n (topPointY - (invBarPos - barH))) / stackHeight;\n x1 = barX + barW + topXwidth; // top bottom\n x2 = x1 - 2 * topXwidth; // top top\n x3 = barX - bottomXwidth + barW; // bottom top\n x4 = barX + bottomXwidth + barW; // bottom bottom\n y1 = barY;\n y2 = barY + barH - minPointLength;\n if (point.y < 0) {\n y2 = barY + barH + minPointLength;\n }\n }\n // Register shape type and arguments to be used in drawPoints\n point.shapeType = 'path';\n point.shapeArgs = {\n x: x1,\n y: y1,\n width: x2 - x1,\n height: barH,\n // path of pyramid\n d: [\n ['M', x1, y1],\n ['L', x2, y1],\n ['L', x3, y2],\n ['L', x4, y2],\n ['Z']\n ]\n };\n }\n }\n}\n/* *\n *\n * Static properties\n *\n * */\nColumnPyramidSeries.defaultOptions = merge(ColumnSeries.defaultOptions, ColumnPyramidSeriesDefaults);\nSeriesRegistry.registerSeriesType('columnpyramid', ColumnPyramidSeries);\n/* *\n *\n * Default Export\n *\n * */\nexport default ColumnPyramidSeries;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\n/* *\n *\n * API Options\n *\n * */\n/**\n * Error bars are a graphical representation of the variability of data and\n * are used on graphs to indicate the error, or uncertainty in a reported\n * measurement.\n *\n * @sample highcharts/demo/error-bar/\n * Error bars on a column series\n * @sample highcharts/series-errorbar/on-scatter/\n * Error bars on a scatter series\n * @sample highcharts/series-errorbar/datalabels/\n * Error bars with data labels\n *\n * @extends plotOptions.boxplot\n * @excluding boostBlending, boostThreshold\n * @product highcharts\n * @requires highcharts-more\n * @optionparent plotOptions.errorbar\n */\nconst ErrorBarSeriesDefaults = {\n /**\n * The main color of the bars. This can be overridden by\n * [stemColor](#plotOptions.errorbar.stemColor) and\n * [whiskerColor](#plotOptions.errorbar.whiskerColor) individually.\n *\n * @sample {highcharts} highcharts/plotoptions/error-bar-styling/\n * Error bar styling\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @default #000000\n * @since 3.0\n * @product highcharts\n */\n color: \"#000000\" /* Palette.neutralColor100 */,\n grouping: false,\n /**\n * The parent series of the error bar. The default value links it to\n * the previous series. Otherwise, use the id of the parent series.\n *\n * @since 3.0\n * @product highcharts\n */\n linkedTo: ':previous',\n tooltip: {\n pointFormat: '\\u25CF {series.name}: {point.low} - {point.high}
'\n },\n /**\n * The line width of the whiskers, the horizontal lines marking\n * low and high values. When `null`, the general\n * [lineWidth](#plotOptions.errorbar.lineWidth) applies.\n *\n * @sample {highcharts} highcharts/plotoptions/error-bar-styling/\n * Error bar styling\n *\n * @type {number}\n * @since 3.0\n * @product highcharts\n */\n whiskerWidth: null\n};\n/**\n * A `errorbar` series. If the [type](#series.errorbar.type) option\n * is not specified, it is inherited from [chart.type](#chart.type).\n *\n * @extends series,plotOptions.errorbar\n * @excluding dataParser, dataURL, stack, stacking, boostThreshold,\n * boostBlending\n * @product highcharts\n * @requires highcharts-more\n * @apioption series.errorbar\n */\n/**\n * An array of data points for the series. For the `errorbar` series\n * type, points can be given in the following ways:\n *\n * 1. An array of arrays with 3 or 2 values. In this case, the values correspond\n * to `x,low,high`. If the first value is a string, it is applied as the name\n * of the point, and the `x` value is inferred. The `x` value can also be\n * omitted, in which case the inner arrays should be of length 2\\. Then the\n * `x` value is automatically calculated, either starting at 0 and\n * incremented by 1, or from `pointStart` and `pointInterval` given in the\n * series options.\n * ```js\n * data: [\n * [0, 10, 2],\n * [1, 1, 8],\n * [2, 4, 5]\n * ]\n * ```\n *\n * 2. An array of objects with named values. The following snippet shows only a\n * few settings, see the complete options set below. If the total number of\n * data points exceeds the series'\n * [turboThreshold](#series.errorbar.turboThreshold), this option is not\n * available.\n * ```js\n * data: [{\n * x: 1,\n * low: 0,\n * high: 0,\n * name: \"Point2\",\n * color: \"#00FF00\"\n * }, {\n * x: 1,\n * low: 5,\n * high: 5,\n * name: \"Point1\",\n * color: \"#FF00FF\"\n * }]\n * ```\n *\n * @sample {highcharts} highcharts/series/data-array-of-arrays/\n * Arrays of numeric x and y\n * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/\n * Arrays of datetime x and y\n * @sample {highcharts} highcharts/series/data-array-of-name-value/\n * Arrays of point.name and y\n * @sample {highcharts} highcharts/series/data-array-of-objects/\n * Config objects\n *\n * @type {Array|Array<(number|string),number,number>|*>}\n * @extends series.arearange.data\n * @excluding dataLabels, drilldown, marker, states\n * @product highcharts\n * @apioption series.errorbar.data\n */\n''; // adds doclets above to transpiled file\n/* *\n *\n * Default Export\n *\n * */\nexport default ErrorBarSeriesDefaults;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport BoxPlotSeries from '../BoxPlot/BoxPlotSeries.js';\nimport ColumnSeries from '../Column/ColumnSeries.js';\nimport ErrorBarSeriesDefaults from './ErrorBarSeriesDefaults.js';\nimport SeriesRegistry from '../../Core/Series/SeriesRegistry.js';\nconst { arearange: AreaRangeSeries } = SeriesRegistry.seriesTypes;\nimport U from '../../Core/Utilities.js';\nconst { addEvent, merge, extend } = U;\n/* *\n *\n * Class\n *\n * */\n/**\n * Errorbar series type\n *\n * @private\n * @class\n * @name Highcharts.seriesTypes.errorbar\n *\n * @augments Highcharts.Series\n */\nclass ErrorBarSeries extends BoxPlotSeries {\n /* *\n *\n * Functions\n *\n * */\n getColumnMetrics() {\n const series = this;\n // Get the width and X offset, either on top of the linked series\n // column or standalone\n return ((series.linkedParent && series.linkedParent.columnMetrics) ||\n ColumnSeries.prototype.getColumnMetrics.call(series));\n }\n drawDataLabels() {\n const series = this, valKey = series.pointValKey;\n if (AreaRangeSeries) {\n AreaRangeSeries.prototype.drawDataLabels.call(series);\n // Arearange drawDataLabels does not reset point.y to high,\n // but to low after drawing (#4133)\n for (const point of series.points) {\n point.y = point[valKey];\n }\n }\n }\n toYData(point) {\n // return a plain array for speedy calculation\n return [point.low, point.high];\n }\n}\n/* *\n *\n * Static Properties\n *\n * */\nErrorBarSeries.defaultOptions = merge(BoxPlotSeries.defaultOptions, ErrorBarSeriesDefaults);\naddEvent(ErrorBarSeries, 'afterTranslate', function () {\n for (const point of this.points) {\n point.plotLow = point.plotY;\n }\n}, { order: 0 });\nextend(ErrorBarSeries.prototype, {\n // pointClass: ErrorBarPoint, // just a declaration\n pointArrayMap: ['low', 'high'],\n pointValKey: 'high',\n doQuartiles: false\n});\nSeriesRegistry.registerSeriesType('errorbar', ErrorBarSeries);\n/* *\n *\n * Default Export\n *\n * */\nexport default ErrorBarSeries;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport SeriesRegistry from '../../Core/Series/SeriesRegistry.js';\nconst { series: { prototype: { pointClass: Point } } } = SeriesRegistry;\n/* *\n *\n * Class\n *\n * */\nclass GaugePoint extends Point {\n /* *\n *\n * Functions\n *\n * */\n /* eslint-disable valid-jsdoc */\n /**\n * Don't do any hover colors or anything\n * @private\n */\n setState(state) {\n this.state = state;\n }\n}\n/* *\n *\n * Default Export\n *\n * */\nexport default GaugePoint;\n", "/* *\n *\n * (c) 2010-2024 Torstein Honsi\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport GaugePoint from './GaugePoint.js';\nimport H from '../../Core/Globals.js';\nconst { noop } = H;\nimport SeriesRegistry from '../../Core/Series/SeriesRegistry.js';\nconst { series: Series, seriesTypes: { column: ColumnSeries } } = SeriesRegistry;\nimport U from '../../Core/Utilities.js';\nconst { clamp, isNumber, extend, merge, pick, pInt, defined } = U;\n/* *\n *\n * Class\n *\n * */\n/**\n *\n * The `gauge` series type\n *\n * @private\n * @class\n * @name Highcharts.seriesTypes.map\n *\n * @augments Highcharts.Series\n */\nclass GaugeSeries extends Series {\n /* *\n *\n * Functions\n *\n * */\n /* eslint-disable valid-jsdoc */\n /**\n * Calculate paths etc\n * @private\n */\n translate() {\n const series = this, yAxis = series.yAxis, options = series.options, center = yAxis.center;\n series.generatePoints();\n series.points.forEach((point) => {\n const dialOptions = merge(options.dial, point.dial), radius = (pInt(dialOptions.radius) * center[2]) / 200, baseLength = (pInt(dialOptions.baseLength) * radius) / 100, rearLength = (pInt(dialOptions.rearLength) * radius) / 100, baseWidth = dialOptions.baseWidth, topWidth = dialOptions.topWidth;\n let overshoot = options.overshoot, rotation = yAxis.startAngleRad + yAxis.translate(point.y, void 0, void 0, void 0, true);\n // Handle the wrap and overshoot options\n if (isNumber(overshoot) || options.wrap === false) {\n overshoot = isNumber(overshoot) ?\n (overshoot / 180 * Math.PI) : 0;\n rotation = clamp(rotation, yAxis.startAngleRad - overshoot, yAxis.endAngleRad + overshoot);\n }\n rotation = rotation * 180 / Math.PI;\n point.shapeType = 'path';\n const d = dialOptions.path || [\n ['M', -rearLength, -baseWidth / 2],\n ['L', baseLength, -baseWidth / 2],\n ['L', radius, -topWidth / 2],\n ['L', radius, topWidth / 2],\n ['L', baseLength, baseWidth / 2],\n ['L', -rearLength, baseWidth / 2],\n ['Z']\n ];\n point.shapeArgs = {\n d,\n translateX: center[0],\n translateY: center[1],\n rotation: rotation\n };\n // Positions for data label\n point.plotX = center[0];\n point.plotY = center[1];\n if (defined(point.y) && yAxis.max - yAxis.min) {\n point.percentage =\n (point.y - yAxis.min) / (yAxis.max - yAxis.min) * 100;\n }\n });\n }\n /**\n * Draw the points where each point is one needle\n * @private\n */\n drawPoints() {\n const series = this, chart = series.chart, center = series.yAxis.center, pivot = series.pivot, options = series.options, pivotOptions = options.pivot, renderer = chart.renderer;\n series.points.forEach((point) => {\n const graphic = point.graphic, shapeArgs = point.shapeArgs, d = shapeArgs.d, dialOptions = merge(options.dial, point.dial); // #1233\n if (graphic) {\n graphic.animate(shapeArgs);\n shapeArgs.d = d; // animate alters it\n }\n else {\n point.graphic =\n renderer[point.shapeType](shapeArgs)\n .addClass('highcharts-dial')\n .add(series.group);\n }\n // Presentational attributes\n if (!chart.styledMode) {\n point.graphic[graphic ? 'animate' : 'attr']({\n stroke: dialOptions.borderColor,\n 'stroke-width': dialOptions.borderWidth,\n fill: dialOptions.backgroundColor\n });\n }\n });\n // Add or move the pivot\n if (pivot) {\n pivot.animate({\n translateX: center[0],\n translateY: center[1]\n });\n }\n else if (pivotOptions) {\n series.pivot =\n renderer.circle(0, 0, pivotOptions.radius)\n .attr({\n zIndex: 2\n })\n .addClass('highcharts-pivot')\n .translate(center[0], center[1])\n .add(series.group);\n // Presentational attributes\n if (!chart.styledMode) {\n series.pivot.attr({\n fill: pivotOptions.backgroundColor,\n stroke: pivotOptions.borderColor,\n 'stroke-width': pivotOptions.borderWidth\n });\n }\n }\n }\n /**\n * Animate the arrow up from startAngle\n * @private\n */\n animate(init) {\n const series = this;\n if (!init) {\n series.points.forEach((point) => {\n const graphic = point.graphic;\n if (graphic) {\n // start value\n graphic.attr({\n rotation: series.yAxis.startAngleRad * 180 / Math.PI\n });\n // animate\n graphic.animate({\n rotation: point.shapeArgs.rotation\n }, series.options.animation);\n }\n });\n }\n }\n /**\n * @private\n */\n render() {\n this.group = this.plotGroup('group', 'series', this.visible ? 'inherit' : 'hidden', this.options.zIndex, this.chart.seriesGroup);\n Series.prototype.render.call(this);\n this.group.clip(this.chart.clipRect);\n }\n /**\n * Extend the basic setData method by running processData and generatePoints\n * immediately, in order to access the points from the legend.\n * @private\n */\n setData(data, redraw) {\n Series.prototype.setData.call(this, data, false);\n this.processData();\n this.generatePoints();\n if (pick(redraw, true)) {\n this.chart.redraw();\n }\n }\n /**\n * Define hasData function for non-cartesian series.\n * Returns true if the series has points at all.\n * @private\n */\n hasData() {\n return !!this.points.length; // != 0\n }\n}\n/* *\n *\n * Static properties\n *\n * */\n/**\n * Gauges are circular plots displaying one or more values with a dial\n * pointing to values along the perimeter.\n *\n * @sample highcharts/demo/gauge-speedometer/\n * Gauge chart\n *\n * @extends plotOptions.line\n * @excluding animationLimit, boostThreshold, colorAxis, colorKey,\n * connectEnds, connectNulls, cropThreshold, dashStyle,\n * dragDrop, findNearestPointBy, getExtremesFromAll, marker,\n * negativeColor, pointPlacement, shadow, softThreshold,\n * stacking, states, step, threshold, turboThreshold, xAxis,\n * zoneAxis, zones, dataSorting, boostBlending\n * @product highcharts\n * @requires highcharts-more\n * @optionparent plotOptions.gauge\n */\nGaugeSeries.defaultOptions = merge(Series.defaultOptions, {\n /**\n * When this option is `true`, the dial will wrap around the axes.\n * For instance, in a full-range gauge going from 0 to 360, a value\n * of 400 will point to 40\\. When `wrap` is `false`, the dial stops\n * at 360.\n *\n * @see [overshoot](#plotOptions.gauge.overshoot)\n *\n * @type {boolean}\n * @default true\n * @since 3.0\n * @product highcharts\n * @apioption plotOptions.gauge.wrap\n */\n /**\n * Data labels for the gauge. For gauges, the data labels are\n * enabled by default and shown in a bordered box below the point.\n *\n * @since 2.3.0\n * @product highcharts\n */\n dataLabels: {\n borderColor: \"#cccccc\" /* Palette.neutralColor20 */,\n borderRadius: 3,\n borderWidth: 1,\n crop: false,\n defer: false,\n enabled: true,\n verticalAlign: 'top',\n y: 15,\n zIndex: 2\n },\n /**\n * Options for the dial or arrow pointer of the gauge.\n *\n * In styled mode, the dial is styled with the\n * `.highcharts-gauge-series .highcharts-dial` rule.\n *\n * @sample {highcharts} highcharts/css/gauge/\n * Styled mode\n *\n * @type {*}\n * @since 2.3.0\n * @product highcharts\n */\n dial: {\n /**\n * The background or fill color of the gauge's dial.\n *\n * @sample {highcharts} highcharts/plotoptions/gauge-dial/\n * Dial options demonstrated\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @default #000000\n * @since 2.3.0\n * @product highcharts\n * @apioption plotOptions.gauge.dial.backgroundColor\n */\n backgroundColor: \"#000000\" /* Palette.neutralColor100 */,\n /**\n * The length of the dial's base part, relative to the total\n * radius or length of the dial.\n *\n * @sample {highcharts} highcharts/plotoptions/gauge-dial/\n * Dial options demonstrated\n *\n * @type {string}\n * @default 70%\n * @since 2.3.0\n * @product highcharts\n * @apioption plotOptions.gauge.dial.baseLength\n */\n baseLength: '70%',\n /**\n * The pixel width of the base of the gauge dial. The base is\n * the part closest to the pivot, defined by baseLength.\n *\n * @sample {highcharts} highcharts/plotoptions/gauge-dial/\n * Dial options demonstrated\n *\n * @type {number}\n * @default 3\n * @since 2.3.0\n * @product highcharts\n * @apioption plotOptions.gauge.dial.baseWidth\n */\n baseWidth: 3,\n /**\n * The border color or stroke of the gauge's dial. By default,\n * the borderWidth is 0, so this must be set in addition to a\n * custom border color.\n *\n * @sample {highcharts} highcharts/plotoptions/gauge-dial/\n * Dial options demonstrated\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @default #cccccc\n * @since 2.3.0\n * @product highcharts\n * @apioption plotOptions.gauge.dial.borderColor\n */\n borderColor: \"#cccccc\" /* Palette.neutralColor20 */,\n /**\n * The width of the gauge dial border in pixels.\n *\n * @sample {highcharts} highcharts/plotoptions/gauge-dial/\n * Dial options demonstrated\n *\n * @type {number}\n * @default 0\n * @since 2.3.0\n * @product highcharts\n * @apioption plotOptions.gauge.dial.borderWidth\n */\n borderWidth: 0,\n /**\n * An array with an SVG path for the custom dial.\n *\n * @sample {highcharts} highcharts/plotoptions/gauge-path/\n * Dial options demonstrated\n *\n * @type {Highcharts.SVGPathArray}\n * @since 10.2.0\n * @product highcharts\n * @apioption plotOptions.gauge.dial.path\n */\n /**\n * The radius or length of the dial, in percentages relative to\n * the radius of the gauge itself.\n *\n * @sample {highcharts} highcharts/plotoptions/gauge-dial/\n * Dial options demonstrated\n *\n * @type {string}\n * @default 80%\n * @since 2.3.0\n * @product highcharts\n * @apioption plotOptions.gauge.dial.radius\n */\n radius: '80%',\n /**\n * The length of the dial's rear end, the part that extends out\n * on the other side of the pivot. Relative to the dial's\n * length.\n *\n * @sample {highcharts} highcharts/plotoptions/gauge-dial/\n * Dial options demonstrated\n *\n * @type {string}\n * @default 10%\n * @since 2.3.0\n * @product highcharts\n * @apioption plotOptions.gauge.dial.rearLength\n */\n rearLength: '10%',\n /**\n * The width of the top of the dial, closest to the perimeter.\n * The pivot narrows in from the base to the top.\n *\n * @sample {highcharts} highcharts/plotoptions/gauge-dial/\n * Dial options demonstrated\n *\n * @type {number}\n * @default 1\n * @since 2.3.0\n * @product highcharts\n * @apioption plotOptions.gauge.dial.topWidth\n */\n topWidth: 1\n },\n /**\n * Allow the dial to overshoot the end of the perimeter axis by\n * this many degrees. Say if the gauge axis goes from 0 to 60, a\n * value of 100, or 1000, will show 5 degrees beyond the end of the\n * axis when this option is set to 5.\n *\n * @see [wrap](#plotOptions.gauge.wrap)\n *\n * @sample {highcharts} highcharts/plotoptions/gauge-overshoot/\n * Allow 5 degrees overshoot\n *\n * @type {number}\n * @since 3.0.10\n * @product highcharts\n * @apioption plotOptions.gauge.overshoot\n */\n /**\n * Options for the pivot or the center point of the gauge.\n *\n * In styled mode, the pivot is styled with the\n * `.highcharts-gauge-series .highcharts-pivot` rule.\n *\n * @sample {highcharts} highcharts/css/gauge/\n * Styled mode\n *\n * @type {*}\n * @since 2.3.0\n * @product highcharts\n */\n pivot: {\n /**\n * The pixel radius of the pivot.\n *\n * @sample {highcharts} highcharts/plotoptions/gauge-pivot/\n * Pivot options demonstrated\n *\n * @type {number}\n * @default 5\n * @since 2.3.0\n * @product highcharts\n * @apioption plotOptions.gauge.pivot.radius\n */\n radius: 5,\n /**\n * The border or stroke width of the pivot.\n *\n * @sample {highcharts} highcharts/plotoptions/gauge-pivot/\n * Pivot options demonstrated\n *\n * @type {number}\n * @default 0\n * @since 2.3.0\n * @product highcharts\n * @apioption plotOptions.gauge.pivot.borderWidth\n */\n borderWidth: 0,\n /**\n * The border or stroke color of the pivot. In able to change\n * this, the borderWidth must also be set to something other\n * than the default 0.\n *\n * @sample {highcharts} highcharts/plotoptions/gauge-pivot/\n * Pivot options demonstrated\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @default #cccccc\n * @since 2.3.0\n * @product highcharts\n * @apioption plotOptions.gauge.pivot.borderColor\n */\n borderColor: \"#cccccc\" /* Palette.neutralColor20 */,\n /**\n * The background color or fill of the pivot.\n *\n * @sample {highcharts} highcharts/plotoptions/gauge-pivot/\n * Pivot options demonstrated\n *\n * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}\n * @default #000000\n * @since 2.3.0\n * @product highcharts\n * @apioption plotOptions.gauge.pivot.backgroundColor\n */\n backgroundColor: \"#000000\" /* Palette.neutralColor100 */\n },\n tooltip: {\n headerFormat: ''\n },\n /**\n * Whether to display this particular series or series type in the\n * legend. Defaults to false for gauge series.\n *\n * @since 2.3.0\n * @product highcharts\n */\n showInLegend: false\n // Prototype members\n});\nextend(GaugeSeries.prototype, {\n // chart.angular will be set to true when a gauge series is present,\n // and this will be used on the axes\n angular: true,\n directTouch: true,\n drawGraph: noop,\n drawTracker: ColumnSeries.prototype.drawTracker,\n fixedBox: true,\n forceDL: true,\n noSharedTooltip: true,\n pointClass: GaugePoint,\n trackerGroups: ['group', 'dataLabelsGroup']\n});\nSeriesRegistry.registerSeriesType('gauge', GaugeSeries);\n/* *\n *\n * Default Export\n *\n * */\nexport default GaugeSeries;\n/* *\n *\n * API options\n *\n * */\n/**\n * A `gauge` series. If the [type](#series.gauge.type) option is not\n * specified, it is inherited from [chart.type](#chart.type).\n *\n * @extends series,plotOptions.gauge\n * @excluding animationLimit, boostThreshold, connectEnds, connectNulls,\n * cropThreshold, dashStyle, dataParser, dataURL, findNearestPointBy,\n * getExtremesFromAll, marker, negativeColor, pointPlacement, shadow,\n * softThreshold, stack, stacking, states, step, threshold,\n * turboThreshold, zoneAxis, zones, dataSorting, boostBlending\n * @product highcharts\n * @requires highcharts-more\n * @apioption series.gauge\n */\n/**\n * An array of data points for the series. For the `gauge` series type,\n * points can be given in the following ways:\n *\n * 1. An array of numerical values. In this case, the numerical values will be\n * interpreted as `y` options. Example:\n * ```js\n * data: [0, 5, 3, 5]\n * ```\n *\n * 2. An array of objects with named values. The following snippet shows only a\n * few settings, see the complete options set below. If the total number of\n * data points exceeds the series'\n * [turboThreshold](#series.gauge.turboThreshold), this option is not\n * available.\n * ```js\n * data: [{\n * y: 6,\n * name: \"Point2\",\n * color: \"#00FF00\"\n * }, {\n * y: 8,\n * name: \"Point1\",\n * color: \"#FF00FF\"\n * }]\n * ```\n *\n * The typical gauge only contains a single data value.\n *\n * @sample {highcharts} highcharts/chart/reflow-true/\n * Numerical values\n * @sample {highcharts} highcharts/series/data-array-of-objects/\n * Config objects\n *\n * @type {Array}\n * @extends series.line.data\n * @excluding drilldown, marker, x\n * @product highcharts\n * @apioption series.gauge.data\n */\n''; // adds the doclets above in the transpiled file\n", "/* *\n *\n * Networkgraph series\n *\n * (c) 2010-2024 Pawe\u0142 Fus\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport H from '../Core/Globals.js';\nconst { composed } = H;\nimport U from '../Core/Utilities.js';\nconst { addEvent, pushUnique } = U;\n/* *\n *\n * Functions\n *\n * */\n/**\n * @private\n */\nfunction compose(ChartClass) {\n if (pushUnique(composed, 'DragNodes')) {\n addEvent(ChartClass, 'load', onChartLoad);\n }\n}\n/**\n * Draggable mode:\n * @private\n */\nfunction onChartLoad() {\n const chart = this;\n let mousedownUnbinder, mousemoveUnbinder, mouseupUnbinder;\n if (chart.container) {\n mousedownUnbinder = addEvent(chart.container, 'mousedown', (event) => {\n const point = chart.hoverPoint;\n if (point &&\n point.series &&\n point.series.hasDraggableNodes &&\n point.series.options.draggable) {\n point.series.onMouseDown(point, event);\n mousemoveUnbinder = addEvent(chart.container, 'mousemove', (e) => (point &&\n point.series &&\n point.series.onMouseMove(point, e)));\n mouseupUnbinder = addEvent(chart.container.ownerDocument, 'mouseup', (e) => {\n mousemoveUnbinder();\n mouseupUnbinder();\n return point &&\n point.series &&\n point.series.onMouseUp(point, e);\n });\n }\n });\n }\n addEvent(chart, 'destroy', function () {\n mousedownUnbinder();\n });\n}\n/**\n * Mouse down action, initializing drag&drop mode.\n *\n * @private\n * @param {Highcharts.Point} point\n * The point that event occurred.\n * @param {Highcharts.PointerEventObject} event\n * Browser event, before normalization.\n */\nfunction onMouseDown(point, event) {\n const normalizedEvent = this.chart.pointer?.normalize(event) || event;\n point.fixedPosition = {\n chartX: normalizedEvent.chartX,\n chartY: normalizedEvent.chartY,\n plotX: point.plotX,\n plotY: point.plotY\n };\n point.inDragMode = true;\n}\n/**\n * Mouse move action during drag&drop.\n *\n * @private\n *\n * @param {global.Event} event\n * Browser event, before normalization.\n * @param {Highcharts.Point} point\n * The point that event occurred.\n *\n */\nfunction onMouseMove(point, event) {\n if (point.fixedPosition && point.inDragMode) {\n const series = this, chart = series.chart, normalizedEvent = chart.pointer?.normalize(event) || event, diffX = point.fixedPosition.chartX - normalizedEvent.chartX, diffY = point.fixedPosition.chartY - normalizedEvent.chartY, graphLayoutsLookup = chart.graphLayoutsLookup;\n let newPlotX, newPlotY;\n // At least 5px to apply change (avoids simple click):\n if (Math.abs(diffX) > 5 || Math.abs(diffY) > 5) {\n newPlotX = point.fixedPosition.plotX - diffX;\n newPlotY = point.fixedPosition.plotY - diffY;\n if (chart.isInsidePlot(newPlotX, newPlotY)) {\n point.plotX = newPlotX;\n point.plotY = newPlotY;\n point.hasDragged = true;\n this.redrawHalo(point);\n graphLayoutsLookup.forEach((layout) => {\n layout.restartSimulation();\n });\n }\n }\n }\n}\n/**\n * Mouse up action, finalizing drag&drop.\n *\n * @private\n * @param {Highcharts.Point} point\n * The point that event occurred.\n */\nfunction onMouseUp(point) {\n if (point.fixedPosition) {\n if (point.hasDragged) {\n if (this.layout.enableSimulation) {\n this.layout.start();\n }\n else {\n this.chart.redraw();\n }\n }\n point.inDragMode = point.hasDragged = false;\n if (!this.options.fixedDraggable) {\n delete point.fixedPosition;\n }\n }\n}\n/**\n * Redraw halo on mousemove during the drag&drop action.\n *\n * @private\n * @param {Highcharts.Point} point\n * The point that should show halo.\n */\nfunction redrawHalo(point) {\n if (point && this.halo) {\n this.halo.attr({\n d: point.haloPath(this.options.states.hover.halo.size)\n });\n }\n}\n/* *\n *\n * Default Export\n *\n * */\nconst DragNodesComposition = {\n compose,\n onMouseDown,\n onMouseMove,\n onMouseUp,\n redrawHalo\n};\nexport default DragNodesComposition;\n", "/* *\n *\n * Networkgraph series\n *\n * (c) 2010-2024 Pawe\u0142 Fus\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport A from '../Core/Animation/AnimationUtilities.js';\nconst { setAnimation } = A;\nimport H from '../Core/Globals.js';\nconst { composed } = H;\nimport U from '../Core/Utilities.js';\nconst { addEvent, pushUnique } = U;\n/* *\n *\n * Constants\n *\n * */\nconst integrations = {};\nconst layouts = {};\n/* *\n *\n * Functions\n *\n * */\n/**\n * @private\n */\nfunction compose(ChartClass) {\n if (pushUnique(composed, 'GraphLayout')) {\n addEvent(ChartClass, 'afterPrint', onChartAfterPrint);\n addEvent(ChartClass, 'beforePrint', onChartBeforePrint);\n addEvent(ChartClass, 'predraw', onChartPredraw);\n addEvent(ChartClass, 'render', onChartRender);\n }\n}\n/**\n * Re-enable simulation after print.\n * @private\n */\nfunction onChartAfterPrint() {\n if (this.graphLayoutsLookup) {\n this.graphLayoutsLookup.forEach((layout) => {\n // return to default simulation\n layout.updateSimulation();\n });\n this.redraw();\n }\n}\n/**\n * Disable simulation before print if enabled.\n * @private\n */\nfunction onChartBeforePrint() {\n if (this.graphLayoutsLookup) {\n this.graphLayoutsLookup.forEach((layout) => {\n layout.updateSimulation(false);\n });\n this.redraw();\n }\n}\n/**\n * Clear previous layouts.\n * @private\n */\nfunction onChartPredraw() {\n if (this.graphLayoutsLookup) {\n this.graphLayoutsLookup.forEach((layout) => {\n layout.stop();\n });\n }\n}\n/**\n * @private\n */\nfunction onChartRender() {\n let systemsStable, afterRender = false;\n const layoutStep = (layout) => {\n if (layout.maxIterations-- &&\n isFinite(layout.temperature) &&\n !layout.isStable() &&\n !layout.enableSimulation) {\n // Hook similar to build-in addEvent, but instead of\n // creating whole events logic, use just a function.\n // It's faster which is important for rAF code.\n // Used e.g. in packed-bubble series for bubble radius\n // calculations\n if (layout.beforeStep) {\n layout.beforeStep();\n }\n layout.step();\n systemsStable = false;\n afterRender = true;\n }\n };\n if (this.graphLayoutsLookup) {\n setAnimation(false, this);\n // Start simulation\n this.graphLayoutsLookup.forEach((layout) => layout.start());\n // Just one sync step, to run different layouts similar to\n // async mode.\n while (!systemsStable) {\n systemsStable = true;\n this.graphLayoutsLookup.forEach(layoutStep);\n }\n if (afterRender) {\n this.series.forEach((series) => {\n if (series && series.layout) {\n series.render();\n }\n });\n }\n }\n}\n/* *\n *\n * Default Export\n *\n * */\nconst GraphLayoutComposition = {\n compose,\n integrations,\n layouts\n};\nexport default GraphLayoutComposition;\n", "/* *\n *\n * (c) 2010-2024 Grzegorz Blachlinski, Sebastian Bochan\n *\n * License: www.highcharts.com/license\n *\n * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!\n *\n * */\n'use strict';\nimport Chart from '../../Core/Chart/Chart.js';\nimport Point from '../../Core/Series/Point.js';\nimport SeriesRegistry from '../../Core/Series/SeriesRegistry.js';\nconst { seriesTypes: { bubble: { prototype: { pointClass: BubblePoint } } } } = SeriesRegistry;\n/* *\n *\n * Class\n *\n * */\nclass PackedBubblePoint extends BubblePoint {\n /* *\n *\n * Functions\n *\n * */\n /* eslint-disable valid-jsdoc */\n /**\n * Destroy point.\n * Then remove point from the layout.\n * @private\n */\n destroy() {\n if (this.series.layout) {\n this.series.layout.removeElementFromCollection(this, this.series.layout.nodes);\n }\n return Point.prototype.destroy.apply(this, arguments);\n }\n firePointEvent() {\n const series = this.series, seriesOptions = series.options;\n if (this.isParentNode && seriesOptions.parentNode) {\n const temp = seriesOptions.allowPointSelect;\n seriesOptions.allowPointSelect = (seriesOptions.parentNode.allowPointSelect);\n Point.prototype.firePointEvent.apply(this, arguments);\n seriesOptions.allowPointSelect = temp;\n }\n else {\n Point.prototype.firePointEvent.apply(this, arguments);\n }\n }\n select() {\n const point = this, series = this.series, chart = series.chart;\n if (point.isParentNode) {\n chart.getSelectedPoints = chart.getSelectedParentNodes;\n Point.prototype.select.apply(this, arguments);\n chart.getSelectedPoints = Chart.prototype.getSelectedPoints;\n }\n else {\n Point.prototype.select.apply(this, arguments);\n }\n }\n}\n/* *\n *\n * Default Export\n *\n * */\nexport default PackedBubblePoint;\n", "/* *\n *\n * Imports\n *\n * */\nimport U from '../../Core/Utilities.js';\nconst { isNumber } = U;\n/* *\n *\n * Constants\n *\n * */\n/**\n * A packed bubble series is a two dimensional series type, where each point\n * renders a value in X, Y position. Each point is drawn as a bubble\n * where the bubbles don't overlap with each other and the radius\n * of the bubble relates to the value.\n *\n * @sample highcharts/demo/packed-bubble/\n * Packed bubble chart\n * @sample highcharts/demo/packed-bubble-split/\n * Split packed bubble chart\n *\n * @extends plotOptions.bubble\n * @excluding connectEnds, connectNulls, cropThreshold, dragDrop, jitter,\n * keys, pointPlacement, sizeByAbsoluteValue, step, xAxis,\n * yAxis, zMax, zMin, dataSorting, boostThreshold,\n * boostBlending\n * @product highcharts\n * @since 7.0.0\n * @requires highcharts-more\n * @optionparent plotOptions.packedbubble\n *\n * @private\n */\nconst PackedBubbleSeriesDefaults = {\n /**\n * Minimum bubble size. Bubbles will automatically size between the\n * `minSize` and `maxSize` to reflect the value of each bubble.\n * Can be either pixels (when no unit is given), or a percentage of\n * the smallest one of the plot width and height, divided by the square\n * root of total number of points.\n *\n * @sample highcharts/plotoptions/bubble-size/\n * Bubble size\n *\n * @type {number|string}\n *\n * @private\n */\n minSize: '10%',\n /**\n * Maximum bubble size. Bubbles will automatically size between the\n * `minSize` and `maxSize` to reflect the value of each bubble.\n * Can be either pixels (when no unit is given), or a percentage of\n * the smallest one of the plot width and height, divided by the square\n * root of total number of points.\n *\n * @sample highcharts/plotoptions/bubble-size/\n * Bubble size\n *\n * @type {number|string}\n *\n * @private\n */\n maxSize: '50%',\n sizeBy: 'area',\n zoneAxis: 'y',\n crisp: false,\n tooltip: {\n pointFormat: 'Value: {point.value}'\n },\n /**\n * Flag to determine if nodes are draggable or not. Available for\n * graph with useSimulation set to true only.\n *\n * @since 7.1.0\n *\n * @private\n */\n draggable: true,\n /**\n * An option is giving a possibility to choose between using simulation\n * for calculating bubble positions. These reflects in both animation\n * and final position of bubbles. Simulation is also adding options to\n * the series graph based on used layout. In case of big data sets, with\n * any performance issues, it is possible to disable animation and pack\n * bubble in a simple circular way.\n *\n * @sample highcharts/series-packedbubble/spiral/\n * useSimulation set to false\n *\n * @since 7.1.0\n *\n * @private\n */\n useSimulation: true,\n /**\n * Series options for parent nodes.\n *\n * @since 8.1.1\n *\n * @private\n */\n parentNode: {\n /**\n * Allow this series' parent nodes to be selected\n * by clicking on the graph.\n *\n * @since 8.1.1\n */\n allowPointSelect: false\n },\n /**\n /**\n *\n * @declare Highcharts.SeriesPackedBubbleDataLabelsOptionsObject\n *\n * @private\n */\n dataLabels: {\n /**\n * The\n * [format string](https://www.highcharts.com/docs/chart-concepts/labels-and-string-formatting)\n * specifying what to show for _node_ in the networkgraph. In v7.0\n * defaults to `{key}`, since v7.1 defaults to `undefined` and\n * `formatter` is used instead.\n *\n * @type {string}\n * @since 7.0.0\n * @apioption plotOptions.packedbubble.dataLabels.format\n */\n // eslint-disable-next-line valid-jsdoc\n /**\n * Callback JavaScript function to format the data label for a node.\n * Note that if a `format` is defined, the format takes precedence\n * and the formatter is ignored.\n *\n * @type {Highcharts.SeriesPackedBubbleDataLabelsFormatterCallbackFunction}\n * @since 7.0.0\n */\n formatter: function () {\n const { numberFormatter } = this.series.chart;\n const { value } = this.point;\n return isNumber(value) ? numberFormatter(value, -1) : '';\n },\n /**\n * @type {string}\n * @since 7.1.0\n * @apioption plotOptions.packedbubble.dataLabels.parentNodeFormat\n */\n // eslint-disable-next-line valid-jsdoc\n /**\n * @type {Highcharts.SeriesPackedBubbleDataLabelsFormatterCallbackFunction}\n * @since 7.1.0\n */\n parentNodeFormatter: function () {\n return this.name;\n },\n /**\n * @sample {highcharts} highcharts/series-packedbubble/packed-dashboard\n * Dashboard with dataLabels on parentNodes\n *\n * @declare Highcharts.SeriesPackedBubbleDataLabelsTextPathOptionsObject\n * @since 7.1.0\n */\n parentNodeTextPath: {\n /**\n * Presentation attributes for the text path.\n *\n * @type {Highcharts.SVGAttributes}\n * @since 7.1.0\n * @apioption plotOptions.packedbubble.dataLabels.attributes\n */\n /**\n * Enable or disable `textPath` option for link's or marker's\n * data labels.\n *\n * @since 7.1.0\n */\n enabled: true\n },\n /**\n * Options for a _node_ label text which should follow marker's\n * shape.\n *\n * **Note:** Only SVG-based renderer supports this option.\n *\n * @extends plotOptions.series.dataLabels.textPath\n * @apioption plotOptions.packedbubble.dataLabels.textPath\n */\n padding: 0,\n style: {\n transition: 'opacity 2000ms'\n }\n },\n /**\n * Options for layout algorithm when simulation is enabled. Inside there\n * are options to change the speed, padding, initial bubbles positions\n * and more.\n *\n * @extends plotOptions.networkgraph.layoutAlgorithm\n * @excluding approximation, attractiveForce, repulsiveForce, theta\n * @since 7.1.0\n *\n * @private\n */\n layoutAlgorithm: {\n /**\n * Initial layout algorithm for positioning nodes. Can be one of\n * the built-in options (\"circle\", \"random\") or a function where\n * positions should be set on each node (`this.nodes`) as\n * `node.plotX` and `node.plotY`.\n *\n * @sample highcharts/series-networkgraph/initial-positions/\n * Initial positions with callback\n *\n * @type {\"circle\"|\"random\"|Function}\n */\n initialPositions: 'circle',\n /**\n * @sample highcharts/series-packedbubble/initial-radius/\n * Initial radius set to 200\n *\n * @extends plotOptions.networkgraph.layoutAlgorithm.initialPositionRadius\n * @excluding states\n */\n initialPositionRadius: 20,\n /**\n * The distance between two bubbles, when the algorithm starts to\n * treat two bubbles as overlapping. The `bubblePadding` is also the\n * expected distance between all the bubbles on simulation end.\n */\n bubblePadding: 5,\n /**\n * Whether bubbles should interact with their parentNode to keep\n * them inside.\n */\n parentNodeLimit: false,\n /**\n * Whether series should interact with each other or not. When\n * `parentNodeLimit` is set to true, thi option should be set to\n * false to avoid sticking points in wrong series parentNode.\n */\n seriesInteraction: true,\n /**\n * In case of split series, this option allows user to drag and\n * drop points between series, for changing point related series.\n *\n * @sample highcharts/series-packedbubble/packed-dashboard/\n * Example of drag'n drop bubbles for bubble kanban\n */\n dragBetweenSeries: false,\n /**\n * Layout algorithm options for parent nodes.\n *\n * @extends plotOptions.networkgraph.layoutAlgorithm\n * @excluding approximation, attractiveForce, enableSimulation,\n * repulsiveForce, theta\n */\n parentNodeOptions: {\n maxIterations: 400,\n gravitationalConstant: 0.03,\n maxSpeed: 50,\n initialPositionRadius: 100,\n seriesInteraction: true,\n /**\n * Styling options for parentNodes markers. Similar to\n * line.marker options.\n *\n * @sample highcharts/series-packedbubble/parentnode-style/\n * Bubble size\n *\n * @extends plotOptions.series.marker\n * @excluding states\n */\n marker: {\n fillColor: null,\n fillOpacity: 1,\n lineWidth: null,\n lineColor: null,\n symbol: 'circle'\n }\n },\n enableSimulation: true,\n /**\n * Type of the algorithm used when positioning bubbles.\n * @ignore-option\n */\n type: 'packedbubble',\n /**\n * Integration type. Integration determines how forces are applied\n * on particles. The `packedbubble` integration is based on\n * the networkgraph `verlet` integration, where the new position\n * is based on a previous position without velocity:\n * `newPosition += previousPosition - newPosition`.\n *\n * @sample highcharts/series-networkgraph/forces/\n *\n * @ignore-option\n */\n integration: 'packedbubble',\n maxIterations: 1000,\n /**\n * Whether to split series into individual groups or to mix all\n * series together.\n *\n * @since 7.1.0\n * @default false\n */\n splitSeries: false,\n /**\n * Max speed that node can get in one iteration. In terms of\n * simulation, it's a maximum translation (in pixels) that a node\n * can move (in both, x and y, dimensions). While `friction` is\n * applied on all nodes, max speed is applied only for nodes that\n * move very fast, for example small or disconnected ones.\n *\n * @see [layoutAlgorithm.integration](#series.networkgraph.layoutAlgorithm.integration)\n *\n * @see [layoutAlgorithm.friction](#series.networkgraph.layoutAlgorithm.friction)\n */\n maxSpeed: 5,\n gravitationalConstant: 0.01,\n friction: -0.981\n }\n};\n/* *\n *\n * Default Export\n *\n * */\nexport default PackedBubbleSeriesDefaults;\n/* *\n *\n * API Options\n *\n * */\n/**\n * A `packedbubble` series. If the [type](#series.packedbubble.type) option is\n * not specified, it is inherited from [chart.type](#chart.type).\n *\n * @type {Object}\n * @extends series,plotOptions.packedbubble\n * @excluding cropThreshold, dataParser, dataSorting, dataURL, dragDrop, stack,\n * boostThreshold, boostBlending\n * @product highcharts\n * @requires highcharts-more\n * @apioption series.packedbubble\n */\n/**\n * An array of data points for the series. For the `packedbubble` series type,\n * points can be given in the following ways:\n *\n * 1. An array of `values`.\n *\n * ```js\n * data: [5, 1, 20]\n * ```\n *\n * 2. An array of objects with named values. The objects are point\n * configuration objects as seen below. If the total number of data points\n * exceeds the series' [turboThreshold](#series.packedbubble.turboThreshold),\n * this option is not available.\n *\n * ```js\n * data: [{\n * value: 1,\n * name: \"Point2\",\n * color: \"#00FF00\"\n * }, {\n * value: 5,\n * name: \"Point1\",\n * color: \"#FF00FF\"\n * }]\n * ```\n *\n * @type {Array