UNPKG

highcharts

Version:
14 lines 3.77 kB
/** * Highstock JS v13.0.1 (2026-08-17) * @module highcharts/indicators/aroon-oscillator * @requires highcharts * @requires highcharts/modules/stock * * Indicator series type for Highcharts Stock * * (c) 2010-2026 Highsoft AS * Author: Wojciech Chmiel * * A commercial license may be required depending on use, * see www.highcharts.com/license */import*as e from"../highcharts.js";let t={};t.n=e=>{let a=e&&e.__esModule?()=>e.default:()=>e;return t.d(a,{a:a}),a},t.d=(e,a)=>{if(Array.isArray(a))for(var r=0;r<a.length;){var o=a[r++],i=a[r++];t.o(e,o)?0===i&&r++:0===i?Object.defineProperty(e,o,{enumerable:!0,value:a[r++]}):Object.defineProperty(e,o,{enumerable:!0,get:i})}else for(var o in a)t.o(a,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:a[o]})},t.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);let a=e.default;var r,o=t.n(a);let i=e.default.SeriesRegistry;var s=t.n(i);let{sma:{prototype:n}}=s().seriesTypes;!function(e){let t=["bottomLine"],r=["top","bottom"],o=["top"];function i(e){return"plot"+e.charAt(0).toUpperCase()+e.slice(1)}function s(e,t){let a=[];return(e.pointArrayMap||[]).forEach(e=>{e!==t&&a.push(i(e))}),a}function l(){let e=this,t=e.pointValKey,r=e.linesApiNames,o=e.areaLinesNames,l=e.points,p=e.options,h=e.graph,c={options:{gapSize:p.gapSize}},f=[],u=s(e,t),y=l.length,g;if(u.forEach((e,t)=>{for(f[t]=[];y--;)g=l[y],f[t].push({x:g.x,plotX:g.plotX,plotY:g[e],isNull:!(0,a.defined)(g[e])});y=l.length}),e.userOptions.fillColor&&o.length){let t=f[u.indexOf(i(o[0]))],r=1===o.length?l:f[u.indexOf(i(o[1]))],s=e.color;e.points=r,e.nextPoints=t,e.color=e.userOptions.fillColor,e.options=(0,a.merge)(l,c),e.graph=e.area,e.fillGraph=!0,n.drawGraph.call(e),e.area=e.graph,delete e.nextPoints,delete e.fillGraph,e.color=s}r.forEach((t,r)=>{f[r]?(e.points=f[r],p[t]?e.options=(0,a.merge)(p[t].styles,c):(0,a.error)('Error: "There is no '+t+' in DOCS options declared. Check if linesApiNames are consistent with your DOCS line names."'),e.graph=e["graph"+t],n.drawGraph.call(e),e["graph"+t]=e.graph):(0,a.error)('Error: "'+t+" doesn't have equivalent in pointArrayMap. To many elements in linesApiNames relative to pointArrayMap.\"")}),e.points=l,e.options=p,e.graph=h,n.drawGraph.call(e)}function p(e){let t,a=[],r=[];if(e=e||this.points,this.fillGraph&&this.nextPoints){if((t=n.getGraphPath.call(this,this.nextPoints))&&t.length){t[0][0]="L",a=n.getGraphPath.call(this,e),r=t.slice(0,a.length);for(let e=r.length-1;e>=0;e--)a.push(r[e])}}else a=n.getGraphPath.apply(this,arguments);return a}function h(e){let t=[];return(this.pointArrayMap||[]).forEach(a=>{t.push(e[a])}),t}function c(){let e=this.pointArrayMap,t=[],a;t=s(this),n.translate.apply(this,arguments),this.points.forEach(r=>{e.forEach((e,o)=>{a=r[e],this.dataModify&&(a=this.dataModify.modifyValue(a)),null!==a&&(r[t[o]]=this.yAxis.toPixels(a,!0))})})}e.compose=function(e){let a=e.prototype;return a.linesApiNames=a.linesApiNames||t.slice(),a.pointArrayMap=a.pointArrayMap||r.slice(),a.pointValKey=a.pointValKey||"top",a.areaLinesNames=a.areaLinesNames||o.slice(),a.drawGraph=l,a.getGraphPath=p,a.toYData=h,a.translate=c,e}}(r||(r={}));let l=r,{aroon:p}=s().seriesTypes;class h extends p{getValues(e,t){let a,r,o=[],i=[],s=[],n=super.getValues.call(this,e,t);for(r=0;r<n.yData.length;r++)a=n.yData[r][0]-n.yData[r][1],o.push([n.xData[r],a]),i.push(n.xData[r]),s.push(a);return{values:o,xData:i,yData:s}}}h.defaultOptions=(0,a.merge)(p.defaultOptions,{tooltip:{pointFormat:'<span style="color:{point.color}">●</span><b> {series.name}</b>: {point.y}'}}),(0,a.extend)(h.prototype,{nameBase:"Aroon Oscillator",linesApiNames:[],pointArrayMap:["y"],pointValKey:"y"}),l.compose(p),s().registerSeriesType("aroonoscillator",h);let c=o();export{c as default};