highcharts
Version:
JavaScript charting framework
14 lines • 4.22 kB
JavaScript
/**
* Highstock JS v13.0.1 (2026-08-17)
* @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";let t={};t.n=e=>{let r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{if(Array.isArray(r))for(var a=0;a<r.length;){var o=r[a++],n=r[a++];t.o(e,o)?0===n&&a++:0===n?Object.defineProperty(e,o,{enumerable:!0,value:r[a++]}):Object.defineProperty(e,o,{enumerable:!0,get:n})}else for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);let r=e.default;var a,o=t.n(r);let n=e.default.SeriesRegistry;var i=t.n(n);let{sma:{prototype:s}}=i().seriesTypes;!function(e){let t=["bottomLine"],a=["top","bottom"],o=["top"];function n(e){return"plot"+e.charAt(0).toUpperCase()+e.slice(1)}function i(e,t){let r=[];return(e.pointArrayMap||[]).forEach(e=>{e!==t&&r.push(n(e))}),r}function p(){let e=this,t=e.pointValKey,a=e.linesApiNames,o=e.areaLinesNames,p=e.points,l=e.options,h=e.graph,c={options:{gapSize:l.gapSize}},f=[],u=i(e,t),y=p.length,d;if(u.forEach((e,t)=>{for(f[t]=[];y--;)d=p[y],f[t].push({x:d.x,plotX:d.plotX,plotY:d[e],isNull:!(0,r.defined)(d[e])});y=p.length}),e.userOptions.fillColor&&o.length){let t=f[u.indexOf(n(o[0]))],a=1===o.length?p:f[u.indexOf(n(o[1]))],i=e.color;e.points=a,e.nextPoints=t,e.color=e.userOptions.fillColor,e.options=(0,r.merge)(p,c),e.graph=e.area,e.fillGraph=!0,s.drawGraph.call(e),e.area=e.graph,delete e.nextPoints,delete e.fillGraph,e.color=i}a.forEach((t,a)=>{f[a]?(e.points=f[a],l[t]?e.options=(0,r.merge)(l[t].styles,c):(0,r.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],s.drawGraph.call(e),e["graph"+t]=e.graph):(0,r.error)('Error: "'+t+" doesn't have equivalent in pointArrayMap. To many elements in linesApiNames relative to pointArrayMap.\"")}),e.points=p,e.options=l,e.graph=h,s.drawGraph.call(e)}function l(e){let t,r=[],a=[];if(e=e||this.points,this.fillGraph&&this.nextPoints){if((t=s.getGraphPath.call(this,this.nextPoints))&&t.length){t[0][0]="L",r=s.getGraphPath.call(this,e),a=t.slice(0,r.length);for(let e=a.length-1;e>=0;e--)r.push(a[e])}}else r=s.getGraphPath.apply(this,arguments);return r}function h(e){let t=[];return(this.pointArrayMap||[]).forEach(r=>{t.push(e[r])}),t}function c(){let e=this.pointArrayMap,t=[],r;t=i(this),s.translate.apply(this,arguments),this.points.forEach(a=>{e.forEach((e,o)=>{r=a[e],this.dataModify&&(r=this.dataModify.modifyValue(r)),null!==r&&(a[t[o]]=this.yAxis.toPixels(r,!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=p,r.getGraphPath=l,r.toYData=h,r.translate=c,e}}(a||(a={}));let p=a,{sma:l}=i().seriesTypes;function h(e,t){let r=e[0],a=0,o;for(o=1;o<e.length;o++)("max"===t&&e[o]>=r||"min"===t&&e[o]<=r)&&(r=e[o],a=o);return a}class c extends l{getValues(e,t){let a,o,n,i,s,p=t.period,l=e.xData,c=e.yData,f=c?c.length:0,u=[],y=[],d=[];for(i=p-1;i<f;i++)n=h((s=c.slice(i-p+1,i+2)).map(function(e){return(0,r.pick)(e[2],e)}),"min"),a=h(s.map(function(e){return(0,r.pick)(e[1],e)}),"max")/p*100,o=n/p*100,l[i+1]&&(u.push([l[i+1],a,o]),y.push(l[i+1]),d.push([a,o]));return{values:u,xData:y,yData:d}}}c.defaultOptions=(0,r.merge)(l.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"}}),(0,r.extend)(c.prototype,{areaLinesNames:[],linesApiNames:["aroonDown"],nameBase:"Aroon",pointArrayMap:["y","aroonDown"],pointValKey:"y"}),p.compose(c),i().registerSeriesType("aroon",c);let f=o();export{f as default};