highcharts
Version:
JavaScript charting framework
14 lines • 3.99 kB
JavaScript
/**
* Highstock JS v12.5.0 (2026-01-12)
* @module highcharts/indicators/aroon
* @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";var t,a={};a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var o in t)a.o(t,o)&&!a.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);let o=e.default;var r=a.n(o);let n=e.default.SeriesRegistry;var i=a.n(n);let{sma:{prototype:s}}=i().seriesTypes,{defined:p,error:l,merge:h}=r();!function(e){let t=["bottomLine"],a=["top","bottom"],o=["top"];function r(e){return"plot"+e.charAt(0).toUpperCase()+e.slice(1)}function n(e,t){let a=[];return(e.pointArrayMap||[]).forEach(e=>{e!==t&&a.push(r(e))}),a}function i(){let e=this,t=e.pointValKey,a=e.linesApiNames,o=e.areaLinesNames,i=e.points,c=e.options,u=e.graph,f={options:{gapSize:c.gapSize}},y=[],m=n(e,t),d=i.length,g;if(m.forEach((e,t)=>{for(y[t]=[];d--;)g=i[d],y[t].push({x:g.x,plotX:g.plotX,plotY:g[e],isNull:!p(g[e])});d=i.length}),e.userOptions.fillColor&&o.length){let t=y[m.indexOf(r(o[0]))],a=1===o.length?i:y[m.indexOf(r(o[1]))],n=e.color;e.points=a,e.nextPoints=t,e.color=e.userOptions.fillColor,e.options=h(i,f),e.graph=e.area,e.fillGraph=!0,s.drawGraph.call(e),e.area=e.graph,delete e.nextPoints,delete e.fillGraph,e.color=n}a.forEach((t,a)=>{y[a]?(e.points=y[a],c[t]?e.options=h(c[t].styles,f):l('Error: "There is no '+t+' in DOCS options declared. Check if linesApiNames are consistent with your DOCS line names."'),e.graph=e["graph"+t],s.drawGraph.call(e),e["graph"+t]=e.graph):l('Error: "'+t+" doesn't have equivalent in pointArrayMap. To many elements in linesApiNames relative to pointArrayMap.\"")}),e.points=i,e.options=c,e.graph=u,s.drawGraph.call(e)}function c(e){let t,a=[],o=[];if(e=e||this.points,this.fillGraph&&this.nextPoints){if((t=s.getGraphPath.call(this,this.nextPoints))&&t.length){t[0][0]="L",a=s.getGraphPath.call(this,e),o=t.slice(0,a.length);for(let e=o.length-1;e>=0;e--)a.push(o[e])}}else a=s.getGraphPath.apply(this,arguments);return a}function u(e){let t=[];return(this.pointArrayMap||[]).forEach(a=>{t.push(e[a])}),t}function f(){let e=this.pointArrayMap,t=[],a;t=n(this),s.translate.apply(this,arguments),this.points.forEach(o=>{e.forEach((e,r)=>{a=o[e],this.dataModify&&(a=this.dataModify.modifyValue(a)),null!==a&&(o[t[r]]=this.yAxis.toPixels(a,!0))})})}e.compose=function(e){let r=e.prototype;return r.linesApiNames=r.linesApiNames||t.slice(),r.pointArrayMap=r.pointArrayMap||a.slice(),r.pointValKey=r.pointValKey||"top",r.areaLinesNames=r.areaLinesNames||o.slice(),r.drawGraph=i,r.getGraphPath=c,r.toYData=u,r.translate=f,e}}(t||(t={}));let c=t,{sma:u}=i().seriesTypes,{extend:f,merge:y,pick:m}=r();function d(e,t){let a=e[0],o=0,r;for(r=1;r<e.length;r++)("max"===t&&e[r]>=a||"min"===t&&e[r]<=a)&&(a=e[r],o=r);return o}class g extends u{getValues(e,t){let a,o,r,n,i,s=t.period,p=e.xData,l=e.yData,h=l?l.length:0,c=[],u=[],f=[];for(n=s-1;n<h;n++)r=d((i=l.slice(n-s+1,n+2)).map(function(e){return m(e[2],e)}),"min"),a=d(i.map(function(e){return m(e[1],e)}),"max")/s*100,o=r/s*100,p[n+1]&&(c.push([p[n+1],a,o]),u.push(p[n+1]),f.push([a,o]));return{values:c,xData:u,yData:f}}}g.defaultOptions=y(u.defaultOptions,{params:{index:void 0,period:25},marker:{enabled:!1},tooltip:{pointFormat:'<span style="color:{point.color}">●</span><b> {series.name}</b><br/>Aroon Up: {point.y}<br/>Aroon Down: {point.aroonDown}<br/>'},aroonDown:{styles:{lineWidth:1,lineColor:void 0}},dataGrouping:{approximation:"averages"}}),f(g.prototype,{areaLinesNames:[],linesApiNames:["aroonDown"],nameBase:"Aroon",pointArrayMap:["y","aroonDown"],pointValKey:"y"}),c.compose(g),i().registerSeriesType("aroon",g);let A=r();export{A as default};