teechart.js 4.0.4 → 5.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/3D-COMPATIBILITY.md +45 -0
- package/README.md +463 -27
- package/dist/chunks/chart-p639xVyw.js +16 -0
- package/dist/chunks/chart-p639xVyw.js.map +1 -0
- package/dist/chunks/palette-series-DfyYptK1.js +16 -0
- package/dist/chunks/palette-series-DfyYptK1.js.map +1 -0
- package/dist/chunks/series-DeozLXIv.js +16 -0
- package/dist/chunks/series-DeozLXIv.js.map +1 -0
- package/dist/teechart.3d.esm.js +27 -0
- package/dist/teechart.3d.esm.js.map +1 -0
- package/dist/teechart.auto.esm.js +16 -0
- package/dist/teechart.auto.esm.js.map +1 -0
- package/dist/teechart.core.esm.js +16 -0
- package/dist/teechart.core.esm.js.map +1 -0
- package/dist/teechart.esm.js +16 -0
- package/dist/teechart.esm.js.map +1 -0
- package/dist/teechart.js +14 -3
- package/dist/teechart.js.map +1 -1
- package/dist/teechart.maps.esm.js +16 -0
- package/dist/teechart.maps.esm.js.map +1 -0
- package/dist/types/accessibility.d.ts +29 -0
- package/dist/types/accessibility.d.ts.map +1 -0
- package/dist/types/auto.d.ts +4 -0
- package/dist/types/auto.d.ts.map +1 -0
- package/dist/types/chart-options.d.ts +826 -0
- package/dist/types/chart-options.d.ts.map +1 -0
- package/dist/types/chart.d.ts +252 -0
- package/dist/types/chart.d.ts.map +1 -0
- package/dist/types/checkbox.d.ts +12 -0
- package/dist/types/checkbox.d.ts.map +1 -0
- package/dist/types/core/elements/axes.d.ts +17 -0
- package/dist/types/core/elements/axes.d.ts.map +1 -0
- package/dist/types/core/elements/axis-grid.d.ts +20 -0
- package/dist/types/core/elements/axis-grid.d.ts.map +1 -0
- package/dist/types/core/elements/axis-labels.d.ts +54 -0
- package/dist/types/core/elements/axis-labels.d.ts.map +1 -0
- package/dist/types/core/elements/axis-ticks.d.ts +19 -0
- package/dist/types/core/elements/axis-ticks.d.ts.map +1 -0
- package/dist/types/core/elements/axis-title.d.ts +16 -0
- package/dist/types/core/elements/axis-title.d.ts.map +1 -0
- package/dist/types/core/elements/axis.d.ts +125 -0
- package/dist/types/core/elements/axis.d.ts.map +1 -0
- package/dist/types/core/elements/chart-image.d.ts +13 -0
- package/dist/types/core/elements/chart-image.d.ts.map +1 -0
- package/dist/types/core/elements/font.d.ts +28 -0
- package/dist/types/core/elements/font.d.ts.map +1 -0
- package/dist/types/core/elements/format.d.ts +125 -0
- package/dist/types/core/elements/format.d.ts.map +1 -0
- package/dist/types/core/elements/gradient.d.ts +23 -0
- package/dist/types/core/elements/gradient.d.ts.map +1 -0
- package/dist/types/core/elements/legend-symbol.d.ts +49 -0
- package/dist/types/core/elements/legend-symbol.d.ts.map +1 -0
- package/dist/types/core/elements/legend.d.ts +131 -0
- package/dist/types/core/elements/legend.d.ts.map +1 -0
- package/dist/types/core/elements/margins.d.ts +9 -0
- package/dist/types/core/elements/margins.d.ts.map +1 -0
- package/dist/types/core/elements/panel.d.ts +13 -0
- package/dist/types/core/elements/panel.d.ts.map +1 -0
- package/dist/types/core/elements/scroll.d.ts +14 -0
- package/dist/types/core/elements/scroll.d.ts.map +1 -0
- package/dist/types/core/elements/shadow.d.ts +14 -0
- package/dist/types/core/elements/shadow.d.ts.map +1 -0
- package/dist/types/core/elements/stroke.d.ts +19 -0
- package/dist/types/core/elements/stroke.d.ts.map +1 -0
- package/dist/types/core/elements/wall.d.ts +13 -0
- package/dist/types/core/elements/wall.d.ts.map +1 -0
- package/dist/types/core/elements/zoom.d.ts +33 -0
- package/dist/types/core/elements/zoom.d.ts.map +1 -0
- package/dist/types/core/primitives.d.ts +33 -0
- package/dist/types/core/primitives.d.ts.map +1 -0
- package/dist/types/core.d.ts +96 -0
- package/dist/types/core.d.ts.map +1 -0
- package/dist/types/data/data-engine.d.ts +245 -0
- package/dist/types/data/data-engine.d.ts.map +1 -0
- package/dist/types/date.format.d.ts +5 -0
- package/dist/types/date.format.d.ts.map +1 -0
- package/dist/types/declarative-tools.d.ts +6 -0
- package/dist/types/declarative-tools.d.ts.map +1 -0
- package/dist/types/do-http-request.d.ts +2 -0
- package/dist/types/do-http-request.d.ts.map +1 -0
- package/dist/types/dom-tip.d.ts +41 -0
- package/dist/types/dom-tip.d.ts.map +1 -0
- package/dist/types/events.d.ts +82 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/extras.d.ts +18 -0
- package/dist/types/extras.d.ts.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/interaction.d.ts +67 -0
- package/dist/types/interaction.d.ts.map +1 -0
- package/dist/types/map-series-definition.d.ts +5 -0
- package/dist/types/map-series-definition.d.ts.map +1 -0
- package/dist/types/maps/africa-map.d.ts +10 -0
- package/dist/types/maps/africa-map.d.ts.map +1 -0
- package/dist/types/maps/asia-map.d.ts +10 -0
- package/dist/types/maps/asia-map.d.ts.map +1 -0
- package/dist/types/maps/australia-map.d.ts +10 -0
- package/dist/types/maps/australia-map.d.ts.map +1 -0
- package/dist/types/maps/europe-map.d.ts +10 -0
- package/dist/types/maps/europe-map.d.ts.map +1 -0
- package/dist/types/maps/europe27-map.d.ts +10 -0
- package/dist/types/maps/europe27-map.d.ts.map +1 -0
- package/dist/types/maps/layout-map.d.ts +51 -0
- package/dist/types/maps/layout-map.d.ts.map +1 -0
- package/dist/types/maps/map-types.d.ts +19 -0
- package/dist/types/maps/map-types.d.ts.map +1 -0
- package/dist/types/maps/south-america-map.d.ts +10 -0
- package/dist/types/maps/south-america-map.d.ts.map +1 -0
- package/dist/types/maps/spain-map.d.ts +11 -0
- package/dist/types/maps/spain-map.d.ts.map +1 -0
- package/dist/types/maps/svg-map.d.ts +37 -0
- package/dist/types/maps/svg-map.d.ts.map +1 -0
- package/dist/types/maps/usa-map.d.ts +12 -0
- package/dist/types/maps/usa-map.d.ts.map +1 -0
- package/dist/types/maps/world-map.d.ts +14 -0
- package/dist/types/maps/world-map.d.ts.map +1 -0
- package/dist/types/maps.d.ts +15 -0
- package/dist/types/maps.d.ts.map +1 -0
- package/dist/types/marks-animation.d.ts +16 -0
- package/dist/types/marks-animation.d.ts.map +1 -0
- package/dist/types/modern-theme.d.ts +14 -0
- package/dist/types/modern-theme.d.ts.map +1 -0
- package/dist/types/optional-options.d.ts +6 -0
- package/dist/types/optional-options.d.ts.map +1 -0
- package/dist/types/palette.d.ts +11 -0
- package/dist/types/palette.d.ts.map +1 -0
- package/dist/types/platform.d.ts +27 -0
- package/dist/types/platform.d.ts.map +1 -0
- package/dist/types/plugin.d.ts +80 -0
- package/dist/types/plugin.d.ts.map +1 -0
- package/dist/types/quadrants-plugin.d.ts +45 -0
- package/dist/types/quadrants-plugin.d.ts.map +1 -0
- package/dist/types/register-all.d.ts +3 -0
- package/dist/types/register-all.d.ts.map +1 -0
- package/dist/types/rendering/canvas-graphics.d.ts +65 -0
- package/dist/types/rendering/canvas-graphics.d.ts.map +1 -0
- package/dist/types/rendering/graphics.d.ts +59 -0
- package/dist/types/rendering/graphics.d.ts.map +1 -0
- package/dist/types/rendering/renderer.d.ts +58 -0
- package/dist/types/rendering/renderer.d.ts.map +1 -0
- package/dist/types/rendering/three-graphics.d.ts +22 -0
- package/dist/types/rendering/three-graphics.d.ts.map +1 -0
- package/dist/types/responsive.d.ts +8 -0
- package/dist/types/responsive.d.ts.map +1 -0
- package/dist/types/series/activity-gauge.d.ts +18 -0
- package/dist/types/series/activity-gauge.d.ts.map +1 -0
- package/dist/types/series/arc-gauge.d.ts +74 -0
- package/dist/types/series/arc-gauge.d.ts.map +1 -0
- package/dist/types/series/area.d.ts +24 -0
- package/dist/types/series/area.d.ts.map +1 -0
- package/dist/types/series/bar.d.ts +17 -0
- package/dist/types/series/bar.d.ts.map +1 -0
- package/dist/types/series/box-plot.d.ts +140 -0
- package/dist/types/series/box-plot.d.ts.map +1 -0
- package/dist/types/series/bubble.d.ts +25 -0
- package/dist/types/series/bubble.d.ts.map +1 -0
- package/dist/types/series/bullet.d.ts +86 -0
- package/dist/types/series/bullet.d.ts.map +1 -0
- package/dist/types/series/candle.d.ts +27 -0
- package/dist/types/series/candle.d.ts.map +1 -0
- package/dist/types/series/circular-gauge.d.ts +100 -0
- package/dist/types/series/circular-gauge.d.ts.map +1 -0
- package/dist/types/series/color-series.d.ts +59 -0
- package/dist/types/series/color-series.d.ts.map +1 -0
- package/dist/types/series/composed-series.d.ts +76 -0
- package/dist/types/series/composed-series.d.ts.map +1 -0
- package/dist/types/series/custom-bar.d.ts +63 -0
- package/dist/types/series/custom-bar.d.ts.map +1 -0
- package/dist/types/series/custom-series.d.ts +74 -0
- package/dist/types/series/custom-series.d.ts.map +1 -0
- package/dist/types/series/donut.d.ts +17 -0
- package/dist/types/series/donut.d.ts.map +1 -0
- package/dist/types/series/gantt.d.ts +47 -0
- package/dist/types/series/gantt.d.ts.map +1 -0
- package/dist/types/series/high-low-bar.d.ts +24 -0
- package/dist/types/series/high-low-bar.d.ts.map +1 -0
- package/dist/types/series/histogram.d.ts +36 -0
- package/dist/types/series/histogram.d.ts.map +1 -0
- package/dist/types/series/horiz-area.d.ts +11 -0
- package/dist/types/series/horiz-area.d.ts.map +1 -0
- package/dist/types/series/horiz-bar.d.ts +23 -0
- package/dist/types/series/horiz-bar.d.ts.map +1 -0
- package/dist/types/series/line.d.ts +22 -0
- package/dist/types/series/line.d.ts.map +1 -0
- package/dist/types/series/linear-gauge.d.ts +73 -0
- package/dist/types/series/linear-gauge.d.ts.map +1 -0
- package/dist/types/series/map-series.d.ts +82 -0
- package/dist/types/series/map-series.d.ts.map +1 -0
- package/dist/types/series/numeric-gauge.d.ts +96 -0
- package/dist/types/series/numeric-gauge.d.ts.map +1 -0
- package/dist/types/series/palette-series.d.ts +39 -0
- package/dist/types/series/palette-series.d.ts.map +1 -0
- package/dist/types/series/pie.d.ts +81 -0
- package/dist/types/series/pie.d.ts.map +1 -0
- package/dist/types/series/point-xy.d.ts +13 -0
- package/dist/types/series/point-xy.d.ts.map +1 -0
- package/dist/types/series/polar.d.ts +37 -0
- package/dist/types/series/polar.d.ts.map +1 -0
- package/dist/types/series/sankey.d.ts +90 -0
- package/dist/types/series/sankey.d.ts.map +1 -0
- package/dist/types/series/series-list.d.ts +127 -0
- package/dist/types/series/series-list.d.ts.map +1 -0
- package/dist/types/series/series-list.types.d.ts +43 -0
- package/dist/types/series/series-list.types.d.ts.map +1 -0
- package/dist/types/series/sliced.d.ts +13 -0
- package/dist/types/series/sliced.d.ts.map +1 -0
- package/dist/types/series/surface.d.ts +24 -0
- package/dist/types/series/surface.d.ts.map +1 -0
- package/dist/types/series/treemap.d.ts +107 -0
- package/dist/types/series/treemap.d.ts.map +1 -0
- package/dist/types/series/violin.d.ts +105 -0
- package/dist/types/series/violin.d.ts.map +1 -0
- package/dist/types/series/volume.d.ts +11 -0
- package/dist/types/series/volume.d.ts.map +1 -0
- package/dist/types/series-definitions.d.ts +30 -0
- package/dist/types/series-definitions.d.ts.map +1 -0
- package/dist/types/series-registry.d.ts +37 -0
- package/dist/types/series-registry.d.ts.map +1 -0
- package/dist/types/series-utils.d.ts +29 -0
- package/dist/types/series-utils.d.ts.map +1 -0
- package/dist/types/series.d.ts +342 -0
- package/dist/types/series.d.ts.map +1 -0
- package/dist/types/slider.d.ts +49 -0
- package/dist/types/slider.d.ts.map +1 -0
- package/dist/types/spline.d.ts +2 -0
- package/dist/types/spline.d.ts.map +1 -0
- package/dist/types/table/chart-table.d.ts +27 -0
- package/dist/types/table/chart-table.d.ts.map +1 -0
- package/dist/types/teechart-3d.d.ts +4 -0
- package/dist/types/teechart-3d.d.ts.map +1 -0
- package/dist/types/theme.d.ts +41 -0
- package/dist/types/theme.d.ts.map +1 -0
- package/dist/types/three/chart-3d.d.ts +77 -0
- package/dist/types/three/chart-3d.d.ts.map +1 -0
- package/dist/types/three/chart-options-3d.d.ts +5 -0
- package/dist/types/three/chart-options-3d.d.ts.map +1 -0
- package/dist/types/three/teechart-3d.d.ts +25 -0
- package/dist/types/three/teechart-3d.d.ts.map +1 -0
- package/dist/types/three-context.d.ts +184 -0
- package/dist/types/three-context.d.ts.map +1 -0
- package/dist/types/three-context.types.d.ts +177 -0
- package/dist/types/three-context.types.d.ts.map +1 -0
- package/dist/types/three-parametric-geometry.d.ts +7 -0
- package/dist/types/three-parametric-geometry.d.ts.map +1 -0
- package/dist/types/three.d.ts +6 -0
- package/dist/types/three.d.ts.map +1 -0
- package/dist/types/tools/animate-hover.d.ts +13 -0
- package/dist/types/tools/animate-hover.d.ts.map +1 -0
- package/dist/types/tools/annotation.d.ts +169 -0
- package/dist/types/tools/annotation.d.ts.map +1 -0
- package/dist/types/tools/base-animation.d.ts +83 -0
- package/dist/types/tools/base-animation.d.ts.map +1 -0
- package/dist/types/tools/cursor-tool.d.ts +51 -0
- package/dist/types/tools/cursor-tool.d.ts.map +1 -0
- package/dist/types/tools/drag-tool.d.ts +28 -0
- package/dist/types/tools/drag-tool.d.ts.map +1 -0
- package/dist/types/tools/index.d.ts +8 -0
- package/dist/types/tools/index.d.ts.map +1 -0
- package/dist/types/tools/tool.d.ts +27 -0
- package/dist/types/tools/tool.d.ts.map +1 -0
- package/dist/types/tools/tools.d.ts +33 -0
- package/dist/types/tools/tools.d.ts.map +1 -0
- package/dist/types/utils.d.ts +23 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/dist/types/worker.d.ts +92 -0
- package/dist/types/worker.d.ts.map +1 -0
- package/package.json +74 -27
- package/dist/Tween.js +0 -13
- package/dist/date.format.js +0 -145
- package/dist/excanvas/canvas.text.js +0 -489
- package/dist/excanvas/excanvas.compiled.js +0 -35
- package/dist/excanvas/excanvas.js +0 -924
- package/dist/excanvas/excanvas_text.js +0 -1416
- package/dist/three.js +0 -990
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"series-DeozLXIv.js","sources":["../../../../src/series-utils.ts","../../../../src/core/primitives.ts","../../../../src/utils.ts","../../../../src/platform.ts","../../../../src/core/elements/chart-image.ts","../../../../src/core/elements/gradient.ts","../../../../src/core/elements/shadow.ts","../../../../src/core/elements/stroke.ts","../../../../src/core/elements/font.ts","../../../../src/core/elements/format.ts","../../../../src/core/elements/axis-grid.ts","../../../../src/date.format.ts","../../../../src/core/elements/axis-labels.ts","../../../../src/core/elements/axis-ticks.ts","../../../../src/events.ts","../../../../src/tools/tool.ts","../../../../src/tools/base-animation.ts","../../../../src/tools/animate-hover.ts","../../../../src/core/elements/margins.ts","../../../../src/dom-tip.ts","../../../../src/rendering/canvas-graphics.ts","../../../../src/rendering/renderer.ts","../../../../src/tools/annotation.ts","../../../../src/core/elements/axis-title.ts","../../../../src/core/elements/axis.ts","../../../../src/do-http-request.ts","../../../../src/palette.ts","../../../../src/series.ts"],"sourcesContent":["import type { Series } from \"./series.js\"\nimport type { Pointer } from \"./series/custom-series.js\"\n\nexport interface SeriesDataLike {\n\tvalues: number[]\n\tlabels: string[]\n\tcode?: unknown[]\n}\n\nexport function parseText(data: SeriesDataLike, text: string): void {\n\tdata.values = []\n\tdata.labels = []\n\tconst lines = text.split(\"\\n\")\n\tfor (let t = 0; t < lines.length; t++) {\n\t\tconst fields = lines[t].split(\",\")\n\t\tlet numberFound = false\n\t\tfor (const field of fields) {\n\t\t\tconst value = parseFloat(field)\n\t\t\tif (!Number.isNaN(value)) {\n\t\t\t\tnumberFound = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif (!numberFound) {\n\t\t\tdata.values[t] = 0\n\t\t\tcontinue\n\t\t}\n\t\tlet value = parseFloat(fields.length === 1 ? fields[0] : fields.length === 2 ? fields[0] : fields[1])\n\t\tif (Number.isNaN(value)) value = 0\n\t\tif (fields.length > 1) data.labels[t] = fields[fields.length - 1]\n\t\tdata.values[t] = value\n\t}\n}\n\nexport function ArraySumAbs(a: ArrayLike<number>): number {\n\tlet sum = 0\n\tfor (let i = a.length - 1; i >= 0; i--) sum += a[i] > 0 ? a[i] : -a[i]\n\treturn sum\n}\n\nexport function isArray(obj: unknown): obj is unknown[] {\n\treturn Array.isArray(obj)\n}\n\nexport function removeEmptyArrayElements<T>(arr: ArrayLike<T> | T): ArrayLike<T> | T {\n\tif (!isArray(arr)) return arr\n\treturn arr.filter(elem => elem !== null).map(removeEmptyArrayElements) as T[]\n}\n\nfunction toNumber(item: number | Date): number {\n\treturn item instanceof Date ? item.getTime() : Number(item)\n}\n\n/** True when every value is a number or Date and none is smaller than the one before it. */\nexport function isAscending(values: ArrayLike<number | Date>): boolean {\n\tlet previous = -Number.MAX_VALUE\n\tfor (let i = 0; i < values.length; i++) {\n\t\tconst value = toNumber(values[i])\n\t\t// Written so that NaN, null and undefined also fail the check.\n\t\tif (!(value >= previous)) return false\n\t\tprevious = value\n\t}\n\treturn true\n}\n\n/**\n * For ascending x values, the half open range of points that can be drawn inside [minimum, maximum],\n * including the neighbouring point on each side so that lines entering and leaving the range are kept.\n * Returns null when the values are not ascending or do not match `length`, so callers draw everything.\n */\nexport function visiblePointRange(\n\tx: ArrayLike<number | Date>,\n\tlength: number,\n\tminimum: number,\n\tmaximum: number\n): [number, number] | null {\n\tif (x.length !== length || length === 0 || Number.isNaN(minimum) || Number.isNaN(maximum)) return null\n\tif (!isAscending(x)) return null\n\n\tconst low = Math.min(minimum, maximum)\n\tconst high = Math.max(minimum, maximum)\n\n\t// First index whose value is at least `limit`, or greater than it when `strict`.\n\tconst search = (limit: number, strict: boolean): number => {\n\t\tlet lower = 0\n\t\tlet upper = length\n\t\twhile (lower < upper) {\n\t\t\tconst middle = (lower + upper) >>> 1\n\t\t\tconst value = toNumber(x[middle])\n\t\t\tif (strict ? value > limit : value >= limit) upper = middle\n\t\t\telse lower = middle + 1\n\t\t}\n\t\treturn lower\n\t}\n\n\treturn [Math.max(0, search(low, false) - 1), Math.min(length, search(high, true) + 1)]\n}\n\nexport function ArrayMax(a: ArrayLike<number | Date>): number {\n\t// Only actual arrays were filtered; other array-like inputs keep their coercion semantics.\n\tconst skipNulls = isArray(a)\n\tlet max = -Number.MAX_VALUE\n\tfor (let i = 0; i < a.length; i++) {\n\t\tconst item = a[i]\n\t\tif (skipNulls && item === null) continue\n\t\tconst value = item instanceof Date ? item.getTime() : item\n\t\tif (max < value) max = value\n\t}\n\treturn max\n}\n\nexport function ArrayMin(a: ArrayLike<number | Date>): number {\n\tconst skipNulls = isArray(a)\n\tlet min = Number.MAX_VALUE\n\tfor (let i = 0; i < a.length; i++) {\n\t\tconst item = a[i]\n\t\tif (skipNulls && item === null) continue\n\t\tconst value = item instanceof Date ? item.getTime() : item\n\t\tif (min > value) min = value\n\t}\n\treturn min\n}\n\n/**\n * The point marker of a series that draws one (line like series), or undefined. Gauges also have a\n * `pointer`, but it is a plain Format with no marker settings, so it is left out.\n */\nexport function pointerOf(series: Series): Pointer | undefined {\n\tconst pointer = (series as { pointer?: unknown }).pointer\n\treturn pointer && typeof pointer === \"object\" && \"format\" in pointer ? (pointer as Pointer) : undefined\n}\n\n/** The value at `fraction` (0 to 1) of an ascending sorted array, interpolating between neighbours. */\nexport function quantile(sorted: number[], fraction: number): number {\n\tconst position = (sorted.length - 1) * fraction\n\tconst lower = Math.floor(position)\n\tconst upper = Math.ceil(position)\n\treturn sorted[lower] + (sorted[upper] - sorted[lower]) * (position - lower)\n}\n","export interface PointLike {\n\tx: number\n\ty: number\n}\n\n/** A two-dimensional point. */\nexport class Point implements PointLike {\n\tx: number\n\ty: number\n\n\tconstructor(x = 0, y = 0) {\n\t\tthis.x = x\n\t\tthis.y = y\n\t}\n}\n\n/** A rectangle with an origin and dimensions. */\nexport class Rectangle implements PointLike {\n\tx: number\n\ty: number\n\twidth: number\n\theight: number\n\tautomatic: boolean | undefined\n\n\tconstructor(x = 0, y = 0, width = 0, height = 0) {\n\t\tthis.x = x\n\t\tthis.y = y\n\t\tthis.width = width\n\t\tthis.height = height\n\t}\n\n\tset(x: number, y: number, width: number, height: number): void {\n\t\tthis.x = x\n\t\tthis.y = y\n\t\tthis.width = width\n\t\tthis.height = height\n\t}\n\n\tsetFrom(rectangle: PointLike & { width: number; height: number }): void {\n\t\tthis.x = rectangle.x\n\t\tthis.y = rectangle.y\n\t\tthis.width = rectangle.width\n\t\tthis.height = rectangle.height\n\t}\n\n\tgetRight(): number {\n\t\treturn this.x + this.width\n\t}\n\n\tgetBottom(): number {\n\t\treturn this.y + this.height\n\t}\n\n\tsetTop(value: number): void {\n\t\tthis.height -= value - this.y\n\t\tthis.y = value\n\t}\n\n\tsetBottom(value: number): void {\n\t\tthis.height = value - this.y\n\t}\n\n\tsetLeft(value: number): void {\n\t\tthis.width -= value - this.x\n\t\tthis.x = value\n\t}\n\n\tsetRight(value: number): void {\n\t\tthis.width = value - this.x\n\t}\n\n\tcontains(point: PointLike): boolean {\n\t\treturn point.x >= this.x && point.x <= this.getRight() && point.y >= this.y && point.y <= this.getBottom()\n\t}\n\n\toffset(x: number, y: number): void {\n\t\tthis.x += x\n\t\tthis.y += y\n\t}\n}\n","export interface PointLike {\n\tx: number\n\ty: number\n}\n\nexport interface ChartLike {\n\tcanvas: HTMLCanvasElement\n\tdestroyed?: boolean\n\tzoom: { reset(): void }\n\tdraw(): void\n\t_doubleTapCleanup?: (() => void) | null\n\t_eventCleanups?: Array<() => void>\n}\n\nexport function pointInLine(p: PointLike, p1: PointLike, p2: PointLike, tolerance: number): boolean {\n\tlet dx: number\n\tlet dy: number\n\tif (p2.x === p1.x && p2.y === p1.y) {\n\t\tdx = p.x - p1.x\n\t\tdy = p.y - p1.y\n\t} else {\n\t\tdx = p2.x - p1.x\n\t\tdy = p2.y - p1.y\n\t\tconst projection = ((p.x - p1.x) * dx + (p.y - p1.y) * dy) / (dx * dx + dy * dy)\n\t\tif (projection < 0) {\n\t\t\tdx = p.x - p1.x\n\t\t\tdy = p.y - p1.y\n\t\t} else if (projection > 1) {\n\t\t\tdx = p.x - p2.x\n\t\t\tdy = p.y - p2.y\n\t\t} else {\n\t\t\tdx = p.x - (p1.x + projection * dx)\n\t\t\tdy = p.y - (p1.y + projection * dy)\n\t\t}\n\t}\n\tif ((p.x === p1.x && p.y === p1.y) || (p.x === p2.x && p.y === p2.y)) return true\n\treturn Math.sqrt(dx * dx + dy * dy) <= tolerance + 1\n}\n\nexport function dashedLine(\n\tctx: CanvasRenderingContext2D,\n\tx: number,\n\ty: number,\n\tx2: number,\n\ty2: number,\n\tda = [10, 5]\n): void {\n\tctx.save()\n\tconst dx = x2 - x,\n\t\tdy = y2 - y\n\tconst len = Math.sqrt(dx * dx + dy * dy)\n\tctx.translate(x, y)\n\tctx.moveTo(0, 0)\n\tctx.rotate(Math.atan2(dy, dx))\n\tlet dashIndex = 0,\n\t\tdraw = true,\n\t\tprogress = 0\n\twhile (progress < len) {\n\t\tprogress += da[dashIndex++ % da.length]\n\t\tif (progress > len) progress = len\n\t\tif (draw) ctx.lineTo(progress, 0)\n\t\telse ctx.moveTo(progress, 0)\n\t\tdraw = !draw\n\t}\n\tctx.restore()\n}\n\nexport function doubleTap(chart: ChartLike): void {\n\tif (chart._doubleTapCleanup) return\n\tlet lastTap = 0\n\tconst onTouchEnd = (e: TouchEvent) => {\n\t\tif (chart.destroyed) return\n\t\tconst currentTime = Date.now(),\n\t\t\ttapLength = currentTime - lastTap\n\t\tif (tapLength < 600 && tapLength > 100) {\n\t\t\tchart.zoom.reset()\n\t\t\tchart.draw()\n\t\t}\n\t\tlastTap = currentTime\n\t\te.preventDefault()\n\t}\n\tchart.canvas.addEventListener(\"touchend\", onTouchEnd)\n\tchart._doubleTapCleanup = () => {\n\t\tchart.canvas.removeEventListener(\"touchend\", onTouchEnd)\n\t\tchart._doubleTapCleanup = null\n\t}\n\tchart._eventCleanups?.push(chart._doubleTapCleanup)\n}\n\nexport function trunc(value: number): number {\n\treturn value | 0\n}\n\nexport function toRadians(angle: number): number {\n\treturn angle * (Math.PI / 180)\n}\n\nexport function copyOwnProperties(target: object, source: object): void {\n\tfor (const key of Reflect.ownKeys(source)) {\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(source, key)\n\t\tif (descriptor) Object.defineProperty(target, key, descriptor)\n\t}\n}\n\nexport function colorToRgba(color: string | number[], alpha: number): string {\n\treturn `rgba( ${color[0]}, ${color[1]}, ${color[2]}, ${alpha} )`\n}\n\nexport function getTableCellText(cell: HTMLTableCellElement): string {\n\treturn cell.textContent || cell.innerText // IE\n}\n","/** Browser runtime boundary used by the chart engine. */\n\n/** Dynamic constructors are intentionally open at this legacy browser boundary. */\nexport type PlatformConstructor<T = unknown> = new (...args: unknown[]) => T\n\nexport function getWindow(): Window | undefined {\n\treturn globalThis.window\n}\n\nexport function getDocument(): Document | undefined {\n\treturn globalThis.document\n}\n\nexport function getNavigator(): Navigator | undefined {\n\treturn globalThis.navigator || getWindow()?.navigator\n}\n\nexport function getPlatformConstructor<T = unknown>(name: string): PlatformConstructor<T> | undefined {\n\treturn ((globalThis as unknown as Record<string, unknown>)[name] || getWindow()?.[name as keyof Window]) as\n\t\t| PlatformConstructor<T>\n\t\t| undefined\n}\n\nexport function getXMLHttpRequest(): PlatformConstructor<XMLHttpRequest> | undefined {\n\treturn getPlatformConstructor<XMLHttpRequest>(\"XMLHttpRequest\")\n}\n\nexport function getDOMParser(): PlatformConstructor<DOMParser> | undefined {\n\treturn getPlatformConstructor<DOMParser>(\"DOMParser\")\n}\n\nexport function getImageConstructor(): PlatformConstructor<HTMLImageElement> | undefined {\n\treturn getPlatformConstructor<HTMLImageElement>(\"Image\")\n}\n\n/** The `Microsoft.XMLHTTP` object of legacy Internet Explorer. */\nexport interface LegacyXmlHttpRequest {\n\topen(method: string, url: string, async: boolean): void\n\tsend(): void\n\tresponseXML: XMLDocument\n}\n\n/** The `Microsoft.XMLDOM` object of legacy Internet Explorer. */\nexport interface LegacyXmlDocument extends XMLDocument {\n\tasync: boolean\n\tloadXML(text: string): boolean\n}\n\nexport function getActiveXObject<T = unknown>(): PlatformConstructor<T> | undefined {\n\treturn getPlatformConstructor<T>(\"ActiveXObject\")\n}\n\nexport function isCanvasElement(value: unknown): value is HTMLCanvasElement {\n\tconst CanvasElement = globalThis.HTMLCanvasElement\n\treturn typeof CanvasElement !== \"undefined\" && value instanceof CanvasElement\n}\n\nexport function isTableElement(value: unknown): value is HTMLTableElement {\n\tconst TableElement = globalThis.HTMLTableElement\n\treturn typeof TableElement !== \"undefined\" && value instanceof TableElement\n}\n\nexport function requestAnimationFrame(callback: FrameRequestCallback): number {\n\tconst runtimeWindow = getWindow()\n\tconst request = globalThis.requestAnimationFrame || runtimeWindow?.requestAnimationFrame\n\treturn request ? request.call(runtimeWindow, callback) : setTimeout(callback, 0)\n}\n\nexport function cancelAnimationFrame(handle: number): void {\n\tconst runtimeWindow = getWindow()\n\tconst cancel = globalThis.cancelAnimationFrame || runtimeWindow?.cancelAnimationFrame\n\tif (cancel) cancel.call(runtimeWindow, handle)\n\telse clearTimeout(handle)\n}\n","import { getImageConstructor } from \"../../platform.js\"\nimport type { Chart } from \"../../chart.js\"\nimport type { Graphics } from \"../../rendering/graphics.js\"\n\nexport class ChartImage {\n\tchart: Chart\n\turl = \"\"\n\trepeat = \"no-repeat\"\n\tbackFill = false\n\tvisible = true\n\timage: HTMLImageElement | null = null\n\n\tconstructor(chart: Chart) {\n\t\tthis.chart = chart\n\t}\n\n\ttryDraw(x: number, y: number, width: number, height: number, graphics?: Graphics | null): void {\n\t\tif (!this.image) {\n\t\t\tconst ImageConstructor = getImageConstructor()\n\t\t\tif (!ImageConstructor) throw new Error(\"Image is not supported by this browser.\")\n\t\t\tthis.image = new ImageConstructor() as HTMLImageElement\n\t\t\tthis.image.onload = () => this.chart.draw()\n\t\t}\n\n\t\tconst image = this.image\n\t\tconst drawingSurface = graphics || this.chart.graphics\n\t\tif (!drawingSurface) return\n\n\t\tif (image.src === \"\") {\n\t\t\timage.src = this.url\n\t\t\treturn\n\t\t}\n\n\t\tif (this.repeat === \"repeat\") {\n\t\t\tconst pattern = drawingSurface.createPattern(image, \"repeat\")\n\t\t\tif (pattern) {\n\t\t\t\tdrawingSurface.fillStyle = pattern\n\t\t\t\tdrawingSurface.fillRect(x, y, width, height)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tdrawingSurface.drawImage(image, x, y, width, height)\n\t}\n}\n","import type { Chart } from \"../../chart.js\"\nimport type { Rectangle } from \"../primitives.js\"\nimport type { Gradient as DrawingGradient } from \"../../rendering/graphics.js\"\n\ntype GradientBounds = Pick<Rectangle, \"x\" | \"y\" | \"width\" | \"height\">\n\nexport type GradientDirection = \"topbottom\" | \"bottomtop\" | \"leftright\" | \"rightleft\" | \"radial\" | \"diagonalup\" | string\n\nexport class Gradient {\n\tchart: Chart | undefined\n\tvisible = false\n\tcolors: string[] = [\"white\", \"silver\"]\n\tdirection: GradientDirection = \"topbottom\"\n\tstops: number[] | null = null\n\toffset = { x: 0, y: 0 }\n\n\tconstructor(chart?: Chart) {\n\t\tthis.chart = chart\n\t}\n\n\tcreate(rectangle: Rectangle, color?: string): CanvasGradient {\n\t\treturn this.createDrawing(rectangle, color) as CanvasGradient\n\t}\n\n\trect(x: number, y: number, width: number, height: number, color?: string): CanvasGradient {\n\t\treturn this.createDrawing({ x, y, width, height }, color) as CanvasGradient\n\t}\n\n\tcreateDrawing(rectangle: GradientBounds, color?: string): DrawingGradient {\n\t\tconst context = this.chart?.graphics || this.chart?.ctx\n\t\tif (!context) throw new Error(\"Gradient requires a chart context\")\n\t\tconst { x, y, width, height } = rectangle\n\t\tconst createLinear = (x0: number, y0: number, x1: number, y1: number) =>\n\t\t\tcontext.createLinearGradient(x0, y0, x1, y1)\n\t\tlet gradient: DrawingGradient\n\n\t\tswitch (this.direction) {\n\t\t\tcase \"topbottom\":\n\t\t\t\tgradient = createLinear(x, y, x, y + height)\n\t\t\t\tbreak\n\t\t\tcase \"bottomtop\":\n\t\t\t\tgradient = createLinear(x, y + height, x, y)\n\t\t\t\tbreak\n\t\t\tcase \"leftright\":\n\t\t\t\tgradient = createLinear(x, y, x + width, y)\n\t\t\t\tbreak\n\t\t\tcase \"rightleft\":\n\t\t\t\tgradient = createLinear(x + width, y, x, y)\n\t\t\t\tbreak\n\t\t\tcase \"radial\": {\n\t\t\t\tconst centerX = x + width * 0.5 + this.offset.x\n\t\t\t\tconst centerY = y + height * 0.5 + this.offset.y\n\t\t\t\tconst radius = Math.max(width, height)\n\t\t\t\tgradient = context.createRadialGradient(centerX, centerY, 0, centerX, centerY, radius)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcase \"diagonalup\":\n\t\t\t\tgradient = createLinear(x, y + height, x + width, y)\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\tgradient = createLinear(x, y, x + width, y + height)\n\t\t}\n\n\t\tif (color) this.setEndColor(color)\n\t\tconst stopCount = this.stops?.length ?? 0\n\t\tif (this.colors.length > 1) {\n\t\t\tfor (let index = 0; index < this.colors.length; index++) {\n\t\t\t\tconst stop = stopCount <= index ? index / (this.colors.length - 1) : (this.stops?.[index] ?? 0)\n\t\t\t\tgradient.addColorStop(stop, this.colors[index])\n\t\t\t}\n\t\t} else gradient.addColorStop(0, this.colors[0] || \"white\")\n\n\t\treturn gradient\n\t}\n\n\tsetEndColor(color: string): void {\n\t\tif (!color) return\n\t\tfor (let index = 1; index < this.colors.length; index++) this.colors[index] = color\n\t}\n}\n","import type { Chart } from \"../../chart.js\"\nimport type { Graphics } from \"../../rendering/graphics.js\"\n\nexport class Shadow {\n\tchart: Chart | undefined\n\tvisible = false\n\tblur = 4\n\tcolor = \"rgba(80,80,80,0.75)\"\n\twidth = 4\n\theight = 4\n\n\tconstructor(chart?: Chart) {\n\t\tthis.chart = chart\n\t}\n\n\tprepare(context: Pick<Graphics, \"shadowBlur\" | \"shadowColor\" | \"shadowOffsetX\" | \"shadowOffsetY\">): void {\n\t\tif (this.visible) {\n\t\t\tcontext.shadowBlur = this.blur\n\t\t\tcontext.shadowColor = this.color\n\t\t\tcontext.shadowOffsetX = this.width\n\t\t\tcontext.shadowOffsetY = this.chart?.isAndroid ? -this.height : this.height\n\t\t} else context.shadowColor = \"transparent\"\n\t}\n\n\tset(shadow: Shadow): void {\n\t\tthis.visible = shadow.visible\n\t\tthis.color = shadow.color\n\t\tthis.blur = shadow.blur\n\t\tthis.width = shadow.width\n\t\tthis.height = shadow.height\n\t}\n}\n","import { Gradient } from \"./gradient.js\"\nimport type { Chart } from \"../../chart.js\"\nimport type { Graphics } from \"../../rendering/graphics.js\"\n\ntype StrokeContext = Pick<\n\tGraphics,\n\t\"strokeStyle\" | \"lineWidth\" | \"lineJoin\" | \"lineCap\" | \"shadowColor\" | \"setLineDash\"\n>\n\nexport class Stroke {\n\tchart: Chart | undefined\n\tfill = \"black\"\n\tsize = 1\n\tjoin: CanvasLineJoin = \"round\"\n\tcap: CanvasLineCap = \"square\"\n\tdash: number[] | null = null\n\tprivate _g: Gradient | null = null\n\n\tconstructor(chart?: Chart) {\n\t\tthis.chart = chart\n\t}\n\n\tget gradient(): Gradient {\n\t\tif (!this._g) this._g = new Gradient(this.chart)\n\t\treturn this._g\n\t}\n\n\tprepare(fill?: string, context?: StrokeContext): void {\n\t\tconst chart = this.chart\n\t\tif (!chart) return\n\t\tconst ctx = context || chart.graphics || chart.ctx\n\t\tif (!ctx) return\n\t\tconst gradient = this._g\n\t\tctx.strokeStyle = gradient?.visible ? gradient.createDrawing(chart.bounds) : fill || this.fill\n\t\tctx.lineWidth = this.size\n\t\tctx.lineJoin = this.join\n\t\tctx.lineCap = this.cap\n\t\tctx.shadowColor = \"transparent\"\n\n\t\tctx.setLineDash(this.dash || [])\n\t}\n\n\tsetChart(chart: Chart): void {\n\t\tthis.chart = chart\n\t\tif (this._g) this._g.chart = chart\n\t}\n}\n","import { Gradient } from \"./gradient.js\"\nimport { Shadow } from \"./shadow.js\"\nimport { Stroke } from \"./stroke.js\"\nimport type { Chart } from \"../../chart.js\"\n\nexport class Font {\n\tchart: Chart | undefined\n\tstyle = \"11px Tahoma\"\n\tfill = \"black\"\n\ttextAlign: CanvasTextAlign = \"center\"\n\tbaseLine: CanvasTextBaseline = \"alphabetic\"\n\tlineThrough: boolean | undefined\n\t/** Gauge ticks: draws the tick labels. */\n\tvisible?: boolean\n\t/** The gradient, once it has been used. Read by Format to avoid creating it. */\n\t_g: Gradient | null = null\n\tprivate _sh: Shadow | null = null\n\t/** The stroke, once it has been used. Read by Format to avoid creating it. */\n\t_s: Stroke | null = null\n\n\tconstructor(chart?: Chart) {\n\t\tthis.chart = chart\n\t}\n\n\tget gradient(): Gradient {\n\t\tif (!this._g) this._g = new Gradient(this.chart)\n\t\treturn this._g\n\t}\n\n\tget shadow(): Shadow {\n\t\tif (!this._sh) this._sh = new Shadow(this.chart)\n\t\treturn this._sh\n\t}\n\n\tget stroke(): Stroke {\n\t\tif (!this._s) {\n\t\t\tthis._s = new Stroke(this.chart)\n\t\t\tthis._s.fill = \"\"\n\t\t}\n\t\treturn this._s\n\t}\n\n\tgetSize(): number {\n\t\tfor (const part of this.style.split(\" \")) {\n\t\t\tconst size = parseFloat(part)\n\t\t\tif (size) return size\n\t\t}\n\t\treturn 20\n\t}\n\n\tsetSize(value: number): void {\n\t\tthis.style = this.style\n\t\t\t.split(\" \")\n\t\t\t.map(part => (parseFloat(part) ? `${value}px` : part))\n\t\t\t.join(\" \")\n\t}\n\n\tprepare(): void {\n\t\tconst context = this.chart?.graphics || this.chart?.ctx\n\t\tif (!context) return\n\t\tcontext.textAlign = this.textAlign\n\t\tcontext.textBaseline = this.baseLine\n\t\tif (this._sh) this._sh.prepare(context)\n\t\tif (context.font !== this.style) context.font = this.style\n\t}\n\n\tsetChart(chart: Chart): void {\n\t\tthis.chart = chart\n\t\tif (this._g) this._g.chart = chart\n\t\tif (this._sh) this._sh.chart = chart\n\t\tif (this._s) this._s.setChart(chart)\n\t}\n}\n","import { Point, Rectangle } from \"../primitives.js\"\nimport { ChartImage } from \"./chart-image.js\"\nimport { Font } from \"./font.js\"\nimport { Gradient } from \"./gradient.js\"\nimport { Shadow } from \"./shadow.js\"\nimport { Stroke } from \"./stroke.js\"\nimport type { Chart } from \"../../chart.js\"\nimport type { Graphics } from \"../../rendering/graphics.js\"\nimport type { ThreeGraphics } from \"../../rendering/three-graphics.js\"\n\ninterface FormatRound {\n\tx: number\n\ty: number\n\tcorners?: [boolean, boolean, boolean, boolean]\n}\n\ntype BoundsProvider = (() => Rectangle) | null\n\n/** Anything with the position and size of a rectangle. */\ninterface Bounds {\n\tx: number\n\ty: number\n\twidth: number\n\theight: number\n}\ntype FormatCoordinate = number | { x: number; y: number; width: number; height: number } | object\n\n/** An offset in percent of the size of the owner. */\nexport interface PercentLocation {\n\tx: number\n\ty: number\n}\n\nconst NO_OFFSET: PercentLocation = { x: 0, y: 0 }\n\n/** The percentage offset of a location, or no offset when it is a placement name. */\nexport function percentLocation(location: PercentLocation | string): PercentLocation {\n\treturn typeof location === \"string\" ? NO_OFFSET : location\n}\n\n/**\n * @public\n * @class Contains visual parameters like fill, shadow, image, font.\n * @param {Tee.Chart} chart The parent chart this format object belongs to.\n */\nexport class Format {\n\tchart: Chart\n\tsize = 0\n\tback = 0\n\tpadding = 0\n\tpointer = false\n\tshape = \"\"\n\t/** Gauge hover: the value under the mouse, or null when there is none. */\n\tvalue: number | null = 0\n\ttext = \"\"\n\t/** A percentage offset (gauge elements) or a placement name such as \"end\" or \"center\" (bar marks). */\n\tlocation: PercentLocation | string = { x: 0, y: 0 }\n\tposition = { x: 0, y: 0 }\n\twidth = 0\n\theight = 0\n\tgradient: Gradient\n\tfill = \"rgb(200,200,200)\"\n\tstroke: Stroke\n\tround: FormatRound = { x: 0, y: 0 }\n\ttransparency = 0\n\tenabled = true\n\ttube?: boolean\n\tbeveled?: boolean\n\tdoSuperNums = false\n\tdoSubNums = false\n\tfont: Font\n\tshadow: Shadow\n\tdeclare z: number\n\tdeclare depth: number\n\tvisible?: boolean\n\tlength?: number\n\tradius?: number\n\tranges?: Array<{ value: number; fill: string }>\n\ttop?: Format\n\tvalid?: boolean\n\tunderline?: boolean\n\t/** Gauge ticks: draws each tick as a triangle. */\n\tdeclare triangle?: boolean\n\t/** Gauge ticks: draws them outside the scale. */\n\tdeclare outside?: boolean\n\t/** Series hover: highlights the line as well as the point. */\n\tdeclare line?: boolean\n\t/** Gauge minor ticks per major tick. */\n\tdeclare count?: number\n\t_img: ChartImage | null = null\n\t_tmpPolygonBounds = new Rectangle()\n\n\tconstructor(chart?: Chart) {\n\t\t// A format can be created before it has a chart: it is set with setChart.\n\t\tthis.chart = chart as Chart\n\n\t\tthis.gradient = new Gradient(chart)\n\t\tthis.stroke = new Stroke(chart)\n\n\t\tthis.font = new Font(chart)\n\t\tthis.shadow = new Shadow(chart)\n\t}\n\n\tprivate getGraphics(): Graphics | null {\n\t\treturn (this.chart?.graphics || this.chart?.ctx) as Graphics | null\n\t}\n\n\tget image() {\n\t\tif (!this._img) {\n\t\t\tthis._img = new ChartImage(this.chart)\n\t\t}\n\n\t\treturn this._img\n\t}\n\n\t/**\n\t * Draws a rectangle with rounded corners.\n\t */\n\troundRect(\n\t\tctx: Graphics & { roundRect?: (x: number, y: number, w: number, h: number, r?: number) => void },\n\t\tx: number,\n\t\ty: number,\n\t\twidth: number,\n\t\theight: number\n\t) {\n\t\tif (ctx.roundRect) {\n\t\t\t// The canvas takes a single radius; the vertical one was always ignored.\n\t\t\tctx.roundRect(x, y, width, height, this.round.x)\n\t\t\treturn\n\t\t}\n\n\t\tlet r = x + width\n\t\tlet b = y + height\n\t\tlet xr = this.round.x\n\t\tlet yr = this.round.y\n\t\tconst corners = this.round.corners\n\n\t\tif (height < 0) {\n\t\t\ty = b\n\t\t\tb = y - height\n\t\t}\n\n\t\tif (width < 0) {\n\t\t\tx = r\n\t\t\tr = x - width\n\t\t}\n\n\t\tif (2 * xr > width) xr = width * 0.5\n\t\tif (2 * yr > height) yr = height * 0.5\n\n\t\t!corners || corners[0] ? ctx.moveTo(x + xr, y) : ctx.moveTo(x, y)\n\n\t\tif (!corners || corners[1]) {\n\t\t\tctx.lineTo(r - xr, y)\n\t\t\tctx.quadraticCurveTo(r, y, r, y + yr)\n\t\t} else {\n\t\t\tctx.lineTo(r, y)\n\t\t}\n\n\t\tif (!corners || corners[2]) {\n\t\t\tctx.lineTo(r, b - yr)\n\t\t\tctx.quadraticCurveTo(r, b, r - xr, b)\n\t\t} else {\n\t\t\tctx.lineTo(r, b)\n\t\t}\n\n\t\tif (!corners || corners[3]) {\n\t\t\tctx.lineTo(x + xr, b)\n\t\t\tctx.quadraticCurveTo(x, b, x, b - yr)\n\t\t} else {\n\t\t\tctx.lineTo(x, b)\n\t\t}\n\n\t\tif (!corners || corners[0]) {\n\t\t\tctx.lineTo(x, y + yr)\n\t\t\tctx.quadraticCurveTo(x, y, x + xr, y)\n\t\t} else {\n\t\t\tctx.lineTo(x, y)\n\t\t}\n\n\t\tctx.closePath()\n\t}\n\n\t/** @param {string} [_text] */\n\ttextHeight(_text?: string): number {\n\t\treturn this.font.getSize() * 1.3\n\t}\n\n\ttextWidth(text: string): number {\n\t\treturn this.getGraphics()?.measureText(text).width || 0\n\t}\n\n\tfillBack(c: Graphics, getbounds: BoundsProvider, x?: number, y?: number, width?: number, height?: number) {\n\t\tif (this.gradient.visible) {\n\t\t\tc.fillStyle = getbounds\n\t\t\t\t? this.gradient.createDrawing(getbounds())\n\t\t\t\t: this.gradient.createDrawing({ x: Number(x), y: Number(y), width: Number(width), height: Number(height) })\n\t\t\tc.fill()\n\t\t} else if (this.fill !== \"\") {\n\t\t\tc.fillStyle = this.fill\n\t\t\tc.fill()\n\t\t}\n\t}\n\n\tdraw(\n\t\tc: Graphics,\n\t\tgetbounds: BoundsProvider,\n\t\tx?: FormatCoordinate,\n\t\ty?: number,\n\t\twidth?: number,\n\t\theight?: number\n\t): void {\n\t\tconst i = this._img\n\t\tlet oldtransp = 1\n\n\t\tif (typeof x === \"object\") {\n\t\t\tconst rectangle = x as { x: number; y: number; width: number; height: number }\n\t\t\ty = rectangle.y\n\t\t\twidth = rectangle.width\n\t\t\theight = rectangle.height\n\t\t\tx = rectangle.x\n\t\t}\n\n\t\tif (this.transparency > 0) {\n\t\t\toldtransp = c.globalAlpha\n\t\t\tc.globalAlpha = (1 - this.transparency) * oldtransp\n\t\t}\n\n\t\tthis.shadow.prepare(c)\n\n\t\tif (i?.visible && i.url !== \"\") {\n\t\t\tc.save()\n\t\t\tc.clip()\n\n\t\t\tif (i.backFill === true) {\n\t\t\t\tthis.fillBack(c, getbounds, x, y, width, height)\n\t\t\t}\n\n\t\t\tif (getbounds) {\n\t\t\t\tconst r = getbounds()\n\t\t\t\ti.tryDraw(r.x, r.y, r.width, r.height)\n\t\t\t} else {\n\t\t\t\ti.tryDraw(Number(x), Number(y), Number(width), Number(height))\n\t\t\t}\n\n\t\t\tc.restore()\n\t\t} else {\n\t\t\tthis.fillBack(c, getbounds, x, y, width, height)\n\t\t}\n\n\t\tif (this.stroke.fill !== \"\") {\n\t\t\tthis.stroke.prepare()\n\t\t\tc.stroke()\n\t\t}\n\n\t\tif (this.transparency > 0) {\n\t\t\tc.globalAlpha = oldtransp\n\t\t}\n\t}\n\n\tsubNums(str: string): string {\n\t\tlet newStr = \"\"\n\n\t\tfor (let i = 0; i < str.length; i++) {\n\t\t\tconst code = str.charCodeAt(i)\n\n\t\t\tif (code >= 48 && code <= 57) {\n\t\t\t\tnewStr += String.fromCharCode(code + 8272)\n\t\t\t} else {\n\t\t\t\tnewStr += str[i]\n\t\t\t}\n\t\t}\n\n\t\treturn newStr\n\t}\n\n\tsuperNums(str: string): string {\n\t\tlet newStr = \"\"\n\n\t\tfor (let i = 0; i < str.length; i++) {\n\t\t\tconst code = str.charCodeAt(i)\n\n\t\t\tif (code === 48 || (code >= 52 && code <= 57)) {\n\t\t\t\tnewStr += String.fromCharCode(code + 8256)\n\t\t\t} else if (code === 49) {\n\t\t\t\tnewStr += String.fromCharCode(185)\n\t\t\t} else if (code === 50) {\n\t\t\t\tnewStr += String.fromCharCode(178)\n\t\t\t} else if (code === 51) {\n\t\t\t\tnewStr += String.fromCharCode(179)\n\t\t\t} else {\n\t\t\t\tnewStr += str[i]\n\t\t\t}\n\t\t}\n\n\t\treturn newStr\n\t}\n\n\tdrawText(bounds: Bounds, text: string) {\n\t\tconst g = this.font._g\n\t\tconst c = this.getGraphics()\n\t\tif (!c) return\n\t\tconst s = this.font._s\n\t\tconst a = this.font.textAlign\n\t\tlet x = bounds.x\n\t\tlet y = bounds.y\n\n\t\tconst drawAtXY = (value: string) => {\n\t\t\tc.fillText(value, x, y)\n\n\t\t\tif (s && s.fill !== \"\") {\n\t\t\t\ts.prepare()\n\t\t\t\tc.strokeText(value, x, y)\n\t\t\t}\n\t\t}\n\n\t\tif (this.font.lineThrough) {\n\t\t\tc.beginPath()\n\t\t\tc.moveTo(bounds.x, bounds.y + bounds.height * 0.4)\n\t\t\tc.lineTo(bounds.x + bounds.width, bounds.y + bounds.height * 0.4)\n\t\t\tc.stroke()\n\t\t\tc.closePath()\n\t\t}\n\n\t\tc.fillStyle = g?.visible && bounds ? g.createDrawing(bounds) : this.font.fill\n\n\t\tif (a === \"center\") x += 0.5 * bounds.width\n\t\telse if (a === \"right\" || a === \"end\") x += bounds.width\n\n\t\tconst rows = `${text}`.split(\"\\n\")\n\t\tconst l = rows.length\n\n\t\tif (l > 1) {\n\t\t\tconst h = this.textHeight(rows[0])\n\n\t\t\tfor (let t = 0; t < l; t++) {\n\t\t\t\tif (this.doSuperNums) drawAtXY(this.superNums(rows[t]))\n\t\t\t\telse if (this.doSubNums) drawAtXY(this.subNums(rows[t]))\n\t\t\t\telse drawAtXY(rows[t])\n\n\t\t\t\ty += h\n\t\t\t}\n\t\t} else {\n\t\t\tif (this.doSuperNums) drawAtXY(this.superNums(text))\n\t\t\telse if (this.doSubNums) drawAtXY(this.subNums(text))\n\t\t\telse drawAtXY(text)\n\t\t}\n\t}\n\n\trectangle(x?: FormatCoordinate, y?: number, width?: number, height?: number): void {\n\t\tif (this.transparency < 1) {\n\t\t\tif (typeof x === \"object\") {\n\t\t\t\tconst rectangle = x as { x: number; y: number; width: number; height: number }\n\t\t\t\tthis.rectangle(rectangle.x, rectangle.y, rectangle.width, rectangle.height)\n\t\t\t} else {\n\t\t\t\tthis.rectPath(Number(x), Number(y), Number(width), Number(height))\n\t\t\t\tconst c = this.getGraphics()\n\t\t\t\tif (c) this.draw(c, null, x, y, width, height)\n\t\t\t}\n\t\t}\n\t}\n\n\tpolygonBounds(points: Array<{ x: number; y: number }>, r: Bounds) {\n\t\tlet x0 = 0\n\t\tlet y0 = 0\n\t\tlet x1 = 0\n\t\tlet y1 = 0\n\n\t\tconst l = points.length\n\n\t\tif (l > 0) {\n\t\t\tx0 = x1 = points[0].x\n\t\t\ty0 = y1 = points[0].y\n\n\t\t\tfor (let t = 1; t < l; t++) {\n\t\t\t\tlet p = points[t].x\n\t\t\t\tif (p < x0) x0 = p\n\t\t\t\telse if (p > x1) x1 = p\n\n\t\t\t\tp = points[t].y\n\t\t\t\tif (p < y0) y0 = p\n\t\t\t\telse if (p > y1) y1 = p\n\t\t\t}\n\t\t}\n\n\t\tr.x = x0\n\t\tr.y = y0\n\t\tr.width = x1 - x0\n\t\tr.height = y1 - y0\n\t}\n\n\tpolygon(points: Point[]): void {\n\t\tconst c = this.getGraphics()\n\t\tif (!c || points.length === 0) return\n\t\tconst l = points.length\n\n\t\tc.beginPath()\n\t\tc.moveTo(points[0].x, points[0].y)\n\n\t\tfor (let t = 1; t < l; t++) {\n\t\t\tc.lineTo(points[t].x, points[t].y)\n\t\t}\n\n\t\tc.closePath()\n\n\t\tthis.draw(c, () => {\n\t\t\tthis.polygonBounds(points, this._tmpPolygonBounds)\n\t\t\treturn this._tmpPolygonBounds\n\t\t})\n\t}\n\n\tellipsePath(c: Graphics & ThreeGraphics, cx: number, cy: number, width: number, height: number) {\n\t\tif (this.chart.__webgl) {\n\t\t\tc.z = this.z\n\t\t\tc.depth = this.depth\n\t\t\tc.ellipsePath?.(cx, cy, width, height)\n\t\t} else {\n\t\t\tc.save()\n\t\t\tc.translate(cx, cy)\n\t\t\tc.scale(width * 0.5, height * 0.5)\n\t\t\tc.beginPath()\n\t\t\tc.arc(0, 0, 1, 0, 2 * Math.PI, false)\n\t\t\tc.restore()\n\t\t}\n\t}\n\n\tellipse(cx: number, cy: number, width: number, height: number) {\n\t\tconst c = this.getGraphics()\n\t\tif (!c) return\n\t\tthis.ellipsePath(c, cx, cy, width, height)\n\t\tthis.draw(c, null, cx - width * 0.5, cy - height * 0.5, width, height)\n\t}\n\n\tsphere(cx: number, cy: number, width: number, height: number) {\n\t\tif (this.chart.__webgl) {\n\t\t\tconst ctx = this.chart.drawContext\n\t\t\tctx.depth = this.depth\n\t\t\tctx.z = this.z\n\n\t\t\tif (this.gradient.visible) {\n\t\t\t\tctx.fillStyle = this.gradient.colors[this.gradient.colors.length - 1]\n\t\t\t}\n\n\t\t\tctx.sphere?.(cx, cy, width, height)\n\t\t} else {\n\t\t\tthis.ellipse(cx, cy, width, height)\n\t\t}\n\t}\n\n\tcylinder(r: Bounds, topradius: number, vertical: boolean, inverted: boolean) {\n\t\tif (this.chart.__webgl) {\n\t\t\tconst ctx = this.chart.drawContext\n\t\t\tctx.depth = this.depth\n\t\t\tctx.z = this.z\n\t\t\tctx.image = this.image\n\t\t\tctx.cylinder?.(r, topradius, vertical, inverted)\n\t\t\treturn\n\t\t}\n\n\t\tif (topradius === 1) {\n\t\t\tthis.cube(r)\n\t\t} else {\n\t\t\tconst w = r.width\n\t\t\tconst h = r.height\n\n\t\t\tif (vertical) {\n\t\t\t\tthis.polygon([new Point(r.x + w * 0.5, r.y), new Point(r.x, r.y + h), new Point(r.x + w, r.y + h)])\n\t\t\t} else {\n\t\t\t\tthis.polygon([new Point(r.x + w, r.y + h * 0.5), new Point(r.x, r.y), new Point(r.x, r.y + h)])\n\t\t\t}\n\t\t}\n\t}\n\n\tcube(r: Bounds) {\n\t\tconst a = this.chart.aspect\n\t\tconst is3D = a.view3d\n\t\tlet w: number\n\t\tlet h: number\n\t\tlet old = false\n\t\tlet ax = 0\n\t\tlet ay = 0\n\n\t\tif (is3D) {\n\t\t\tif (this.chart.__webgl) {\n\t\t\t\tconst ctx = this.chart.drawContext\n\t\t\t\tctx.depth = this.depth\n\t\t\t\tctx.z = this.z\n\t\t\t\tctx.cube?.(r, this.round.x)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst z = this.z\n\t\t\tconst depth = this.depth\n\n\t\t\tax = z * a._orthox\n\t\t\tay = -z * a._orthoy\n\n\t\t\tw = r.x + r.width\n\t\t\th = r.y + r.height\n\n\t\t\tconst dx = depth * a._orthox\n\t\t\tconst dy = -depth * a._orthoy\n\n\t\t\told = this.shadow.visible\n\t\t\tthis.shadow.visible = false\n\n\t\t\tconst ww = w + dx\n\t\t\tconst hh = r.y + dy\n\n\t\t\tif (depth > 0) {\n\t\t\t\tthis.polygon([\n\t\t\t\t\t{ x: w, y: r.y },\n\t\t\t\t\t{ x: ww, y: hh },\n\t\t\t\t\t{ x: ww, y: h + dy },\n\t\t\t\t\t{ x: w, y: h }\n\t\t\t\t])\n\n\t\t\t\tif (r.width > 0) {\n\t\t\t\t\tthis.polygon([\n\t\t\t\t\t\t{ x: r.x, y: r.y },\n\t\t\t\t\t\t{ x: r.x + dx, y: hh },\n\t\t\t\t\t\t{ x: ww, y: hh },\n\t\t\t\t\t\t{ x: w, y: r.y }\n\t\t\t\t\t])\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.rectPath(r.x + ax, r.y + ay, r.width, r.height)\n\n\t\tif (is3D) {\n\t\t\tthis.shadow.visible = old\n\t\t}\n\t}\n\n\trectPath(x: number, y: number, width: number, height: number) {\n\t\tconst c = this.getGraphics()\n\t\tif (!c) return\n\n\t\tc.beginPath()\n\n\t\tif (this.round.x > 0 && this.round.y > 0) this.roundRect(c, x, y, width, height)\n\t\telse c.rect(x, y, width, height)\n\t}\n\n\tsetChart(chart: Chart) {\n\t\tthis.chart = chart\n\t\tthis.shadow.chart = chart\n\t\tthis.gradient.chart = chart\n\t\tthis.font.setChart(chart)\n\n\t\tif (this._img) {\n\t\t\tthis._img.chart = chart\n\t\t}\n\n\t\tthis.stroke.setChart(chart)\n\t}\n}\n","import type { Chart } from \"../../chart.js\"\nimport { Format } from \"./format.js\"\n\n/**\n * @constructor\n * @class Format and parameters to display a grid of lines at axes increments\n * @param {Tee.Chart} chart The chart object this axis grid object belongs to.\n * @property {Format} format Visual properties to draw axis grids.\n * @property {Boolean} [visible=true] Determines if grid lines will be displayed or not.\n * @property {Boolean} [centered=false] Determines if grid lines are displayed at axis label positions or at middle between labels.\n * @property {Boolean} [lineDash=false] Draws grid lines using dash-dot segments or solid lines.\n */\nexport class AxisGrid {\n\tchart: Chart\n\tformat: Format\n\tvisible = true\n\tcentered = false\n\tlineDash = false\n\n\tconstructor(chart: Chart) {\n\t\tthis.chart = chart\n\t\tthis.format = new Format(chart)\n\t\tthis.format.stroke.fill = \"silver\"\n\t\tthis.format.stroke.cap = \"butt\"\n\t\tthis.format.fill = \"\"\n\t}\n}\n","interface DateFormatFunction {\n\t(date?: string | number | Date, mask?: string, utc?: boolean): string\n\tmasks: Record<string, string>\n\ti18n: { dayNames: string[]; monthNames: string[] }\n}\n\nconst dateFormat = (() => {\n\tconst tokenPattern = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\\1?|[LloSZ]|\"[^\"]*\"|'[^']*'/g,\n\t\ttimezonePattern =\n\t\t\t/\\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\\d{4})?)\\b/g,\n\t\ttimezoneClipPattern = /[^-+\\dA-Z]/g,\n\t\tpadWithZeros = (val: string | number, len = 2) => {\n\t\t\tval = String(val)\n\t\t\twhile (val.length < len) val = `0${val}`\n\t\t\treturn val\n\t\t}\n\n\t// Regexes and supporting functions are cached through closure\n\treturn (...args: [date?: string | number | Date, mask?: string, utc?: boolean]) => {\n\t\tlet [date, mask, utc] = args\n\t\tconst formatFunction = dateFormat\n\n\t\t// You can't provide utc if you skip other args (use the \"UTC:\" mask prefix)\n\t\tif (args.length === 1 && Object.prototype.toString.call(date) === \"[object String]\" && !/\\d/.test(String(date))) {\n\t\t\tmask = String(date)\n\t\t\tdate = undefined\n\t\t}\n\n\t\t// Passing date through Date applies Date.parse, if necessary\n\t\tconst dateValue = date ? new Date(date instanceof Date ? date.getTime() : date) : new Date()\n\t\tif (Number.isNaN(dateValue.getTime())) throw SyntaxError(\"invalid date\")\n\n\t\tmask = String(formatFunction.masks[mask as string] || mask || formatFunction.masks.default)\n\n\t\t// Allow setting the utc argument via the mask\n\t\tif (mask.slice(0, 4) === \"UTC:\") {\n\t\t\tmask = mask.slice(4)\n\t\t\tutc = true\n\t\t}\n\n\t\tconst getterPrefix = utc ? \"getUTC\" : \"get\",\n\t\t\tdayOfMonth = dateValue[`${getterPrefix}Date`](),\n\t\t\tdayOfWeek = dateValue[`${getterPrefix}Day`](),\n\t\t\tmonth = dateValue[`${getterPrefix}Month`](),\n\t\t\tyear = dateValue[`${getterPrefix}FullYear`](),\n\t\t\thours = dateValue[`${getterPrefix}Hours`](),\n\t\t\tminutes = dateValue[`${getterPrefix}Minutes`](),\n\t\t\tseconds = dateValue[`${getterPrefix}Seconds`](),\n\t\t\tmilliseconds = dateValue[`${getterPrefix}Milliseconds`](),\n\t\t\ttimezoneOffset = utc ? 0 : dateValue.getTimezoneOffset(),\n\t\t\tflags = {\n\t\t\t\td: dayOfMonth,\n\t\t\t\tdd: padWithZeros(dayOfMonth),\n\t\t\t\tddd: formatFunction.i18n.dayNames[dayOfWeek],\n\t\t\t\tdddd: formatFunction.i18n.dayNames[dayOfWeek + 7],\n\t\t\t\tm: month + 1,\n\t\t\t\tmm: padWithZeros(month + 1),\n\t\t\t\tmmm: formatFunction.i18n.monthNames[month],\n\t\t\t\tmmmm: formatFunction.i18n.monthNames[month + 12],\n\t\t\t\tyy: String(year).slice(2),\n\t\t\t\tyyyy: year,\n\t\t\t\th: hours % 12 || 12,\n\t\t\t\thh: padWithZeros(hours % 12 || 12),\n\t\t\t\tH: hours,\n\t\t\t\tHH: padWithZeros(hours),\n\t\t\t\tM: minutes,\n\t\t\t\tMM: padWithZeros(minutes),\n\t\t\t\ts: seconds,\n\t\t\t\tss: padWithZeros(seconds),\n\t\t\t\tl: padWithZeros(milliseconds, 3),\n\t\t\t\tL: padWithZeros(milliseconds > 99 ? Math.round(milliseconds / 10) : milliseconds),\n\t\t\t\tt: hours < 12 ? \"a\" : \"p\",\n\t\t\t\ttt: hours < 12 ? \"am\" : \"pm\",\n\t\t\t\tT: hours < 12 ? \"A\" : \"P\",\n\t\t\t\tTT: hours < 12 ? \"AM\" : \"PM\",\n\t\t\t\tZ: utc ? \"UTC\" : (String(dateValue).match(timezonePattern) || [\"\"]).pop()?.replace(timezoneClipPattern, \"\"),\n\t\t\t\to:\n\t\t\t\t\t(timezoneOffset > 0 ? \"-\" : \"+\") +\n\t\t\t\t\tpadWithZeros(Math.floor(Math.abs(timezoneOffset) / 60) * 100 + (Math.abs(timezoneOffset) % 60), 4),\n\t\t\t\tS: [\"th\", \"st\", \"nd\", \"rd\"][\n\t\t\t\t\tdayOfMonth % 10 > 3 ? 0 : (Number((dayOfMonth % 100) - (dayOfMonth % 10) !== 10) * dayOfMonth) % 10\n\t\t\t\t]\n\t\t\t}\n\n\t\treturn mask.replace(tokenPattern, token =>\n\t\t\ttoken in flags ? String((flags as Record<string, unknown>)[token]) : token.slice(1, token.length - 1)\n\t\t)\n\t}\n})() as DateFormatFunction\n\n// Some common format strings\ndateFormat.masks = {\n\tdefault: \"ddd mmm dd yyyy HH:MM:ss\",\n\tshortDate: \"m/d/yy\",\n\tmediumDate: \"mmm d, yyyy\",\n\tlongDate: \"mmmm d, yyyy\",\n\tfullDate: \"dddd, mmmm d, yyyy\",\n\tshortTime: \"h:MM TT\",\n\tmediumTime: \"h:MM:ss TT\",\n\tlongTime: \"h:MM:ss TT Z\",\n\tisoDate: \"yyyy-mm-dd\",\n\tisoTime: \"HH:MM:ss\",\n\tisoDateTime: \"yyyy-mm-dd'T'HH:MM:ss\",\n\tisoUtcDateTime: \"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'\"\n}\n\n// Internationalization strings\ndateFormat.i18n = {\n\tdayNames: [\n\t\t\"Sun\",\n\t\t\"Mon\",\n\t\t\"Tue\",\n\t\t\"Wed\",\n\t\t\"Thu\",\n\t\t\"Fri\",\n\t\t\"Sat\",\n\t\t\"Sunday\",\n\t\t\"Monday\",\n\t\t\"Tuesday\",\n\t\t\"Wednesday\",\n\t\t\"Thursday\",\n\t\t\"Friday\",\n\t\t\"Saturday\"\n\t],\n\tmonthNames: [\n\t\t\"Jan\",\n\t\t\"Feb\",\n\t\t\"Mar\",\n\t\t\"Apr\",\n\t\t\"May\",\n\t\t\"Jun\",\n\t\t\"Jul\",\n\t\t\"Aug\",\n\t\t\"Sep\",\n\t\t\"Oct\",\n\t\t\"Nov\",\n\t\t\"Dec\",\n\t\t\"January\",\n\t\t\"February\",\n\t\t\"March\",\n\t\t\"April\",\n\t\t\"May\",\n\t\t\"June\",\n\t\t\"July\",\n\t\t\"August\",\n\t\t\"September\",\n\t\t\"October\",\n\t\t\"November\",\n\t\t\"December\"\n\t]\n}\n\nexport const DateUtils = {\n\tformat(date?: string | number | Date, mask?: string, utc?: boolean): string {\n\t\treturn dateFormat(date, mask, utc)\n\t},\n\n\tmsecsRound(min: number, max: number): number {\n\t\tconst days = Math.round((max - min) / 86400000)\n\n\t\tif (days <= 60) return min\n\n\t\tconst date = new Date(min)\n\t\tlet month = date.getMonth()\n\t\tlet year = date.getFullYear()\n\n\t\tif (month < 11) month++\n\t\telse {\n\t\t\tmonth = 0\n\t\t\tyear++\n\t\t}\n\n\t\treturn new Date(year, month, 1).getTime()\n\t}\n}\n","import { trunc } from \"../../utils.js\"\nimport type { Chart } from \"../../chart.js\"\nimport type { Series, SeriesData } from \"../../series.js\"\nimport type { Axis } from \"./axis.js\"\nimport { Format } from \"./format.js\"\nimport { DateUtils } from \"../../date.format.js\"\n\n/** Series that label their own rows on the non-mandatory axis (e.g. Bullet). */\ntype RowLabelSeries = Series & { rowLabel?: (row: number) => string | undefined }\n\nfunction rowLabelOf(series: Series | null): ((row: number) => string | undefined) | undefined {\n\tconst rowLabel = (series as RowLabelSeries | null)?.rowLabel\n\treturn typeof rowLabel === \"function\" ? rowLabel.bind(series) : undefined\n}\n\n/**\n * @constructor\n * @public\n * @class Displays text to annotate axes\n * @param {Tee.Chart} chart The chart object this axis labels object belongs to.\n * @property {Format} format Defines the visual properties to paint the axis title.\n * @property {Boolean} [visible=true] Determines if axis labels will be displayed or not.\n * @property {String} dateFormat=\"shortDate\" Configures string format for date & time labels\n * @property {Number} rotation=0 Defines the label rotation angle from 0 to 360 degree.\n * @property {String} labelStyle=\"auto\" Determines label contents from series data (\"auto\", \"value\", \"mark\", \"text\").\n * @property {Number} decimals=2 Defines the number of decimals for floating-point numeric labels.\n * @property {Boolean} alternate=false When true, labels are displayed at alternate positions to fit more labels in the same space.\n * @property {String} wordWrap=\"no\" Determines if replace label white spaces with new line (\"auto\", \"yes\", \"no\").\n */\nexport class AxisLabels {\n\tchart: Chart\n\taxis: Axis\n\tformat: Format\n\tdecimals = 2\n\tfixedDecimals = false\n\tpadding = 4\n\tseparation = 10 // %\n\tvisible = true\n\trotation = 0\n\talternate = false\n\tmaxWidth = 0\n\t/** @type {string|undefined} */\n\tvalueFormat: string | undefined\n\t/** @type {string|boolean} */\n\twordWrap: string | boolean = \"no\" // auto,yes,no\n\t/** @type {((value: number, text: string) => string)|undefined} */\n\tongetlabel: ((value: number, text: string) => string) | undefined\n\troundFirst = true\n\tlabelStyle = \"auto\" // auto,value,mark,text\n\tdateFormat = \"shortDate\"\n\t_text: Series | null = null\n\t_textlabels: string[] | null = null\n\n\tconstructor(chart: Chart, axis: Axis) {\n\t\tthis.chart = chart\n\t\tthis.axis = axis\n\t\tthis.format = new Format(chart)\n\t}\n\n\tcheckStyle() {\n\t\tconst st = this.labelStyle,\n\t\t\ts = this.axis.firstSeries\n\n\t\tthis._text = null\n\t\tthis._textlabels = null\n\n\t\tif (st === \"auto\") {\n\t\t\tif (\n\t\t\t\ts &&\n\t\t\t\t(s.data.labels.length > 0 || rowLabelOf(s)) &&\n\t\t\t\ts.associatedToAxis(this.axis) &&\n\t\t\t\tthis.axis.horizontal === s.notmandatory.horizontal\n\t\t\t) {\n\t\t\t\tthis._text = s\n\n\t\t\t\t/* if ((this.chart.series.items.length > 1) && (this.chart.series.items[0] instanceof Tee.Bar) \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&& (this.chart.series.items[0].stacked == \"sideAll\")){\n\t\t\t\n\t\t\tvar li=chart.series.items, t, tt, ser;\n\t\t\tthis._textlabels=this._text.data.labels;\n\t\t\tfor(t=1; ser=li[t++];){\n\t\t\t\t\tif (ser.visible && ser.associatedToAxis(axis)) {\n\t\t\t\t\tfor(tt=0; tt < ser.data.values.length; tt++){ \n\t\t\t\t\t\tthis._textlabels.push(ser.data.labels[tt]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (s === undefined)\n\t\t\t\t\t\t\t\ts=\"\";\n\t\t\t\t\t}*/\n\t\t\t}\n\t\t} else if (st === \"mark\" || st === \"text\") this._text = s\n\t}\n\n\tformatValueString(value: number): string {\n\t\tif (this.valueFormat) {\n\t\t\tconst decimalSeparator = Number(\"1.2\").toLocaleString().substr(1, 1)\n\n\t\t\tconst amountWithCommas = (value * 1).toLocaleString()\n\t\t\tconst arParts = String(amountWithCommas).split(decimalSeparator)\n\t\t\tconst intPart = arParts[0]\n\n\t\t\tlet padding = \"\"\n\t\t\tif (this.decimals > 0)\n\t\t\t\tfor (let i = 0; i < this.decimals; i++) {\n\t\t\t\t\tpadding = `${padding}0`\n\t\t\t\t}\n\n\t\t\tlet decPart = arParts.length > 1 ? arParts[1] : \"\"\n\t\t\tdecPart = (decPart + padding).substr(0, this.decimals)\n\n\t\t\tif (decPart.length > 0) return intPart + decimalSeparator + decPart\n\t\t\telse return intPart\n\t\t} else return value.toFixed(this.decimals)\n\t}\n\n\t/**\n\t * @returns {String} Returns the series label that corresponds to a given value, (or the value if no label exists).\n\t */\n\tgetLabel(value: number): string {\n\t\tlet v = trunc(value),\n\t\t\ts: string,\n\t\t\tdata: SeriesData\n\n\t\tif (this._text && v === value) {\n\t\t\tdata = this._text.data\n\n\t\t\tif (data.x) v = data.x.indexOf(v)\n\n\t\t\tconst li = this.chart.series.items\n\t\t\tlet t: number, ser: Series & { continuous?: boolean; maxZ?: number }\n\n\t\t\tconst rowLabel = rowLabelOf(this._text)\n\n\t\t\tif (rowLabel) {\n\t\t\t\ts = rowLabel(value) ?? \"\"\n\t\t\t}\n\t\t\t//specific case: check for non-std sideAll labelling\n\t\t\telse if (li.length > 0 && li[0]?.constructor?.name === \"Bar\" && li[0].stacked === \"sideAll\") {\n\t\t\t\ts = data.labels[value]\n\t\t\t} else {\n\t\t\t\ts = data.labels[v]\n\t\t\t}\n\n\t\t\t// Last resort, try to find labels from any series in axis:\n\n\t\t\tif (!s && !rowLabel) {\n\t\t\t\tfor (t = 0; t < li.length; t++) {\n\t\t\t\t\tser = li[t]\n\t\t\t\t\tif (!ser) break\n\t\t\t\t\tif (ser !== this._text) {\n\t\t\t\t\t\tif (ser.visible && ser.associatedToAxis(this.axis)) {\n\t\t\t\t\t\t\ts = ser.data.labels[v]\n\t\t\t\t\t\t\tif (s) break\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (s === undefined) s = \"\"\n\t\t\t}\n\t\t} else if (this.axis.dateTime) {\n\t\t\ts = DateUtils.format(new Date(value), this.dateFormat)\n\t\t} else s = this.formatValueString(value)\n\n\t\tif (this.wordWrap !== \"no\" && this.wordWrap !== false) {\n\t\t\ts = s.replace(/ /g, \"\\n\")\n\t\t}\n\n\t\tif (this.ongetlabel) {\n\t\t\ts = this.ongetlabel(value, s)\n\t\t\tthis.format.font.prepare() // <-- in case user code at ongetlabel event has changed the font.\n\t\t}\n\n\t\treturn `${s}`\n\t}\n\n\t/**\n\t * @returns {Number} Returns the width in pixels of value converted to string.\n\t */\n\twidth(value: number): number {\n\t\tconst oldFixDec = this.fixedDecimals //check widest label when sizing\n\t\tthis.fixedDecimals = true\n\t\tconst tmpWidth = this.format.textWidth(this.getLabel(value))\n\t\tthis.fixedDecimals = oldFixDec\n\t\treturn tmpWidth\n\t}\n}\n","import type { Chart } from \"../../chart.js\"\nimport { Stroke } from \"./stroke.js\"\n\n/**\n * @constructor\n * @class Stroke parameters to draw small lines at axes labels positions\n * @param {Tee.Chart} chart The chart object this axis ticks object belongs to.\n * @property {Tee.Stroke} stroke Defines the visual attributes used to draw the axis ticks.\n * @property {Number} [length=4] The length of ticks in pixels.\n */\nexport class AxisTicks {\n\tchart: Chart\n\tstroke: Stroke\n\tvisible = true\n\tlength = 4\n\tcount = 3\n\tz = 0\n\n\tconstructor(chart: Chart) {\n\t\tthis.chart = chart\n\t\tthis.stroke = new Stroke(chart)\n\t\tthis.stroke.cap = \"butt\"\n\t}\n}\n","import type { Chart } from \"./chart.js\"\nimport type { Point } from \"./core/primitives.js\"\nimport type { Series } from \"./series.js\"\nimport type { BaseAnimation } from \"./tools/base-animation.js\"\nimport type { ToolTip } from \"./tools/annotation.js\"\nimport type { DragTool } from \"./tools/drag-tool.js\"\n\n/** Maps each event name to the arguments its listeners receive. */\nexport type EventMap = { [name: string]: unknown[] }\n\nexport type EventListener<Args extends unknown[]> = (...args: Args) => void\n\n/** Events of a `Chart`. The `on*` properties of the chart remain available and run before these listeners. */\nexport interface ChartEventMap {\n\t/** After every draw, once the series and tools have been painted. */\n\tdraw: [chart: Chart]\n\t/** After the canvas size changed through `resize`. */\n\tresize: [width: number, height: number]\n\t/** After a drag selection zoomed the axes. */\n\tzoom: [chart: Chart]\n\t/** After a drag selection undid the zoom. */\n\tzoomreset: [chart: Chart]\n\t/** While the user pans the chart. */\n\tscroll: [event: unknown]\n\t/** When the user clicks a point of a series; `index` is the point index. */\n\tseriesclick: [series: Series, index: number, x: number, y: number]\n\t/** When the keyboard moves the focus to a point (see the `accessibility.keyboard` option). */\n\tpointfocus: [series: Series, index: number]\n\t/** Before the chart releases its resources. Its listeners are removed afterwards. */\n\tdestroy: [chart: Chart]\n}\n\n/** Events of a `Series`. */\nexport interface SeriesEventMap {\n\t/** When the user clicks one of its points. */\n\tclick: [series: Series, index: number, x: number, y: number]\n\t/** After the series was painted. */\n\tdraw: [series: Series]\n\t/** Gauges only: after the value changed, either by dragging or by an animation. */\n\tchange: [series: Series]\n}\n\n/** Events of a `Tool`; each tool type only emits the ones that apply to it. */\nexport interface ToolEventMap {\n\t/** ToolTip: after it was shown for a series point. */\n\tshow: [tool: ToolTip, series: Series, index: number]\n\t/** ToolTip: before it is hidden. */\n\thide: [tool: ToolTip]\n\t/** CursorTool: after the cursor moved. */\n\tchange: [point: Point]\n\t/** DragTool: after a dragged point was released with a new value. */\n\tchanged: [tool: DragTool, value: number]\n\t/** Animations: when they begin. */\n\tstart: []\n\t/** Animations: when they end. */\n\tstop: [animation: BaseAnimation]\n}\n\n/** The subscription methods shared by `Chart`, `Series` and `Tool`. */\nexport interface Observable<Events extends { [K in keyof Events]: unknown[] }> {\n\t/** Subscribes `listener` and returns a function that removes it. */\n\ton<K extends keyof Events>(name: K, listener: EventListener<Events[K]>): () => void\n\t/** Like `on`, but the listener runs once. */\n\tonce<K extends keyof Events>(name: K, listener: EventListener<Events[K]>): () => void\n\t/** Removes `listener`, or every listener of `name` when it is omitted. */\n\toff<K extends keyof Events>(name: K, listener?: EventListener<Events[K]>): void\n}\n\ninterface Subscription {\n\tlistener: EventListener<never[]>\n\tonce: boolean\n}\n\n/**\n * A minimal typed event emitter. Listeners run in subscription order; one that throws does not stop\n * the others, and the first error is rethrown once all of them ran.\n */\nexport class Emitter<Events extends { [K in keyof Events]: unknown[] }> {\n\tprivate subscriptions = new Map<keyof Events, Subscription[]>()\n\n\ton<K extends keyof Events>(name: K, listener: EventListener<Events[K]>, once = false): () => void {\n\t\tconst list = this.subscriptions.get(name) ?? []\n\t\tconst subscription = { listener: listener as unknown as EventListener<never[]>, once }\n\t\tlist.push(subscription)\n\t\tthis.subscriptions.set(name, list)\n\n\t\treturn () => this.remove(name, subscription)\n\t}\n\n\toff<K extends keyof Events>(name: K, listener?: EventListener<Events[K]>): void {\n\t\tconst list = this.subscriptions.get(name)\n\t\tif (!list) return\n\n\t\tif (listener === undefined) this.subscriptions.delete(name)\n\t\telse\n\t\t\tthis.replace(\n\t\t\t\tname,\n\t\t\t\tlist.filter(item => item.listener !== (listener as unknown as EventListener<never[]>))\n\t\t\t)\n\t}\n\n\thas(name: keyof Events): boolean {\n\t\treturn (this.subscriptions.get(name)?.length ?? 0) > 0\n\t}\n\n\temit<K extends keyof Events>(name: K, ...args: Events[K]): void {\n\t\tconst list = this.subscriptions.get(name)\n\t\tif (!list) return\n\n\t\tlet failed = false\n\t\tlet failure: unknown\n\t\t// A listener may subscribe or unsubscribe while the event runs, so iterate over a copy.\n\t\tfor (const subscription of [...list]) {\n\t\t\tif (subscription.once) this.remove(name, subscription)\n\t\t\ttry {\n\t\t\t\t;(subscription.listener as unknown as EventListener<Events[K]>)(...args)\n\t\t\t} catch (error) {\n\t\t\t\tif (!failed) {\n\t\t\t\t\tfailed = true\n\t\t\t\t\tfailure = error\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (failed) throw failure\n\t}\n\n\tclear(): void {\n\t\tthis.subscriptions.clear()\n\t}\n\n\tprivate remove(name: keyof Events, subscription: Subscription): void {\n\t\tconst list = this.subscriptions.get(name)\n\t\tif (list)\n\t\t\tthis.replace(\n\t\t\t\tname,\n\t\t\t\tlist.filter(item => item !== subscription)\n\t\t\t)\n\t}\n\n\tprivate replace(name: keyof Events, list: Subscription[]): void {\n\t\tif (list.length === 0) this.subscriptions.delete(name)\n\t\telse this.subscriptions.set(name, list)\n\t}\n}\n","import type { Chart } from \"../chart.js\"\nimport { Emitter, type EventListener, type ToolEventMap } from \"../events.js\"\n\nexport type ToolChart = Chart\n\nexport class Tool {\n\tchart: ToolChart\n\tactive = true\n\tdestroyed = false\n\t_events?: Emitter<ToolEventMap>\n\n\tconstructor(chart: ToolChart) {\n\t\tthis.chart = chart\n\t}\n\n\t/** Subscribes `listener` to tool events and returns a function that removes it. */\n\ton<K extends keyof ToolEventMap>(name: K, listener: EventListener<ToolEventMap[K]>): () => void {\n\t\treturn (this._events ??= new Emitter<ToolEventMap>()).on(name, listener)\n\t}\n\n\t/** Like `on`, but the listener runs once. */\n\tonce<K extends keyof ToolEventMap>(name: K, listener: EventListener<ToolEventMap[K]>): () => void {\n\t\treturn (this._events ??= new Emitter<ToolEventMap>()).on(name, listener, true)\n\t}\n\n\t/** Removes `listener`, or every listener of `name` when it is omitted. */\n\toff<K extends keyof ToolEventMap>(name: K, listener?: EventListener<ToolEventMap[K]>): void {\n\t\tthis._events?.off(name, listener)\n\t}\n\n\t/** @internal */\n\t_hasListeners(name: keyof ToolEventMap): boolean {\n\t\treturn this._events?.has(name) ?? false\n\t}\n\n\t/** @internal */\n\t_emit<K extends keyof ToolEventMap>(name: K, ...args: ToolEventMap[K]): void {\n\t\tthis._events?.emit(name, ...args)\n\t}\n\n\tmousedown(_event: unknown): boolean {\n\t\treturn false\n\t}\n\tmousemove(_point: unknown): void {}\n\tmouseout(): void {}\n\tclicked(_point?: unknown): boolean {\n\t\treturn false\n\t}\n\tdraw(): void {}\n\tdestroy(): void {\n\t\tthis._events?.clear()\n\t\tthis.active = false\n\t\tthis.destroyed = true\n\t}\n}\n","import { trunc } from \"../utils.js\"\nimport { cancelAnimationFrame, requestAnimationFrame } from \"../platform.js\"\nimport type { Chart } from \"../chart.js\"\nimport type { Axis } from \"../core/elements/axis.js\"\nimport type { Series } from \"../series.js\"\nimport { Tool } from \"./tool.js\"\n\ntype AnimationStep = (fraction: number) => void\ntype FadeState = Partial<Record<\"legend\" | \"walls\" | \"series\" | \"marks\" | \"title\" | \"axes\" | \"panel\", boolean>>\n\nfunction isChartTarget(target: unknown): target is Chart {\n\treturn typeof target === \"object\" && target !== null && \"canvas\" in target && \"series\" in target\n}\n\nfunction isSeriesTarget(target: unknown): target is Series {\n\tif (typeof target !== \"object\" || target === null) return false\n\tconst candidate = target as { data?: { values?: unknown }; clicked?: unknown }\n\treturn !!(candidate.data && Array.isArray(candidate.data.values) && typeof candidate.clicked === \"function\")\n}\n\n/**\n * @constructor\n * @augments Tool\n * @class Base abstract class to perform Animations.\n * @property {Number} [duration=500] Duration in milliseconds of the animation.\n * @property {boolean} [loop=false] When true, the animation never stops (starts again when finished).\n * @property {boolean} [running=false] Read-only, returns if the animation is currently running.\n * @property {BaseAnimation[]} items Sub-animations that are executed in parallel with self.\n * @property {boolean} [autoDraw=true] When true, the animation repaints the chart at every step.\n */\nexport class BaseAnimation extends Tool {\n\tduration = 500\n\tmode = \"linear\"\n\titems: BaseAnimation[] = []\n\tautoDraw = true\n\tloop = false\n\trunning = false\n\tonstart: (() => void) | null = null\n\tonstop: ((animation: BaseAnimation) => void) | null = null\n\tinit = 0\n\tprivate _onStep: AnimationStep | undefined\n\tprivate _frameHandle: number | null = null\n\tprivate _fallbackFrameHandle: ReturnType<typeof setTimeout> | null = null\n\tprivate _chartForCleanup: Chart | null = null\n\tprivate _attachChart: (chart: Chart) => void = () => {}\n\tprivate _detachChart: () => void = () => {}\n\tprivate _scheduleStep: () => void = () => {}\n\tstep: () => void = () => {}\n\n\tconstructor(target?: Chart | BaseAnimation | object, onStep?: AnimationStep) {\n\t\tsuper(target as Chart)\n\t\tthis.initializeAnimation(target, onStep)\n\t}\n\n\tprivate initializeAnimation(target?: Chart | BaseAnimation | object, onStep?: AnimationStep): void {\n\t\tthis.active = true\n\t\tthis.items = []\n\n\t\tif (target)\n\t\t\tif (target instanceof BaseAnimation) {\n\t\t\t\tthis.chart = target.chart\n\t\t\t\ttarget.items.push(this)\n\t\t\t} else if (isChartTarget(target)) this.chart = target\n\n\t\tthis._onStep = onStep\n\t\tthis._attachChart = chart => {\n\t\t\tif (!chart || this._chartForCleanup === chart) return\n\t\t\tthis._detachChart()\n\t\t\tthis._chartForCleanup = chart\n\t\t\tchart._animations ??= new Set()\n\t\t\tchart._animations.add(this)\n\t\t}\n\t\tthis._detachChart = () => {\n\t\t\tthis._chartForCleanup?._animations?.delete(this)\n\t\t\tthis._chartForCleanup = null\n\t\t}\n\t\tthis._scheduleStep = () => {\n\t\t\tlet completed = false\n\t\t\tconst runStep = () => {\n\t\t\t\tif (completed) return\n\t\t\t\tcompleted = true\n\t\t\t\tif (this._frameHandle !== null) cancelAnimationFrame(this._frameHandle)\n\t\t\t\tif (this._fallbackFrameHandle !== null) clearTimeout(this._fallbackFrameHandle)\n\t\t\t\tthis._frameHandle = null\n\t\t\t\tthis._fallbackFrameHandle = null\n\t\t\t\tthis.step()\n\t\t\t}\n\n\t\t\tthis._frameHandle = requestAnimationFrame(() => {\n\t\t\t\trunStep()\n\t\t\t})\n\t\t\tthis._fallbackFrameHandle = setTimeout(runStep, 50)\n\t\t}\n\t\tthis.step = () => {\n\t\t\tif (!this.running) return\n\t\t\tif (this.chart?.destroyed) {\n\t\t\t\tthis.cancel()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst elapsed = (Date.now() - this.init) / this.duration\n\t\t\tconst fraction = this.mode === \"linear\" ? elapsed : 2 ** (10 * (elapsed - 1))\n\n\t\t\tif (fraction >= 0 && fraction < 1) {\n\t\t\t\tif (this.running) {\n\t\t\t\t\tthis.doStep(fraction)\n\n\t\t\t\t\tfor (const item of this.items) {\n\t\t\t\t\t\tif (item.active) {\n\t\t\t\t\t\t\titem.chart = this.chart\n\t\t\t\t\t\t\titem.doStep(fraction)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.autoDraw) this.chart.draw()\n\n\t\t\t\t\tthis._scheduleStep()\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.stop()\n\t\t\t\tfor (const item of this.items) {\n\t\t\t\t\tif (item.active) {\n\t\t\t\t\t\titem.chart = this.chart\n\t\t\t\t\t\titem.stop()\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (this.onstop) this.onstop(this)\n\t\t\t\tthis._emit(\"stop\", this)\n\n\t\t\t\tif (this.loop) this.startAnimation()\n\t\t\t\telse {\n\t\t\t\t\tthis.running = false\n\t\t\t\t\tthis.chart.draw()\n\t\t\t\t\tthis._detachChart()\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate startAnimation(): void {\n\t\tif (!this.chart || this.chart.destroyed) {\n\t\t\tthis.running = false\n\t\t\treturn\n\t\t}\n\t\tthis._attachChart(this.chart)\n\t\tthis.init = Date.now()\n\n\t\tthis.start()\n\t\tfor (const item of this.items) {\n\t\t\tif (item.active) {\n\t\t\t\titem.chart = this.chart\n\t\t\t\titem.start()\n\t\t\t}\n\t\t}\n\n\t\tthis.chart.draw()\n\t\tthis._scheduleStep()\n\t}\n\n\tanimate(chart?: Chart): void {\n\t\tif (!this.running) {\n\t\t\tthis.running = true\n\n\t\t\tif (chart) this.chart = chart\n\n\t\t\tthis.startAnimation()\n\t\t}\n\t}\n\n\tcancel(): void {\n\t\tthis.running = false\n\t\tif (this._frameHandle !== null) cancelAnimationFrame(this._frameHandle)\n\t\tif (this._fallbackFrameHandle !== null) clearTimeout(this._fallbackFrameHandle)\n\t\tthis._frameHandle = null\n\t\tthis._fallbackFrameHandle = null\n\t\tfor (const item of this.items) item.cancel?.()\n\t\tthis._detachChart()\n\t}\n\n\tdestroy(): void {\n\t\tthis.cancel()\n\t\tsuper.destroy()\n\t}\n\n\tstart(): void {\n\t\tif (this.onstart) this.onstart()\n\t\tthis._emit(\"start\")\n\t}\n\n\tstop(): void {\n\t\tthis.onstop?.(this)\n\t\tthis._emit(\"stop\", this)\n\t}\n\n\tdoStep(fraction: number): void {\n\t\tthis._onStep?.(fraction)\n\t}\n}\n\n/**\n * @constructor\n * @augments Tee.BaseAnimation\n * @class Fades in/out chart elements.\n */\nexport class FadeAnimation extends BaseAnimation {\n\tfade: FadeState = {}\n\tprivate _fadeState: FadeState = this.fade\n\tkind: \"in\" | \"out\" = \"in\"\n\tconstructor(target?: Chart | BaseAnimation) {\n\t\tsuper(target)\n\t\tthis.kind = \"in\"\n\t\tthis.fade = {}\n\t\tthis._fadeState = this.fade\n\t}\n\n\tsetTransp(value: number): void {\n\t\tif (this.kind === \"out\") value = 1 - value\n\n\t\tconst fa = this._fadeState\n\n\t\tif (fa.legend) this.chart.legend.format.transparency = value\n\n\t\tif (fa.walls) this.chart.walls.transparency = value\n\n\t\tif (fa.series)\n\t\t\tthis.chart.series.each(s => {\n\t\t\t\ts.format.transparency = value\n\t\t\t})\n\n\t\tif (fa.marks)\n\t\t\tthis.chart.series.each(s => {\n\t\t\t\ts.marks.transparency = value\n\t\t\t})\n\n\t\tif (fa.title) this.chart.title.format.transparency = value\n\n\t\tif (fa.axes) this.chart.axes.transparency = value\n\n\t\tif (fa.panel) this.chart.panel.format.transparency = value\n\t}\n\n\tstart(): void {\n\t\tthis._fadeState = this.fade\n\t\tthis.setTransp(1)\n\t}\n\n\tstop(): void {\n\t\tthis.setTransp(0)\n\t}\n\n\tdoStep(fraction: number): void {\n\t\tthis.setTransp(1 - fraction)\n\t}\n}\n\n/**\n * @constructor\n * @augments Tee.BaseAnimation\n * @class Animates series data\n * @property {Tee.Series} series Optional Tee.Series object to animate. When null, all series and axes are animated.\n * @property {String} [kind=\"axis\"] Animation style. Can be: axis, left, top, right, bottom, x, y, each, all, zoomin, zoomout.\n */\nexport class SeriesAnimation extends BaseAnimation {\n\tseries: Series | null = null\n\toldmin = 0\n\toldmax = 0\n\toldauto = true\n\tkind = \"axis\"\n\t_scaling = 1\n\n\tconstructor(target?: Chart | BaseAnimation | Series) {\n\t\tsuper(target)\n\n\t\tif (isSeriesTarget(target)) {\n\t\t\tthis.series = target\n\t\t\tthis.chart = target.chart\n\t\t} else this.series = null\n\n\t\tthis.oldmin = 0\n\t\tthis.oldmax = 0\n\t\tthis.oldauto = true\n\t\tthis.kind = \"axis\"\n\t\tthis._scaling = 1\n\t}\n\n\tchangeAxis(axis: Axis, amount: number): void {\n\t\taxis.automatic = false\n\t\tconst mid = (this.oldmin + this.oldmax) * 0.5\n\t\tconst range = (this.oldmax - this.oldmin) * 0.5\n\t\taxis.maximum = mid + amount * range\n\t\taxis.minimum = mid - amount * range\n\t}\n\n\tgetAxis(): Axis | null {\n\t\tconst series = this.series || this.chart.series.firstVisible()\n\t\treturn series ? series.mandatoryAxis : null\n\t}\n\n\tgetOtherAxis(): Axis | null {\n\t\tconst series = this.series || this.chart.series.firstVisible()\n\t\tif (series) {\n\t\t\tif (series.yMandatory) {\n\t\t\t\tif (series.vertAxis === \"both\") return this.chart.axes.right\n\t\t\t} else if (series.horizAxis === \"both\") return this.chart.axes.top\n\t\t}\n\t\treturn null\n\t}\n\n\tdoStep(fraction: number): void {\n\t\tconst axis = this.getAxis()\n\t\tconst otherAxis = this.getOtherAxis()\n\t\tif (axis) {\n\t\t\taxis.automatic = false\n\t\t}\n\t\tif (otherAxis) {\n\t\t\totherAxis.automatic = false\n\t\t}\n\n\t\tif (this.kind === \"axis\") {\n\t\t\tif (!axis) return\n\t\t\tthis.changeAxis(axis, 1 + (1 - fraction) * 100)\n\t\t\tif (otherAxis) this.changeAxis(otherAxis, 1 + (1 - fraction) * 100)\n\t\t} else\n\t\t\tthis.chart.series.each(s => {\n\t\t\t\tif (this.series && this.series !== s) return\n\n\t\t\t\tconst values = s.data.values\n\t\t\t\tconst oldValues = s.data._old\n\t\t\t\tconst length = values.length\n\n\t\t\t\tif (s?.constructor?.name === \"ActivityGauge\") {\n\t\t\t\t\ts.maxDrawWidth = Number(s.maxWidth) * fraction\n\t\t\t\t} else if (s?.constructor?.name === \"Pie\") {\n\t\t\t\t\ts.rotation = 360 * (1 - fraction)\n\t\t\t\t\tthis._scaling = fraction\n\t\t\t\t} else if (this.kind === \"each\" && oldValues) {\n\t\t\t\t\tconst stepFraction = trunc(length * fraction)\n\n\t\t\t\t\tfor (let index = 0; index < stepFraction; index++) values[index] = oldValues[index]\n\n\t\t\t\t\tif (stepFraction < length) values[stepFraction] = oldValues[stepFraction] * (length * fraction - stepFraction)\n\t\t\t\t} else if (this.kind === \"all\" && oldValues) {\n\t\t\t\t\tfor (let index = 0; index < length; index++) values[index] = oldValues[index] * fraction\n\t\t\t\t} else if (this.kind !== \"axis\") {\n\t\t\t\t\tthis._scaling = fraction\n\t\t\t\t}\n\t\t\t})\n\t}\n\n\tstop(): void {\n\t\tthis.doStep(1)\n\t\tconst axis = this.getAxis()\n\t\tconst otherAxis = this.getOtherAxis()\n\n\t\tif (axis) {\n\t\t\taxis.maximum = this.oldmax\n\t\t\taxis.minimum = this.oldmin\n\t\t\taxis.automatic = this.oldauto\n\t\t}\n\t\tif (otherAxis) {\n\t\t\totherAxis.maximum = this.oldmax\n\t\t\totherAxis.minimum = this.oldmin\n\t\t\totherAxis.automatic = this.oldauto\n\t\t}\n\n\t\tthis.chart.series.each(s => {\n\t\t\tif (s.transform) s.transform = null\n\n\t\t\tif (this.kind === \"each\" || this.kind === \"all\")\n\t\t\t\tif (s.data._old) {\n\t\t\t\t\ts.data.values = s.data._old\n\t\t\t\t\ts.data._old = null\n\t\t\t\t}\n\t\t})\n\t}\n\n\tstart(): void {\n\t\tconst axis = this.getAxis()\n\t\tconst otherAxis = this.getOtherAxis()\n\t\tconst chart = this.chart\n\t\tconst series = chart.series.items\n\t\tconst width = chart.chartRect.width\n\t\tconst height = chart.chartRect.height\n\t\tconst chartWidth = chart.bounds.width\n\t\tconst chartHeight = chart.bounds.height\n\n\t\tif (series.length === 0 || !axis) return\n\n\t\tthis.oldmin = axis.minimum\n\t\tthis.oldmax = axis.maximum\n\t\tthis.oldauto = axis.automatic\n\n\t\tfor (const seriesItem of series) {\n\t\t\tif (this.series && this.series !== seriesItem) continue\n\n\t\t\tif (seriesItem?.constructor?.name === \"Pie\")\n\t\t\t\tseriesItem.transform = () => {\n\t\t\t\t\tseriesItem.chart.drawContext.scale(this._scaling, this._scaling)\n\t\t\t\t}\n\t\t\telse if (this.kind === \"each\" || this.kind === \"all\") {\n\t\t\t\tconst values = seriesItem.data.values\n\t\t\t\tseriesItem.data._old = values.slice(0)\n\t\t\t\tseriesItem.data.values = values.slice(0)\n\t\t\t\tfor (let index = 0; index < seriesItem.data.values.length; index++) seriesItem.data.values[index] = 0\n\t\t\t\taxis.automatic = false\n\t\t\t\tif (otherAxis) otherAxis.automatic = false\n\t\t\t} else if (this.kind === \"left\")\n\t\t\t\tseriesItem.transform = () => {\n\t\t\t\t\tseriesItem.chart.drawContext.translate(-width * (1 - this._scaling), 0)\n\t\t\t\t}\n\t\t\telse if (this.kind === \"right\")\n\t\t\t\tseriesItem.transform = () => {\n\t\t\t\t\tseriesItem.chart.drawContext.translate(width * (1 - this._scaling), 0)\n\t\t\t\t}\n\t\t\telse if (this.kind === \"x\")\n\t\t\t\tseriesItem.transform = () => {\n\t\t\t\t\tseriesItem.chart.drawContext.scale(this._scaling, 1)\n\t\t\t\t}\n\t\t\telse if (this.kind === \"y\")\n\t\t\t\tseriesItem.transform = () => {\n\t\t\t\t\tseriesItem.chart.drawContext.scale(1, this._scaling)\n\t\t\t\t}\n\t\t\telse if (this.kind === \"top\")\n\t\t\t\tseriesItem.transform = () => {\n\t\t\t\t\tseriesItem.chart.drawContext.translate(0, -height * (1 - this._scaling))\n\t\t\t\t}\n\t\t\telse if (this.kind === \"bottom\")\n\t\t\t\tseriesItem.transform = () => {\n\t\t\t\t\tseriesItem.chart.drawContext.translate(0, height * (1 - this._scaling))\n\t\t\t\t}\n\t\t\telse if (this.kind === \"zoomin\")\n\t\t\t\tseriesItem.transform = () => {\n\t\t\t\t\tconst context = seriesItem.chart.drawContext\n\t\t\t\t\tcontext.translate(chartWidth * 0.5, chartHeight * 0.5)\n\t\t\t\t\tcontext.scale(this._scaling, this._scaling)\n\t\t\t\t\tcontext.translate(-chartWidth * 0.5, -chartHeight * 0.5)\n\t\t\t\t}\n\t\t\telse if (this.kind === \"zoomout\")\n\t\t\t\tseriesItem.transform = () => {\n\t\t\t\t\tconst context = seriesItem.chart.drawContext\n\t\t\t\t\tcontext.translate(chartWidth * 0.5, chartHeight * 0.5)\n\t\t\t\t\tcontext.scale(2 - this._scaling, 2 - this._scaling)\n\t\t\t\t\tcontext.translate(-chartWidth * 0.5, -chartHeight * 0.5)\n\t\t\t\t}\n\t\t}\n\n\t\tif (this.kind === \"axis\") {\n\t\t\tthis.changeAxis(axis, 100)\n\t\t\tif (otherAxis) this.changeAxis(otherAxis, 100)\n\t\t}\n\t}\n}\n","import type { Format } from \"../core/elements/format.js\"\nimport { Shadow } from \"../core/elements/shadow.js\"\nimport type { Rectangle } from \"../core/primitives.js\"\nimport { BaseAnimation } from \"./base-animation.js\"\n\nexport class AnimateHover {\n\tautoHide: boolean | undefined\n\tformat: Format\n\tbounds: Rectangle\n\tenabled = true\n\told: Shadow\n\n\tconstructor(duration: number, bounds: Rectangle, format: Format) {\n\t\tthis.format = format\n\t\tthis.bounds = bounds\n\t\tthis.old = new Shadow()\n\t\tthis.old.set(format.shadow)\n\n\t\tconst shadow = format.shadow\n\t\tshadow.visible = true\n\t\tshadow.color = \"rgba(0,255,0,0.1)\"\n\t\tshadow.blur = 10\n\t\tshadow.width = 0\n\t\tshadow.height = 0\n\n\t\tconst animation = new BaseAnimation(format.chart, (fraction: number) => {\n\t\t\tif (!this.enabled) return\n\t\t\tif (fraction < 1) this.format.shadow.color = `rgba(0,255,0,${fraction})`\n\t\t\telse if (this.autoHide) this.restore()\n\t\t})\n\n\t\tanimation.duration = duration\n\t\tanimation.animate()\n\t}\n\n\trestore(): void {\n\t\tthis.format.shadow.set(this.old)\n\t\tthis.enabled = false\n\t}\n}\n","import type { Rectangle } from \"../primitives.js\"\n\nexport class Margins {\n\tleft = 2\n\ttop = 2\n\tright = 2\n\tbottom = 2\n\n\tapply(rectangle: Rectangle): void {\n\t\tconst width = rectangle.width\n\t\tconst height = rectangle.height\n\n\t\trectangle.x += width * this.left * 0.01\n\t\trectangle.width -= width * Math.min(100, this.left + this.right) * 0.01\n\t\trectangle.y += height * this.top * 0.01\n\t\trectangle.height -= height * Math.min(100, this.top + this.bottom) * 0.01\n\t}\n}\n","import type { Chart } from \"./chart.js\"\nimport { Point } from \"./core/primitives.js\"\nimport { getDocument, getWindow } from \"./platform.js\"\nimport type { Series } from \"./series.js\"\nimport type { ToolTip } from \"./tools/annotation.js\"\nimport { BaseAnimation } from \"./tools/base-animation.js\"\n\ninterface TooltipTarget extends HTMLCanvasElement {\n\tchart?: Chart\n}\n\ninterface TooltipElement extends HTMLDivElement {\n\ttimer: ReturnType<typeof setTimeout> | null\n}\n\ninterface TooltipPointer {\n\tvisible: boolean\n\tsecondCircleRadius: number\n\tfirstCircleRadius: number\n\tfill: string\n\tsecondCircleOpacity: number\n\tfirstCircleOpacity: number\n\tanimationVisible: boolean\n\tanimationDuration: number\n}\n\ntype DOMToolTip = ToolTip & { pointer: TooltipPointer }\n\nconst cleanupCharts = new WeakSet<Chart>()\nlet positionDocument: Document | null = null\n\nfunction stopMouseTracking(): void {\n\tpositionDocument?.removeEventListener(\"mousemove\", DOMTip.pos)\n\tpositionDocument = null\n}\n\nexport interface DOMTipRenderer {\n\tshow: (value: string, width?: number | \"auto\", target?: TooltipTarget, domStyle?: string, toolTip?: ToolTip) => void\n\thide: () => void\n}\n\nlet top = 3,\n\tleft = 3,\n\tarrowtt: HTMLDivElement | null = null,\n\tspeed = 10,\n\ttimer = 10,\n\tarrowWidth = 8,\n\tarrowStyleBefore: HTMLStyleElement | null = null,\n\tfollowCursor = false,\n\tarrowStyleAfter: HTMLStyleElement | null = null,\n\tarrowBorderWidth = 0,\n\ttip: DOMToolTip | null = null,\n\tpreviousIndex: number | undefined,\n\tpreviousNearestSeries: Series | undefined,\n\tdomStylesBorderColor = \"\",\n\tdomStylesBackgroundColor = \"\",\n\tendalpha = 97,\n\talpha = 0,\n\ttt: TooltipElement | null = null,\n\tttstyle: CSSStyleDeclaration | null = null,\n\th = 0,\n\tmoveDuration = 0,\n\tsnapNext = false,\n\tanimation: BaseAnimation | null = null,\n\townerChart: Chart | undefined,\n\tactiveController: DOMTipController | null = null,\n\ttarget: TooltipTarget | null = null,\n\twidth = 0\n\n/** Finds the chart point the tooltip must point at: the tool's current point, else the nearest series value. */\nfunction anchorPoint(chart: Chart, e: MouseEvent, horizontal: boolean, overCanvas: boolean): Point {\n\tconst point = new Point()\n\tconst current = tip?.currentSeries\n\tif (current && tip && tip.currentIndex >= 0) {\n\t\tcurrent.calc(tip.currentIndex, point)\n\t\treturn point\n\t}\n\tif (!overCanvas) return point\n\tconst index = horizontal\n\t\t? Math.round(chart.axes.left.fromPos(e.layerY))\n\t\t: Math.round(\n\t\t\t\tchart.axes.bottom.fromSizeCalcIndex(\n\t\t\t\t\te.clientX -\n\t\t\t\t\t\t(chart.interactionCanvas || chart.canvas).getBoundingClientRect().left -\n\t\t\t\t\t\tchart.axes.bottom.startPos\n\t\t\t\t)\n\t\t\t)\n\tlet minDistance = Number.POSITIVE_INFINITY\n\tfor (const series of chart.series.items) {\n\t\tconst value = series.data.values[index]\n\t\tconst distance = Math.abs(\n\t\t\tvalue - (horizontal ? chart.axes.bottom.fromPos(e.layerX) : chart.axes.left.fromPos(e.layerY))\n\t\t)\n\t\tif (distance < minDistance || (Number.isNaN(minDistance) && !Number.isNaN(distance))) {\n\t\t\tminDistance = distance\n\t\t\tseries.calc(index, point)\n\t\t}\n\t}\n\treturn point\n}\n\n/** Where the tooltip sits relative to the point it describes. */\ntype TipSide = \"top\" | \"bottom\" | \"left\" | \"right\"\n\n/** Draws the tooltip arrow as a rotated square that inherits the tooltip background and border. */\nfunction positionArrow(before: HTMLStyleElement, after: HTMLStyleElement, side: TipSide, offset: number): void {\n\tconst size = arrowWidth * 2\n\tconst border = domStylesBorderColor || \"transparent\"\n\t// The edge of the tooltip that carries the arrow, and the two borders that stay visible once rotated.\n\tconst edge = { top: \"bottom\", bottom: \"top\", left: \"right\", right: \"left\" }[side]\n\tconst [sides, other] = {\n\t\ttop: [\"border-right\", \"border-bottom\"],\n\t\tbottom: [\"border-left\", \"border-top\"],\n\t\tleft: [\"border-right\", \"border-top\"],\n\t\tright: [\"border-left\", \"border-bottom\"]\n\t}[side]\n\tconst along = side === \"top\" || side === \"bottom\" ? `left:${offset}px` : `top:${offset}px`\n\tbefore.innerHTML =\n\t\t`.teetiparrow{position:absolute;width:${size}px;height:${size}px;${along};${edge}:-${arrowWidth + 1}px;` +\n\t\t`background:${domStylesBackgroundColor || \"#fff\"};transform:rotate(45deg);box-sizing:border-box;` +\n\t\t`${sides}:1px solid ${border};${other}:1px solid ${border};}`\n\tafter.innerHTML = \"\"\n}\n\n/** Distance in pixels the tooltip travels while fading in or out. */\nconst slideDistance = 6\n\nfunction prefersReducedMotion(): boolean {\n\treturn getWindow()?.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches ?? false\n}\n\n/** Ties the slide offset to the fade so the tooltip rises into place as it appears. */\nfunction applySlide(): void {\n\tif (!ttstyle) return\n\tconst offset = moveDuration > 0 ? slideDistance * (1 - alpha / endalpha) : 0\n\tttstyle.transform = offset > 0.05 ? `translateY(${offset.toFixed(2)}px)` : \"\"\n}\n\nfunction isLegacyIE() {\n\treturn !!getDocument()?.all\n}\n\n// biome-ignore lint/complexity/noStaticOnlyClass: <explanation> This class is only used as a static helper for tooltips, and it doesn't need to be instantiated. It serves as a namespace for related functions and properties, and it doesn't maintain any instance state. Therefore, it makes sense to use a static class in this case.\nexport class DOMTip {\n\tstatic show(v: string, w: number | \"auto\" = 0, dest?: TooltipTarget, domStyle = \"\", toolTip?: ToolTip): void {\n\t\tconst runtimeDocument = getDocument()\n\t\tif (!runtimeDocument?.body) return\n\t\tconst chart = toolTip?.chart || dest?.chart\n\t\tif (chart?.destroyed || toolTip?.destroyed) return\n\t\tif (tt && tt.ownerDocument !== runtimeDocument) {\n\t\t\tDOMTip.stop()\n\t\t\ttt.remove()\n\t\t\tarrowStyleBefore?.remove()\n\t\t\tarrowStyleAfter?.remove()\n\t\t\ttt = null\n\t\t\tttstyle = null\n\t\t}\n\t\tif (ownerChart !== chart || tip !== (toolTip || null)) DOMTip.stop()\n\t\townerChart = chart\n\t\tactiveController = null\n\t\tconst ie = isLegacyIE()\n\n\t\tif (toolTip) {\n\t\t\ttip = toolTip as DOMToolTip\n\t\t\tfollowCursor = toolTip.followCursor\n\t\t\tarrowWidth = followCursor ? 0 : 8\n\t\t}\n\t\tif (!tt) {\n\t\t\tarrowStyleAfter = runtimeDocument.createElement(\"style\")\n\t\t\tarrowStyleBefore = runtimeDocument.createElement(\"style\")\n\n\t\t\tdomStylesBorderColor = \"\"\n\t\t\ttt = runtimeDocument.createElement(\"div\") as TooltipElement\n\t\t\tarrowtt = runtimeDocument.createElement(\"div\")\n\n\t\t\ttt.setAttribute(\"id\", \"teetip1\")\n\t\t\tarrowtt.setAttribute(\"id\", \"teetiparrow1\")\n\t\t\ttt.className = \"teetip\"\n\t\t\tarrowtt.className = \"teetiparrow\"\n\n\t\t\ttt.setAttribute(\"style\", domStyle)\n\t\t\tdomStylesBorderColor = tt.style.getPropertyValue(\"border-color\")\n\t\t\tdomStylesBackgroundColor = tt.style.getPropertyValue(\"background-color\")\n\n\t\t\tconst borderWidth = tt.style.getPropertyValue(\"border-width\")\n\t\t\tarrowBorderWidth = borderWidth.length === 0 ? 0 : Number.parseFloat(borderWidth) * 2\n\n\t\t\tpositionArrow(arrowStyleBefore, arrowStyleAfter, \"top\", 20)\n\t\t\truntimeDocument.head.appendChild(arrowStyleBefore)\n\t\t\truntimeDocument.head.appendChild(arrowStyleAfter)\n\n\t\t\truntimeDocument.body.appendChild(tt)\n\t\t\ttt.appendChild(arrowtt)\n\t\t\tttstyle = tt.style\n\t\t\tttstyle.opacity = \"0\"\n\n\t\t\t// IE only:\n\t\t\tif (ie) ttstyle.filter = \"alpha(opacity=0)\"\n\t\t}\n\n\t\tif (!tt || !ttstyle || !arrowtt || !arrowStyleBefore || !arrowStyleAfter) return\n\n\t\ttarget = dest ?? null\n\t\tif (chart?._eventCleanups && !cleanupCharts.has(chart)) {\n\t\t\tcleanupCharts.add(chart)\n\t\t\tchart._eventCleanups.push(() => {\n\t\t\t\tcleanupCharts.delete(chart)\n\t\t\t\tDOMTip.stop(chart)\n\t\t\t})\n\t\t}\n\n\t\tmoveDuration = toolTip && !prefersReducedMotion() ? Math.max(0, toolTip.animated) : 0\n\t\t// A tooltip that is not yet visible must jump to its first position instead of gliding from the last one.\n\t\tif (alpha === 0) snapNext = true\n\n\t\tttstyle.display = \"block\"\n\t\tttstyle.position = \"absolute\"\n\t\ttt.innerHTML = `${arrowtt.outerHTML}<div style=\"position:relative\">${v}</div>`\n\t\tttstyle.width = typeof w === \"number\" && w > 0 ? `${w}px` : \"auto\"\n\n\t\tif (!w && ie) ttstyle.width = `${tt.offsetWidth}px`\n\n\t\tif (tt.offsetWidth > 300) ttstyle.width = `${300}px`\n\t\twidth = tt.offsetWidth\n\t\th = tt.offsetHeight + top\n\t\tDOMTip._scheduleFade(1)\n\n\t\tif (positionDocument !== runtimeDocument) {\n\t\t\tstopMouseTracking()\n\t\t\truntimeDocument.addEventListener(\"mousemove\", DOMTip.pos)\n\t\t\tpositionDocument = runtimeDocument\n\t\t}\n\t}\n\n\tstatic pos(e: MouseEvent): void {\n\t\tconst runtimeDocument = getDocument()\n\t\tconst runtimeWindow = getWindow()\n\t\tif (!runtimeDocument || !tt || !ttstyle || !arrowStyleBefore || !arrowStyleAfter) return\n\t\tconst ie = isLegacyIE()\n\t\tlet chart: Chart | undefined\n\t\tlet horizontal = false\n\t\tlet placed = false\n\t\tlet d: HTMLElement\n\t\tlet u = 0\n\t\tlet l = 0\n\t\tconst eventTarget = e.target as TooltipTarget | null\n\n\t\tif (tip) {\n\t\t\tif (tip.followCursor) {\n\t\t\t\tarrowWidth = 0\n\t\t\t\tfollowCursor = true\n\t\t\t} else {\n\t\t\t\tarrowWidth = 8\n\t\t\t\tfollowCursor = false\n\t\t\t}\n\n\t\t\tif (target && ownerChart) {\n\t\t\t\tchart = ownerChart\n\t\t\t\thorizontal = chart.axes.bottom.firstSeries ? !chart.axes.bottom.firstSeries.yMandatory : false\n\t\t\t}\n\t\t\tif (chart) {\n\t\t\t\t// Redrawing is only needed to erase and repaint the optional tooltip point marker.\n\t\t\t\tif (tip?.pointer.visible) chart.draw()\n\t\t\t\tif (followCursor || !target) {\n\t\t\t\t\td = runtimeDocument.documentElement\n\t\t\t\t\tu = ie ? e.clientY + d.scrollTop : e.pageY\n\t\t\t\t\tl = ie ? e.clientX + d.scrollLeft : e.pageX - width / 2 - 10 - arrowWidth\n\t\t\t\t\tarrowStyleBefore.innerHTML =\n\t\t\t\t\t\t\".teetiparrow{width:0;height:0;border: \" +\n\t\t\t\t\t\tarrowWidth +\n\t\t\t\t\t\t\"px solid;position: absolute;content: '';border-color: \" +\n\t\t\t\t\t\tdomStylesBorderColor +\n\t\t\t\t\t\t\" \" +\n\t\t\t\t\t\tdomStylesBorderColor +\n\t\t\t\t\t\t\" transparent transparent;bottom: -\" +\n\t\t\t\t\t\tarrowWidth * 2 +\n\t\t\t\t\t\t\"px;left: \" +\n\t\t\t\t\t\t(tt.getBoundingClientRect().width - arrowWidth * 2 - arrowBorderWidth / 2) +\n\t\t\t\t\t\t\"px;}\"\n\t\t\t\t\tarrowStyleAfter.innerHTML =\n\t\t\t\t\t\t\".teetiparrow:after{content: ' ';position: absolute;width: 0;height: 0;left: -\" +\n\t\t\t\t\t\t(arrowWidth - arrowBorderWidth / 2) +\n\t\t\t\t\t\t\"px;bottom: \" +\n\t\t\t\t\t\t(arrowBorderWidth - (arrowWidth - 1)) +\n\t\t\t\t\t\t\"px; border: \" +\n\t\t\t\t\t\t(arrowWidth - arrowBorderWidth / 2) +\n\t\t\t\t\t\t\"px solid;border-color: \" +\n\t\t\t\t\t\tdomStylesBackgroundColor +\n\t\t\t\t\t\t\" \" +\n\t\t\t\t\t\tdomStylesBackgroundColor +\n\t\t\t\t\t\t\" transparent transparent;}\"\n\t\t\t\t} else {\n\t\t\t\t\tconst point = anchorPoint(chart, e, horizontal, eventTarget === (chart.interactionCanvas || chart.canvas))\n\t\t\t\t\tconst canvasRect = (chart.interactionCanvas || chart.canvas).getBoundingClientRect()\n\t\t\t\t\tconst tipRect = tt.getBoundingClientRect()\n\t\t\t\t\tconst scrollX = runtimeWindow?.scrollX ?? 0\n\t\t\t\t\tconst scrollY = runtimeWindow?.scrollY ?? 0\n\t\t\t\t\tconst viewWidth = runtimeWindow?.innerWidth || runtimeDocument.documentElement.clientWidth || Number.MAX_VALUE\n\t\t\t\t\tconst gap = arrowWidth + 4\n\t\t\t\t\tconst anchorX = point.x + canvasRect.left + scrollX\n\t\t\t\t\tconst anchorY = point.y + canvasRect.top + scrollY\n\t\t\t\t\tconst minLeft = scrollX + 4\n\t\t\t\t\tconst maxLeft = scrollX + viewWidth - tipRect.width - 4\n\t\t\t\t\tconst current = tip?.currentSeries\n\t\t\t\t\tlet side: TipSide | undefined =\n\t\t\t\t\t\tcurrent && tip && tip.currentIndex >= 0 ? current.tooltipSide(tip.currentIndex) : undefined\n\t\t\t\t\t// Sideways placement needs room on that side; otherwise fall back to above/below.\n\t\t\t\t\tif (side === \"right\" && anchorX + gap + tipRect.width > scrollX + viewWidth - 4) side = \"bottom\"\n\t\t\t\t\tif (side === \"left\" && anchorX - gap - tipRect.width < scrollX + 4) side = \"top\"\n\t\t\t\t\tif (side === \"left\" || side === \"right\") {\n\t\t\t\t\t\tl = Math.round(side === \"right\" ? anchorX + gap : anchorX - gap - tipRect.width)\n\t\t\t\t\t\tu = Math.round(anchorY - tipRect.height / 2)\n\t\t\t\t\t\tconst arrowTop = Math.max(8, Math.min(anchorY - u - arrowWidth, tipRect.height - arrowWidth * 2 - 8))\n\t\t\t\t\t\tpositionArrow(arrowStyleBefore, arrowStyleAfter, side === \"right\" ? \"right\" : \"left\", arrowTop)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tl = Math.round(Math.max(minLeft, Math.min(anchorX - tipRect.width / 2, Math.max(minLeft, maxLeft))))\n\t\t\t\t\t\tu = Math.round(anchorY - tipRect.height - gap)\n\t\t\t\t\t\tconst below = side === \"bottom\" || u < scrollY + 4\n\t\t\t\t\t\tif (below) u = Math.round(anchorY + gap)\n\t\t\t\t\t\tconst arrowLeft = Math.max(8, Math.min(anchorX - l - arrowWidth, tipRect.width - arrowWidth * 2 - 8))\n\t\t\t\t\t\tpositionArrow(arrowStyleBefore, arrowStyleAfter, below ? \"bottom\" : \"top\", arrowLeft)\n\t\t\t\t\t}\n\t\t\t\t\tplaced = true\n\t\t\t\t}\n\t\t\t\tif (tip?.pointer.visible) {\n\t\t\t\t\tdrawPoint()\n\t\t\t\t\tu -=\n\t\t\t\t\t\ttip.pointer.secondCircleRadius > tip.pointer.firstCircleRadius\n\t\t\t\t\t\t\t? tip.pointer.secondCircleRadius\n\t\t\t\t\t\t\t: tip.pointer.firstCircleRadius\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\td = runtimeDocument.documentElement\n\t\t\t\tu = ie ? e.clientY + d.scrollTop : e.pageY\n\t\t\t\tl = ie ? e.clientX + d.scrollLeft : e.pageX - width / 2 - 10 - arrowWidth\n\t\t\t}\n\t\t} else {\n\t\t\tarrowWidth = 0\n\t\t\tfollowCursor = true\n\t\t\td = runtimeDocument.documentElement\n\t\t\tu = ie ? e.clientY + d.scrollTop : e.pageY\n\t\t\tl = ie ? e.clientX + d.scrollLeft : e.pageX - width / 2 - 10 - arrowWidth\n\t\t\tarrowStyleBefore.innerHTML =\n\t\t\t\t\".teetiparrow{width:0;height:0;border: \" +\n\t\t\t\tarrowWidth +\n\t\t\t\t\"px solid;position: absolute;content: '';border-color: \" +\n\t\t\t\tdomStylesBorderColor +\n\t\t\t\t\" \" +\n\t\t\t\tdomStylesBorderColor +\n\t\t\t\t\" transparent transparent;bottom: -\" +\n\t\t\t\tarrowWidth * 2 +\n\t\t\t\t\"px;left: \" +\n\t\t\t\t(tt.getBoundingClientRect().width - arrowWidth * 2 - arrowBorderWidth / 2) +\n\t\t\t\t\"px;}\"\n\t\t\tarrowStyleAfter.innerHTML =\n\t\t\t\t\".teetiparrow:after{content: ' ';position: absolute;width: 0;height: 0;left: -\" +\n\t\t\t\t(arrowWidth - arrowBorderWidth / 2) +\n\t\t\t\t\"px;bottom: \" +\n\t\t\t\t(arrowBorderWidth - (arrowWidth - 1)) +\n\t\t\t\t\"px; border: \" +\n\t\t\t\t(arrowWidth - arrowBorderWidth / 2) +\n\t\t\t\t\"px solid;border-color: \" +\n\t\t\t\tdomStylesBackgroundColor +\n\t\t\t\t\" \" +\n\t\t\t\tdomStylesBackgroundColor +\n\t\t\t\t\" transparent transparent;}\"\n\t\t}\n\t\tif (!placed) {\n\t\t\tif (u - h < 0) u = h\n\t\t\tif (l < 0) l = 0\n\n\t\t\tif (target) {\n\t\t\t\tlet offsetLeft = target.offsetLeft\n\t\t\t\tlet node: HTMLElement = target\n\t\t\t\twhile (node.offsetParent != null) {\n\t\t\t\t\toffsetLeft += node.offsetLeft\n\t\t\t\t\tnode = node.offsetParent as HTMLElement\n\t\t\t\t}\n\n\t\t\t\tif (l > offsetLeft + target.clientWidth - tt.offsetWidth - 25)\n\t\t\t\t\tl = offsetLeft + target.clientWidth - tt.offsetWidth - 25\n\t\t\t}\n\t\t}\n\n\t\tconst glide = placed && moveDuration > 0 && !snapNext\n\t\tif (!glide) ttstyle.transition = \"none\"\n\t\tif (followCursor) {\n\t\t\tttstyle.top = `${u - h}px`\n\t\t\tttstyle.left = `${l + left}px`\n\t\t} else {\n\t\t\tttstyle.top = `${u}px`\n\t\t\tttstyle.left = `${l}px`\n\t\t}\n\t\tif (placed && moveDuration > 0) {\n\t\t\tif (snapNext) {\n\t\t\t\tvoid tt.offsetWidth // commit the jump before transitions are re-enabled\n\t\t\t\tsnapNext = false\n\t\t\t}\n\t\t\tttstyle.transition = `left ${moveDuration}ms ease-out, top ${moveDuration}ms ease-out`\n\t\t}\n\n\t\tfunction animatePointer(point: Point, c: CanvasRenderingContext2D | null): void {\n\t\t\tif (!tip) return\n\t\t\tconst pointer = tip.pointer\n\t\t\tconst chart = tip.chart\n\t\t\tanimation?.cancel()\n\t\t\tanimation = new BaseAnimation(chart, (f: number) => {\n\t\t\t\tif (!chart || chart.destroyed) return\n\t\t\t\tif (f < 1) {\n\t\t\t\t\tchart.draw()\n\t\t\t\t\tdrawPointAt(point, pointer.secondCircleRadius * f, pointer.fill, pointer.secondCircleOpacity, c)\n\t\t\t\t\tdrawPointAt(point, pointer.firstCircleRadius * f, pointer.fill, pointer.firstCircleOpacity, c)\n\t\t\t\t}\n\t\t\t})\n\t\t\tanimation.onstop = () => {\n\t\t\t\tif (!chart || chart.destroyed) return\n\t\t\t\tchart.draw()\n\t\t\t\tdrawPointAt(point, pointer.secondCircleRadius, pointer.fill, pointer.secondCircleOpacity, c)\n\t\t\t\tdrawPointAt(point, pointer.firstCircleRadius, pointer.fill, pointer.firstCircleOpacity, c)\n\t\t\t}\n\t\t\tanimation.duration = pointer.animationDuration\n\t\t\tanimation.animate()\n\t\t}\n\t\tfunction drawPointAt(\n\t\t\tpoint: Point,\n\t\t\tsize: number,\n\t\t\tcolor: string,\n\t\t\topacity: number,\n\t\t\tc: CanvasRenderingContext2D | null\n\t\t): void {\n\t\t\tif (!c) return\n\t\t\tc.strokeStyle = color\n\t\t\tc.fillStyle = color\n\t\t\tc.globalAlpha = opacity\n\t\t\tc.lineWidth = size\n\t\t\tc.beginPath()\n\t\t\tc.ellipse(point.x, point.y, size / 2, size / 2, 0, 0, 7, false)\n\t\t\tc.stroke()\n\t\t}\n\t\tfunction drawPoint(): void {\n\t\t\tif (chart && eventTarget === (chart.interactionCanvas || chart.canvas)) {\n\t\t\t\tchart.draw()\n\t\t\t\tlet index = 0\n\t\t\t\tconst point = new Point()\n\t\t\t\tlet distance = 0\n\t\t\t\tlet minDistance = 0\n\t\t\t\tlet nearestSeries: Series | undefined\n\t\t\t\tif (!tip) return\n\t\t\t\tconst pointer = tip.pointer\n\t\t\t\tif (!horizontal)\n\t\t\t\t\tindex = Math.round(\n\t\t\t\t\t\tchart.axes.bottom.fromSizeCalcIndex(\n\t\t\t\t\t\t\te.clientX -\n\t\t\t\t\t\t\t\t(chart.interactionCanvas || chart.canvas).getBoundingClientRect().left -\n\t\t\t\t\t\t\t\tchart.axes.bottom.startPos\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\telse index = Math.round(chart.axes.left.fromPos(e.layerY))\n\t\t\t\tif (eventTarget === (chart.interactionCanvas || chart.canvas)) {\n\t\t\t\t\tfor (let n = 0; n < chart.series.items.length; n++) {\n\t\t\t\t\t\tif (!horizontal)\n\t\t\t\t\t\t\tdistance = Math.abs(chart.series.items[n].data.values[index] - chart.axes.left.fromPos(e.layerY))\n\t\t\t\t\t\telse distance = Math.abs(chart.series.items[n].data.values[index] - chart.axes.bottom.fromPos(e.layerX))\n\t\t\t\t\t\tif (n === 0) {\n\t\t\t\t\t\t\tminDistance = distance\n\t\t\t\t\t\t\tchart.series.items[n].calc(index, point)\n\t\t\t\t\t\t\tnearestSeries = chart.series.items[n]\n\t\t\t\t\t\t} else if (distance < minDistance) {\n\t\t\t\t\t\t\tchart.series.items[n].calc(index, point)\n\t\t\t\t\t\t\tminDistance = distance\n\t\t\t\t\t\t\tnearestSeries = chart.series.items[n]\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst c = chart.ctx\n\t\t\t\tif (!previousNearestSeries) {\n\t\t\t\t\tpreviousNearestSeries = nearestSeries\n\t\t\t\t} else if (index !== -1 && previousNearestSeries !== nearestSeries) {\n\t\t\t\t\tpreviousNearestSeries = nearestSeries\n\t\t\t\t\tif (pointer.animationVisible) animatePointer(point, c) //here will go the animation\n\t\t\t\t}\n\n\t\t\t\tif ((index !== -1 && !previousIndex) || index === -1) {\n\t\t\t\t\tpreviousIndex = index\n\t\t\t\t} else if (index !== -1 && previousIndex !== index) {\n\t\t\t\t\tpreviousIndex = index\n\t\t\t\t\tif (pointer.animationVisible) animatePointer(point, c) //here will go the animation\n\t\t\t\t}\n\n\t\t\t\tdrawPointAt(point, pointer.secondCircleRadius, pointer.fill, pointer.secondCircleOpacity, c)\n\t\t\t\tdrawPointAt(point, pointer.firstCircleRadius, pointer.fill, pointer.firstCircleOpacity, c)\n\t\t\t}\n\t\t}\n\t}\n\n\tstatic fade(d: number): void {\n\t\tconst a = alpha\n\n\t\tif ((a !== endalpha && d === 1) || (a !== 0 && d === -1)) {\n\t\t\tlet i = speed\n\n\t\t\tif (endalpha - a < speed && d === 1) i = endalpha - a\n\t\t\telse if (alpha < speed && d === -1) i = a\n\n\t\t\talpha = a + i * d\n\n\t\t\tif (!ttstyle) return\n\t\t\tttstyle.opacity = `${alpha * 0.01}`\n\t\t\tapplySlide()\n\n\t\t\t// IE only:\n\t\t\tif (isLegacyIE()) ttstyle.filter = `alpha(opacity=${alpha})`\n\t\t\tDOMTip._scheduleFade(d)\n\t\t} else {\n\t\t\tif (tt) tt.timer = null\n\t\t\tif (d === -1) {\n\t\t\t\tDOMTip.stop()\n\t\t\t}\n\t\t}\n\t}\n\n\tstatic hide() {\n\t\tif (tt && ttstyle && ttstyle.display !== \"none\") {\n\t\t\tanimation?.cancel()\n\t\t\tanimation = null\n\t\t\tstopMouseTracking()\n\t\t\tDOMTip._scheduleFade(-1)\n\t\t\townerChart?.draw()\n\t\t}\n\t}\n\n\tstatic _scheduleFade(direction: number): void {\n\t\tconst element = tt\n\t\tif (!element) return\n\t\tif (element.timer) clearTimeout(element.timer)\n\t\telement.timer = setTimeout(() => {\n\t\t\telement.timer = null\n\t\t\tDOMTip.fade(direction)\n\t\t}, timer)\n\t}\n\n\t/**\n\t * Cancels DOM tooltip activity owned by a chart that is being destroyed.\n\t * @param {Tee.Chart} chart Chart that owned the current tooltip.\n\t */\n\tstatic stop(chart?: Chart): void {\n\t\tif (chart && ownerChart !== chart) return\n\t\tanimation?.cancel()\n\t\tanimation = null\n\t\tif (tt?.timer) clearTimeout(tt.timer)\n\t\tif (tt) tt.timer = null\n\t\tif (ttstyle) {\n\t\t\tttstyle.display = \"none\"\n\t\t\tttstyle.opacity = \"0\"\n\t\t\tttstyle.transform = \"\"\n\t\t\tttstyle.transition = \"none\"\n\t\t}\n\t\tsnapNext = false\n\t\tstopMouseTracking()\n\t\townerChart = undefined\n\t\tactiveController = null\n\t\ttarget = null\n\t\ttip = null\n\t\tpreviousIndex = undefined\n\t\tpreviousNearestSeries = undefined\n\t\talpha = 0\n\t}\n}\n\n/** @internal Identifies the tool currently using the legacy singleton. */\nexport function isDOMTipOwner(toolTip: ToolTip): boolean {\n\treturn tip === toolTip\n}\n\n/**\n * Chart-owned DOM tooltip controller.\n *\n * The legacy static DOMTip API remains available for maps and backwards\n * compatibility, while chart tooltips use this controller so they can be\n * enabled, disabled, or rendered by an application-owned implementation.\n */\nexport class DOMTipController {\n\tprivate _enabled = true\n\trenderer: DOMTipRenderer | null = null\n\n\tget enabled(): boolean {\n\t\treturn this._enabled\n\t}\n\n\tset enabled(value: boolean) {\n\t\tthis._enabled = value\n\t\tif (!value) this.hide()\n\t}\n\n\tshow(value: string, width: number | \"auto\" = 0, target?: TooltipTarget, domStyle = \"\", toolTip?: ToolTip): void {\n\t\tif (!this.enabled || toolTip?.destroyed || (toolTip?.chart || target?.chart)?.destroyed) return\n\t\tif (this.renderer) this.renderer.show(value, width, target, domStyle, toolTip)\n\t\telse {\n\t\t\tif (!getDocument()?.body) return\n\t\t\tDOMTip.show(value, width, target, domStyle, toolTip)\n\t\t\tactiveController = this\n\t\t}\n\t}\n\n\thide(): void {\n\t\tif (this.renderer) this.renderer.hide()\n\t\telse if (activeController === this) DOMTip.hide()\n\t}\n\n\tstop(chart: Chart): void {\n\t\tif (this.renderer) this.renderer.hide()\n\t\telse DOMTip.stop(chart)\n\t}\n}\n","import type { Gradient, Graphics, TextMetricsLike } from \"./graphics.js\"\n\n/** Adapts the browser Canvas 2D context to the renderer-neutral surface. */\nexport class CanvasGraphics implements Graphics {\n\tconstructor(private readonly context: CanvasRenderingContext2D) {}\n\n\tget fillStyle(): unknown {\n\t\treturn this.context.fillStyle\n\t}\n\tset fillStyle(value: unknown) {\n\t\tthis.context.fillStyle = value as string | CanvasGradient | CanvasPattern\n\t}\n\tget strokeStyle(): unknown {\n\t\treturn this.context.strokeStyle\n\t}\n\tset strokeStyle(value: unknown) {\n\t\tthis.context.strokeStyle = value as string | CanvasGradient | CanvasPattern\n\t}\n\tget font(): string {\n\t\treturn this.context.font\n\t}\n\tset font(value: string) {\n\t\tthis.context.font = value\n\t}\n\tget globalAlpha(): number {\n\t\treturn this.context.globalAlpha\n\t}\n\tset globalAlpha(value: number) {\n\t\tthis.context.globalAlpha = value\n\t}\n\tget lineWidth(): number {\n\t\treturn this.context.lineWidth\n\t}\n\tset lineWidth(value: number) {\n\t\tthis.context.lineWidth = value\n\t}\n\tget lineCap(): string {\n\t\treturn this.context.lineCap\n\t}\n\tset lineCap(value: string) {\n\t\tthis.context.lineCap = value as CanvasLineCap\n\t}\n\tget lineJoin(): string {\n\t\treturn this.context.lineJoin\n\t}\n\tset lineJoin(value: string) {\n\t\tthis.context.lineJoin = value as CanvasLineJoin\n\t}\n\tget miterLimit(): number {\n\t\treturn this.context.miterLimit\n\t}\n\tset miterLimit(value: number) {\n\t\tthis.context.miterLimit = value\n\t}\n\tget globalCompositeOperation(): string {\n\t\treturn this.context.globalCompositeOperation\n\t}\n\tset globalCompositeOperation(value: string) {\n\t\tthis.context.globalCompositeOperation = value as GlobalCompositeOperation\n\t}\n\tget textAlign(): string {\n\t\treturn this.context.textAlign\n\t}\n\tset textAlign(value: string) {\n\t\tthis.context.textAlign = value as CanvasTextAlign\n\t}\n\tget textBaseline(): string {\n\t\treturn this.context.textBaseline\n\t}\n\tset textBaseline(value: string) {\n\t\tthis.context.textBaseline = value as CanvasTextBaseline\n\t}\n\tget shadowColor(): string {\n\t\treturn this.context.shadowColor\n\t}\n\tset shadowColor(value: string) {\n\t\tthis.context.shadowColor = value\n\t}\n\tget shadowBlur(): number {\n\t\treturn this.context.shadowBlur\n\t}\n\tset shadowBlur(value: number) {\n\t\tthis.context.shadowBlur = value\n\t}\n\tget shadowOffsetX(): number {\n\t\treturn this.context.shadowOffsetX\n\t}\n\tset shadowOffsetX(value: number) {\n\t\tthis.context.shadowOffsetX = value\n\t}\n\tget shadowOffsetY(): number {\n\t\treturn this.context.shadowOffsetY\n\t}\n\tset shadowOffsetY(value: number) {\n\t\tthis.context.shadowOffsetY = value\n\t}\n\n\tsave(): void {\n\t\tthis.context.save()\n\t}\n\trestore(): void {\n\t\tthis.context.restore()\n\t}\n\tbeginPath(): void {\n\t\tthis.context.beginPath()\n\t}\n\tclosePath(): void {\n\t\tthis.context.closePath()\n\t}\n\tmoveTo(x: number, y: number): void {\n\t\tthis.context.moveTo(x, y)\n\t}\n\tlineTo(x: number, y: number): void {\n\t\tthis.context.lineTo(x, y)\n\t}\n\tquadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void {\n\t\tthis.context.quadraticCurveTo(cpx, cpy, x, y)\n\t}\n\tbezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void {\n\t\tthis.context.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y)\n\t}\n\tarc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void {\n\t\tthis.context.arc(x, y, radius, startAngle, endAngle, counterclockwise)\n\t}\n\troundRect(x: number, y: number, width: number, height: number, radii?: number | number[]): void {\n\t\tthis.context.roundRect(x, y, width, height, radii)\n\t}\n\trect(x: number, y: number, width: number, height: number): void {\n\t\tthis.context.rect(x, y, width, height)\n\t}\n\tclip(): void {\n\t\tthis.context.clip()\n\t}\n\tfill(fillRule?: string): void {\n\t\tthis.context.fill(fillRule as CanvasFillRule)\n\t}\n\tstroke(): void {\n\t\tthis.context.stroke()\n\t}\n\tfillRect(x: number, y: number, width: number, height: number): void {\n\t\tthis.context.fillRect(x, y, width, height)\n\t}\n\tstrokeRect(x: number, y: number, width: number, height: number): void {\n\t\tthis.context.strokeRect(x, y, width, height)\n\t}\n\tclearRect(x: number, y: number, width: number, height: number): void {\n\t\tthis.context.clearRect(x, y, width, height)\n\t}\n\ttranslate(x: number, y: number): void {\n\t\tthis.context.translate(x, y)\n\t}\n\tscale(x: number, y: number): void {\n\t\tthis.context.scale(x, y)\n\t}\n\trotate(angle: number): void {\n\t\tthis.context.rotate(angle)\n\t}\n\tsetLineDash(segments: number[]): void {\n\t\tthis.context.setLineDash(segments)\n\t}\n\tfillText(text: string, x: number, y: number, maxWidth?: number): void {\n\t\tthis.context.fillText(text, x, y, maxWidth)\n\t}\n\tstrokeText(text: string, x: number, y: number, maxWidth?: number): void {\n\t\tthis.context.strokeText(text, x, y, maxWidth)\n\t}\n\tmeasureText(text: string): TextMetricsLike {\n\t\treturn this.context.measureText(text)\n\t}\n\tcreateLinearGradient(x0: number, y0: number, x1: number, y1: number): Gradient {\n\t\treturn this.context.createLinearGradient(x0, y0, x1, y1)\n\t}\n\tcreateRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): Gradient {\n\t\treturn this.context.createRadialGradient(x0, y0, r0, x1, y1, r1)\n\t}\n\tcreatePattern(image: unknown, repetition?: string): unknown {\n\t\treturn this.context.createPattern(\n\t\t\timage as CanvasImageSource,\n\t\t\trepetition as \"repeat\" | \"repeat-x\" | \"repeat-y\" | \"no-repeat\"\n\t\t)\n\t}\n\tdrawImage(image: unknown, ...args: number[]): void {\n\t\tthis.context.drawImage(\n\t\t\timage as CanvasImageSource,\n\t\t\t...(args as [number, number, number, number, number, number, number, number])\n\t\t)\n\t}\n}\n","import { CanvasGraphics } from \"./canvas-graphics.js\"\nimport type { Graphics } from \"./graphics.js\"\n\n/**\n * Rendering boundary used by a chart.\n *\n * The first implementation still targets Canvas. Keeping context acquisition\n * behind this interface gives the chart a stable seam for future renderers\n * without changing the existing drawing code in one large migration.\n */\nexport interface Renderer {\n\tgetContext(): CanvasRenderingContext2D | null\n\tgetGraphics?(): Graphics | null\n\tsetContext(context: CanvasRenderingContext2D | null): void\n\tclearRect(x: number, y: number, width: number, height: number): void\n}\n\nexport interface RendererSize {\n\twidth: number\n\theight: number\n}\n\nexport interface ResizableRenderer {\n\tresize(width: number, height: number): void\n}\n\nexport interface ImageRenderer {\n\ttoDataURL(format?: string, quality?: number): string\n}\n\nexport interface SizedRenderer {\n\tgetSize(): RendererSize\n}\n\nexport interface ClientSizedRenderer {\n\tgetClientSize(): RendererSize\n}\n\n/** Renderer backed by an HTML canvas element. */\nexport class CanvasRenderer implements Renderer, ResizableRenderer, ImageRenderer, SizedRenderer, ClientSizedRenderer {\n\tprivate context: CanvasRenderingContext2D | null = null\n\tprivate graphics: Graphics | null = null\n\tprivate ratio = 1\n\n\tconstructor(private readonly canvas: HTMLCanvasElement) {}\n\n\t/** Device pixels per drawing unit. Sizes reported by this renderer stay in drawing units. */\n\tget pixelRatio(): number {\n\t\treturn this.ratio\n\t}\n\n\t/**\n\t * Changes the backing store resolution without changing the drawing size: the canvas keeps its\n\t * display size and gets `ratio` times more pixels. Call `resize` afterwards to apply it.\n\t */\n\tsetPixelRatio(ratio: number): void {\n\t\tthis.ratio = ratio > 0 && Number.isFinite(ratio) ? ratio : 1\n\t}\n\n\t/** Maps drawing units to device pixels on the current context; call it at the start of each draw. */\n\tapplyTransform(context: CanvasRenderingContext2D): void {\n\t\tif (this.ratio !== 1) context.setTransform(this.ratio, 0, 0, this.ratio, 0, 0)\n\t}\n\n\tgetContext(): CanvasRenderingContext2D | null {\n\t\treturn this.context || (this.canvas.getContext ? this.canvas.getContext(\"2d\") : null)\n\t}\n\n\tgetGraphics(): Graphics | null {\n\t\tconst context = this.getContext()\n\t\tif (!context) return null\n\t\tif (!this.graphics) this.graphics = new CanvasGraphics(context)\n\t\treturn this.graphics\n\t}\n\n\tsetContext(context: CanvasRenderingContext2D | null): void {\n\t\tthis.context = context\n\t\tthis.graphics = context ? new CanvasGraphics(context) : null\n\t}\n\n\tclearRect(x: number, y: number, width: number, height: number): void {\n\t\tthis.getContext()?.clearRect(x, y, width, height)\n\t}\n\n\tresize(width: number, height: number): void {\n\t\tconst ratio = this.ratio\n\t\tconst pixelWidth = Math.round(width * ratio)\n\t\tconst pixelHeight = Math.round(height * ratio)\n\t\tif (this.canvas.width === pixelWidth && this.canvas.height === pixelHeight) return\n\n\t\tconst displayed = ratio === 1 ? null : this.getClientSize()\n\t\tthis.canvas.width = pixelWidth\n\t\tthis.canvas.height = pixelHeight\n\n\t\t// A canvas without CSS size would otherwise grow with its backing store.\n\t\tif (displayed && this.canvas.style) {\n\t\t\tconst grown = this.getClientSize()\n\t\t\tif (displayed.width > 0 && grown.width !== displayed.width) this.canvas.style.width = `${displayed.width}px`\n\t\t\tif (displayed.height > 0 && grown.height !== displayed.height) this.canvas.style.height = `${displayed.height}px`\n\t\t}\n\t}\n\n\tgetSize(): RendererSize {\n\t\treturn { width: this.canvas.width / this.ratio, height: this.canvas.height / this.ratio }\n\t}\n\n\tgetClientSize(): RendererSize {\n\t\t// An OffscreenCanvas has no layout: its size is the drawing size.\n\t\tif (typeof this.canvas.clientWidth !== \"number\") return this.getSize()\n\t\treturn { width: this.canvas.clientWidth, height: this.canvas.clientHeight }\n\t}\n\n\t/** Encodes the canvas as an image. Works for canvas elements and for an `OffscreenCanvas`. */\n\ttoBlob(type?: string, quality?: number): Promise<Blob> {\n\t\tconst canvas = this.canvas as Partial<HTMLCanvasElement> & Partial<OffscreenCanvas>\n\t\tif (typeof canvas.convertToBlob === \"function\") return canvas.convertToBlob({ type, quality })\n\t\tconst encode = canvas.toBlob\n\t\tif (typeof encode === \"function\") {\n\t\t\treturn new Promise((resolve, reject) =>\n\t\t\t\tencode.call(\n\t\t\t\t\tcanvas,\n\t\t\t\t\tblob => (blob ? resolve(blob) : reject(new Error(\"The canvas could not be encoded\"))),\n\t\t\t\t\ttype,\n\t\t\t\t\tquality\n\t\t\t\t)\n\t\t\t)\n\t\t}\n\t\treturn Promise.reject(new Error(\"This canvas cannot be encoded as a Blob\"))\n\t}\n\n\ttoDataURL(format?: string, quality?: number): string {\n\t\treturn format === undefined ? this.canvas.toDataURL() : this.canvas.toDataURL(format, quality)\n\t}\n}\n","import type { Chart } from \"../chart.js\"\nimport { Format, type PercentLocation } from \"../core/elements/format.js\"\nimport { Margins } from \"../core/elements/margins.js\"\nimport { Point, Rectangle } from \"../core/primitives.js\"\nimport { DOMTip, isDOMTipOwner } from \"../dom-tip.js\"\nimport { cancelAnimationFrame, getDocument, requestAnimationFrame } from \"../platform.js\"\nimport { CanvasRenderer } from \"../rendering/renderer.js\"\nimport type { Series } from \"../series.js\"\nimport { AnimateHover } from \"./animate-hover.js\"\nimport { Tool } from \"./tool.js\"\n\n/**\n * @constructor\n * @augments Tool\n * @class Represents a rectangle containing text\n * @param {Tee.Chart} chart The parent chart this annotation belongs to.\n * @param {String} text The text to draw inside the annotation.\n * @param {Number} [x=10] Optional left side position in pixels.\n * @param {Number} [y=10] Optional top side position in pixels.\n * @property {Tee.Margins} margins Properties to control spacing between text and rectangle boundaries.\n * @property {Boolean} visible When true, the annotation is displayed.\n * @property {Boolean} transparent When true, the annotation background is not displayed. Only the text is painted.\n * @property {Format} format Properties to control the annotation background and text appearance.\n */\nexport class Annotation extends Tool {\n\t/**\n\t * A percentage offset (gauge elements) or a placement name such as \"end\" or \"center\" (bar marks).\n\t */\n\tdeclare location: PercentLocation | string\n\t// Set by initializeAnnotation, which the constructor calls.\n\tdeclare position: Point\n\tdeclare margins: Margins\n\tdeclare bounds: Rectangle\n\tdeclare format: Format\n\tdeclare items: Annotation[]\n\tdeclare text: string\n\tdeclare visible: boolean\n\tdeclare transparent: boolean\n\tdeclare isDom: boolean\n\tdeclare domElement: HTMLElement | null\n\tdeclare domStyle: string\n\tdeclare rows: string[]\n\n\tgetCanvasSize(): { width: number; height: number } {\n\t\treturn this.chart.renderer instanceof CanvasRenderer\n\t\t\t? this.chart.renderer.getSize()\n\t\t\t: { width: this.chart.canvas.width, height: this.chart.canvas.height }\n\t}\n\tcursor: string | undefined\n\tvisual: unknown\n\tprivate declare _fontH: number\n\tprivate declare _thisH: number\n\tprivate declare _over: AnimateHover | null\n\tmouseinside = false\n\twasinside = false\n\n\tconstructor(chart: Chart, text = \"\", x = 10, y = 10) {\n\t\tsuper(chart)\n\t\tthis.initializeAnnotation(chart, text, x, y)\n\t}\n\n\tprivate initializeAnnotation(chart: Chart, text: string, x: number, y: number): void {\n\t\tthis.position = new Point(x || 10, y || 10)\n\t\tthis.margins = new Margins()\n\t\tthis.items = []\n\t\tthis.bounds = new Rectangle()\n\t\tthis.visible = true\n\t\tthis.transparent = false\n\t\tthis.text = text || \"\"\n\t\tthis.isDom = false\n\t\tthis.domElement = null\n\t\tthis.domStyle = \"border-radius: 5px;border: 2px solid #faad44;background: #FFF;padding:5px;\"\n\t\tthis.format = new Format(chart)\n\t\tthis._fontH = 0\n\t\tthis._thisH = 0\n\t\tthis._over = null\n\n\t\tconst format = this.format\n\t\tformat.font.textAlign = \"center\"\n\t\tformat.font.baseLine = \"top\"\n\t\tformat.fill = \"beige\"\n\t\tformat.round = { x: 4, y: 4 }\n\t\tformat.stroke.fill = \"silver\"\n\t\tformat.shadow.visible = true\n\t\tformat.depth = 0.05\n\t\tformat.z = 0.5\n\t}\n\n\tgetDOMHeight(): number {\n\t\treturn this.domElement == null ? 0 : this.domElement.offsetHeight\n\t}\n\n\tgetDOMWidth(): number {\n\t\treturn this.domElement == null ? 0 : this.domElement.offsetWidth\n\t}\n\n\tmoveTo(x: number, y: number): void {\n\t\tthis.position.x = x\n\t\tthis.position.y = y\n\t\tthis.resize()\n\t}\n\n\t_isEmpty(str: string): boolean {\n\t\treturn !str || 0 === str.length\n\t}\n\n\tshouldDraw(): boolean {\n\t\treturn this.visible && !this._isEmpty(this.text)\n\t}\n\n\tasync resize(): Promise<void> {\n\t\tif (this._isEmpty(this.text)) return\n\n\t\tconst format = this.format\n\t\tconst margins = this.margins\n\t\tconst bounds = this.bounds\n\n\t\tformat.font.prepare()\n\n\t\tthis.rows = this.text.split(\"\\n\")\n\t\tthis._fontH = format.textHeight(this.text)\n\n\t\tconst rowCount = this.rows.length\n\n\t\tthis._thisH = this._fontH * rowCount + margins.top\n\n\t\tlet width: number\n\t\tconst height = this._thisH + margins.bottom\n\n\t\tif (rowCount > 1) {\n\t\t\twidth = 0\n\t\t\tfor (const row of this.rows) width = Math.max(width, format.textWidth(`${row}W`))\n\t\t} else width = format.textWidth(`${this.text}W`)\n\n\t\twidth += margins.left + margins.right\n\n\t\tconst position = this.position\n\t\tbounds.set(position.x, position.y, width, height)\n\t}\n\n\tadd(text: string): Annotation {\n\t\tconst annotation = new Annotation(this.chart, text)\n\n\t\tthis.items.push(annotation)\n\t\tannotation.transparent = true\n\t\treturn annotation\n\t}\n\n\tasync doDraw(): Promise<void> {\n\t\tif (!this._isEmpty(this.text)) {\n\t\t\tconst f = this.format,\n\t\t\t\tb = this.bounds,\n\t\t\t\tm = this.margins\n\n\t\t\tif (this.isDom) {\n\t\t\t\tawait this.drawDOMText()\n\t\t\t} else {\n\t\t\t\tif (this.transparent) this.chart.drawContext.z = f.z\n\t\t\t\telse if (this.chart.aspect.view3d && this.format.depth > 0) {\n\t\t\t\t\tconst oldz = f.z\n\t\t\t\t\tf.z -= this.format.depth * 0.5\n\t\t\t\t\tf.cube(b)\n\t\t\t\t\tf.draw(this.chart.drawContext, null, b)\n\t\t\t\t\tf.z = oldz\n\t\t\t\t} else {\n\t\t\t\t\tthis.chart.drawContext.z = f.z\n\t\t\t\t\tf.rectangle(b)\n\t\t\t\t}\n\n\t\t\t\tlet old = 1,\n\t\t\t\t\tft = this.format.transparency,\n\t\t\t\t\tctx = this.chart.drawContext\n\n\t\t\t\tif (ft > 0) {\n\t\t\t\t\told = ctx.globalAlpha\n\t\t\t\t\tctx.globalAlpha = (1 - ft) * old\n\t\t\t\t}\n\n\t\t\t\tf.font.prepare()\n\n\t\t\t\tb.y += m.top + 0.1 * this._fontH\n\t\t\t\tb.x += m.left\n\n\t\t\t\tconst w = b.width\n\t\t\t\tb.width -= m.right\n\n\t\t\t\t/*\n\t\tif (this.transform) {\n\t\t\tctx.save();\n\t\t\tthis.transform(b);\n\t\t}\n\t\t*/\n\n\t\t\t\tf.drawText(b, this.text)\n\n\t\t\t\tb.x = this.position.x\n\t\t\t\tb.y = this.position.y\n\t\t\t\tb.width = w\n\n\t\t\t\tif (ft > 0) ctx.globalAlpha = old\n\t\t\t}\n\t\t}\n\t}\n\n\tclicked(p: Point): boolean {\n\t\treturn this.visible && this.bounds.contains(p)\n\t}\n\n\tdoMouseMove(p: Point): void {\n\t\tthis.mouseinside = this.clicked(p)\n\n\t\tif (this.mouseinside) {\n\t\t\tif (this.cursor) this.chart.newCursor = this.cursor\n\n\t\t\tif (!this.wasinside) this._over = new AnimateHover(250, this.bounds, this.format)\n\t\t} else if (this.wasinside && this._over) {\n\t\t\tthis._over.restore()\n\t\t\tthis.chart.draw()\n\t\t}\n\n\t\tthis.wasinside = this.mouseinside\n\t}\n\n\tmousemove(p: Point): void {\n\t\tif (this.cursor && this.cursor !== \"default\") this.doMouseMove(p)\n\t}\n\n\tforceDraw(): void {\n\t\tthis.resize()\n\t\tthis.doDraw()\n\t}\n\n\tsetChart(chart: Chart): void {\n\t\tthis.chart = chart\n\t\tthis.format.setChart(chart)\n\t}\n\n\tasync drawDOMText(): Promise<void> {\n\t\tif (this.domElement) await this.resize()\n\t\tconst runtimeDocument = getDocument()\n\t\tif (!runtimeDocument?.body) return\n\n\t\tconst rect = (this.chart.interactionCanvas || this.chart.canvas).getBoundingClientRect()\n\t\tconst opacity = this.transparent ? \"opacity:0;\" : \"opacity:1;\"\n\t\tif (!this.domElement) {\n\t\t\tthis.domElement = runtimeDocument.createElement(\"div\")\n\t\t\truntimeDocument.body.appendChild(this.domElement)\n\t\t}\n\n\t\tif (this.visible === false)\n\t\t\tthis.domElement.setAttribute(\n\t\t\t\t\"style\",\n\t\t\t\t\"visibility:hidden; position:absolute;top:\" +\n\t\t\t\t\t(this.position.y + rect.top) +\n\t\t\t\t\t\"px;left:\" +\n\t\t\t\t\t(this.position.x + rect.left) +\n\t\t\t\t\t\"px;display:block;z-index:10000;\" +\n\t\t\t\t\tthis.domStyle +\n\t\t\t\t\topacity\n\t\t\t)\n\t\telse\n\t\t\tthis.domElement.setAttribute(\n\t\t\t\t\"style\",\n\t\t\t\t\"visibility:visible; position:absolute;top:\" +\n\t\t\t\t\t(this.position.y + rect.top) +\n\t\t\t\t\t\"px;left:\" +\n\t\t\t\t\t(this.position.x + rect.left) +\n\t\t\t\t\t\"px;display:block;z-index:10000;\" +\n\t\t\t\t\tthis.domStyle +\n\t\t\t\t\topacity\n\t\t\t)\n\t\tif (this.domElement.innerHTML !== this.text) this.domElement.innerHTML = this.text\n\t}\n\n\tasync draw(): Promise<void> {\n\t\tif (this.isDom) await this.drawDOMText()\n\t\telse if (this.visible) this.forceDraw()\n\t}\n\n\tdestroy(): void {\n\t\tif (this.destroyed) return\n\t\tfor (const item of this.items) item?.destroy?.()\n\t\tthis.items.length = 0\n\t\tthis.domElement?.remove?.()\n\t\tthis.domElement = null\n\t\tsuper.destroy()\n\t}\n}\n\n/** Position options for pie and donut marks. */\nexport type MarkPlacement = \"inside\" | \"outside\"\n\n/** Connector styles for outside pie and donut marks. */\nexport type MarkConnector = \"none\" | \"straight\" | \"elbow\"\n\nfunction escapeHtml(value: string): string {\n\treturn value.replace(/[&<>\"']/g, ch => `&#${ch.charCodeAt(0)};`)\n}\n\n/** Resolve matching categories without assuming that every series has the same points. */\nfunction sharedTooltipPoints(series: Series, index: number): { series: Series; index: number }[] {\n\tif (!series.useAxes) return [{ series, index }]\n\tconst x = Number(series.data.x ? series.data.x[index] : index)\n\tconst points: { series: Series; index: number }[] = []\n\tfor (const candidate of series.chart.series.items) {\n\t\tif (\n\t\t\t!candidate.visible ||\n\t\t\t!candidate.useAxes ||\n\t\t\tcandidate.yMandatory !== series.yMandatory ||\n\t\t\tcandidate.notmandatory !== series.notmandatory\n\t\t)\n\t\t\tcontinue\n\t\tconst values = candidate.data.values\n\t\tconst xs = candidate.data.x\n\t\tconst matchingIndex = xs\n\t\t\t? Number(xs[index]) === x\n\t\t\t\t? index\n\t\t\t\t: xs.findIndex(value => Number(value) === x)\n\t\t\t: Number.isInteger(x)\n\t\t\t\t? x\n\t\t\t\t: -1\n\t\tif (matchingIndex >= 0 && Number.isFinite(values[matchingIndex]) && !candidate.isNull(matchingIndex)) {\n\t\t\tpoints.push({ series: candidate, index: matchingIndex })\n\t\t}\n\t}\n\treturn points\n}\n\n/** Percentage of the stack total for 100% stacked series, as a suffix for the value text. */\nfunction stackShare(series: Series, index: number): string {\n\tif (series.stacked !== \"100\") return \"\"\n\tconst total = series.pointOrigin(index, true)\n\tconst value = series.data.values[index]\n\treturn total > 0 && Number.isFinite(value) ? ` (${((value * 100) / total).toFixed(1)}%)` : \"\"\n}\n\n/** Extra rows for extended tooltips. */\nfunction extendedRows(series: Series, index: number): [string, string][] {\n\tconst values = series.data.values\n\tconst numbers = values.filter(value => Number.isFinite(value))\n\tconst total = numbers.reduce((sum, value) => sum + Math.abs(value), 0)\n\tconst value = values[index]\n\tconst rows: [string, string][] = []\n\tconst x = series.data.x?.[index]\n\tif (x !== undefined && x !== null && String(x) !== (series.data.labels[index] || \"\")) rows.push([\"X\", String(x)])\n\tif (total > 0 && Number.isFinite(value)) rows.push([\"Share\", `${((Math.abs(value) / total) * 100).toFixed(1)}%`])\n\tif (numbers.length > 1 && Number.isFinite(value)) {\n\t\tconst average = numbers.reduce((sum, item) => sum + item, 0) / numbers.length\n\t\tconst diff = value - average\n\t\trows.push([\"vs average\", `${diff >= 0 ? \"+\" : \"\"}${Number(diff.toFixed(2))}`])\n\t\trows.push([\"Maximum\", String(Math.max(...numbers))])\n\t\trows.push([\"Minimum\", String(Math.min(...numbers))])\n\t}\n\trows.push([\"Point\", `${index + 1} of ${values.length}`])\n\treturn rows\n}\n\n/** Structured tooltip body: point label as header, then a swatch row with series name and value. */\nfunction toolTipHtml(\n\tcolor: string,\n\tseriesName: string,\n\tlabel: string,\n\tvalue: string,\n\tdetails: [string, string][]\n): string {\n\tconst header =\n\t\tlabel && label !== seriesName\n\t\t\t? `<div style=\"font-weight:600;${seriesName ? \"margin-bottom:6px\" : \"margin-bottom:2px\"}\">${escapeHtml(label)}</div>`\n\t\t\t: \"\"\n\tconst swatch = `<span style=\"display:inline-block;width:10px;height:10px;border-radius:3px;background:${escapeHtml(color || \"#64748b\")}\"></span>`\n\treturn (\n\t\t`${header}<div style=\"display:flex;align-items:center;gap:8px\">${swatch}` +\n\t\t(seriesName ? `<span style=\"color:#475569\">${escapeHtml(seriesName)}</span>` : \"\") +\n\t\t`<span style=\"margin-left:auto;padding-left:16px;font-weight:600;font-variant-numeric:tabular-nums\">${escapeHtml(value)}</span></div>` +\n\t\t(details.length\n\t\t\t? `<div style=\"margin-top:8px;padding-top:6px;border-top:1px solid #e2e8f0;display:grid;grid-template-columns:auto auto;gap:2px 16px;font-size:12px\">` +\n\t\t\t\tdetails\n\t\t\t\t\t.map(\n\t\t\t\t\t\t([name, text]) =>\n\t\t\t\t\t\t\t`<span style=\"color:#64748b\">${escapeHtml(name)}</span><span style=\"text-align:right;font-variant-numeric:tabular-nums\">${escapeHtml(text)}</span>`\n\t\t\t\t\t)\n\t\t\t\t\t.join(\"\") +\n\t\t\t\t\"</div>\"\n\t\t\t: \"\")\n\t)\n}\n\n/**\n * @constructor\n * @augments Annotation\n * @class Shows an annotation when mouse is over a series data point\n * @param {Tee.Chart} chart The parent chart this tooltip belongs to.\n * @property {Boolean} [autoHide=false] When true, the tooltip is automatically removed after \"delay\" milliseconds.\n * @property {Number} [delay=1000] Amount of milliseconds to wait before removing the last displayed tooltip (when \"autoHide\" is true).\n * @property {Number} [animated=100] Duration in milliseconds to animate the movement of tooltip from old to new position. DOM tooltips also use it to glide between points and slide in; it is skipped when the user prefers reduced motion.\n * @property {Boolean} [findPoint=false] When true, the tooltip jumps to the nearest point.\n * @property {Boolean} [realTime=false] When true, unmoved tip provides live updates on changing point values.\n */\nexport class ToolTip extends Annotation {\n\t/** Lists visible cartesian series sharing the hovered category or x value. Defaults to false. */\n\tshared = false\n\tpointer: Record<string, string | number | boolean>\n\tfindPoint: boolean\n\tfollowCursor: boolean\n\tcurrentSeries: Series | null\n\tcurrentIndex: number\n\trealTime: boolean\n\t/** When true, DOM tooltips list extra details: x value, share of total, position and difference from the average. */\n\textended: boolean\n\ttimID: ReturnType<typeof setTimeout> | null\n\tautoHide: boolean\n\tdelay: number\n\tanimated: number\n\tautoRedraw: boolean\n\trender: \"dom\" | \"canvas\"\n\tonhide: ((tooltip: ToolTip) => void) | undefined\n\tongettext: ((tooltip: ToolTip, text: string, series: Series, index: number) => string | Promise<string>) | undefined\n\tonshow: ((tooltip: ToolTip, series: Series, index: number) => void) | undefined\n\tcurrP: Point | undefined\n\toldX = 0\n\toldY = 0\n\tdeltaX = 0\n\tdeltaY = 0\n\tinit = 0\n\tprivate _animOwner: ToolTip | null\n\tprivate _animationFrame: number | null\n\tprivate _cancelPending: () => void\n\tprivate readonly _cleanupChart: Chart\n\tprivate _refreshVersion = 0\n\n\tconstructor(chart: Chart) {\n\t\tsuper(chart)\n\t\tthis._cleanupChart = chart\n\t\tthis.pointer = {\n\t\t\tfill: \"Green\",\n\t\t\tfirstCircleRadius: \"2\",\n\t\t\tsecondCircleRadius: \"5\",\n\t\t\tvisible: false,\n\t\t\tfirstCircleOpacity: \"1\",\n\t\t\tsecondCircleOpacity: \"0.4\",\n\t\t\tanimationVisible: true,\n\t\t\tanimationDuration: 200\n\t\t}\n\t\tthis.visible = false\n\t\tthis.findPoint = false\n\t\tthis.currentSeries = null\n\t\tthis.currentIndex = -1\n\t\tthis.realTime = false\n\t\tthis.extended = false\n\t\tthis.timID = null\n\t\tthis.autoHide = false\n\t\tthis.delay = 1000\n\t\tthis.animated = 100\n\t\tthis.autoRedraw = true\n\t\tthis.render = \"dom\"\n\t\tthis.domStyle =\n\t\t\t\"padding:10px 12px; margin-left:0; background:#fff; border:1px solid #cbd5e1; border-radius:8px; color:#0f172a; font:13px/1.4 system-ui,sans-serif; box-shadow:0 2px 6px rgba(15,23,42,.08); pointer-events:none; white-space:nowrap;\"\n\t\tthis.followCursor = false\n\t\tthis._animOwner = null\n\t\tthis._animationFrame = null\n\t\tthis._cancelPending = () => {\n\t\t\tthis._refreshVersion++\n\t\t\tif (this.timID !== null) clearTimeout(this.timID)\n\t\t\tthis.timID = null\n\t\t\tif (this._animationFrame !== null) cancelAnimationFrame(this._animationFrame)\n\t\t\tthis._animationFrame = null\n\t\t\tthis._animOwner = null\n\t\t}\n\t\tchart?._eventCleanups?.push(this._cancelPending)\n\t}\n\n\tasync hide(): Promise<void> {\n\t\tthis._cancelPending()\n\t\tthis.currP = undefined\n\t\tif (this.destroyed || this.chart.destroyed) {\n\t\t\treturn\n\t\t}\n\t\tconst isDom = this.render === \"dom\"\n\n\t\tif (this.visible || isDom) {\n\t\t\tif (this.onhide) this.onhide(this)\n\t\t\tthis._emit(\"hide\", this)\n\n\t\t\tthis.visible = false\n\n\t\t\tif (this.autoRedraw) {\n\t\t\t\tif (isDom) {\n\t\t\t\t\tif (this.chart.domTip.renderer || isDOMTipOwner(this)) this.chart.domTip.hide()\n\t\t\t\t} else this.chart.draw()\n\t\t\t}\n\n\t\t\tthis.currentIndex = -1\n\t\t\tthis.currentSeries = null\n\t\t}\n\t}\n\n\tdestroy(): void {\n\t\tif (this.destroyed) return\n\t\tthis._cancelPending()\n\t\tconst index = this._cleanupChart._eventCleanups.indexOf(this._cancelPending)\n\t\tif (index !== -1) this._cleanupChart._eventCleanups.splice(index, 1)\n\t\tif (isDOMTipOwner(this)) DOMTip.stop()\n\t\tthis.currP = undefined\n\t\tthis.visible = false\n\t\tthis.currentSeries = null\n\t\tthis.currentIndex = -1\n\t\tsuper.destroy()\n\t}\n\n\tasync mousemove(point: Point): Promise<void> {\n\t\tif (this.destroyed || this.chart.destroyed) return\n\t\tconst seriesList = this.chart.series\n\t\tconst seriesCount = seriesList.count()\n\t\tlet currentSeries: Series | null = null\n\t\tlet index = -1\n\t\tif (this.chart.chartRect.contains(point))\n\t\t\tfor (let seriesIndex = seriesCount - 1; seriesIndex >= 0; seriesIndex--) {\n\t\t\t\tlet series = seriesList.items[seriesIndex]\n\n\t\t\t\tif (series.visible) {\n\t\t\t\t\t// Continuous series can resolve the nearest point from x directly, avoiding a segment scan.\n\t\t\t\t\t// Stacked series overlap their neighbours' lines, so they are resolved by band instead of by hit-test.\n\t\t\t\t\tconst stacked = series.stacked\n\t\t\t\t\tconst inStack = !!stacked && stacked !== \"no\" && stacked !== \"side\" && stacked !== \"sideAll\"\n\t\t\t\t\tindex = (this.findPoint || inStack) && series.continuous ? -1 : series.clicked(point)\n\t\t\t\t\tif (index === -1 && series.continuous) {\n\t\t\t\t\t\tindex = Math.round(this.chart.axes.bottom.fromSizeCalcIndex(point.x - this.chart.axes.bottom.startPos))\n\t\t\t\t\t\tlet closestDistance = Number.POSITIVE_INFINITY\n\t\t\t\t\t\tconst probe = new Point()\n\t\t\t\t\t\tconst base = new Point()\n\t\t\t\t\t\tfor (let candidateIndex = 0; candidateIndex < seriesCount; candidateIndex++) {\n\t\t\t\t\t\t\tconst candidate = seriesList.items[candidateIndex]\n\t\t\t\t\t\t\tif (!candidate.visible || candidate.data.values[index] === undefined) continue\n\t\t\t\t\t\t\t// Compare in pixels along the value axis, so stacked series are measured at their stacked position.\n\t\t\t\t\t\t\tconst yMand = candidate.yMandatory\n\t\t\t\t\t\t\tconst cursor = yMand ? point.y : point.x\n\t\t\t\t\t\t\tcandidate.calc(index, probe)\n\t\t\t\t\t\t\tconst top = yMand ? probe.y : probe.x\n\t\t\t\t\t\t\tlet distance = Math.abs(top - cursor)\n\t\t\t\t\t\t\tconst st = candidate.stacked\n\t\t\t\t\t\t\tif (st && st !== \"no\" && st !== \"side\" && st !== \"sideAll\") {\n\t\t\t\t\t\t\t\t// Between the previous stack level and this one counts as a direct hit.\n\t\t\t\t\t\t\t\tcandidate.calcStack(index, base, 0)\n\t\t\t\t\t\t\t\tconst edge = yMand ? base.y : base.x\n\t\t\t\t\t\t\t\tif (cursor >= Math.min(edge, top) && cursor <= Math.max(edge, top)) distance = 0\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (distance < closestDistance) {\n\t\t\t\t\t\t\t\tclosestDistance = distance\n\t\t\t\t\t\t\t\tseries = candidate\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (index !== -1) {\n\t\t\t\t\t\tcurrentSeries = series\n\t\t\t\t\t\tthis.currP = point\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\telse {\n\t\t\tindex = -1\n\t\t\tthis.currP = undefined\n\t\t}\n\t\tif (index === -1) {\n\t\t\tthis.currP = undefined\n\t\t\tthis.hide()\n\n\t\t\tthis.currentIndex = -1\n\t\t\tthis.currentSeries = null\n\t\t} else if (index !== this.currentIndex || currentSeries !== this.currentSeries || this.realTime) {\n\t\t\tthis.currentIndex = index\n\t\t\tthis.currentSeries = currentSeries\n\n\t\t\tif (currentSeries) {\n\t\t\t\tawait this.refresh(currentSeries, index)\n\t\t\t\tif (this.destroyed || this.chart.destroyed) return\n\t\t\t\tif (this.currentSeries !== currentSeries || this.currentIndex !== index) return\n\n\t\t\t\tif (this.autoHide && this.delay > 0) {\n\t\t\t\t\tif (this.timID !== null) clearTimeout(this.timID)\n\t\t\t\t\tthis.timID = setTimeout(\n\t\t\t\t\t\t(args: [ToolTip]) => {\n\t\t\t\t\t\t\tif (args) args[0].hide()\n\t\t\t\t\t\t},\n\t\t\t\t\t\tthis.delay,\n\t\t\t\t\t\t[this]\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate stepAnimation(): void {\n\t\tconst owner = this._animOwner\n\t\tif (!owner || owner.chart.destroyed) return\n\n\t\tconst moveToFraction = (fraction: number): void => {\n\t\t\towner.moveTo(owner.oldX + fraction * owner.deltaX, owner.oldY + fraction * owner.deltaY)\n\t\t\tif (owner.autoRedraw) owner.chart.draw()\n\t\t}\n\n\t\tconst fraction = (Date.now() - owner.init) / owner.animated\n\n\t\tif (fraction < 1) {\n\t\t\tmoveToFraction(fraction)\n\t\t\tthis._animationFrame = requestAnimationFrame(() => {\n\t\t\t\tthis._animationFrame = null\n\t\t\t\tthis.stepAnimation()\n\t\t\t})\n\t\t} else {\n\t\t\tmoveToFraction(1)\n\t\t\tthis._animOwner = null\n\t\t}\n\t}\n\n\tasync refresh(series: Series, index: number): Promise<void> {\n\t\tif (this.destroyed || this.chart.destroyed) return\n\t\tconst version = ++this._refreshVersion\n\t\tconst isDom = this.render === \"dom\"\n\t\tthis.visible = !isDom\n\n\t\tconst points = this.shared ? sharedTooltipPoints(series, index) : [{ series, index }]\n\t\tconst rows = points.map(({ series: item, index: pointIndex }, rowIndex) => {\n\t\t\tconst parts = item.tooltipParts?.(pointIndex)\n\t\t\tconst label = parts ? parts.label : item.data.labels[pointIndex] || \"\"\n\t\t\tconst pointValue = parts\n\t\t\t\t? parts.value\n\t\t\t\t: item.constructor.name === \"Pie\"\n\t\t\t\t\t? `${item.valueText(pointIndex)} (${item.toPercent(pointIndex)})`\n\t\t\t\t\t: item.valueText(pointIndex) + stackShare(item, pointIndex)\n\t\t\tconst seriesName = parts ? \"\" : item.title\n\t\t\treturn {\n\t\t\t\ttext: [seriesName, label && label !== seriesName ? label : \"\", pointValue].filter(Boolean).join(\" · \"),\n\t\t\t\thtml: toolTipHtml(\n\t\t\t\t\tparts?.color ?? item.legendColor(pointIndex),\n\t\t\t\t\tseriesName,\n\t\t\t\t\trowIndex === 0 ? label : \"\",\n\t\t\t\t\tpointValue,\n\t\t\t\t\tthis.extended ? (parts?.details ?? extendedRows(item, pointIndex)) : []\n\t\t\t\t)\n\t\t\t}\n\t\t})\n\t\tthis.text = rows.map(row => row.text).join(\"\\n\")\n\t\tconst defaultText = this.text\n\t\tconst value = this.ongettext ? await this.ongettext(this, defaultText, series, index) : defaultText\n\t\tif (version !== this._refreshVersion || this.destroyed || this.chart.destroyed) return\n\t\tthis.text = value\n\t\tconst domHtml =\n\t\t\tthis.ongettext || this.render !== \"dom\"\n\t\t\t\t? value\n\t\t\t\t: rows.length > 1\n\t\t\t\t\t? `<div style=\"display:grid;gap:8px\">${rows.map(row => row.html).join(\"\")}</div>`\n\t\t\t\t\t: rows.map(row => row.html).join(\"\")\n\n\t\tif (this.text !== \"\") {\n\t\t\tthis.resize()\n\n\t\t\tconst p = new Point()\n\t\t\tseries.calc(index, p)\n\n\t\t\tp.x -= this.bounds.width * 0.5\n\t\t\tp.y -= 1.5 * this.bounds.height\n\n\t\t\tif (p.x < 0) p.x = 0\n\t\t\tif (p.y < 0) p.y = 0\n\n\t\t\tif (\n\t\t\t\t!isDom &&\n\t\t\t\t!this.autoHide &&\n\t\t\t\tthis.animated > 0 &&\n\t\t\t\t!Number.isNaN(this.position.x) &&\n\t\t\t\t!Number.isNaN(this.position.y)\n\t\t\t) {\n\t\t\t\tif (this._animationFrame !== null) cancelAnimationFrame(this._animationFrame)\n\t\t\t\tthis.oldX = this.position.x\n\t\t\t\tthis.oldY = this.position.y\n\n\t\t\t\tthis.deltaX = p.x - this.oldX\n\t\t\t\tthis.deltaY = p.y - this.oldY\n\n\t\t\t\tthis.init = Date.now()\n\t\t\t\tthis._animOwner = this\n\t\t\t\tthis._animationFrame = requestAnimationFrame(() => {\n\t\t\t\t\tthis._animationFrame = null\n\t\t\t\t\tthis.stepAnimation()\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tthis.moveTo(p.x, p.y)\n\n\t\t\t\tif (this.autoRedraw)\n\t\t\t\t\tif (isDom)\n\t\t\t\t\t\tthis.chart.domTip.show(\n\t\t\t\t\t\t\tdomHtml,\n\t\t\t\t\t\t\t\"auto\",\n\t\t\t\t\t\t\tthis.chart.interactionCanvas || this.chart.canvas,\n\t\t\t\t\t\t\tthis.domStyle,\n\t\t\t\t\t\t\tthis\n\t\t\t\t\t\t)\n\t\t\t\t\telse this.chart.draw()\n\t\t\t}\n\n\t\t\tif (this.onshow) this.onshow(this, series, index)\n\t\t\tthis._emit(\"show\", this, series, index)\n\t\t}\n\t}\n}\n\n/**\n * @memberOf Tee.Chart\n * @constructor\n * @augments Annotation\n * @class Displays text at top or bottom chart sides\n * @param {Tee.Chart} chart The parent chart this title object belongs to.\n * @param {Color} fontColor The color to fill the title text.\n * @param {Boolean} [expand=false] When true, title background is aligned to panel.\n */\nexport class Title extends Annotation {\n\tprivate _expand = false\n\tpadding = 0\n\n\tget expand(): boolean {\n\t\treturn this._expand\n\t}\n\n\tset expand(value: boolean) {\n\t\tthis._expand = value\n\t\tif (!value) {\n\t\t\tconst format = this.format\n\t\t\tformat.round.x = 8\n\t\t\tformat.round.y = 8\n\t\t\tformat.round.corners = undefined\n\t\t\tformat.stroke.fill = \"black\"\n\t\t}\n\t}\n\n\tconstructor(chart: Chart, fontColor: string) {\n\t\tsuper(chart)\n\t\tthis.transparent = true\n\n\t\tconst font = this.format.font\n\t\tconst shadow = font.shadow\n\t\tshadow.visible = true\n\t\tshadow.width = 2\n\t\tshadow.height = 2\n\t\tshadow.blur = 8\n\n\t\tfont.style = \"18px Tahoma\"\n\t\tfont.fill = fontColor\n\n\t\tthis.padding = 4\n\t}\n\n\tcalcRect(fromTop: boolean): void {\n\t\tthis.resize()\n\n\t\tconst borderSize = this.transparent ? 1 : 2\n\t\tconst bounds = this.bounds\n\t\tconst size = bounds.height + borderSize * this.padding\n\t\tconst chartRect = this.chart.chartRect\n\t\tconst position = this.position\n\n\t\tif (fromTop) {\n\t\t\tposition.y = chartRect.y\n\n\t\t\tif (chartRect.automatic) chartRect.setTop(chartRect.y + size)\n\t\t} else {\n\t\t\tposition.y = chartRect.y + chartRect.height - bounds.height - this.padding\n\n\t\t\tif (chartRect.automatic) chartRect.height -= size\n\t\t}\n\n\t\tif (chartRect.height < 0) chartRect.height = 0\n\n\t\tposition.x = 0.5 * (this.getCanvasSize().width - bounds.width)\n\t}\n\n\ttryDraw(top: boolean): void {\n\t\tif (this.shouldDraw()) {\n\t\t\tthis.calcRect(top)\n\n\t\t\tconst b = this.bounds,\n\t\t\t\tctx = this.chart.drawContext,\n\t\t\t\tgroups = ctx.beginParent,\n\t\t\t\tp = this.position\n\n\t\t\tthis.visual = ctx.beginParent ? ctx.beginParent() : null\n\n\t\t\tif (this._expand) {\n\t\t\t\tconst f = this.chart.panel.format\n\t\t\t\tp.x = f.stroke.fill !== \"\" ? f.stroke.size : 0\n\t\t\t\tconst canvasSize = this.getCanvasSize()\n\t\t\t\tp.y = top ? p.x : canvasSize.height - (f.shadow.visible ? f.shadow.height : 0) - p.x - b.height\n\n\t\t\t\tb.width = canvasSize.width - (f.shadow.visible ? f.shadow.width : 0) - 2 * p.x\n\n\t\t\t\tconst ff = this.format\n\t\t\t\tff.round.x = f.round.x\n\t\t\t\tff.round.y = f.round.y\n\t\t\t\tff.round.corners = [top, top, !top, !top]\n\t\t\t\tff.stroke.fill = \"\"\n\n\t\t\t\tthis.transparent = false\n\t\t\t}\n\n\t\t\tb.x = p.x\n\t\t\tb.y = p.y\n\n\t\t\tthis.doDraw()\n\n\t\t\tif (groups) ctx.endParent?.()\n\t\t}\n\t}\n}\n\n/**\n * @memberOf Tee.Series\n * @constructor\n * @augments Annotation\n * @class Formatting properties to display annotations near series data points\n * @param {Tee.Series} series The parent series this marks object belongs to.\n * @param {Tee.Chart} chart The parent chart this marks object belongs to.\n * @property {Format} arrow Displays a line from mark to corresponding series point.\n * @property {Number} [arrow.length=10] Distance in pixels from mark to corresponding series point.\n * @property {Boolean} [arrow.underline=false] Draws a line under mark text.\n * @property {String} [style=\"auto\"] Determines the text to display inside mark.\n * @property {Boolean} visible Defines if series marks are to be displayed or not.\n * @property {Number} [drawEvery=1] Controls how many marks to skip in between. (Useful for large series).\n */\nexport class Marks extends Annotation {\n\tdeclare z: number\n\tdeclare transparency: number\n\tseries: Series\n\tarrow: Format\n\tongettext: ((series: Series, index: number, text: string) => string) | undefined\n\tshowZero = false\n\tstyle = \"auto\"\n\tdrawEvery = 1\n\tplacement: MarkPlacement = \"outside\"\n\tconnector: MarkConnector = \"straight\"\n\n\tconstructor(series: Series, chart: Chart) {\n\t\tsuper(chart)\n\t\tthis.series = series\n\n\t\tthis.arrow = new Format(chart)\n\t\tthis.arrow.visible = true\n\t\tthis.arrow.length = 10\n\t\tthis.arrow.underline = false\n\t\tthis.arrow.z = 0.5\n\t\tthis.arrow.depth = 0.1\n\n\t\tthis.visible = false\n\t\tthis.format.z = 0.5\n\t}\n\n\tsetChart(chart: Chart): void {\n\t\tthis.chart = chart\n\t\tthis.format.setChart(chart)\n\t\tthis.arrow.setChart(chart)\n\t}\n\n\tdrawPolar(center: Point, radius: number, angle: number, index: number): void {\n\t\tconst text = this.series.markText(index)\n\t\tconst pointX = center.x + Math.cos(angle) * radius\n\t\tconst pointY = center.y + Math.sin(angle) * radius\n\t\tconst context = this.chart.drawContext\n\t\tconst arrow = this.arrow\n\n\t\tthis.text = text\n\t\tthis.resize()\n\n\t\tconst bounds = this.bounds\n\t\tlet point2X: number\n\t\tlet point2Y: number\n\t\tconst position = this.position\n\t\tconst donut = \"donut\" in this.series ? (this.series as Series & { donut: number }).donut : 0\n\t\tconst placementRadius = this.placement === \"inside\" && donut > 0 ? radius * (1 + donut * 0.01) * 0.5 : radius * 0.62\n\n\t\tif (this.placement === \"inside\") {\n\t\t\tposition.x = center.x + Math.cos(angle) * placementRadius - bounds.width * 0.5\n\t\t\tposition.y = center.y + Math.sin(angle) * placementRadius - bounds.height * 0.5\n\t\t\tthis.draw()\n\t\t\treturn\n\t\t}\n\n\t\tradius += arrow.length ?? 0\n\t\tpoint2X = center.x + Math.cos(angle) * radius\n\t\tpoint2Y = center.y + Math.sin(angle) * radius\n\n\t\tif (point2X - bounds.width < 0) point2X -= point2X - bounds.width - 4\n\n\t\tif (Math.abs(point2X - center.x) < bounds.width) position.x = point2X - bounds.width * 0.5\n\t\telse position.x = point2X < center.x ? point2X - bounds.width : point2X\n\n\t\tif (Math.abs(point2Y - center.y) < bounds.height) position.y = point2Y - bounds.height * 0.5\n\t\telse position.y = point2Y < center.y ? point2Y - bounds.height : point2Y\n\n\t\tcontext.beginPath()\n\t\tcontext.moveTo(pointX, pointY)\n\t\tcontext.lineTo(point2X, point2Y)\n\n\t\tif (this.connector === \"elbow\") {\n\t\t\tconst lineY = position.y + bounds.height + 2\n\t\t\tcontext.lineTo(point2X, lineY)\n\t\t\tcontext.moveTo(position.x, lineY)\n\t\t\tcontext.lineTo(position.x + bounds.width, lineY)\n\t\t} else if (arrow.underline && (point2Y <= position.y || point2Y >= position.y + bounds.height)) {\n\t\t\tcontext.moveTo(position.x, point2Y)\n\t\t\tcontext.lineTo(position.x + bounds.width, point2Y)\n\t\t}\n\n\t\tarrow.stroke.prepare()\n\t\tif (arrow.visible && this.connector !== \"none\") context.stroke()\n\n\t\tthis.draw()\n\t}\n\n\tcanDraw(x: number, y: number, index: number, inverted: boolean): boolean {\n\t\tconst text = this.series.markText(index)\n\t\tconst arrow = this.arrow\n\n\t\tif (text && text !== \"\" && (this.showZero || text !== \"0\")) {\n\t\t\tthis.text = text\n\t\t\tthis.resize()\n\n\t\t\tconst factor = inverted ? -1 : 1,\n\t\t\t\tr = this.bounds,\n\t\t\t\tm = this.series.yMandatory\n\n\t\t\tif (m) {\n\t\t\t\tr.x = x - r.width * 0.5\n\t\t\t\tr.y = y - factor * ((arrow.length ?? 0) + (inverted ? 0 : r.height))\n\t\t\t} else {\n\t\t\t\tr.x = x + factor * (arrow.length ?? 0)\n\t\t\t\tif (inverted) r.x -= r.width\n\t\t\t\tr.y = y - r.height * 0.5\n\t\t\t}\n\n\t\t\tthis.position.x = r.x\n\t\t\tthis.position.y = r.y\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\n\tdrawMark(x: number, y: number, index: number, inverted: boolean): void {\n\t\tif (this.canDraw(x, y, index, inverted)) {\n\t\t\tthis.draw()\n\n\t\t\tconst arrow = this.arrow\n\t\t\tif (arrow.visible) {\n\t\t\t\tconst r = this.bounds,\n\t\t\t\t\tm = this.series.yMandatory\n\n\t\t\t\tconst rbot = inverted ? r.y : r.getBottom(),\n\t\t\t\t\tc = this.chart.drawContext,\n\t\t\t\t\tis3d = this.chart.aspect.view3d\n\n\t\t\t\tif (m) {\n\t\t\t\t\tif (is3d) {\n\t\t\t\t\t\tconst rr = { x: x - 3, y: rbot, width: 6, height: y - rbot }\n\n\t\t\t\t\t\tarrow.z = this.format.z - arrow.depth * 0.5\n\t\t\t\t\t\tarrow.cylinder(rr, 1, true, inverted)\n\t\t\t\t\t\tarrow.draw(this.chart.drawContext, null, rr)\n\t\t\t\t\t\treturn\n\t\t\t\t\t} else {\n\t\t\t\t\t\tc.beginPath()\n\t\t\t\t\t\tc.moveTo(x, rbot)\n\t\t\t\t\t\tc.lineTo(x, y)\n\t\t\t\t\t\tif (arrow.underline) {\n\t\t\t\t\t\t\tc.moveTo(r.x, rbot)\n\t\t\t\t\t\t\tc.lineTo(r.x + r.width, rbot)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst py = r.y + r.height * 0.5\n\n\t\t\t\t\tc.beginPath()\n\t\t\t\t\tc.moveTo(x, py)\n\n\t\t\t\t\tif (inverted) r.x += r.width\n\t\t\t\t\tc.lineTo(r.x, py)\n\n\t\t\t\t\tif (arrow.underline) {\n\t\t\t\t\t\tc.moveTo(r.x, r.y + r.height)\n\t\t\t\t\t\tc.lineTo(r.x + (inverted ? -r.width : r.width), r.y + r.height)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tarrow.stroke.prepare()\n\t\t\t\tc.stroke()\n\t\t\t}\n\t\t}\n\t}\n}\n","import type { Chart } from \"../../chart.js\"\nimport { Annotation } from \"../../tools/index.js\"\nimport type { Point } from \"../primitives.js\"\nimport type { Format } from \"./format.js\"\nimport type { Graphics } from \"../../rendering/graphics.js\"\n\nexport class AxisTitle extends Annotation {\n\tdeclare chart: Chart\n\tdeclare format: Format\n\tdeclare position: Point\n\tdeclare forceDraw: () => void\n\tpadding = 4\n\ttransparent = true\n\trotation = 0\n\n\tconstructor(chart: Chart) {\n\t\tsuper(chart)\n\t\tthis.format.font.textAlign = \"center\"\n\t}\n\n\tdrawIt(textAlign: CanvasTextAlign, x: number, y: number, rotation: number): void {\n\t\tconst position = this.position\n\t\tthis.format.font.textAlign = textAlign\n\n\t\tif (rotation === 0) {\n\t\t\tposition.x = x\n\t\t\tposition.y = y\n\t\t\tthis.forceDraw()\n\t\t\treturn\n\t\t}\n\n\t\tconst context = this.chart.graphics || (this.chart.ctx as Graphics | null)\n\t\tif (!context) return\n\t\tcontext.save()\n\t\tcontext.translate(x, y)\n\t\tcontext.rotate((-rotation * Math.PI) / 180)\n\t\tposition.x = 0\n\t\tposition.y = 0\n\t\tthis.forceDraw()\n\t\tcontext.restore()\n\t}\n}\n","import { dashedLine, toRadians } from \"../../utils.js\"\nimport type { Chart } from \"../../chart.js\"\nimport type { Series } from \"../../series.js\"\nimport { Rectangle } from \"../primitives.js\"\nimport { AxisGrid } from \"./axis-grid.js\"\nimport { AxisLabels } from \"./axis-labels.js\"\nimport type { CustomBar } from \"../../series/custom-bar.js\"\nimport { AxisTicks } from \"./axis-ticks.js\"\nimport { AxisTitle } from \"./axis-title.js\"\nimport { Format } from \"./format.js\"\n\nfunction calcWordWrap(format: Format, text: string): number {\n\tvar r = 0,\n\t\tw: number,\n\t\tss = text.split(\" \"),\n\t\tt: number\n\n\tfor (t = 0; t < ss.length; t++) {\n\t\tw = format.textWidth(ss[t])\n\t\tif (w > r) r = w\n\t}\n\n\treturn r\n}\n\n/**\n * @returns {Boolean} Returns if any visible series has less than n values.\n * Only called from Axis calcIncrement, to avoid axis label increments to be\n * smaller than series number of points.\n */\nfunction anySeriesHasLessThan(axis: Axis, count: number): boolean {\n\tlet series: Series | undefined\n\n\tfor (let index = 0; index < axis.chart.series.items.length; index++) {\n\t\tseries = axis.chart.series.items[index]\n\t\tif (!series) break\n\t\tif (series.visible && series.sequential) {\n\t\t\tconst isY = series.yMandatory\n\n\t\t\tif ((isY && axis.horizontal) || (!isY && !axis.horizontal)) {\n\t\t\t\tif (series.associatedToAxis(axis)) {\n\t\t\t\t\tif (series.count() <= count) return true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false\n}\n\n/**\n * @returns {Number} Returns the next bigger value in the sequence 1,2,5,10,20,50...\n */\nfunction nextStep(value: number): number {\n\tif (!Number.isFinite(value)) return 1\n\telse if (value >= 10) return 10 * nextStep(0.1 * value)\n\telse if (value < 1) return 0.1 * nextStep(value * 10)\n\telse return value < 2 ? 2 : value < 5 ? 5 : 10\n}\n\n/**\n * @returns {Number} Returns the best appropriate distance between axis labels.\n */\nfunction calcIncrement(axis: Axis, maxLabelSize: number): number {\n\tif (axis.maximum === axis.minimum) return 1\n\t// An axis with no room left (for example a chart in a tiny canvas) shows a single tick instead of millions.\n\telse if (!(axis.axisSize > 0 && maxLabelSize > 0)) return Math.abs(axis.maximum - axis.minimum)\n\telse {\n\t\tlet tmp = axis.axisSize / maxLabelSize,\n\t\t\tless = anySeriesHasLessThan(axis, tmp)\n\t\ttmp = Math.abs(axis.maximum - axis.minimum) / (tmp + 1)\n\t\treturn less ? Math.max(1, tmp) : nextStep(tmp)\n\t}\n}\n\n/** The labels of a series that names its own rows (for example Bullet), or null. */\nfunction rowLabelsOf(series: Series): string[] | null {\n\tif (typeof series.rowLabel !== \"function\" || typeof series.rowCount !== \"function\") return null\n\n\tconst labels: string[] = []\n\tfor (let index = 0, count = series.rowCount(); index < count; index++) labels.push(series.rowLabel(index) ?? \"\")\n\treturn labels\n}\n\n/**\n * @memberOf Tee.Chart\n * @constructor\n * @class Defines a scale from minimum to maximum, to transform series points into chart canvas pixels coordinates.\n * @param {Tee.Chart} chart The chart object this axis object belongs to.\n * @param {Boolean} horizontal Determines if axis is horizontal or vertical.\n * @param {Boolean} otherSide Determines if axis is at top/right or bottom/left side of chart.\n * @property {Format} format Visual properties to draw the axis line.\n * @property {Tee.Chart.Axis-Labels} labels Properties to display axis labels at tick increments.\n * @property {Tee.Chart.Axis-Grid} grid Properties to display grid lines at tick increments.\n * @property {Tee.Chart.Axis-Ticks} ticks Properties to display tick lines at each increment.\n * @property {Tee.Chart.Axis-Ticks} innerTicks Properties to display tick lines at each increment, inside chart.\n * @property {Tee.Chart.Axis-Ticks} minorTicks Properties to display small tick lines between ticks.\n * @property {Tee.Chart.Axis-Title} title Properties to display text that describes the axis.\n */\nexport class Axis {\n\tchart\n\thorizontal\n\totherSide\n\tvisible = true\n\tinverted = false\n\tbounds: Rectangle\n\tposition = 0\n\tformat: Format\n\tcustom = false\n\tz = 0\n\tmaxLabelDepth = 0\n\tlabels: AxisLabels\n\tgrid: AxisGrid\n\tticks: AxisTicks\n\tinnerTicks: AxisTicks\n\tminorTicks: AxisTicks\n\ttitle: AxisTitle\n\tautomatic = true\n\tminimum = 0\n\tmaximum = 0\n\tincrement = 0\n\tlog = false\n\tstartPos = 0\n\tendPos = 0\n\tstart = 0\n\tend = 100\n\taxisSize = 0\n\tscale = 0\n\tincrem = 0\n\tminAxisRange = 0.0000000001\n\t/** When true, automatic label increments are whole numbers (never 0.5, 0.2...) unless the range is tiny. */\n\tintegerSteps = false\n\t/** Percent of the data range added above the automatic maximum, so the highest value does not touch the edge. */\n\theadroom = 0\n\tfirstSeries: Series | null = null\n\tdateTime = false\n\taxisPos = 0\n\n\tconstructor(chart: Chart, horizontal: boolean, otherSide: boolean) {\n\t\tthis.chart = chart\n\t\tthis.horizontal = horizontal\n\t\tthis.otherSide = otherSide\n\t\tthis.bounds = new Rectangle()\n\n\t\tthis.format = new Format(chart)\n\t\tthis.format.stroke.size = 2\n\t\tthis.format.depth = 0.2\n\n\t\tthis.z = otherSide ? 1 : 0\n\n\t\tthis.labels = new AxisLabels(chart, this)\n\t\tconst f = this.labels.format.font\n\n\t\tif (horizontal) {\n\t\t\tf.textAlign = \"center\"\n\t\t\tf.baseLine = otherSide ? \"bottom\" : \"top\"\n\t\t} else {\n\t\t\tf.textAlign = otherSide ? \"left\" : \"right\"\n\t\t\tf.baseLine = \"middle\"\n\t\t}\n\n\t\tthis.grid = new AxisGrid(chart)\n\t\tthis.ticks = new AxisTicks(chart)\n\n\t\tthis.innerTicks = new AxisTicks(chart)\n\t\tthis.innerTicks.visible = false\n\n\t\tthis.minorTicks = new AxisTicks(chart)\n\t\tthis.minorTicks.visible = false\n\t\tthis.minorTicks.length = 2\n\t\tthis.minorTicks.count = 3\n\n\t\tthis.title = new AxisTitle(chart)\n\t\tif (!horizontal) this.title.rotation = otherSide ? 270 : 90\n\t}\n\n\t/**\n\t * Changes the axis maximum and minimum values\n\t * @param {Number} delta The positive or negative amount to scroll.\n\t */\n\tscroll(delta: number): void {\n\t\tthis.automatic = false\n\t\tif (this.inverted) delta = -delta\n\t\tthis.minimum += delta\n\t\tthis.maximum += delta\n\t}\n\n\t/**\n\t * @returns {Number} Returns the approximated width in pixels of largest axis label.\n\t */\n\tminmaxLabelWidth(adjust: boolean): number {\n\t\tvar l = this.labels,\n\t\t\t// biome-ignore lint/correctness/noInvalidUseBeforeDeclaration: <explanation>\n\t\t\tf = l._text,\n\t\t\tw = 0,\n\t\t\ts: string,\n\t\t\twordWrap: boolean\n\t\tvar la = this.labels\n\n\t\tif (f !== null && f !== undefined) {\n\t\t\twordWrap = l.wordWrap === \"auto\" || l.wordWrap === \"yes\"\n\n\t\t\tla.format.font.prepare()\n\n\t\t\t// Series that label their own rows (e.g. Bullet) provide one label per row:\n\t\t\tconst labels = rowLabelsOf(f) ?? f.data.labels\n\n\t\t\tfor (let t = 0, le = labels.length; t < le; t++) {\n\t\t\t\ts = labels[t]\n\t\t\t\tif (l.ongetlabel) s = l.ongetlabel(t, s)\n\n\t\t\t\tif (s) w = Math.max(w, wordWrap ? calcWordWrap(l.format, s) : l.format.textWidth(s))\n\t\t\t}\n\t\t} else {\n\t\t\tconst mi = this.roundMin(),\n\t\t\t\tma = this.maximum\n\t\t\tw = Math.max(l.width(mi), l.width(0.5 * (mi + ma)))\n\n\t\t\tw = Math.max(w, l.width(0.0000001))\n\t\t\tw = Math.max(w, l.width(ma))\n\t\t}\n\n\t\t//adjust for rotation (if any). Are we adjusting or spacing?\n\t\tif (l.rotation === 0) {\n\t\t\tif ((this.horizontal && adjust) || (!this.horizontal && !adjust)) {\n\t\t\t\tw = la.format.textHeight(\"Wj\")\n\t\t\t}\n\t\t} else if (this.horizontal) {\n\t\t\tif (adjust) {\n\t\t\t\tw = Math.abs(Math.sin(toRadians(l.rotation)) * w)\n\t\t\t} else {\n\t\t\t\tw = Math.abs(Math.cos(toRadians(l.rotation)) * w)\n\t\t\t}\n\t\t} else {\n\t\t\tif (adjust) {\n\t\t\t\tw = Math.abs(Math.cos(toRadians(l.rotation)) * w)\n\t\t\t} else {\n\t\t\t\tw = Math.abs(Math.sin(toRadians(l.rotation)) * w)\n\t\t\t}\n\t\t}\n\n\t\t//guarantee minimum spacing\n\t\tif (w < la.format.textHeight(\"Wj\")) w = la.format.textHeight(\"Wj\")\n\t\treturn w\n\t}\n\n\tcheckRange(): void {\n\t\tif (this.maximum - this.minimum < this.minAxisRange) this.maximum = this.minimum + this.minAxisRange\n\t}\n\n\tcheckMinMax(): void {\n\t\tvar s = this.chart.series,\n\t\t\th = this.horizontal\n\n\t\tif (this.automatic) {\n\t\t\tthis.minimum = h ? s.minXValue(this) : s.minYValue(this)\n\t\t\tthis.maximum = h ? s.maxXValue(this) : s.maxYValue(this)\n\n\t\t\tif (this.headroom > 0 && !this.log) this.maximum += (this.maximum - this.minimum) * this.headroom * 0.01\n\n\t\t\tthis.checkRange()\n\t\t}\n\t}\n\n\tcalcAxisScale(): void {\n\t\tvar range = this.maximum - this.minimum\n\t\tif (range === 0) range = 1\n\t\telse if (this.log) range = Math.log(range)\n\n\t\tthis.scale = this.axisSize / range\n\t}\n\n\tcalcScale(): void {\n\t\tvar la = this.labels,\n\t\t\tl: number\n\n\t\tla.format.font.prepare()\n\t\tl = this.minmaxLabelWidth(false)\n\n\t\tif (la.alternate) l *= 0.5\n\n\t\tl *= 1 + la.separation * 0.02\n\n\t\tthis.increm = this.increment === 0 ? calcIncrement(this, l) : this.increment\n\n\t\tif (this.integerSteps && this.increment === 0 && this.maximum - this.minimum >= 3) {\n\t\t\tthis.increm = Math.max(1, Math.round(this.increm))\n\t\t}\n\n\t\tif (this.increm <= 0) this.increm = 0.1\n\t\telse if (this.increm > 0 && this.increm <= 0.00000001) this.increm = 0.00000001\n\t}\n\n\t/**\n\t * @returns {Boolean} Returns the first visible series associated to this axis, or null if any.\n\t */\n\thasAnySeries(): Series | null {\n\t\tvar li = this.chart.series.items,\n\t\t\tt: number,\n\t\t\ts: Series,\n\t\t\td: Array<number | Date> | undefined,\n\t\t\th: boolean\n\n\t\tfor (t = 0; t < li.length; t++) {\n\t\t\ts = li[t]\n\t\t\tif (!s) break\n\t\t\t// DB fix Sep-2013, empty series should not be considered:\n\t\t\tif (s.visible && s.associatedToAxis(this) && (s.__alwaysDraw || s.count() > 0)) {\n\t\t\t\t// Remember now if series \"s\" has date-time values:\n\n\t\t\t\th = this.horizontal\n\t\t\t\tif (s.yMandatory) h = !h\n\n\t\t\t\td = h ? s.data.values : s.data.x\n\t\t\t\tthis.dateTime = d !== undefined && d.length > 0 && d[0] instanceof Date\n\n\t\t\t\treturn s\n\t\t\t}\n\t\t}\n\n\t\treturn null\n\t}\n\n\tdrawAxis(): void {\n\t\tvar f = this.format,\n\t\t\tpos = this.axisPos,\n\t\t\tstart = this.startPos,\n\t\t\tend = this.endPos\n\n\t\tvar rad = 20 * f.depth,\n\t\t\tr: { x: number; y: number; width: number; height: number }\n\n\t\tif (this.chart.aspect.view3d && rad > 0) {\n\t\t\tconst c = this.chart.ctx\n\t\t\tif (!c) return\n\t\t\tif (this.horizontal) r = { x: start, y: pos - rad * 0.5, width: end - start, height: rad }\n\t\t\telse r = { x: pos - rad * 0.5, y: start, width: rad, height: end - start }\n\n\t\t\tconst old = this.z\n\t\t\tf.z = old - f.depth * 0.5\n\t\t\tf.cylinder(r, 1, !this.horizontal, false)\n\t\t\tf.draw(c, null, r)\n\t\t\tf.z = old\n\t\t} else {\n\t\t\tconst c = this.chart.graphics\n\t\t\tif (!c) return\n\n\t\t\tc.beginPath()\n\n\t\t\tif (this.horizontal) {\n\t\t\t\tc.moveTo(start, pos)\n\t\t\t\tc.lineTo(end, pos)\n\t\t\t} else {\n\t\t\t\tc.moveTo(pos, start)\n\t\t\t\tc.lineTo(pos, end)\n\t\t\t}\n\n\t\t\tf.stroke.prepare()\n\t\t\tc.stroke()\n\t\t}\n\t}\n\n\tdrawGrids(): void {\n\t\tvar c = this.chart.drawContext,\n\t\t\tp: number,\n\t\t\tr = this.chart.chartRect,\n\t\t\tf = this.grid.format,\n\t\t\tx1 = Number.NaN,\n\t\t\ty1 = Number.NaN,\n\t\t\tx2 = Number.NaN,\n\t\t\ty2 = Number.NaN,\n\t\t\tv: number,\n\t\t\tvmin = this.roundMin()\n\n\t\tif (this.grid.centered) {\n\t\t\tconst tmp = this.increm * 0.5\n\t\t\tif (vmin - tmp >= this.minimum) vmin -= tmp\n\t\t\telse vmin += tmp\n\t\t}\n\n\t\tconst a = this.chart.aspect,\n\t\t\tis3d = a.view3d,\n\t\t\tisOrtho = is3d && a.orthogonal,\n\t\t\toff3d = is3d ? 1 : 0\n\n\t\tc.beginPath()\n\n\t\tif (this.horizontal) {\n\t\t\ty1 = this.bounds.y - off3d\n\t\t\ty2 = this.otherSide ? r.getBottom() - 1 : r.y + 1\n\t\t} else {\n\t\t\tx1 = this.bounds.x + off3d\n\t\t\tx2 = this.otherSide ? r.x + 1 : r.getRight() - 1\n\t\t}\n\n\t\tvar oldpos = Number.NaN,\n\t\t\tpos = -1\n\n\t\tif (f.fill !== \"\") {\n\t\t\tv = vmin\n\n\t\t\tconst old = f.stroke.fill\n\t\t\tf.stroke.fill = \"\"\n\n\t\t\twhile (v <= this.maximum) {\n\t\t\t\tp = this.calc(v)\n\n\t\t\t\tif (pos % 2 === 0)\n\t\t\t\t\tthis.horizontal ? f.rectangle(oldpos, y2, p - oldpos, y1 - y2) : f.rectangle(x1, oldpos, x2 - x1, p - oldpos)\n\n\t\t\t\toldpos = p\n\n\t\t\t\tv += this.increm\n\t\t\t\tpos++\n\t\t\t}\n\n\t\t\tf.stroke.fill = old\n\t\t\tc.fillStyle = \"\"\n\t\t}\n\n\t\tv = vmin\n\n\t\tif (isOrtho)\n\t\t\tif (this.horizontal) {\n\t\t\t\ty1 -= a._orthoy\n\t\t\t\ty2 -= a._orthoy\n\t\t\t} else {\n\t\t\t\tx1 += a._orthox\n\t\t\t\tx2 += a._orthox\n\t\t\t}\n\n\t\tvar isCustomDash = f.stroke.dash && !c.setLineDash && !(c as { mozCurrentTransform?: unknown }).mozCurrentTransform\n\n\t\tc.z = is3d ? this.chart.walls.back.format.z - 0.01 : 0\n\n\t\twhile (v <= this.maximum) {\n\t\t\tpos = this.calc(v)\n\n\t\t\tthis.horizontal ? (x1 = x2 = pos) : (y1 = y2 = pos)\n\n\t\t\tif (isOrtho) {\n\t\t\t\tif (this.horizontal) {\n\t\t\t\t\tx1 += a._orthox\n\t\t\t\t\tx2 += a._orthox\n\t\t\t\t} else {\n\t\t\t\t\ty1 -= a._orthoy\n\t\t\t\t\ty2 -= a._orthoy\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// TODO: lineZ (3D grid sides)\n\n\t\t\tif (is3d && !this.otherSide && c.lineZ) c.lineZ(x1, y1, 0, c.z)\n\n\t\t\tif (isCustomDash) dashedLine(c, x1, y1, x2, y2)\n\t\t\telse {\n\t\t\t\tc.moveTo(x1, y1)\n\t\t\t\tc.lineTo(x2, y2)\n\t\t\t}\n\n\t\t\tv += this.increm\n\t\t}\n\n\t\tf.stroke.prepare()\n\t\tf.shadow.prepare(c)\n\n\t\tc.stroke()\n\t}\n\n\t/**\n\t * @returns {Number} Returns the axis minimum value rounded according the axis increment distance.\n\t */\n\troundMin(): number {\n\t\t// OLD: var v=trunc(this.minimum/this.increm);\n\n\t\t// NEW: Fix against rounding precision of \"trunc\" (|0) operator:\n\n\t\tif (this.increm === 0 || !this.labels.roundFirst) return this.minimum\n\t\telse {\n\t\t\t//var v = parseFloat(new Number(this.minimum/this.increm).toFixed(0));\n\n\t\t\tfunction truncFloat(n: number) {\n\t\t\t\treturn n - (n % 1)\n\t\t\t}\n\n\t\t\tconst v = truncFloat(this.minimum / this.increm)\n\n\t\t\treturn this.increm * (this.minimum <= 0 ? v : 1 + v)\n\t\t}\n\t}\n\n\tdrawTicks(t: AxisTicks, factor: number, mult: number): void {\n\t\tvar v = this.roundMin(),\n\t\t\ttl = 1 + t.length,\n\t\t\ttl2 = 1\n\n\t\tif ((this.horizontal && this.otherSide) || (!this.horizontal && !this.otherSide)) {\n\t\t\ttl = -tl\n\t\t\ttl2 = -1\n\t\t}\n\n\t\ttl *= factor\n\t\ttl2 *= factor\n\n\t\ttl += this.axisPos\n\t\ttl2 += this.axisPos\n\n\t\tvar p: number,\n\t\t\tinc: number,\n\t\t\tn = 1,\n\t\t\tcou = 0\n\n\t\tif (mult === 0) inc = this.increm\n\t\telse {\n\t\t\tn += mult\n\t\t\tinc = this.increm / n\n\t\t}\n\n\t\tvar c = this.chart.drawContext\n\n\t\tc.beginPath()\n\n\t\twhile (v <= this.maximum) {\n\t\t\tif (mult === 0 || cou++ % n !== 0) {\n\t\t\t\tp = this.calc(v)\n\n\t\t\t\tif (this.horizontal) {\n\t\t\t\t\tc.moveTo(p, tl2)\n\t\t\t\t\tc.lineTo(p, tl)\n\t\t\t\t} else {\n\t\t\t\t\tc.moveTo(tl2, p)\n\t\t\t\t\tc.lineTo(tl, p)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tv += inc\n\t\t}\n\n\t\tt.stroke.prepare()\n\n\t\tt.z = this.z\n\t\tc.z = t.z\n\n\t\tc.stroke()\n\t}\n\n\tdrawTitle(): void {\n\t\tvar l = this.labels,\n\t\t\ttmpX: number,\n\t\t\ttmpY: number,\n\t\t\ttitleBounds = this.title.bounds,\n\t\t\trotation = this.title.rotation,\n\t\t\t//ctx=this.chart.ctx,\n\t\t\ttextAlign = \"center\"\n\n\t\tif (this.title.text !== \"\") {\n\t\t\tif (this.horizontal) {\n\t\t\t\ttmpY = this.title.padding\n\n\t\t\t\tif (this.ticks.visible) tmpY += this.ticks.length\n\n\t\t\t\tif (l.visible) {\n\t\t\t\t\tl.format.font.prepare()\n\t\t\t\t\tlet h = this.maxLabelDepth\n\t\t\t\t\tif (l.alternate) h *= 2\n\t\t\t\t\ttmpY += h\n\t\t\t\t}\n\n\t\t\t\ttmpX = this.startPos + this.axisSize * 0.5\n\n\t\t\t\tif (this.otherSide) tmpY = -tmpY - titleBounds.height\n\n\t\t\t\ttmpY = this.axisPos + tmpY\n\n\t\t\t\tif (rotation === 0) {\n\t\t\t\t\ttmpX -= titleBounds.width * 0.5\n\t\t\t\t} else {\n\t\t\t\t\ttmpX += titleBounds.height * (this.otherSide ? -0.5 : 0.5)\n\t\t\t\t\tif (!this.otherSide) tmpY += 1.5 * titleBounds.height\n\t\t\t\t\ttextAlign = this.otherSide ? \"near\" : rotation === 270 ? \"near\" : \"far\"\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttmpX = this.title.padding\n\n\t\t\t\tif (this.ticks.visible) tmpX += this.ticks.length\n\n\t\t\t\tif (l.visible) {\n\t\t\t\t\tlet w = l.maxWidth\n\t\t\t\t\tif (l.alternate) w *= 2\n\t\t\t\t\ttmpX += w\n\t\t\t\t}\n\n\t\t\t\ttmpY = this.startPos + 0.5 * this.axisSize\n\n\t\t\t\tif (rotation === 0) {\n\t\t\t\t\ttmpX = this.axisPos + (this.otherSide ? tmpX : -tmpX)\n\t\t\t\t\ttmpY -= 0.5 * titleBounds.height\n\t\t\t\t\ttextAlign = this.otherSide ? \"near\" : \"far\"\n\t\t\t\t} else {\n\t\t\t\t\ttmpX += titleBounds.height\n\t\t\t\t\ttmpX = this.axisPos + (this.otherSide ? tmpX : -tmpX)\n\t\t\t\t\ttmpY += titleBounds.width * (this.otherSide ? -0.5 : 0.5)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.title.drawIt(textAlign as CanvasTextAlign, tmpX, tmpY, rotation)\n\n\t\t\t// chart.ctx.rect(tmpX,tmpY,titleBounds.width,titleBounds.height);\n\t\t\t// chart.ctx.stroke();\n\t\t}\n\t}\n\n\trotatedWidth(l: AxisLabels, w: number): number {\n\t\treturn Math.abs(Math.sin(toRadians(l.rotation)) * w)\n\t}\n\n\tdrawLabel(value: number, r: Rectangle): void {\n\t\tvar l = this.labels,\n\t\t\ts = l.getLabel(value)\n\n\t\t/*\n\t\t\tif (this.firstSeries && (this.firstSeries.notmandatory==this))\n\t\t\t\t\ts=l.getLabel(this.firstSeries,value);\n\t\t\telse\n\t\t\t\t\ts=l.getLabel(null,value);\n\t\t*/\n\n\t\tr.width = l.format.textWidth(s)\n\t\tif (r.width > l.maxWidth) l.maxWidth = r.width\n\n\t\tif (l.rotation === 0) this.horizontal ? (r.x -= 0.5 * r.width) : (r.y += r.height * 0.5)\n\t\telse {\n\t\t\tconst c = this.chart.drawContext\n\t\t\tc.save()\n\t\t\tc.translate(r.x, r.y)\n\t\t\tc.rotate((-Math.PI * l.rotation) / 180)\n\t\t\tc.textAlign = \"right\"\n\n\t\t\tif (this.horizontal) {\n\t\t\t\tconst xDisplacement = this.rotatedWidth(l, r.width) * 0.5\n\t\t\t\tconst yDisplacement = this.rotatedWidth(l, r.height) * 0.5 - 4\n\t\t\t\tif (l.rotation >= 220) this.otherSide ? (r.x = xDisplacement * -1) : (r.x = xDisplacement)\n\t\t\t\telse this.otherSide ? (r.x = xDisplacement + 4) : (r.x = xDisplacement * -1)\n\n\t\t\t\tthis.otherSide ? (r.y = yDisplacement) : (r.y = yDisplacement * -1)\n\t\t\t} else {\n\t\t\t\tconst xDisplacement = this.rotatedWidth(l, r.width)\n\t\t\t\t//const yDisplacement = (this.rotatedWidth(l, r.height));\n\n\t\t\t\tthis.otherSide ? (r.x = xDisplacement) : (r.x = 30)\n\t\t\t\tr.y = -8\n\t\t\t}\n\t\t}\n\n\t\tif (l.format.font.textAlign === \"right\") r.x -= r.width\n\n\t\tl.format.z = this.z * this.chart.walls.back.format.z\n\n\t\tl.format.drawText(r, s)\n\n\t\tif (l.rotation !== 0) this.chart.drawContext.restore()\n\t}\n\n\tdrawLabels(): void {\n\t\tvar v = this.roundMin(),\n\t\t\tr = new Rectangle(),\n\t\t\tc = this.axisPos,\n\t\t\tl = this.labels\n\t\t//var v=(this.minimum<this.maximum) ? this.roundMin() : this.minimum, r=new Rectangle(), c=this.axisPos, l=this.labels;\n\n\t\tl.maxWidth = 0\n\t\tl.format.font.prepare()\n\n\t\tvar tl = this.ticks.visible ? this.ticks.length : 0\n\n\t\ttl += l.padding\n\n\t\tif (this.horizontal) this.otherSide ? (c -= tl) : (c += tl)\n\t\telse this.otherSide ? (c += tl) : (c -= tl)\n\n\t\tvar oldc = c\n\n\t\tr.height = l.format.textHeight(\"Wj\")\n\n\t\tvar alter = l.alternate,\n\t\t\tw = alter ? (this.horizontal ? -this.minmaxLabelWidth(true) : this.minmaxLabelWidth(true)) : 0,\n\t\t\tp: number\n\n\t\t// TODO: if ongetlabels .... (loop for user-custom labels position and text)\n\n\t\twhile (v <= this.maximum) {\n\t\t\tp = this.calc(v)\n\n\t\t\tif (this.horizontal) {\n\t\t\t\tr.x = p\n\t\t\t\tr.y = c // -r.height*0.5;\n\t\t\t} else {\n\t\t\t\tr.x = c\n\t\t\t\tr.y = p - r.height * 0.5\n\t\t\t}\n\n\t\t\tif (alter) c = c === oldc ? (this.otherSide ? oldc + w : oldc - w) : oldc\n\n\t\t\tthis.drawLabel(v, r)\n\t\t\tv += this.increm\n\t\t}\n\t}\n\n\t/**\n\t * @returns {Number} Returns the position in pixels for a given value, using the axis scales.\n\t */\n\tcalc(value: number): number {\n\t\tlet p: number\n\n\t\t// biome-ignore lint/suspicious/noSelfCompare: <explanation> We want to check if value is NaN, and NaN is the only value that is not equal to itself.</explanation>\n\t\tif (value !== value)\n\t\t\t// isNaN() <-- slow\n\t\t\tp = 0\n\t\telse if (this.log) {\n\t\t\tvalue -= this.minimum\n\t\t\tp = value <= 0 ? 0 : Math.log(value) * this.scale\n\t\t} else p = (value - this.minimum) * this.scale\n\n\t\tif (this.horizontal) return this.inverted ? this.endPos - p : this.startPos + p\n\t\telse return this.inverted ? this.startPos + p : this.endPos - p\n\t}\n\n\t/**\n\t * @returns {Number} Returns the axis value for a given position in pixels.\n\t */\n\tfromPos(p: number): number {\n\t\tvar i = this.horizontal\n\t\tif (this.inverted) i = !i\n\t\treturn this.minimum + (i ? p - this.startPos : this.endPos - p) / this.scale\n\t}\n\n\tfromSize(p: number): number {\n\t\treturn p / this.scale\n\t}\n\n\t/**\n\t * @returns {Number} Returns the index of a given position in pixels (only works in bottom axes).\n\t */\n\tfromSizeCalcIndex(p: number): number {\n\t\tvar index = -1\n\t\tif (this.dateTime === true) {\n\t\t\tconst actualValue = ((this.maximum - this.minimum) / this.axisSize) * p + this.minimum\n\t\t\tconst xs = this.chart.series.items[0].data.x ?? []\n\t\t\t// Nearest sample, so irregular date spacing never leaves gaps without a point.\n\t\t\tlet closest = Number.POSITIVE_INFINITY\n\t\t\tfor (let i = 0; i < xs.length; i++) {\n\t\t\t\tconst distance = Math.abs(Number(xs[i]) - actualValue)\n\t\t\t\tif (distance < closest) {\n\t\t\t\t\tclosest = distance\n\t\t\t\t\tindex = i\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tindex = p / this.scale + this.minimum\n\t\t\tif (this.chart.series.items[0].data.values.length < index || index < -0.5) index = -1\n\t\t}\n\t\treturn index\n\t}\n\n\t/**\n\t * @returns {Number} Returns the size in pixels of a given value, using the axis scales.\n\t */\n\tcalcSize(value: number): number {\n\t\treturn Math.abs(this.calc(value) - this.calc(0))\n\t}\n\n\t/**\n\t * @param {Number} p1 Position in pixels to be axis minimum.\n\t * @param {Number} p2 Position in pixels to be axis maximum.\n\t */\n\tcalcMinMax(p1: number, p2: number): void {\n\t\tthis.automatic = false\n\n\t\tvar a = this.fromPos(p1),\n\t\t\tb = this.fromPos(p2),\n\t\t\ttmp: number\n\t\tif (a > b) {\n\t\t\ttmp = a\n\t\t\ta = b\n\t\t\tb = tmp\n\t\t}\n\n\t\tthis.minimum = a\n\t\tthis.maximum = b\n\n\t\tthis.checkRange()\n\t}\n\n\tsetMinMax(min: number, max: number): void {\n\t\tthis.automatic = false\n\n\t\tthis.minimum = min\n\t\tthis.maximum = max\n\n\t\tthis.checkRange()\n\t}\n\n\tsetPos(a: number, b: number): void {\n\t\tthis.startPos = a + this.start * b * 0.01\n\t\tthis.endPos = a + this.end * b * 0.01\n\t\tthis.axisSize = this.endPos - this.startPos\n\t}\n\n\t/** @this {Axis} */\n\tstatic adjustRect = function (this: Axis) {\n\t\tvar s = 0,\n\t\t\tl = this.labels,\n\t\t\tb = this.chart.chartRect,\n\t\t\tti = this.title,\n\t\t\thasTitle: boolean\n\n\t\t// Recalc firstSeries even if this axis is not visible:\n\t\tthis.firstSeries = this.hasAnySeries()\n\n\t\tif (!this.visible) return\n\n\t\tif (this.firstSeries && this.visible) {\n\t\t\tthis.checkMinMax()\n\n\t\t\tl.checkStyle()\n\n\t\t\thasTitle = ti.shouldDraw()\n\t\t\tif (hasTitle) ti.resize()\n\n\t\t\tif (b.automatic && !this.custom) {\n\t\t\t\tif (l.visible) {\n\t\t\t\t\tl.format.font.prepare()\n\t\t\t\t\ts = this.minmaxLabelWidth(true)\n\t\t\t\t\tthis.maxLabelDepth = s\n\n\t\t\t\t\tif (l.alternate) s *= 2\n\t\t\t\t\ts += l.padding\n\t\t\t\t}\n\n\t\t\t\tif (this.ticks.visible) s += this.ticks.length\n\n\t\t\t\tif (hasTitle) s += ti.bounds.height //+ti.padding;\n\n\t\t\t\tif (this.horizontal) this.otherSide ? b.setTop(b.y + s) : (b.height -= s)\n\t\t\t\telse this.otherSide ? (b.width -= s) : b.setLeft(b.x + s)\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Axis rect calcs. Returns current ChartRect.\n\t */\n\t/** @this {Axis} */\n\tstatic calcRect = function (this: Axis) {\n\t\tif (!this.firstSeries) return\n\n\t\tthis.checkMinMax()\n\n\t\t// Calc bounds\n\t\tvar b = this.chart.chartRect,\n\t\t\tbo = this.bounds,\n\t\t\th = this.horizontal\n\n\t\tif (h) {\n\t\t\tbo.y = this.otherSide ? b.y : b.y + b.height\n\t\t\tbo.width = b.width\n\t\t\tthis.setPos(b.x, b.width)\n\t\t} else {\n\t\t\tbo.x = this.otherSide ? b.x + b.width : b.x\n\t\t\tbo.height = b.height\n\t\t\tthis.setPos(b.y, b.height)\n\t\t}\n\n\t\tthis.calcAxisScale()\n\n\t\tvar tmp = this.chart.series\n\n\t\t//specific case: check for non-std sideAll scaling\n\t\tif (tmp.items.length > 0) {\n\t\t\tif (this.automatic) {\n\t\t\t\tconst s = tmp.items[0]\n\n\t\t\t\tif (s?.constructor?.name === \"Bar\" && s.notmandatory === this && s.stacked === \"sideAll\") {\n\t\t\t\t\ts.notmandatory.minimum = -0.5\n\t\t\t\t\ts.notmandatory.maximum = (s as CustomBar).countAll(false) - 0.5\n\t\t\t\t} else {\n\t\t\t\t\t// Series that draw one row per point (e.g. Bullet) center each row in its own slot:\n\t\t\t\t\tconst axisSeries = tmp.items.filter(item => item.visible && item.associatedToAxis(this)),\n\t\t\t\t\t\trows = axisSeries[0]\n\n\t\t\t\t\tif (\n\t\t\t\t\t\trows &&\n\t\t\t\t\t\trows.notmandatory === this &&\n\t\t\t\t\t\ttypeof rows.rowCount === \"function\" &&\n\t\t\t\t\t\taxisSeries.every(item => item.constructor === rows.constructor && item.notmandatory === this)\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.minimum = -0.5\n\t\t\t\t\t\tthis.maximum = Math.max(1, rows.rowCount()) - 0.5\n\t\t\t\t\t\tthis.calcAxisScale()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Calculate axis margins:\n\t\tif (this.automatic) {\n\t\t\tconst s = this.chart.series,\n\t\t\t\tm = h ? s.horizMargins() : s.vertMargins(),\n\t\t\t\thasX = m !== undefined && m.x > 0,\n\t\t\t\thasY = m !== undefined && m.y > 0\n\n\t\t\tif (m && hasX) this.minimum -= this.fromSize(m.x)\n\n\t\t\tif (m && hasY) this.maximum += this.fromSize(m.y)\n\n\t\t\tif (hasX || hasY) this.calcAxisScale()\n\t\t}\n\n\t\tthis.calcScale()\n\n\t\t// Calc pos\n\n\t\tvar v = (h ? b.height : b.width) * this.position * 0.01,\n\t\t\tw = this.chart.walls,\n\t\t\twallsize = 0,\n\t\t\thaswalls = w.visible && this.chart.aspect.view3d\n\n\t\tif (h) {\n\t\t\tif (haswalls && w.bottom.visible) wallsize = w.bottom.size\n\t\t\tthis.axisPos = this.otherSide ? b.y + v : b.getBottom() + wallsize - v\n\t\t} else {\n\t\t\tif (haswalls && w.left.visible) wallsize = w.left.size\n\t\t\tthis.axisPos = this.otherSide ? b.getRight() - v : b.x - wallsize + v\n\t\t}\n\t}\n\n\t/** @this {Axis} */\n\tstatic draw = function (this: Axis) {\n\t\tif (this.visible && this.firstSeries) {\n\t\t\tthis.z = this.otherSide ? this.chart.walls.back.format.z : 0\n\n\t\t\t//guarantee centre label for one-value axes.\n\t\t\tif (Math.abs(this.maximum - this.minimum) <= 0.000000001 /*widen beyond this.minAxisRange*/) {\n\t\t\t\tconst diff = Math.abs(this.minimum) < 0.000000001 ? 0.00000001 : this.minimum / 10000000\n\n\t\t\t\tif (this.minimum !== this.minimum - diff || this.maximum !== this.minimum + diff) {\n\t\t\t\t\tthis.setMinMax(this.minimum - diff, this.maximum + diff)\n\t\t\t\t\tif (this.chart != null) this.chart.draw()\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.format.stroke.fill !== \"\") this.drawAxis()\n\n\t\t\t// Protect against infinite loop:\n\t\t\tif (this.roundMin() + 1000 * this.increm > this.maximum) {\n\t\t\t\tif (this.grid.visible) this.drawGrids()\n\t\t\t\tif (this.ticks.visible) this.drawTicks(this.ticks, 1, 0)\n\t\t\t\tif (this.innerTicks.visible) this.drawTicks(this.innerTicks, -1, 0)\n\t\t\t\tif (this.minorTicks.visible) this.drawTicks(this.minorTicks, 1, Math.max(0, this.minorTicks.count))\n\t\t\t\tif (this.labels.visible) this.drawLabels()\n\t\t\t}\n\n\t\t\tif (this.title.shouldDraw()) this.drawTitle()\n\t\t}\n\t}\n}\n","import { getActiveXObject, getXMLHttpRequest } from \"./platform.js\"\n\ntype HttpRequest = XMLHttpRequest\n\nfunction makeHttpObject(): HttpRequest {\n\tconst XMLHttpRequestConstructor = getXMLHttpRequest()\n\tconst ActiveXObjectConstructor = getActiveXObject()\n\n\ttry {\n\t\tif (XMLHttpRequestConstructor) return new XMLHttpRequestConstructor()\n\t\tthrow new Error(\"XMLHttpRequest is not available\")\n\t} catch (error) {\n\t\tconsole.error(\"XMLHttpRequest is not supported by this browser.\", error)\n\t}\n\ttry {\n\t\tif (ActiveXObjectConstructor) return new ActiveXObjectConstructor(\"Msxml2.XMLHTTP\") as HttpRequest\n\t\tthrow new Error(\"ActiveXObject is not available\")\n\t} catch (error) {\n\t\tconsole.error(\"ActiveXObject 'Msxml2.XMLHTTP' is not supported by this browser.\", error)\n\t}\n\ttry {\n\t\tif (ActiveXObjectConstructor) return new ActiveXObjectConstructor(\"Microsoft.XMLHTTP\") as HttpRequest\n\t\tthrow new Error(\"ActiveXObject is not available\")\n\t} catch (error) {\n\t\tconsole.error(\"ActiveXObject 'Microsoft.XMLHTTP' is not supported by this browser.\", error)\n\t}\n\n\tthrow new Error(\"Could not create HTTP request object.\")\n}\n\nexport function doHttpRequest<T>(\n\ttarget: T,\n\turl: string,\n\tsuccess: (target: T, responseText: string) => void,\n\tfailure?: (status: number, statusText: string) => void\n): void {\n\tconst request = makeHttpObject()\n\trequest.onreadystatechange = () => {\n\t\tif (request.readyState === 4) {\n\t\t\tif (request.status === 200 || request.status === 0) success(target, request.responseText)\n\t\t\telse if (failure) failure(request.status, request.statusText)\n\t\t}\n\t}\n\trequest.open(\"GET\", url, true)\n\trequest.send(null)\n}\n","export type PaletteColor = string\n\nexport const RainbowPalette = (): PaletteColor[] => [\n\t\"#FF0000\",\n\t\"#FF7F00\",\n\t\"#FFFF00\",\n\t\"#00FF00\",\n\t\"#0000FF\",\n\t\"#6600FF\",\n\t\"#8B00FF\"\n]\n\n/** Collection of colors used by series and data points. */\nexport class Palette {\n\tcolors: PaletteColor[]\n\tinverted: boolean | undefined\n\tgrayScale: boolean | undefined\n\n\tconstructor(colors: PaletteColor[] = []) {\n\t\tthis.colors = colors\n\t}\n\n\tget(index: number): PaletteColor | undefined {\n\t\tif (this.colors.length === 0) return undefined\n\t\treturn this.colors[index === -1 ? 0 : index % this.colors.length]\n\t}\n}\n","import type { Chart } from \"./chart.js\"\nimport { Axis } from \"./core/elements/axis.js\"\nimport { Format } from \"./core/elements/format.js\"\nimport type { SeriesLegendSymbol } from \"./core/elements/legend-symbol.js\"\nimport { Point, Rectangle } from \"./core/primitives.js\"\nimport { DateUtils } from \"./date.format.js\"\nimport { doHttpRequest } from \"./do-http-request.js\"\nimport { Emitter, type EventListener, type SeriesEventMap } from \"./events.js\"\nimport { Palette } from \"./palette.js\"\nimport { getActiveXObject, getDOMParser } from \"./platform.js\"\nimport { ArrayMax, ArrayMin, ArraySumAbs, parseText } from \"./series-utils.js\"\nimport { BaseAnimation, Marks } from \"./tools/index.js\"\nimport { trunc } from \"./utils.js\"\n\nfunction requestRedraw(series: Series, redraw: boolean): void {\n\tif (redraw && series.chart) {\n\t\tif (series.chart._requestDraw) series.chart._requestDraw()\n\t\telse series.chart.draw()\n\t}\n}\n\nfunction chartLocale(series: Series): string | undefined {\n\treturn series.chart?.language || undefined\n}\n\ninterface XmlNode {\n\tgetAttribute(name: string): string | null\n\tgetElementsByTagName(name: string): XmlNodeCollection\n}\n\ninterface XmlDocumentLike {\n\tgetElementsByTagName(name: string): XmlNodeCollection\n}\n\ninterface XmlNodeCollection {\n\tlength: number\n\t[index: number]: XmlNode\n}\n\ninterface JsonPoint {\n\tvalue: number\n\tname?: string\n\tx?: number\n\tcolor?: string\n}\n\ninterface JsonSeries {\n\tname: string\n\tcolor: string\n\tmetric: string\n\tcategory: string\n\tpoint?: JsonPoint[]\n}\n\ninterface JsonPayload {\n\tseries?: JsonSeries\n}\n\ninterface JsonInput {\n\tvalue: string | JsonPayload\n}\n\n/**\n * The data of a series. `values` and `labels` exist on every series; the remaining arrays belong to the\n * series types that use them (for example `open`, `high`, `low` and `close` to Candle).\n */\nexport interface SeriesData {\n\tvalues: number[]\n\tlabels: string[]\n\tsource: unknown\n\txml?: { value: string }\n\tjson?: JsonInput\n\t/** Horizontal positions, when they are not the point index. */\n\tx?: Array<number | Date>\n\t/** Previous values kept while values are being animated. */\n\t_old?: number[] | null\n\topen?: number[]\n\thigh?: number[]\n\tlow?: number[]\n\tclose?: number[]\n\tlows?: number[]\n\tstart?: Array<number | Date>\n\tend?: Array<number | Date>\n\tradius?: number[]\n\tcode?: unknown[]\n\tstyles?: string[]\n\ttitle?: string\n}\n\n/** State used to animate the series between its original and its sorted values. */\nexport interface SortedOptions {\n\tsortedDrawAnimation: BaseAnimation\n\tsortedValues: number[]\n\tsortedValuesIndices: number[]\n\toriginalValues: number[]\n\tsortedLabels: string[]\n\toriginalLabels: string[]\n\tsorted: boolean | number[]\n\tascending: boolean\n\tsorting: boolean\n\tsortingAnimationType: string\n}\n\n/** What a series tells a tooltip about one of its points, when the generic series name and value are not enough. */\nexport interface TooltipParts {\n\t/** Header of the tooltip, for example the name of a node or \"A → B\" for a link. */\n\tlabel: string\n\t/** The formatted value. */\n\tvalue: string\n\t/** Swatch color; the series legend color when omitted. */\n\tcolor?: string\n\t/** Extra name and value rows, shown by extended tooltips. */\n\tdetails?: [string, string][]\n}\n\n/** What a series constructor accepts first: the values, the owning chart or a data source object. */\nexport type SeriesInput = number[] | Chart | SeriesData | Series | Record<string, unknown>\n\n/** The labels that go with the values, or the values themselves when the first argument is a chart. */\nexport type SeriesLabels = string[] | number[]\n\n/**\n * @constructor\n * @class Base abstract class to define a series of data\n * @param {Object|Tee.Chart|Number[]} o An array of numbers, or a chart or datasource object.\n * @property {Tee.Chart} chart The parent chart this Series object belongs to.\n * @property {Number[]} data.values Array of numbers as main series data.\n * @property {String[]} data.labels Array of strings used to display at axis labels, legend and marks.\n * @property {Format} format Visual properties to display series data.\n * @property {Boolean} [visible=true] Determines if this series will be displayed or not.\n * @property {String} [cursor=\"default\"] Defines the mouse cursor to show when mouse is over a series point.\n * @property {Object} data Contains all series data values, labels, etc.\n * @property {Tee.Series.Marks} marks Displays annotations near series points.\n * @property {Boolean} [colorEach=\"auto\"] Paints points using series fill color, or each point with a different color\n * from series palette or chart palette color array.\n * @property {String} [horizAxis=\"bottom\"] Defines the horizontal axis associated with this series.\n * @property {String} [vertAxis=\"left\"] Defines the horizontal axis associated with this series.\n */\nexport class Series {\n\tdraw?(): void\n\tdeclare drawLine?: boolean\n\trowCount?(): number\n\trowLabel?(index: number): string | undefined\n\tdeclare maxDrawWidth?: number\n\tdeclare maxWidth?: number\n\tdeclare rotation?: number\n\tdeclare transform?: (() => void) | null\n\tbeforeDraw?(): void\n\t/** Describes a point for tooltips. Series with points that are not plain values, such as Sankey links, define it. */\n\ttooltipParts?(index: number): TooltipParts | undefined\n\tdeclare format: Format\n\tdeclare visible: boolean\n\tdeclare useAxes: boolean\n\t// Properties created by the constructor and shared by every series type. They are declared here so that\n\t// TypeScript knows them; `declare` keeps them out of the emitted class fields.\n\tdeclare _horizAxis: Axis\n\tdeclare _vertAxis: Axis\n\tdeclare mandatoryAxis: Axis\n\tdeclare notmandatory: Axis\n\tdeclare yMandatory: boolean\n\tdeclare marks: Marks\n\tdeclare hover: Format\n\t/** Index of the point under the mouse, or -1. */\n\tdeclare over: number\n\t/** Keeps the series in axis calculations even when it has no points. */\n\tdeclare __alwaysDraw: boolean | undefined\n\t/** Called before the series is drawn. */\n\tdeclare onbeforedraw: ((series: Series) => void) | undefined\n\t/** Called after the series is drawn. */\n\tdeclare ondraw: ((series: Series) => void) | undefined\n\tdeclare palette: Palette\n\tdeclare paletteName: string\n\tdeclare themeName: string\n\tdeclare colorEach: string | boolean\n\tdeclare isColorEach: boolean\n\tdeclare cursor: string\n\tdeclare decimals: number\n\tdeclare legend: { visible: boolean; symbol?: SeriesLegendSymbol }\n\tdeclare legendStrokeColor: string | boolean\n\tdeclare sequential: boolean\n\tdeclare sortedOptions: SortedOptions\n\tdeclare _paintAxes: boolean\n\tdeclare _paintWalls: boolean\n\tdeclare destroyed: boolean\n\t/**\n\t * Largest number of points `append` keeps; older points are dropped. Zero (the default) keeps them all.\n\t */\n\tmaxPoints = 0\n\t_events?: Emitter<SeriesEventMap>\n\tdeclare color: string\n\ttitle = \"\"\n\tdeclare horizAxis: string | Axis\n\tdeclare vertAxis: string | Axis\n\tisStack100: boolean | undefined\n\tstacked: string | undefined\n\tdateFormat: string | undefined\n\tvalueFormat: boolean | undefined\n\tcolorEachLine: string | boolean | undefined\n\tanimate: BaseAnimation | undefined\n\t_cancelGaugeAnimation: (() => void) | undefined\n\t/** The chart the series belongs to. Set when the series is added to a chart. */\n\tdeclare chart: Chart\n\tdeclare data: SeriesData\n\tprivate hiddenPoints = new Set<number>()\n\n\tconstructor(o?: SeriesInput | null, o2?: SeriesLabels | null) {\n\t\tthis._initialize(o, o2)\n\t}\n\n\t_initialize(o?: SeriesInput | null, o2?: SeriesLabels | null): void {\n\t\tthis.chart = null as unknown as Chart\n\t\tthis.data = { values: [], labels: [], source: null }\n\n\t\tthis.sortedOptions = {\n\t\t\tsortedDrawAnimation: new BaseAnimation(),\n\t\t\tsortedValues: [],\n\t\t\tsortedValuesIndices: [],\n\t\t\toriginalValues: [],\n\t\t\tsortedLabels: [],\n\t\t\toriginalLabels: [],\n\t\t\tsorted: false,\n\t\t\tascending: true,\n\t\t\tsorting: false,\n\t\t\tsortingAnimationType: \"verticalchange\"\n\t\t}\n\t\tthis.yMandatory = true\n\t\tthis.horizAxis = \"bottom\"\n\t\tthis.vertAxis = \"left\"\n\t\tthis.legend = { visible: true }\n\t\tthis.legendStrokeColor = false\n\n\t\tthis.sequential = true\n\n\t\tthis.format = new Format(this.chart)\n\t\tthis.hover = new Format(this.chart)\n\t\tvar f = this.format,\n\t\t\tho = this.hover,\n\t\t\ts = ho.shadow\n\t\tthis.sortedOptions.sortedDrawAnimation.duration = 500\n\t\tthis.sortedOptions.sortedDrawAnimation.mode = \"linear\"\n\t\tf.fill = \"\"\n\t\tf.stroke.fill = \"\"\n\t\tthis.visible = true\n\n\t\t// Hover\n\t\tho.stroke.size = 0.3\n\t\tho.fill = \"\"\n\t\tho.stroke.fill = \"red\"\n\n\t\ts.visible = true\n\t\ts.blur = 10\n\t\ts.width = 0\n\t\ts.height = 0\n\n\t\tthis.cursor = \"default\"\n\t\tthis.over = -1\n\n\t\tthis.marks = new Marks(this, this.chart)\n\n\t\tthis.palette = new Palette()\n\t\tthis.paletteName = \"opera\"\n\t\tthis.themeName = \"default\"\n\n\t\tthis.colorEach = \"auto\"\n\t\tthis.useAxes = true\n\t\tthis.decimals = 2\n\n\t\tthis._paintAxes = true\n\t\tthis._paintWalls = true\n\n\t\tthis.title = \"\"\n\n\t\tthis.init(o, o2)\n\t}\n\n\tsortValues(): number[] {\n\t\tthis.sortedOptions.sorting = true\n\t\tvar indices = [],\n\t\t\tvalues = this.data.values,\n\t\t\tascending = this.sortedOptions.ascending,\n\t\t\ti: number\n\t\tthis.sortedOptions.sortedLabels = []\n\t\tfor (i = 0; i < this.data.values.length; i++) {\n\t\t\tindices.push(i)\n\t\t}\n\t\tindices.sort((a, b) => (ascending ? values[a] - values[b] : values[b] - values[a]))\n\t\tthis.sortedOptions.originalValues = this.data.values.slice()\n\t\tthis.sortedOptions.originalLabels = this.data.labels.slice()\n\t\tfor (i = 0; i < indices.length; i++) {\n\t\t\tthis.sortedOptions.sortedLabels.push(\n\t\t\t\tthis.data.labels[indices[i]] ? this.data.labels[indices[i]] : String(indices[i])\n\t\t\t)\n\t\t}\n\t\tthis.sortedOptions.sortedValuesIndices = indices\n\t\tthis.sortedOptions.sortedValues = this.data.values.slice().sort((a, b) => (ascending ? a - b : b - a))\n\t\tthis.sortedOptions.sorting = false\n\t\treturn this.sortedOptions.sortedValues.slice()\n\t}\n\n\tdrawSortedValues(sorted: boolean | number[]): void {\n\t\tvar animation = this.sortedOptions.sortedDrawAnimation,\n\t\t\tprevValues: number[],\n\t\t\tvalues: number[],\n\t\t\tendValues: number[]\n\t\tif (this.sortedOptions.sorted !== sorted && !this.sortedOptions.sorting && animation && !animation.running) {\n\t\t\tthis.sortedOptions.sorted = sorted\n\t\t\tif (sorted) this.sortValues()\n\t\t\tprevValues = sorted ? this.sortedOptions.originalValues.slice() : this.sortedOptions.sortedValues.slice()\n\t\t\tvalues = this.data.values\n\t\t\tendValues = sorted ? this.sortedOptions.sortedValues.slice() : this.sortedOptions.originalValues.slice()\n\n\t\t\tif (!(values.length === endValues.length && values.every((v, i) => v === endValues[i]))) {\n\t\t\t\tanimation.chart = this.chart\n\n\t\t\t\tanimation.doStep = f => {\n\t\t\t\t\tif (f < 1) {\n\t\t\t\t\t\tfor (let i = 0; i < prevValues.length; i++) {\n\t\t\t\t\t\t\tvalues[i] = prevValues[i] + (endValues[i] - prevValues[i]) * f\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tanimation.onstop = () => {\n\t\t\t\t\tfor (let i = 0; i < prevValues.length; i++) {\n\t\t\t\t\t\tvalues[i] = endValues[i]\n\t\t\t\t\t}\n\t\t\t\t\tanimation.running = false\n\t\t\t\t}\n\n\t\t\t\tanimation.onstart = () => {\n\t\t\t\t\tanimation.running = true\n\t\t\t\t}\n\t\t\t\tanimation.animate()\n\t\t\t}\n\t\t\tthis.data.labels = sorted ? this.sortedOptions.sortedLabels.slice() : this.sortedOptions.originalLabels.slice()\n\t\t\tthis.chart.draw()\n\t\t}\n\t}\n\n\tinit(o?: SeriesInput | null, o2?: SeriesLabels | null): void {\n\t\tif (typeof o === \"object\") {\n\t\t\tif (o) {\n\t\t\t\tif (Array.isArray(o)) {\n\t\t\t\t\tthis.data.values = o\n\n\t\t\t\t\tif (Array.isArray(o2)) this.data.labels = o2 as string[]\n\t\t\t\t} else if (o && typeof o === \"object\" && \"canvas\" in o && \"series\" in o) {\n\t\t\t\t\tthis.chart = o as Chart\n\t\t\t\t\tif (Array.isArray(o2)) this.data.values = o2 as number[]\n\t\t\t\t} else {\n\t\t\t\t\tthis.data.source = o\n\t\t\t\t\tthis.refresh()\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Replaces the series data using arrays or any iterable collection.\n\t *\n\t * @param {Iterable<Number>} values Values to display.\n\t * @param {Iterable<String>} [labels] Optional labels associated with values.\n\t * @param {Boolean} [redraw=true] Whether to redraw the owning chart.\n\t * @returns {Tee.Series} This series.\n\t */\n\tsetData(values: Iterable<number>, labels?: Iterable<string> | null, redraw = true): Series {\n\t\tif (!values || typeof values[Symbol.iterator] !== \"function\") {\n\t\t\tthrow new TypeError(\"Series.setData requires an iterable collection of values\")\n\t\t}\n\t\tif (labels !== undefined && labels !== null && typeof labels[Symbol.iterator] !== \"function\") {\n\t\t\tthrow new TypeError(\"Series.setData labels must be an iterable collection\")\n\t\t}\n\n\t\tthis.data.values = Array.from(values)\n\t\tthis.data.labels = labels == null ? [] : Array.from(labels)\n\t\trequestRedraw(this, redraw)\n\t\treturn this\n\t}\n\n\t/**\n\t * Appends one value and optional label to the series.\n\t *\n\t * @param {Number} value Value to append.\n\t * @param {String} [label] Optional label to append.\n\t * @param {Boolean} [redraw=true] Whether to redraw the owning chart.\n\t * @returns {Tee.Series} This series.\n\t */\n\tappend(value: number, label?: string, redraw = true): Series {\n\t\tconst data = this.data\n\t\tdata.values.push(value)\n\t\tif (label !== undefined) data.labels[data.values.length - 1] = label\n\n\t\tconst excess = this.maxPoints > 0 ? data.values.length - this.maxPoints : 0\n\t\tif (excess > 0) {\n\t\t\t// Streaming window: forget the oldest points, keeping labels and x values aligned.\n\t\t\tdata.values.splice(0, excess)\n\t\t\tif (data.labels.length > 0) data.labels.splice(0, excess)\n\t\t\t// x values are only trimmed when the caller already added the one for this point.\n\t\t\tif (data.x && data.x.length >= data.values.length + excess) data.x.splice(0, excess)\n\t\t}\n\n\t\trequestRedraw(this, redraw)\n\t\treturn this\n\t}\n\n\t/**\n\t * Removes all values and labels from the series.\n\t *\n\t * @param {Boolean} [redraw=true] Whether to redraw the owning chart.\n\t * @returns {Tee.Series} This series.\n\t */\n\tclear(redraw = true): Series {\n\t\tthis.data.values = []\n\t\tthis.data.labels = []\n\t\trequestRedraw(this, redraw)\n\t\treturn this\n\t}\n\n\t/**\n\t * @returns {String} Returns the color of index point in series, using series palette or chart palette.\n\t */\n\tgetFill(index: number, f?: Format): string {\n\t\tvar p = this.palette,\n\t\t\tc = p?.colors?.length ? p.get(index) : null\n\t\tif (c === null || c === undefined) return (this.isColorEach || !f ? this.chart.palette.get(index) : f.fill) ?? \"\"\n\t\telse return c\n\t}\n\n\t/**\n\t * @returns {boolean} Returns true when the index'th series value is null and should not be painted.\n\t */\n\tisNull(index: number): boolean {\n\t\treturn this.data.values[index] === null || this.hiddenPoints.has(index)\n\t}\n\n\t/** Sets whether a point is painted without changing its underlying value or label. */\n\tsetPointVisible(index: number, visible: boolean): void {\n\t\tif (visible) this.hiddenPoints.delete(index)\n\t\telse this.hiddenPoints.add(index)\n\t}\n\n\t/**\n\t * @returns {CanvasGradient} Returns a canvas gradient using color, or color if gradient is not visible.\n\t */\n\tgetFillStyle(r: Rectangle, color: string): string | CanvasGradient {\n\t\treturn this.format.gradient.visible ? this.format.gradient.create(r, color) : color\n\t}\n\n\ttitleText(index: number): string {\n\t\treturn this.title || `Series ${index.toString()}`\n\t}\n\n\trefresh(failure?: (...args: unknown[]) => void): void {\n\t\tif (this.data.source) {\n\t\t\tif (this.data.source instanceof HTMLTextAreaElement) {\n\t\t\t\tparseText(this.data, this.data.source.value)\n\n\t\t\t\tif (this.chart) this.chart.draw()\n\t\t\t} else if (this.data.source instanceof HTMLInputElement) {\n\t\t\t\tdoHttpRequest(\n\t\t\t\t\tthis,\n\t\t\t\t\tthis.data.source.value,\n\t\t\t\t\t(target, data) => {\n\t\t\t\t\t\tparseText(target.data, data)\n\t\t\t\t\t\ttarget.chart.draw()\n\t\t\t\t\t},\n\t\t\t\t\t(status, statusText) => {\n\t\t\t\t\t\tif (failure) failure(this, status, statusText)\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t} else if (failure) failure(this)\n\t\t} else if (this.data.xml) {\n\t\t\tparseXML(this, this.data.xml)\n\t\t\tthis.chart.draw()\n\t\t} else if (this.data.json) {\n\t\t\tparseJSON(this, this.data.json)\n\t\t\tthis.chart.draw()\n\t\t}\n\t}\n\n\t/**\n\t * @returns {String} Returns the series index'th data label, or the value if no label exists at that index.\n\t */\n\tvalueOrLabel(index: number): string {\n\t\tvar s = this.data.labels[index]\n\n\t\tif (!s || s === \"\") s = this.valueText(index)\n\n\t\treturn s\n\t}\n\n\t/**\n\t * @returns {String} Returns a percentual representation of the series index'th value, on total of series values.\n\t */\n\ttoPercent(index: number): string {\n\t\tvar v = this.data.values\n\t\treturn `${((100 * Math.abs(v[index])) / ArraySumAbs(v)).toFixed(this.decimals)} %`\n\t}\n\n\t/**\n\t * @returns {String} Returns the text string to show at series marks, for a given series point index.\n\t */\n\tmarkText(index: number): string {\n\t\tvar m = this.marks,\n\t\t\tres = this.dataText(index, m.style, false)\n\t\tres = Array.isArray(res) ? res.join(\" \") : res\n\t\treturn m.ongettext ? m.ongettext(this, index, res) : res\n\t}\n\n\t/**\n\t * @returns {Boolean} Returns if series is associated to axis, either horizontal or vertical.\n\t */\n\tassociatedToAxis(axis: Axis): boolean {\n\t\tif (axis.horizontal) return this.horizAxis === \"both\" || this._horizAxis === axis\n\t\telse return this.vertAxis === \"both\" || this._vertAxis === axis\n\t}\n\n\tbounds(r: Rectangle) {\n\t\tvar h = this._horizAxis,\n\t\t\tv = this._vertAxis\n\n\t\tr.x = h.calc(this.minXValue())\n\t\tr.width = h.calc(this.maxXValue()) - r.x\n\n\t\tr.y = v.calc(this.maxYValue())\n\t\tr.height = v.calc(this.minYValue()) - r.y\n\t}\n\n\t/** Gets the series bounds in canvas coordinates. Pass a Rectangle to reuse it. */\n\tgetCanvasBounds(rectangle = new Rectangle()): Rectangle {\n\t\tthis.bounds(rectangle)\n\t\treturn rectangle\n\t}\n\n\t/** Side of the point's anchor the tooltip is placed on; undefined keeps the default (above, flipping below). */\n\ttooltipSide(_index: number): \"top\" | \"bottom\" | \"left\" | \"right\" | undefined {\n\t\treturn undefined\n\t}\n\n\tcalcStack(index: number, p: Point, value: number): void {\n\t\tvar sum = this.pointOrigin(index, false) + value,\n\t\t\ttmp: number,\n\t\t\ta = this.mandatoryAxis\n\n\t\tp.x = this.notmandatory.calc(this.data.x ? Number(this.data.x[index]) : index)\n\n\t\tif (this.isStack100) {\n\t\t\ttmp = this.pointOrigin(index, true)\n\t\t\tp.y = tmp === 0 ? a.endPos : a.calc((sum * 100.0) / tmp)\n\t\t} else p.y = a.calc(sum)\n\n\t\tif (!this.yMandatory) {\n\t\t\ttmp = p.x\n\t\t\tp.x = p.y\n\t\t\tp.y = tmp\n\t\t}\n\t}\n\n\t/**\n\t * @returns {Number} Returns the sum of all previous visible series index'th value, for stacking.\n\t */\n\tpointOrigin(index: number, sumAll: boolean): number {\n\t\tvar res = 0,\n\t\t\tt: number,\n\t\t\ts: Series & { continuous?: boolean; maxZ?: number },\n\t\t\tli = this.chart.series.items,\n\t\t\tv: number[],\n\t\t\ttmp: number\n\n\t\tfor (t = 0; t < li.length; t++) {\n\t\t\ts = li[t]\n\n\t\t\tif (!sumAll && s === this) break\n\t\t\telse if (s.stacked !== \"no\") {\n\t\t\t\tv = s.data.values\n\n\t\t\t\tif (s.visible && s.constructor === this.constructor && v.length > index) {\n\t\t\t\t\ttmp = v[index]\n\n\t\t\t\t\t// Protect against undefined (NaN)\n\t\t\t\t\tif (tmp !== undefined) res += sumAll && tmp < 0 ? -tmp : tmp\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn res\n\t}\n\n\tdoHover(index: number): void {\n\t\tvar o = this.chart\n\t\tif (index !== this.over) {\n\t\t\tif (o.onhover) o.onhover(this, index)\n\n\t\t\tthis.over = index\n\n\t\t\tif (this.hover.enabled) o._scheduleDraw()\n\t\t}\n\t}\n\n\t/*\n\t * @private\n\t */\n\tinitZ(index?: number, total?: number): void {\n\t\tthis._baseInitZ(index, total)\n\t}\n\n\t_baseInitZ(index?: number, total?: number): void {\n\t\tvar f = this.format\n\t\tf.z = Number(index) / Number(total)\n\t\tf.depth = 1 / Number(total)\n\t\tthis.marks.format.z = f.z + f.depth * 0.5\n\t}\n\n\t/*\n\t * @private\n\t */\n\tsetChart(series: Series, chart: Chart): void {\n\t\tseries.chart = chart\n\n\t\tseries.recalcAxes()\n\n\t\tseries.format.setChart(chart)\n\t\tseries.marks.setChart(chart)\n\t\tseries.hover.setChart(chart)\n\t}\n\n\t/** Subscribes `listener` to series events and returns a function that removes it. */\n\ton<K extends keyof SeriesEventMap>(name: K, listener: EventListener<SeriesEventMap[K]>): () => void {\n\t\treturn (this._events ??= new Emitter<SeriesEventMap>()).on(name, listener)\n\t}\n\n\t/** Like `on`, but the listener runs once. */\n\tonce<K extends keyof SeriesEventMap>(name: K, listener: EventListener<SeriesEventMap[K]>): () => void {\n\t\treturn (this._events ??= new Emitter<SeriesEventMap>()).on(name, listener, true)\n\t}\n\n\t/** Removes `listener`, or every listener of `name` when it is omitted. */\n\toff<K extends keyof SeriesEventMap>(name: K, listener?: EventListener<SeriesEventMap[K]>): void {\n\t\tthis._events?.off(name, listener)\n\t}\n\n\t/** @internal */\n\t_hasListeners(name: keyof SeriesEventMap): boolean {\n\t\treturn this._events?.has(name) ?? false\n\t}\n\n\t/** @internal */\n\t_emit<K extends keyof SeriesEventMap>(name: K, ...args: SeriesEventMap[K]): void {\n\t\tthis._events?.emit(name, ...args)\n\t}\n\n\tdestroy(): void {\n\t\tif (this.destroyed) return\n\t\tthis.destroyed = true\n\t\tthis.sortedOptions?.sortedDrawAnimation?.cancel?.()\n\t\tthis.animate?.cancel?.()\n\t\tthis._events?.clear()\n\t\tthis._cancelGaugeAnimation?.()\n\t\tthis.marks?.destroy?.()\n\t\tthis.chart = null as unknown as Chart\n\t}\n\n\tcalc(index: number, p: Point): void {\n\t\tthis._baseCalc(index, p)\n\t}\n\n\t/** Gets a point's canvas position. Pass a Point to reuse it when querying many points. */\n\tgetPointPosition(index: number, point = new Point()): Point {\n\t\tthis.calc(index, point)\n\t\treturn point\n\t}\n\n\t_baseCalc(index: number, p: Point): void {\n\t\tvar d = this.data,\n\t\t\tx = this.notmandatory.calc(d.x ? Number(d.x[index]) : index),\n\t\t\ty = this.mandatoryAxis.calc(d.values[index])\n\n\t\tp.x = this.yMandatory ? x : y\n\t\tp.y = this.yMandatory ? y : x\n\t}\n\n\trecalcAxes(): void {\n\t\tthis._baseRecalcAxes()\n\t}\n\n\t_baseRecalcAxes(): void {\n\t\tvar a = this.chart.axes\n\n\t\tif (this.horizAxis instanceof Axis) this._horizAxis = this.horizAxis\n\t\telse this._horizAxis = this.horizAxis === \"top\" ? a.top : a.bottom\n\n\t\tif (this.vertAxis instanceof Axis) this._vertAxis = this.vertAxis\n\t\telse this._vertAxis = this.vertAxis === \"right\" ? a.right : a.left\n\n\t\tthis.mandatoryAxis = this.yMandatory ? this._vertAxis : this._horizAxis\n\t\tthis.notmandatory = this.yMandatory ? this._horizAxis : this._vertAxis\n\t}\n\n\t// Pending for solution (gauges.bounds) :\n\tgetRect(): Rectangle {\n\t\treturn new Rectangle()\n\t}\n\n\t/** @param {Point} [_p] */\n\tclicked(_p?: Point): number {\n\t\treturn -1\n\t}\n\n\tfixedFloatToLocal(value: number, decimals: number): string | number {\n\t\tconst locale = chartLocale(this)\n\t\tvar fixed = value.toFixed(decimals),\n\t\t\tlocaleVal = value.toLocaleString(locale),\n\t\t\tn: number | string,\n\t\t\tfractions: string\n\n\t\tif (fixed.indexOf(\".\") !== -1) {\n\t\t\tn = 1.1\n\t\t\tn = n.toLocaleString(locale).substring(1, 2)\n\t\t\tfractions = fixed.substring(fixed.indexOf(\".\") + 1) //zero based idx\n\t\t\treturn (\n\t\t\t\tlocaleVal.substring(0, localeVal.indexOf(n) === -1 ? localeVal.length : localeVal.indexOf(n)) + n + fractions\n\t\t\t)\n\t\t} else return value\n\t}\n\n\t/**\n\t * @returns {String} Returns the text string for a given series point index value.\n\t */\n\tvalueText(index: number): string {\n\t\tvar vv = this.data._old || this.data.values,\n\t\t\t// Series such as Gantt keep Date objects in their value arrays.\n\t\t\td = vv[index] as number | Date\n\n\t\tif (d) {\n\t\t\tif (d instanceof Date) return DateUtils.format(d, this.dateFormat)\n\t\t\telse if (this.valueFormat) return d.toLocaleString(chartLocale(this))\n\t\t\telse if (trunc(d) === d) return this.fixedFloatToLocal(d, 0).toString()\n\t\t\telse return this.fixedFloatToLocal(d, this.decimals).toString()\n\t\t} else return \"0\"\n\t}\n\n\tlabelOrTitle(index: number): string {\n\t\treturn this.data.labels[index] || this.title\n\t}\n\n\tmousedown(_e?: unknown): boolean {\n\t\treturn false\n\t}\n\n\tmousemove(p: Point): void {\n\t\tvar tmp: number, m: Marks, len: number, p2: Point, t: number\n\n\t\tif (this.hover.enabled || this.cursor !== \"default\") {\n\t\t\ttmp = this.clicked(p)\n\n\t\t\tthis.doHover(tmp)\n\n\t\t\tif (this.cursor !== \"default\" && tmp !== -1) {\n\t\t\t\tif (!this.chart.newCursor) this.chart.newCursor = this.cursor\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tm = this.marks\n\n\t\tif (m.visible) {\n\t\t\tlen = this.data.values.length\n\t\t\tp2 = new Point()\n\n\t\t\tfor (t = 0; t < len; t += m.drawEvery)\n\t\t\t\tif (!this.isNull(t)) {\n\t\t\t\t\tthis.markPos(t, p2)\n\n\t\t\t\t\tif (m.canDraw(p2.x, p2.y, t, false)) {\n\t\t\t\t\t\tif (m.bounds.contains(p)) {\n\t\t\t\t\t\t\tthis.doHover(t)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\t}\n\n\tmouseout(): void {}\n\n\tmarkPos(t: number, p: Point): boolean {\n\t\tthis.calc(t, p)\n\t\treturn false\n\t}\n\n\tdrawMarks(): void {\n\t\tvar len = this.data.values.length,\n\t\t\tp = new Point(),\n\t\t\tt: number,\n\t\t\tinv: boolean\n\n\t\tfor (t = 0; t < len; t += this.marks.drawEvery)\n\t\t\tif (!this.isNull(t)) {\n\t\t\t\tinv = this.markPos(t, p)\n\t\t\t\tthis.marks.drawMark(p.x, p.y, t, inv)\n\t\t\t}\n\t}\n\n\thorizMargins(_p?: Point): void {}\n\n\tvertMargins(_p?: Point): void {}\n\n\t/**\n\t * @returns {Number} Returns the minimum value of series x values, or zero if no x values exist.\n\t */\n\tminXValue(): number {\n\t\treturn this._baseMinXValue()\n\t}\n\n\t_baseMinXValue(): number {\n\t\treturn this.data.x && this.data.x.length > 0 ? ArrayMin(this.data.x) : 0\n\t}\n\n\t/**\n\t * @returns {Number} Returns the minimum value of series data values, or zero if no values exist.\n\t */\n\tminYValue(): number {\n\t\treturn this._baseMinYValue()\n\t}\n\n\t_baseMinYValue(): number {\n\t\tvar v = this.data.values\n\t\treturn v.length > 0 ? ArrayMin(v) : 0\n\t}\n\n\t/**\n\t * @returns {Number} Returns the maximum value of series x values, or data length minus one, if no x values exist.\n\t */\n\tmaxXValue(): number {\n\t\treturn this._baseMaxXValue()\n\t}\n\n\t_baseMaxXValue(): number {\n\t\tvar len: number\n\n\t\tif (this.data.x) return this.data.x.length > 0 ? ArrayMax(this.data.x) : 0\n\t\telse {\n\t\t\tlen = this.data.values.length\n\t\t\treturn len === 0 ? 0 : len - 1\n\t\t}\n\t}\n\n\t/**\n\t * @returns {Number} Returns the maximum value of series values, or zero if no values exist.\n\t */\n\tmaxYValue(): number {\n\t\treturn this._baseMaxYValue()\n\t}\n\n\t_baseMaxYValue(): number {\n\t\tvar v = this.data.values,\n\t\t\tl = v.length,\n\t\t\tt: number,\n\t\t\tvalue: number,\n\t\t\tres: number\n\n\t\tif (l > 0) {\n\t\t\tres = ArrayMax(v)\n\n\t\t\tif (Number.isNaN(res)) {\n\t\t\t\t// isNan, protect against\n\t\t\t\tfor (t = 0; t < l; t++) {\n\t\t\t\t\tvalue = v[t]\n\n\t\t\t\t\tif (value !== undefined) {\n\t\t\t\t\t\tif (Number.isNaN(res)) res = value\n\t\t\t\t\t\telse if (value > res) res = value\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn Number.isNaN(res) ? 0 : res\n\t\t} else return 0\n\t}\n\n\tcalcColorEach(): void {\n\t\tthis.isColorEach = this.colorEach === \"yes\"\n\t}\n\n\t/**\n\t * @returns {Number} Returns the maximum of all series values, or sum of all stacked values.\n\t */\n\tstackMaxValue(): number {\n\t\tvar res: number, v: number[], len: number, value: number\n\n\t\tif (this.stacked === \"100\") return 100\n\t\telse {\n\t\t\tif (this.stacked === \"no\") return this._baseMaxYValue()\n\t\t\telse {\n\t\t\t\tres = this._baseMaxYValue()\n\t\t\t\tv = this.data.values\n\t\t\t\tlen = v.length\n\n\t\t\t\twhile (len--) {\n\t\t\t\t\tvalue = v[len]\n\t\t\t\t\tif (value === undefined) value = 0\n\t\t\t\t\tres = Math.max(res, this.pointOrigin(len, false) + value)\n\t\t\t\t}\n\n\t\t\t\treturn res\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @returns {String|String[]} Returns the text string, or value-label pair, for a series point index.\n\t * @param {Number} index The point position in series data array.\n\t * @param {String} style Defines how text is returned: \"auto\", \"value\", \"percent\", \"percentlabel\",\n\t * \"valuelabel\", \"label\", \"index\", \"labelvalue\", \"labelpercent\", \"valuepercent\"\n\t */\n\tdataText(index: number, style: string, title: boolean, asArray?: boolean): string | string[] {\n\t\t/**\n\t\t * @param {unknown} a\n\t\t * @param {unknown} b\n\t\t * @returns {string|string[]}\n\t\t */\n\t\tfunction calcRet(a: string, b: string): string | string[] {\n\t\t\tif (asArray) return l ? [a, b] : [a, \"\"]\n\t\t\telse return a + (b ? ` ${b}` : \"\")\n\t\t}\n\n\t\t/** @type {string|string[]} */\n\t\tvar l = title ? this.labelOrTitle(index) : this.data.labels[index]\n\n\t\tif (style === \"value\") return this.valueText(index)\n\t\telse if (style === \"percent\") return this.toPercent(index)\n\t\telse if (style === \"percentlabel\") return calcRet(this.toPercent(index), l)\n\t\telse if (style === \"valuelabel\" || style === \"auto\") return calcRet(this.valueText(index), l)\n\t\telse if (style === \"label\") return l || \"\"\n\t\telse if (style === \"index\") return index.toFixed(0)\n\t\telse if (style === \"labelvalue\") return calcRet(l, this.valueText(index))\n\t\telse if (style === \"labelpercent\") return calcRet(l, this.toPercent(index))\n\t\telse if (style === \"valuepercent\") return `${this.valueText(index)} ${this.toPercent(index)}`\n\t\telse return this.valueOrLabel(index)\n\t}\n\n\t/**\n\t * @returns {String|String[]} Returns the text string, or value-label pair, for a series point index.\n\t * @param {Number} index The point position in series data array.\n\t * @param {String} style Defines how text is returned: \"auto\", \"value\", \"percent\", \"percentlabel\",\n\t * \"valuelabel\", \"label\", \"index\", \"labelvalue\", \"labelpercent\", \"valuepercent\"\n\t */\n\tlegendText(index: number, style: string, title: boolean, asArray?: boolean): string | string[] {\n\t\treturn this.dataText(index, style, title, asArray)\n\t}\n\n\t/**\n\t * @returns {Number} Returns the number of series data values.\n\t */\n\tcount(): number {\n\t\treturn this.data.values.length\n\t}\n\n\t/**\n\t * @returns {Number} Returns the number of items to show at legend.\n\t */\n\tlegendCount(): number {\n\t\treturn this.count()\n\t}\n\n\t/**\n\t * @returns {Color} Returns the color of index'th legend symbol.\n\t */\n\tlegendColor(index: number): string {\n\t\treturn this.isColorEach && index !== -1\n\t\t\t? this.getFill(index)\n\t\t\t: this.legendStrokeColor\n\t\t\t\t? this.format.stroke.fill\n\t\t\t\t: this.format.fill\n\t}\n\n\taddRandom(count = 5, range = 1000, x = false): Series {\n\t\tif (!range) range = 1000\n\t\tif (!count) count = 5\n\n\t\tvar d = this.data,\n\t\t\tt: number\n\t\td.values.length = count\n\n\t\tconst xs: number[] | undefined = x ? new Array(count) : undefined\n\t\tif (xs) d.x = xs\n\n\t\tif (count > 0) {\n\t\t\td.values[0] = Math.random() * range\n\n\t\t\tif (xs) xs[0] = Math.random() * range\n\n\t\t\tfor (t = 1; t < count; t++) {\n\t\t\t\td.values[t] = d.values[t - 1] + Math.random() * range - range * 0.5\n\t\t\t\tif (xs) xs[t] = Math.random() * range\n\t\t\t}\n\t\t}\n\n\t\treturn this\n\t}\n\n\t/**\n\t * @returns {Array} Returns an array of series data indices sorted according to sortBy parameter.\n\t */\n\tdoSort(sortBy: string, ascending: boolean): number[] | null {\n\t\tif (sortBy === \"none\") return null\n\n\t\tconst len = this.data.values.length\n\t\tconst sorted: number[] = new Array(len)\n\t\tfor (let t = 0; t < len; t++) sorted[t] = t\n\n\t\tif (sortBy === \"labels\") {\n\t\t\tconst labels = this.data.labels\n\t\t\tconst before = ascending ? -1 : 1\n\t\t\tconst after = ascending ? 1 : -1\n\n\t\t\tsorted.sort((a, b) => {\n\t\t\t\tconst A = labels[a].toLowerCase()\n\t\t\t\tconst B = labels[b].toLowerCase()\n\t\t\t\treturn A < B ? before : A === B ? 0 : after\n\t\t\t})\n\t\t} else {\n\t\t\tconst values = this.data.values\n\t\t\tsorted.sort(ascending ? (a, b) => values[a] - values[b] : (a, b) => values[b] - values[a])\n\t\t}\n\n\t\treturn sorted\n\t}\n\n\t/** Loads series from XML text, or from an element whose `value` is the XML text. */\n\tloadXML(xml: string | { value: string }): void {\n\t\tthis.data.xml = typeof xml === \"string\" ? { value: xml } : xml\n\t\tthis.refresh()\n\t}\n\n\t/** Loads series from JSON text, a parsed payload, or an element whose `value` is either of them. */\n\tloadJSON(json: unknown): void {\n\t\tthis.data.json = toJsonInput(json)\n\t\tthis.refresh()\n\t}\n\n\tcellRect(r: Rectangle, act: boolean, series?: new (...args: never[]) => Series): Rectangle {\n\t\tvar visible = { total: 0, index: -1 },\n\t\t\tcols: number,\n\t\t\trows: number,\n\t\t\ttmp: number\n\t\tr.setFrom(this.chart.chartRect)\n\t\tthis.chart.series.visibleCount(this, series, visible)\n\n\t\tif (act && visible.total > 1) {\n\t\t\tcols = Math.round(Math.sqrt(visible.total))\n\t\t\trows = Math.round(visible.total / cols)\n\n\t\t\tif (r.width > r.height) {\n\t\t\t\ttmp = cols\n\t\t\t\tcols = rows\n\t\t\t\trows = tmp\n\t\t\t}\n\n\t\t\tr.width /= cols\n\t\t\tr.x += 1.03 * (visible.index % cols) * r.width\n\n\t\t\tr.height /= rows\n\t\t\tr.y += 1.03 * trunc(visible.index / cols) * r.height\n\n\t\t\t// % spacing between multiple series\n\t\t\tr.width *= 0.94\n\t\t\tr.height *= 0.94\n\t\t}\n\n\t\treturn r\n\t}\n}\n\nfunction loadXML(xml: string): XmlDocumentLike {\n\tconst DOMParserConstructor = getDOMParser()\n\tif (DOMParserConstructor) return new DOMParserConstructor().parseFromString(xml, \"text/xml\")\n\t// Internet Explorer\n\tconst ActiveXObjectConstructor = getActiveXObject()\n\tif (!ActiveXObjectConstructor) throw new Error(\"XML parsing is not supported by this browser.\")\n\tconst xmlDoc = new ActiveXObjectConstructor(\"Microsoft.XMLDOM\") as XmlDocumentLike & {\n\t\tasync: boolean\n\t\tloadXML(value: string): void\n\t}\n\txmlDoc.async = false\n\txmlDoc.loadXML(xml)\n\treturn xmlDoc\n}\n\nfunction toJsonInput(json: unknown): JsonInput {\n\tif (typeof json === \"string\") return { value: json }\n\tif (json && typeof json === \"object\" && \"value\" in json) return json as JsonInput\n\treturn { value: json as JsonPayload }\n}\n\nfunction parseXML(series: Series, xml: { value: string }, seriesTag?: string, pointTag?: string): void {\n\tvar data = series.data,\n\t\tpoints: XmlNodeCollection,\n\t\tt: number\n\tdata.values = []\n\tdata.labels = []\n\n\tseriesTag = seriesTag || \"series\"\n\n\tvar doc = loadXML(xml.value),\n\t\tn: string | null\n\n\tvar s = doc.getElementsByTagName(seriesTag)[0]\n\tif (s) {\n\t\tn = s.getAttribute(\"color\")\n\t\tif (n) series.color = n\n\n\t\tn = s.getAttribute(\"name\")\n\t\tif (n) series.title = n\n\n\t\tn = s.getAttribute(\"metric\")\n\t\tif (n) data.title = n\n\n\t\tpointTag = pointTag || \"point\"\n\n\t\tpoints = s.getElementsByTagName(pointTag)\n\t\tif (points) {\n\t\t\tfor (t = 0; t < points.length; t++) {\n\t\t\t\tn = points[t].getAttribute(\"name\")\n\t\t\t\tif (n) data.labels.push(n)\n\n\t\t\t\tn = points[t].getAttribute(\"value\")\n\t\t\t\tdata.values.push(parseFloat(n as string))\n\n\t\t\t\tn = points[t].getAttribute(\"x\")\n\t\t\t\tif (n) (data.x ??= []).push(parseFloat(n))\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction parseJSON(series: Series, json: JsonInput, _seriesTag?: string, _pointTag?: string): void {\n\tvar data = series.data,\n\t\ttmp: Axis[\"title\"],\n\t\tp: JsonPoint[] | undefined,\n\t\tpp: JsonPoint,\n\t\tt: number\n\tdata.values = []\n\tdata.labels = []\n\n\tconst payload = typeof json.value === \"string\" ? (JSON.parse(json.value) as JsonPayload) : json.value\n\n\tif (payload.series) {\n\t\tif (payload.series.name !== \"\") series.title = payload.series.name\n\t\tif (payload.series.color !== \"\") series.format.fill = payload.series.color\n\n\t\tif (payload.series.metric !== \"\") {\n\t\t\tdata.title = payload.series.metric\n\n\t\t\ttmp = series.mandatoryAxis.title\n\t\t\tif (tmp.text === \"\") tmp.text = data.title\n\t\t}\n\n\t\tif (payload.series.category !== \"\") {\n\t\t\ttmp = series.notmandatory.title\n\t\t\tif (tmp.text === \"\") tmp.text = payload.series.category\n\t\t}\n\n\t\tp = payload.series.point\n\n\t\tif (p) {\n\t\t\tfor (t = 0; t < p.length; t++) {\n\t\t\t\tpp = p[t]\n\n\t\t\t\tdata.values.push(pp.value)\n\n\t\t\t\tif (pp.name !== undefined) data.labels[t] = pp.name\n\n\t\t\t\tif (pp.x !== undefined) {\n\t\t\t\t\tif (!data.x) data.x = []\n\t\t\t\t\tdata.x[t] = pp.x\n\t\t\t\t}\n\n\t\t\t\tif (pp.color && pp.color !== \"\") {\n\t\t\t\t\tif (!series.palette.colors) series.palette.colors = []\n\t\t\t\t\tseries.palette.colors[t] = pp.color\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":["parseText","data","text","values","labels","lines","split","t","length","fields","numberFound","field","value","parseFloat","Number","isNaN","isArray","obj","Array","toNumber","item","Date","getTime","isAscending","previous","MAX_VALUE","i","visiblePointRange","x","minimum","maximum","low","Math","min","high","max","search","limit","strict","lower","upper","middle","ArrayMax","a","skipNulls","ArrayMin","pointerOf","series","pointer","undefined","quantile","sorted","fraction","position","floor","ceil","Point","y","constructor","this","Rectangle","width","height","automatic","set","setFrom","rectangle","getRight","getBottom","setTop","setBottom","setLeft","setRight","contains","point","offset","pointInLine","p","p1","p2","tolerance","dx","dy","projection","sqrt","dashedLine","ctx","x2","y2","da","save","len","translate","moveTo","rotate","atan2","dashIndex","draw","progress","lineTo","restore","doubleTap","chart","_doubleTapCleanup","lastTap","onTouchEnd","e","destroyed","currentTime","now","tapLength","zoom","reset","preventDefault","canvas","addEventListener","removeEventListener","_eventCleanups","push","trunc","toRadians","angle","PI","colorToRgba","color","alpha","getTableCellText","cell","textContent","innerText","getWindow","globalThis","window","getDocument","document","getNavigator","navigator","getPlatformConstructor","name","getXMLHttpRequest","getDOMParser","getActiveXObject","isCanvasElement","CanvasElement","HTMLCanvasElement","isTableElement","TableElement","HTMLTableElement","requestAnimationFrame","callback","runtimeWindow","request","call","setTimeout","cancelAnimationFrame","handle","cancel","clearTimeout","ChartImage","url","repeat","backFill","visible","image","tryDraw","graphics","ImageConstructor","Error","onload","drawingSurface","src","pattern","createPattern","fillStyle","fillRect","drawImage","Gradient","colors","direction","stops","create","createDrawing","rect","context","createLinear","x0","y0","x1","y1","createLinearGradient","gradient","centerX","centerY","radius","createRadialGradient","setEndColor","stopCount","index","stop","addColorStop","Shadow","blur","prepare","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","isAndroid","shadow","Stroke","fill","size","join","cap","dash","_g","strokeStyle","bounds","lineWidth","lineJoin","lineCap","setLineDash","setChart","Font","style","textAlign","baseLine","lineThrough","_sh","_s","stroke","getSize","part","setSize","map","textBaseline","font","NO_OFFSET","percentLocation","location","Format","back","padding","shape","round","transparency","enabled","tube","beveled","doSuperNums","doSubNums","ranges","top","valid","underline","_img","_tmpPolygonBounds","getGraphics","roundRect","r","b","xr","yr","corners","quadraticCurveTo","closePath","textHeight","_text","textWidth","measureText","fillBack","c","getbounds","oldtransp","globalAlpha","clip","subNums","str","newStr","code","charCodeAt","String","fromCharCode","superNums","drawText","g","s","drawAtXY","fillText","strokeText","beginPath","rows","l","h","rectPath","polygonBounds","points","polygon","ellipsePath","cx","cy","__webgl","z","depth","scale","arc","ellipse","sphere","drawContext","cylinder","topradius","vertical","inverted","cube","w","aspect","is3D","view3d","old","ax","ay","_orthox","_orthoy","ww","hh","AxisGrid","format","centered","lineDash","dateFormat","tokenPattern","timezonePattern","timezoneClipPattern","padWithZeros","val","args","date","mask","utc","formatFunction","Object","prototype","toString","test","dateValue","SyntaxError","masks","default","slice","getterPrefix","dayOfMonth","dayOfWeek","month","year","hours","minutes","seconds","milliseconds","timezoneOffset","getTimezoneOffset","flags","d","dd","ddd","i18n","dayNames","dddd","m","mm","mmm","monthNames","mmmm","yy","yyyy","H","HH","M","MM","ss","L","tt","T","TT","Z","match","pop","replace","o","abs","S","token","shortDate","mediumDate","longDate","fullDate","shortTime","mediumTime","longTime","isoDate","isoTime","isoDateTime","isoUtcDateTime","DateUtils","msecsRound","getMonth","getFullYear","rowLabelOf","rowLabel","bind","AxisLabels","axis","decimals","fixedDecimals","separation","rotation","alternate","maxWidth","valueFormat","wordWrap","ongetlabel","roundFirst","labelStyle","_textlabels","checkStyle","st","firstSeries","associatedToAxis","horizontal","notmandatory","formatValueString","decimalSeparator","toLocaleString","substr","amountWithCommas","arParts","intPart","decPart","toFixed","getLabel","v","indexOf","li","items","ser","stacked","dateTime","oldFixDec","tmpWidth","AxisTicks","count","Emitter","subscriptions","Map","on","listener","once","list","get","subscription","remove","off","delete","filter","has","emit","failure","failed","error","clear","Tool","active","_events","_hasListeners","_emit","mousedown","_event","mousemove","_point","mouseout","clicked","destroy","BaseAnimation","duration","mode","autoDraw","loop","running","onstart","onstop","init","_onStep","_frameHandle","_fallbackFrameHandle","_chartForCleanup","_attachChart","_detachChart","_scheduleStep","step","target","onStep","super","initializeAnimation","isChartTarget","_animations","Set","add","completed","runStep","elapsed","doStep","startAnimation","start","animate","FadeAnimation","fade","_fadeState","kind","setTransp","fa","legend","walls","each","marks","title","axes","panel","SeriesAnimation","oldmin","oldmax","oldauto","_scaling","candidate","isSeriesTarget","changeAxis","amount","mid","range","getAxis","firstVisible","mandatoryAxis","getOtherAxis","yMandatory","vertAxis","right","horizAxis","otherAxis","oldValues","_old","maxDrawWidth","stepFraction","transform","chartRect","chartWidth","chartHeight","seriesItem","AnimateHover","autoHide","animation","Margins","left","bottom","apply","cleanupCharts","WeakSet","positionDocument","stopMouseTracking","DOMTip","pos","previousIndex","previousNearestSeries","ownerChart","arrowtt","arrowWidth","arrowStyleBefore","followCursor","arrowStyleAfter","arrowBorderWidth","tip","domStylesBorderColor","domStylesBackgroundColor","ttstyle","moveDuration","snapNext","activeController","positionArrow","before","after","side","border","edge","sides","other","along","innerHTML","isLegacyIE","all","show","dest","domStyle","toolTip","runtimeDocument","body","ownerDocument","ie","createElement","setAttribute","className","getPropertyValue","borderWidth","head","appendChild","opacity","matchMedia","matches","animated","display","outerHTML","offsetWidth","offsetHeight","_scheduleFade","placed","u","eventTarget","documentElement","clientY","scrollTop","pageY","clientX","scrollLeft","pageX","getBoundingClientRect","overCanvas","current","currentSeries","currentIndex","calc","fromPos","layerY","fromSizeCalcIndex","interactionCanvas","startPos","minDistance","POSITIVE_INFINITY","distance","layerX","anchorPoint","canvasRect","tipRect","scrollX","scrollY","viewWidth","innerWidth","clientWidth","gap","anchorX","anchorY","minLeft","maxLeft","tooltipSide","arrowTop","below","arrowLeft","nearestSeries","n","animationVisible","animatePointer","drawPointAt","secondCircleRadius","secondCircleOpacity","firstCircleRadius","firstCircleOpacity","drawPoint","offsetLeft","node","offsetParent","f","animationDuration","transition","applySlide","timer","hide","element","isDOMTipOwner","DOMTipController","_enabled","renderer","CanvasGraphics","miterLimit","globalCompositeOperation","cpx","cpy","bezierCurveTo","cp1x","cp1y","cp2x","cp2y","startAngle","endAngle","counterclockwise","radii","fillRule","strokeRect","clearRect","segments","r0","r1","repetition","CanvasRenderer","ratio","pixelRatio","setPixelRatio","isFinite","applyTransform","setTransform","getContext","setContext","resize","pixelWidth","pixelHeight","displayed","getClientSize","grown","clientHeight","toBlob","type","quality","convertToBlob","encode","Promise","resolve","reject","blob","toDataURL","Annotation","getCanvasSize","cursor","visual","mouseinside","wasinside","initializeAnnotation","margins","transparent","isDom","domElement","_fontH","_thisH","_over","getDOMHeight","getDOMWidth","_isEmpty","shouldDraw","rowCount","row","annotation","doDraw","drawDOMText","oldz","ft","doMouseMove","newCursor","forceDraw","escapeHtml","ch","extendedRows","numbers","total","reduce","sum","diff","toolTipHtml","seriesName","label","details","ToolTip","shared","findPoint","realTime","extended","timID","delay","autoRedraw","render","onhide","ongettext","onshow","currP","oldX","oldY","deltaX","deltaY","_animOwner","_animationFrame","_cancelPending","_cleanupChart","_refreshVersion","domTip","splice","seriesList","seriesCount","seriesIndex","inStack","continuous","closestDistance","probe","base","candidateIndex","yMand","calcStack","refresh","stepAnimation","owner","moveToFraction","version","useAxes","xs","matchingIndex","findIndex","isInteger","isNull","sharedTooltipPoints","pointIndex","rowIndex","parts","tooltipParts","pointValue","valueText","toPercent","pointOrigin","stackShare","Boolean","html","legendColor","defaultText","domHtml","Title","_expand","expand","fontColor","calcRect","fromTop","borderSize","groups","beginParent","canvasSize","ff","endParent","Marks","arrow","showZero","drawEvery","placement","connector","drawPolar","center","markText","pointX","cos","pointY","sin","point2X","point2Y","donut","placementRadius","lineY","canDraw","factor","drawMark","rbot","is3d","rr","py","AxisTitle","drawIt","calcWordWrap","nextStep","calcIncrement","maxLabelSize","axisSize","tmp","less","sequential","isY","anySeriesHasLessThan","Axis","otherSide","custom","maxLabelDepth","grid","ticks","innerTicks","minorTicks","increment","log","endPos","end","increm","minAxisRange","integerSteps","headroom","axisPos","scroll","delta","minmaxLabelWidth","adjust","la","rowLabelsOf","le","mi","roundMin","ma","checkRange","checkMinMax","minXValue","minYValue","maxXValue","maxYValue","calcAxisScale","calcScale","hasAnySeries","__alwaysDraw","drawAxis","rad","drawGrids","NaN","vmin","isOrtho","orthogonal","off3d","oldpos","isCustomDash","mozCurrentTransform","lineZ","drawTicks","mult","tl","tl2","inc","cou","drawTitle","tmpX","tmpY","titleBounds","rotatedWidth","drawLabel","xDisplacement","yDisplacement","drawLabels","oldc","alter","fromSize","actualValue","closest","calcSize","calcMinMax","setMinMax","setPos","static","hasTitle","ti","bo","countAll","axisSeries","every","horizMargins","vertMargins","hasX","hasY","wallsize","haswalls","doHttpRequest","success","XMLHttpRequestConstructor","ActiveXObjectConstructor","console","makeHttpObject","onreadystatechange","readyState","status","responseText","statusText","open","send","RainbowPalette","Palette","grayScale","requestRedraw","redraw","_requestDraw","chartLocale","language","Series","maxPoints","isStack100","colorEachLine","_cancelGaugeAnimation","hiddenPoints","o2","_initialize","source","sortedOptions","sortedDrawAnimation","sortedValues","sortedValuesIndices","originalValues","sortedLabels","originalLabels","ascending","sorting","sortingAnimationType","legendStrokeColor","hover","ho","over","palette","paletteName","themeName","colorEach","_paintAxes","_paintWalls","sortValues","indices","sort","drawSortedValues","prevValues","endValues","setData","Symbol","iterator","TypeError","from","append","excess","getFill","isColorEach","setPointVisible","getFillStyle","titleText","HTMLTextAreaElement","HTMLInputElement","xml","seriesTag","pointTag","DOMParserConstructor","parseFromString","xmlDoc","async","loadXML","getElementsByTagName","getAttribute","parseXML","json","pp","payload","JSON","parse","metric","category","parseJSON","valueOrLabel","ArraySumAbs","res","dataText","_horizAxis","_vertAxis","getCanvasBounds","_index","sumAll","doHover","onhover","_scheduleDraw","initZ","_baseInitZ","recalcAxes","_baseCalc","getPointPosition","_baseRecalcAxes","getRect","_p","fixedFloatToLocal","locale","fractions","fixed","localeVal","substring","labelOrTitle","_e","markPos","drawMarks","inv","_baseMinXValue","_baseMinYValue","_baseMaxXValue","_baseMaxYValue","calcColorEach","stackMaxValue","asArray","calcRet","legendText","legendCount","addRandom","random","doSort","sortBy","A","toLowerCase","B","loadJSON","toJsonInput","cellRect","act","cols","visibleCount"],"mappings":";;;;;;;;;;;;;;AASM,SAAUA,EAAUC,EAAsBC,GAC/CD,EAAKE,OAAS,GACdF,EAAKG,OAAS,GACd,MAAMC,EAAQH,EAAKI,MAAM,MACzB,IAAK,IAAIC,EAAI,EAAGA,EAAIF,EAAMG,OAAQD,IAAK,CACtC,MAAME,EAASJ,EAAME,GAAGD,MAAM,KAC9B,IAAII,GAAc,EAClB,IAAK,MAAMC,KAASF,EAAQ,CAC3B,MAAMG,EAAQC,WAAWF,GACzB,IAAKG,OAAOC,MAAMH,GAAQ,CACzBF,GAAc,EACd,KACD,CACD,CACA,IAAKA,EAAa,CACjBT,EAAKE,OAAOI,GAAK,EACjB,QACD,CACA,IAAIK,EAAQC,WAA6B,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