1/* * 2 * 3 * (c) 2010-2024 Torstein Honsi 4 * 5 * License: www.highcharts.com/license 6 * 7 * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!! 8 * 9 * */ 10'use strict'; 11import PlotLineOrBandAxis from './PlotLineOrBandAxis.js'; 12import U from '../../Utilities.js'; 13const { addEvent, arrayMax, arrayMin, defined, destroyObjectProperties, erase, fireEvent, merge, objectEach, pick } = U; 14/* * 15 * 16 * Class 17 * 18 * */ 19/** 20 * The object wrapper for plot lines and plot bands 21 * 22 * @class 23 * @name Highcharts.PlotLineOrBand 24 * 25 * @param {Highcharts.Axis} axis 26 * Related axis. 27 * 28 * @param {Highcharts.AxisPlotLinesOptions|Highcharts.AxisPlotBandsOptions} [options] 29 * Options to use. 30 */ 31class PlotLineOrBand { 32 /* * 33 * 34 * Static Functions 35 * 36 * */ 37 static compose(ChartClass, AxisClass) { 38 addEvent(ChartClass, 'afterInit', function () { 39 this.labelCollectors.push(() => { 40 const labels = []; 41 for (const axis of this.axes) { 42 for (const { label, options } of axis.plotLinesAndBands) { 43 if (label && !options?.label?.allowOverlap) { 44 labels.push(label); 45 } 46 } 47 } 48 return labels; 49 }); 50 }); 51 return PlotLineOrBandAxis.compose(PlotLineOrBand, AxisClass); 52 } 53 /* * 54 * 55 * Constructor 56 * 57 * */ 58 constructor(axis, options) { 59 /** 60 * Related axis. 61 * 62 * @name Highcharts.PlotLineOrBand#axis 63 * @type {Highcharts.Axis} 64 */ 65 this.axis = axis; 66 /** 67 * Options of the plot line or band. 68 * 69 * @name Highcharts.PlotLineOrBand#options 70 * @type {AxisPlotBandsOptions|AxisPlotLinesOptions} 71 */ 72 this.options = options; 73 this.id = options.id; 74 } 75 /* * 76 * 77 * Functions 78 * 79 * */ 80 /* eslint-disable no-invalid-this, valid-jsdoc */ 81 /** 82 * Render the plot line or plot band. If it is already existing, 83 * move it. 84 * @private 85 * @function Highcharts.PlotLineOrBand#render 86 */ 87 render() { 88 fireEvent(this, 'render'); 89 const { axis, options } = this, { horiz, logarithmic } = axis, { color, events, zIndex = 0 } = options, { renderer, time } = axis.chart, groupAttribs = {}, 90 // These properties only exist on either band or line 91 to = time.parse(options.to), from = time.parse(options.from), value = time.parse(options.value), borderWidth = options.borderWidth; 92 let optionsLabel = options.label, { label, svgElem } = this, path = [], group; 93 const isBand = defined(from) && defined(to), isLine = defined(value), isNew = !svgElem, attribs = { 94 'class': 'highcharts-plot-' + (isBand ? 'band ' : 'line ') + 95 (options.className || '') 96 }; 97 let groupName = isBand ? 'bands' : 'lines'; 98 // Set the presentational attributes 99 if (!axis.chart.styledMode) { 100 if (isLine) { 101 attribs.stroke = color || "#999999" /* Palette.neutralColor40 */; 102 attribs['stroke-width'] = pick(options.width, 1); 103 if (options.dashStyle) { 104 attribs.dashstyle = options.dashStyle; 105 } 106 } 107 else if (isBand) { // Plot band 108 attribs.fill = color || "#e6e9ff" /* Palette.highlightColor10 */; 109 if (borderWidth) { 110 attribs.stroke = options.borderColor; 111 attribs['stroke-width'] = borderWidth; 112 } 113 } 114 } 115 // Grouping and zIndex 116 groupAttribs.zIndex = zIndex; 117 groupName += '-' + zIndex; 118 group = axis.plotLinesAndBandsGroups[groupName]; 119 if (!group) { 120 axis.plotLinesAndBandsGroups[groupName] = group = 121 renderer.g('plot-' + groupName) 122 .attr(groupAttribs).add(); 123 } 124 // Create the path 125 if (!svgElem) { 126 /** 127 * SVG element of the plot line or band. 128 * 129 * @name Highcharts.PlotLineOrBand#svgElem 130 * @type {Highcharts.SVGElement} 131 */ 132 this.svgElem = svgElem = renderer 133 .path() 134 .attr(attribs) 135 .add(group); 136 } 137 // Set the path or return 138 if (defined(value)) { // Plot line 139 path = axis.getPlotLinePath({ 140 value: logarithmic?.log2lin(value) ?? value,
141 lineWidth: svgElem.strokeWidth(), 142 acrossPanes: options.acrossPanes 143 }); 144 } 145 else if (defined(from) && defined(to)) { // Plot band 146 path = axis.getPlotBandPath(logarithmic?.log2lin(from) ?? from, logarithmic?.log2lin(to) ?? to, options); 147 } 148 else { 149 return; 150 } 151 // Common for lines and bands. Add events only if they were not added 152 // before. 153 if (!this.eventsAdded && events) { 154 objectEach(events, (event, eventType) => { 155 svgElem?.on(eventType, (e) => { 156 events[eventType].apply(this, [e]); 157 }); 158 }); 159 this.eventsAdded = true; 160 } 161 if ((isNew || !svgElem.d) && path?.length) { 162 svgElem.attr({ d: path }); 163 } 164 else if (svgElem) { 165 if (path) { 166 svgElem.show(); 167 svgElem.animate({ d: path }); 168 } 169 else if (svgElem.d) { 170 svgElem.hide(); 171 if (label) { 172 this.label = label = label.destroy(); 173 } 174 } 175 } 176 // The plot band/line label 177 if (optionsLabel && 178 (defined(optionsLabel.text) || defined(optionsLabel.formatter)) && 179 path?.length && 180 axis.width > 0 && 181 axis.height > 0 && 182 !path.isFlat) { 183 // Apply defaults 184 optionsLabel = merge({ 185 align: horiz && isBand ? 'center' : void 0, 186 x: horiz ? !isBand && 4 : 10, 187 verticalAlign: !horiz && isBand ? 'middle' : void 0, 188 y: horiz ? isBand ? 16 : 10 : isBand ? 6 : -4, 189 rotation: horiz && !isBand ? 90 : 0, 190 ...(isBand ? { inside: true } : {}) 191 }, optionsLabel); 192 this.renderLabel(optionsLabel, path, isBand, zIndex); 193 // Move out of sight 194 } 195 else if (label) { 196 label.hide(); 197 } 198 // Chainable 199 return this; 200 } 201 /** 202 * Render and align label for plot line or band. 203 * @private 204 * @function Highcharts.PlotLineOrBand#renderLabel 205 */ 206 renderLabel(optionsLabel, path, isBand, zIndex) { 207 const plotLine = this, axis = plotLine.axis, renderer = axis.chart.renderer, inside = optionsLabel.inside; 208 let label = plotLine.label; 209 // Add the SVG element 210 if (!label) { 211 /** 212 * SVG element of the label. 213 * 214 * @name Highcharts.PlotLineOrBand#label 215 * @type {Highcharts.SVGElement} 216 */ 217 plotLine.label = label = renderer 218 .text(this.getLabelText(optionsLabel), 0, 0, optionsLabel.useHTML) 219 .attr({ 220 align: optionsLabel.textAlign || optionsLabel.align, 221 rotation: optionsLabel.rotation, 222 'class': 'highcharts-plot-' + (isBand ? 'band' : 'line') + 223 '-label ' + (optionsLabel.className || ''), 224 zIndex 225 }); 226 if (!axis.chart.styledMode) { 227 label.css(merge({ 228 fontSize: '0.8em', 229 textOverflow: (isBand && !inside) ? '' : 'ellipsis' 230 }, optionsLabel.style)); 231 } 232 label.add(); 233 } 234 // Get the bounding box and align the label 235 // #3000 changed to better handle choice between plotband or plotline 236 const xBounds = path.xBounds || 237 [path[0][1], path[1][1], (isBand ? path[2][1] : path[0][1])], yBounds = path.yBounds || 238 [path[0][2], path[1][2], (isBand ? path[2][2] : path[0][2])], x = arrayMin(xBounds), y = arrayMin(yBounds), bBoxWidth = arrayMax(xBounds) - x; 239 label.align(optionsLabel, false, { 240 x, 241 y, 242 width: bBoxWidth, 243 height: arrayMax(yBounds) - y 244 }); 245 if (!label.alignValue || 246 label.alignValue === 'left' || 247 defined(inside)) { 248 label.css({ 249 width: (optionsLabel.style?.width || ((!isBand || 250 !inside) ? (label.rotation === 90 ? 251 axis.height - (label.alignAttr.y - 252 axis.top) : (optionsLabel.clip ? 253 axis.width : 254 axis.chart.chartWidth) - (label.alignAttr.x - axis.left)) : 255 bBoxWidth)) + 'px' 256 }); 257 } 258 label.show(true); 259 } 260 /** 261 * Get label's text content. 262 * @private 263 * @function Highcharts.PlotLineOrBand#getLabelText 264 */ 265 getLabelText(optionsLabel) { 266 return defined(optionsLabel.formatter) ? 267 optionsLabel.formatter 268 .call(this) : 269 optionsLabel.text; 270 } 271 /** 272 * Remove the plot line or band. 273 * 274 * @function Highcharts.PlotLineOrBand#destroy 275 */ 276 destroy() { 277 // Remove it from the lookup 278 erase(this.axis.plotLinesAndBands, this); 279 delete this.axis; 280 destroyObjectProperties(this); 281 } 282} 283/* * 284 * 285 * Default Export 286 * 287 * */ 288export default PlotLineOrBand; 289/* * 290 * 291 * API Options 292 * 293 * */ 294/** 295 * Options for plot bands on axes. 296 * 297 * @typedef {Highcharts.XAxisPlotBandsOptions|Highcharts.YAxisPlotBandsOptions|Highcharts.ZAxisPlotBandsOptions} Highcharts.AxisPlotBandsOptions 298 */ 299/** 300 * Options for plot band labels on axes. 301 * 302 * @typedef {Highcharts.XAxisPlotBandsLabelOptions|Highcharts.YAxisPlotBandsLabelOptions|Highcharts.ZAxisPlotBandsLabelOptions} Highcharts.AxisPlotBandsLabelOptions 303 */ 304/** 305 * Options for plot lines on axes. 306 * 307 * @typedef {Highcharts.XAxisPlotLinesOptions|Highcharts.YAxisPlotLinesOptions|Highcharts.ZAxisPlotLinesOptions} Highcharts.AxisPlotLinesOptions 308 */ 309/** 310 * Options for plot line labels on axes. 311 * 312 * @typedef {Highcharts.XAxisPlotLinesLabelOptions|Highcharts.YAxisPlotLinesLabelOptions|Highcharts.ZAxisPlotLinesLabelOptions} Highcharts.AxisPlotLinesLabelOptions 313 */ 314(''); 315/* * 316 * 317 * API Options 318 * 319 * */ 320/** 321 * An array of colored bands stretching across the plot area marking an 322 * interval on the axis. 323 * 324 * In styled mode, the plot bands are styled by the `.highcharts-plot-band` 325 * class in addition to the `className` option. 326 * 327 * @productdesc {highcharts} 328 * In a gauge, a plot band on the Y axis (value axis) will stretch along the 329 * perimeter of the gauge. 330 * 331 * @type {Array<*>} 332 * @product highcharts highstock gantt 333 * @apioption xAxis.plotBands 334 */ 335/** 336 * Flag to decide if plotBand should be rendered across all panes. 337 * 338 * @since 7.1.2 339 * @product highstock 340 * @type {boolean} 341 * @default true 342 * @apioption xAxis.plotBands.acrossPanes 343 */ 344/** 345 * Border color for the plot band. Also requires `borderWidth` to be set. 346 * 347 * @type {Highcharts.ColorString} 348 * @apioption xAxis.plotBands.borderColor 349 */ 350/** 351 * Border radius for the plot band. Applies only to gauges. Can be a pixel 352 * value or a percentage, for example `50%`. 353 * 354 * @type {number|string} 355 * @since 11.4.2 356 * @sample {highcharts}
356 highcharts/xaxis/plotbands-gauge-borderradius 357 * Angular gauge with rounded plot bands 358 * @apioption xAxis.plotBands.borderRadius 359 */ 360/** 361 * Border width for the plot band. Also requires `borderColor` to be set. 362 * 363 * @type {number} 364 * @default 0 365 * @apioption xAxis.plotBands.borderWidth 366 */ 367/** 368 * A custom class name, in addition to the default `highcharts-plot-band`, 369 * to apply to each individual band. 370 * 371 * @type {string} 372 * @since 5.0.0 373 * @apioption xAxis.plotBands.className 374 */ 375/** 376 * The color of the plot band. 377 * 378 * @sample {highcharts} highcharts/xaxis/plotbands-color/ 379 * Color band 380 * @sample {highstock} stock/xaxis/plotbands/ 381 * Plot band on Y axis 382 * 383 * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject} 384 * @default ${palette.highlightColor10} 385 * @apioption xAxis.plotBands.color 386 */ 387/** 388 * An object defining mouse events for the plot band. Supported properties 389 * are `click`, `mouseover`, `mouseout`, `mousemove`. 390 * 391 * @sample {highcharts} highcharts/xaxis/plotbands-events/ 392 * Mouse events demonstrated 393 * 394 * @since 1.2 395 * @apioption xAxis.plotBands.events 396 */ 397/** 398 * Click event on a plot band. 399 * 400 * @type {Highcharts.EventCallbackFunction<Highcharts.PlotLineOrBand>} 401 * @apioption xAxis.plotBands.events.click 402 */ 403/** 404 * Mouse move event on a plot band. 405 * 406 * @type {Highcharts.EventCallbackFunction<Highcharts.PlotLineOrBand>} 407 * @apioption xAxis.plotBands.events.mousemove 408 */ 409/** 410 * Mouse out event on the corner of a plot band. 411 * 412 * @type {Highcharts.EventCallbackFunction<Highcharts.PlotLineOrBand>} 413 * @apioption xAxis.plotBands.events.mouseout 414 */ 415/** 416 * Mouse over event on a plot band. 417 * 418 * @type {Highcharts.EventCallbackFunction<Highcharts.PlotLineOrBand>} 419 * @apioption xAxis.plotBands.events.mouseover 420 */ 421/** 422 * The start position of the plot band in axis units. 423 * 424 * On datetime axes, the value can be given as a timestamp or a date string. 425 * 426 * @sample {highcharts} highcharts/xaxis/plotbands-color/ 427 * Datetime axis 428 * @sample {highcharts} highcharts/xaxis/plotbands-from/ 429 * Categorized axis 430 * @sample {highstock} stock/xaxis/plotbands/ 431 * Plot band on Y axis 432 * 433 * @type {number|string} 434 * @apioption xAxis.plotBands.from 435 */ 436/** 437 * An id used for identifying the plot band in Axis.removePlotBand. 438 * 439 * @sample {highcharts} highcharts/xaxis/plotbands-id/ 440 * Remove plot band by id 441 * @sample {highstock} highcharts/xaxis/plotbands-id/ 442 * Remove plot band by id 443 * 444 * @type {string} 445 * @apioption xAxis.plotBands.id 446 */ 447/** 448 * The end position of the plot band in axis units. 449 * 450 * On datetime axes, the value can be given as a timestamp or a date string. 451 * 452 * @sample {highcharts} highcharts/xaxis/plotbands-color/ 453 * Datetime axis 454 * @sample {highcharts} highcharts/xaxis/plotbands-from/ 455 * Categorized axis 456 * @sample {highstock} stock/xaxis/plotbands/ 457 * Plot band on Y axis 458 * 459 * @type {number|string} 460 * @apioption xAxis.plotBands.to 461 */ 462/** 463 * The z index of the plot band within the chart, relative to other 464 * elements. Using the same z index as another element may give 465 * unpredictable results, as the last rendered element will be on top. 466 * Values from 0 to 20 make sense. 467 * 468 * @sample {highcharts} highcharts/xaxis/plotbands-color/ 469 * Behind plot lines by default 470 * @sample {highcharts} highcharts/xaxis/plotbands-zindex/ 471 * Above plot lines 472 * @sample {highcharts} highcharts/xaxis/plotbands-zindex-above-series/ 473 * Above plot lines and series 474 * 475 * @type {number} 476 * @since 1.2 477 * @apioption xAxis.plotBands.zIndex 478 */ 479/** 480 * Text labels for the plot bands 481 * 482 * @product highcharts highstock gantt 483 * @apioption xAxis.plotBands.label 484 */ 485/** 486 * Horizontal alignment of the label. Can be one of "left", "center" or 487 * "right". 488 * 489 * @sample {highcharts} highcharts/xaxis/plotbands-label-align/ 490 * Aligned to the right 491 * @sample {highstock} stock/xaxis/plotbands-label/ 492 * Plot band with labels 493 * 494 * @type {Highcharts.AlignValue} 495 * @default center 496 * @since 2.1 497 * @apioption xAxis.plotBands.label.align 498 */ 499/** 500 * Whether or not the label can be hidden if it overlaps with another label. 501 * 502 * @sample {highcharts} highcharts/xaxis/plotbands-label-allowoverlap/ 503 * A Plotband label overlapping another 504 * 505 * @type {boolean} 506 * @default undefined 507 * @since 11.4.8 508 * @apioption xAxis.plotBands.label.allowOverlap 509 */ 510/** 511 * Wether or not the text of the label can exceed the width of the label. 512 * 513 * @type {boolean} 514 * @product highcharts highstock gantt 515 * @sample {highcharts} highcharts/xaxis/plotbands-label-textwidth/ 516 * Displaying text with text-wrapping/ellipsis, or the full text. 517 * 518 * @default true 519 * @since 11.4.6 520 * @apioption xAxis.plotBands.label.inside 521 */ 522/** 523 * Rotation of the text label in degrees . 524 * 525 * @sample {highcharts} highcharts/xaxis/plotbands-label-rotation/ 526 * Vertical text 527 * 528 * @type {number} 529 * @default 0 530 * @since 2.1 531 * @apioption xAxis.plotBands.label.rotation 532 */ 533/**
534 * CSS styles for the text label. 535 * 536 * In styled mode, the labels are styled by the 537 * `.highcharts-plot-band-label` class. 538 * 539 * @sample {highcharts} highcharts/xaxis/plotbands-label-style/ 540 * Blue and bold label 541 * 542 * @type {Highcharts.CSSObject} 543 * @since 2.1 544 * @apioption xAxis.plotBands.label.style 545 */ 546/** 547 * The string text itself. A subset of HTML is supported. 548 * 549 * @type {string} 550 * @since 2.1 551 * @apioption xAxis.plotBands.label.text 552 */ 553/** 554 * The text alignment for the label. While `align` determines where the 555 * texts anchor point is placed within the plot band, `textAlign` determines 556 * how the text is aligned against its anchor point. Possible values are 557 * "left", "center" and "right". Defaults to the same as the `align` option. 558 * 559 * @sample {highcharts} highcharts/xaxis/plotbands-label-rotation/ 560 * Vertical text in center position but text-aligned left 561 * 562 * @type {Highcharts.AlignValue} 563 * @since 2.1 564 * @apioption xAxis.plotBands.label.textAlign 565 */ 566/** 567 * Whether to [use HTML](https://www.highcharts.com/docs/chart-concepts/labels-and-string-formatting#html) 568 * to render the labels. 569 * 570 * @type {boolean} 571 * @default false 572 * @since 3.0.3 573 * @apioption xAxis.plotBands.label.useHTML 574 */ 575/** 576 * Vertical alignment of the label relative to the plot band. Can be one of 577 * "top", "middle" or "bottom". 578 * 579 * @sample {highcharts} highcharts/xaxis/plotbands-label-verticalalign/ 580 * Vertically centered label 581 * @sample {highstock} stock/xaxis/plotbands-label/ 582 * Plot band with labels 583 * 584 * @type {Highcharts.VerticalAlignValue} 585 * @default top 586 * @since 2.1 587 * @apioption xAxis.plotBands.label.verticalAlign 588 */ 589/** 590 * Horizontal position relative the alignment. Default varies by 591 * orientation. 592 * 593 * @sample {highcharts} highcharts/xaxis/plotbands-label-align/ 594 * Aligned 10px from the right edge 595 * @sample {highstock} stock/xaxis/plotbands-label/ 596 * Plot band with labels 597 * 598 * @type {number} 599 * @since 2.1 600 * @apioption xAxis.plotBands.label.x 601 */ 602/** 603 * Vertical position of the text baseline relative to the alignment. Default 604 * varies by orientation. 605 * 606 * @sample {highcharts} highcharts/xaxis/plotbands-label-y/ 607 * Label on x axis 608 * @sample {highstock} stock/xaxis/plotbands-label/ 609 * Plot band with labels 610 * 611 * @type {number} 612 * @since 2.1 613 * @apioption xAxis.plotBands.label.y 614 */ 615/** 616 * An array of lines stretching across the plot area, marking a specific 617 * value on one of the axes. 618 * 619 * In styled mode, the plot lines are styled by the 620 * `.highcharts-plot-line` class in addition to the `className` option. 621 * 622 * @type {Array<*>} 623 * @product highcharts highstock gantt 624 * @sample {highcharts} highcharts/xaxis/plotlines-color/ 625 * Basic plot line 626 * @sample {highcharts} highcharts/series-solidgauge/labels-auto-aligned/ 627 * Solid gauge plot line 628 * @apioption xAxis.plotLines 629 */ 630/** 631 * Flag to decide if plotLine should be rendered across all panes. 632 * 633 * @sample {highstock} stock/xaxis/plotlines-acrosspanes/ 634 * Plot lines on different panes 635 * 636 * @since 7.1.2 637 * @product highstock 638 * @type {boolean} 639 * @default true 640 * @apioption xAxis.plotLines.acrossPanes 641 */ 642/** 643 * A custom class name, in addition to the default `highcharts-plot-line`, 644 * to apply to each individual line. 645 * 646 * @type {string} 647 * @since 5.0.0 648 * @apioption xAxis.plotLines.className 649 */ 650/** 651 * The color of the line. 652 * 653 * @sample {highcharts} highcharts/xaxis/plotlines-color/ 654 * A red line from X axis 655 * @sample {highstock} stock/xaxis/plotlines/ 656 * Plot line on Y axis 657 * 658 * @type {Highcharts.ColorString} 659 * @default ${palette.neutralColor40} 660 * @apioption xAxis.plotLines.color 661 */ 662/** 663 * The dashing or dot style for the plot line. For possible values see 664 * [this overview](https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-dashstyle-all/). 665 * 666 * @sample {highcharts} highcharts/xaxis/plotlines-dashstyle/ 667 * Dash and dot pattern 668 * @sample {highstock} stock/xaxis/plotlines/ 669 * Plot line on Y axis 670 * 671 * @type {Highcharts.DashStyleValue} 672 * @default Solid 673 * @since 1.2 674 * @apioption xAxis.plotLines.dashStyle 675 */ 676/** 677 * An object defining mouse events for the plot line. Supported 678 * properties are `click`, `mouseover`, `mouseout`, `mousemove`. 679 * 680 * @sample {highcharts} highcharts/xaxis/plotlines-events/ 681 * Mouse events demonstrated 682 * 683 * @since 1.2 684 * @apioption xAxis.plotLines.events 685 */ 686/** 687 * Click event on a plot band. 688 * 689 * @type {Highcharts.EventCallbackFunction<Highcharts.PlotLineOrBand>} 690 * @apioption xAxis.plotLines.events.click 691 */ 692/** 693 * Mouse move event on a plot band. 694 * 695 * @type {Highcharts.EventCallbackFunction<Highcharts.PlotLineOrBand>} 696 * @apioption xAxis.plotLines.events.mousemove 697 */ 698/** 699 * Mouse out event on the corner of a plot band. 700 * 701 * @type {Highcharts.EventCallbackFunction<Highcharts.PlotLineOrBand>} 702 * @apioption xAxis.plotLines.events.mouseout 703 */ 704/** 705 * Mouse over event on a plot band. 706 * 707 * @type {Highcharts.EventCallbackFunction<Highcharts.PlotLineOrBand>} 708 * @apioption xAxis.plotLines.events.mouseover 709 */ 710/** 711 * An id used for identifying the plot line in Axis.removePlotLine. 712 * 713 * @sample {highcharts} highcharts/xaxis/plotlines-id/ 714 * Remove plot line by id 715 * 716 * @type {string} 717 * @apioption xAxis.plotLines.id 718 */ 719/** 720 * The position of the line in axis units. 721 * 722 * On datetime axes, the value can be given as a timestamp or a date string. 723 * 724 * @sample {highcharts} highcharts/xaxis/plotlines-color/ 725 * Between two categories on X axis 726 * @sample {highstock} stock/xaxis/plotlines/ 727 * Plot line on Y axis 728 * 729 * @type {number|string} 730 * @apioption xAxis.plotLines.value 731 */ 732/** 733 * The width or thickness of the plot line. 734 * 735 * @sample {highcharts} highcharts/xaxis/plotlines-color/ 736 * 2px wide line from X axis 737 * @sample {highstock} stock/xaxis/plotlines/ 738 * Plot line on Y axis 739 * 740 * @type {number} 741 * @default 2 742 * @apioption xAxis.plotLines.width 743 */ 744/** 745 * The z index of the plot line within the chart. 746 * 747 * @sample {highcharts} highcharts/xaxis/plotlines-zindex-behind/ 748 * Behind plot lines by default 749 * @sample {highcharts} highcharts/xaxis/plotlines-zindex-above/ 750 * Above plot lines 751 * @sample {highcharts} highcharts/xaxis/plotlines-zindex-above-all/ 752 * Above plot lines and series 753 * 754 * @type {number} 755 * @since 1.2 756 * @apioption xAxis.plotLines.zIndex 757 */ 758/** 759 * Text labels for the plot bands 760 * 761 * @apioption xAxis.plotLines.label 762 */ 763/** 764 * Horizontal alignment of the label. Can be one of "left", "center" or 765 * "right". 766 * 767 * @sample {highcharts} highcharts/xaxis/plotlines-label-align-right/ 768 * Aligned to the right 769 * @sample {highstock} stock/xaxis/plotlines/ 770 * Plot line on Y axis 771 * 772 * @type {Highcharts.AlignValue} 773 * @default left 774 * @since 2.1 775 * @apioption xAxis.plotLines.label.align 776 */ 777/** 778 * Whether to hide labels that are outside the plot area. 779 * 780 * @type {boolean} 781 * @default false 782 * @since 10.3.3 783 * @apioption xAxis.plotLines.labels.clip 784 */ 785/** 786 * Callback JavaScript function to format the label. Useful properties like 787 * the value of plot line or the range of plot band (`from` & `to` 788 * properties) can be found in `this.options` object. 789 * 790 * @sample {highcharts} highcharts/xaxis/plotlines-plotbands-label-formatter 791 * Label formatters for plot line and plot band. 792 * @type {Highcharts.FormatterCallbackFunction<Highcharts.PlotLineOrBand>} 793 * @apioption xAxis.plotLines.label.formatter 794 */ 795/** 796 * Rotation of the text label in degrees. Defaults to 0 for horizontal plot 797 * lines and 90 for vertical lines. 798 * 799 * @sample {highcharts} highcharts/xaxis/plotlines-label-verticalalign-middle/ 800 * Slanted text 801 * 802 * @type {number} 803 * @since 2.1 804 * @apioption xAxis.plotLines.label.rotation 805 */ 806/**
807 * CSS styles for the text label. 808 * 809 * In styled mode, the labels are styled by the 810 * `.highcharts-plot-line-label` class. 811 * 812 * @sample {highcharts} highcharts/xaxis/plotlines-label-style/ 813 * Blue and bold label 814 * 815 * @type {Highcharts.CSSObject} 816 * @since 2.1 817 * @apioption xAxis.plotLines.label.style 818 */ 819/** 820 * The text itself. A subset of HTML is supported. 821 * 822 * @type {string} 823 * @since 2.1 824 * @apioption xAxis.plotLines.label.text 825 */ 826/** 827 * The text alignment for the label. While `align` determines where the 828 * texts anchor point is placed within the plot band, `textAlign` determines 829 * how the text is aligned against its anchor point. Possible values are 830 * "left", "center" and "right". Defaults to the same as the `align` option. 831 * 832 * @sample {highcharts} highcharts/xaxis/plotlines-label-textalign/ 833 * Text label in bottom position 834 * 835 * @type {Highcharts.AlignValue} 836 * @since 2.1 837 * @apioption xAxis.plotLines.label.textAlign 838 */ 839/** 840 * Whether to [use HTML](https://www.highcharts.com/docs/chart-concepts/labels-and-string-formatting#html) 841 * to render the labels. 842 * 843 * @type {boolean} 844 * @default false 845 * @since 3.0.3 846 * @apioption xAxis.plotLines.label.useHTML 847 */ 848/** 849 * Vertical alignment of the label relative to the plot line. Can be 850 * one of "top", "middle" or "bottom". 851 * 852 * @sample {highcharts} highcharts/xaxis/plotlines-label-verticalalign-middle/ 853 * Vertically centered label 854 * 855 * @type {Highcharts.VerticalAlignValue} 856 * @default {highcharts} top 857 * @default {highstock} top 858 * @since 2.1 859 * @apioption xAxis.plotLines.label.verticalAlign 860 */ 861/** 862 * Horizontal position relative the alignment. Default varies by 863 * orientation. 864 * 865 * @sample {highcharts} highcharts/xaxis/plotlines-label-align-right/ 866 * Aligned 10px from the right edge 867 * @sample {highstock} stock/xaxis/plotlines/ 868 * Plot line on Y axis 869 * 870 * @type {number} 871 * @since 2.1 872 * @apioption xAxis.plotLines.label.x 873 */ 874/** 875 * Vertical position of the text baseline relative to the alignment. Default 876 * varies by orientation. 877 * 878 * @sample {highcharts} highcharts/xaxis/plotlines-label-y/ 879 * Label below the plot line 880 * @sample {highstock} stock/xaxis/plotlines/ 881 * Plot line on Y axis 882 * 883 * @type {number} 884 * @since 2.1 885 * @apioption xAxis.plotLines.label.y 886 */ 887/** 888 * @type {Array<*>} 889 * @extends xAxis.plotBands 890 * @apioption yAxis.plotBands 891 */ 892/** 893 * In a gauge chart, this option determines the inner radius of the 894 * plot band that stretches along the perimeter. It can be given as 895 * a percentage string, like `"100%"`, or as a pixel number, like `100`. 896 * By default, the inner radius is controlled by the [thickness]( 897 * #yAxis.plotBands.thickness) option. 898 * 899 * @sample {highcharts} highcharts/xaxis/plotbands-gauge 900 * Gauge plot band 901 * 902 * @type {number|string} 903 * @since 2.3 904 * @product highcharts 905 * @apioption yAxis.plotBands.innerRadius 906 */ 907/** 908 * In a gauge chart, this option determines the outer radius of the 909 * plot band that stretches along the perimeter. It can be given as 910 * a percentage string, like `"100%"`, or as a pixel number, like `100`. 911 * 912 * @sample {highcharts} highcharts/xaxis/plotbands-gauge 913 * Gauge plot band 914 * 915 * @type {number|string} 916 * @default 100% 917 * @since 2.3 918 * @product highcharts 919 * @apioption yAxis.plotBands.outerRadius 920 */ 921/** 922 * In a gauge chart, this option sets the width of the plot band 923 * stretching along the perimeter. It can be given as a percentage 924 * string, like `"10%"`, or as a pixel number, like `10`. The default 925 * value 10 is the same as the default [tickLength](#yAxis.tickLength), 926 * thus making the plot band act as a background for the tick markers. 927 * 928 * @sample {highcharts} highcharts/xaxis/plotbands-gauge 929 * Gauge plot band 930 * 931 * @type {number|string} 932 * @default 10 933 * @since 2.3 934 * @product highcharts 935 * @apioption yAxis.plotBands.thickness 936 */ 937/** 938 * @type {Array<*>} 939 * @extends xAxis.plotLines 940 * @apioption yAxis.plotLines 941 */ 942(''); // Keeps doclets above in JS file
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.