UNPKG

highcharts

Version:
14 lines 3 kB
!/** * Highstock JS v13.0.1 (2026-08-17) * @module highcharts/modules/price-indicator * @requires highcharts * @requires highcharts/modules/stock * * (c) 2018-2026 Highsoft AS * Author: Sebastian Bochan * * Price indicator for Highcharts Stock * * A commercial license may be required depending on use, * see www.highcharts.com/license */function(e,s){"object"==typeof exports&&"object"==typeof module?module.exports=s(e._Highcharts):"function"==typeof define&&define.amd?define("highcharts/modules/price-indicator",["highcharts/highcharts"],function(e){return s(e)}):"object"==typeof exports?exports["highcharts/modules/price-indicator"]=s(e._Highcharts):e.Highcharts=s(e.Highcharts)}("u"<typeof window?this:window,e=>(()=>{"use strict";var s,t={944(s){s.exports=e}};let i={};function r(e){let s=i[e];if(void 0!==s)return s.exports;let o=i[e]={exports:{}};return t[e](o,o.exports,r),o.exports}r.n=e=>{let s=e&&e.__esModule?()=>e.default:()=>e;return r.d(s,{a:s}),s},r.d=(e,s)=>{if(Array.isArray(s))for(var t=0;t<s.length;){var i=s[t++],o=s[t++];r.o(e,i)?0===o&&t++:0===o?Object.defineProperty(e,i,{enumerable:!0,value:s[t++]}):Object.defineProperty(e,i,{enumerable:!0,get:o})}else for(var i in s)r.o(s,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:s[i]})},r.o=(e,s)=>Object.prototype.hasOwnProperty.call(e,s);let o={};r.d(o,{default:()=>h});var a=r(944),l=r.n(a);let{composed:c}=l();s=l().Series,(0,a.pushUnique)(c,"PriceIndication")&&((0,a.addEvent)(s,"afterRender",function(){let e=this.options,s=e.lastVisiblePrice,t=e.lastPrice;if((s||t)&&"highcharts-navigator-series"!==e.id&&this.visible){let{points:i,xAxis:r,yAxis:o}=this,{cross:l,crosshair:c,crossLabel:h}=o,n=i.length,d=this.dataTable.rowCount,b=this.getColumn("x")[d-1],p=this.getColumn("y")[d-1]??this.getColumn("close")[d-1];if(t?.enabled&&(o.crosshair=o.options.crosshair=e.lastPrice,!this.chart.styledMode&&o.crosshair&&o.options.crosshair&&e.lastPrice&&(o.crosshair.color=o.options.crosshair.color=e.lastPrice.color||this.color),o.cross=this.lastPrice,this.lastPriceLabel&&this.lastPriceLabel.destroy(),delete o.crossLabel,o.drawCrosshair(void 0,{x:b,y:p,plotX:r.toPixels(b,!0),plotY:o.toPixels(p,!0)}),this.yAxis.cross&&(this.lastPrice=this.yAxis.cross,this.lastPrice.addClass("highcharts-color-"+this.colorIndex),this.lastPrice.y=p),this.lastPriceLabel=o.crossLabel),s?.enabled&&n>0){o.crosshair=o.options.crosshair=(0,a.merge)({color:"transparent"},e.lastVisiblePrice),o.cross=this.lastVisiblePrice;let s=i[n-1].isInside?i[n-1]:i[n-2];this.lastVisiblePriceLabel?.destroy(),delete o.crossLabel,o.drawCrosshair(void 0,s),o.cross&&(this.lastVisiblePrice=o.cross,s&&"number"==typeof s.y&&(this.lastVisiblePrice.y=s.y)),this.lastVisiblePriceLabel=o.crossLabel}o.crosshair=o.options.crosshair=c,o.cross=l,o.crossLabel=h}}),(0,a.addEvent)(s,"hide",function(){let e=this;["lastPrice","lastPriceLabel","lastVisiblePrice","lastVisiblePriceLabel"].forEach(s=>{e[s]?.hide()})}));let h=l();return o.default})());