highcharts
Version:
JavaScript charting framework
14 lines • 4.8 kB
JavaScript
/**
* Highstock JS v12.6.0 (2026-04-13)
* @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 t from"../highcharts.js";var e,o={};o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let r=t.default;var n=o.n(r);let a=t.default.SeriesRegistry;var i=o.n(a);let{doc:l,win:p}=n();function s(t){return h(t)&&"number"==typeof t.nodeType}function h(t,e){let o;return!!t&&"object"==typeof t&&(!e||"[object Array]"!==(o=Object.prototype.toString.call(t))&&"[object Array Iterator]"!==o)}function c(t,...e){let o,r=[t,...e],n={},a=function(t,e){return"object"!=typeof t&&(t={}),function(t,e,o){for(let o in t)Object.hasOwnProperty.call(t,o)&&e.call((0,t[o]),t[o],o,t)}(e,function(o,r){if("__proto__"!==r&&"constructor"!==r){let n;!h(o,!0)||(n=o?.constructor,h(o,!0)&&!s(o)&&n?.name&&"Object"!==n.name)||s(o)?t[r]=e[r]:t[r]=a(t[r]||{},o)}}),t};!0===t&&(n=r[1],r=Array.prototype.slice.call(r,2));let i=r.length;for(o=0;o<i;o++)n=a(n,r[o]);return n}function u(){let t=arguments,e=t.length;for(let o=0;o<e;o++){let e=t[o];if(null!=e)return e}}Array.prototype.find;let{sma:{prototype:f}}=i().seriesTypes;!function(t){let e=["bottomLine"],o=["top","bottom"],n=["top"];function a(t){return"plot"+t.charAt(0).toUpperCase()+t.slice(1)}function i(t,e){let o=[];return(t.pointArrayMap||[]).forEach(t=>{t!==e&&o.push(a(t))}),o}function l(){let t=this,e=t.pointValKey,o=t.linesApiNames,n=t.areaLinesNames,l=t.points,p=t.options,s=t.graph,h={options:{gapSize:p.gapSize}},u=[],y=i(t,e),m=l.length,d;if(y.forEach((t,e)=>{for(u[e]=[];m--;)d=l[m],u[e].push({x:d.x,plotX:d.plotX,plotY:d[t],isNull:null==d[t]});m=l.length}),t.userOptions.fillColor&&n.length){let e=u[y.indexOf(a(n[0]))],o=1===n.length?l:u[y.indexOf(a(n[1]))],r=t.color;t.points=o,t.nextPoints=e,t.color=t.userOptions.fillColor,t.options=c(l,h),t.graph=t.area,t.fillGraph=!0,f.drawGraph.call(t),t.area=t.graph,delete t.nextPoints,delete t.fillGraph,t.color=r}o.forEach((e,o)=>{u[o]?(t.points=u[o],p[e]?t.options=c(p[e].styles,h):(0,r.error)('Error: "There is no '+e+' in DOCS options declared. Check if linesApiNames are consistent with your DOCS line names."'),t.graph=t["graph"+e],f.drawGraph.call(t),t["graph"+e]=t.graph):(0,r.error)('Error: "'+e+" doesn't have equivalent in pointArrayMap. To many elements in linesApiNames relative to pointArrayMap.\"")}),t.points=l,t.options=p,t.graph=s,f.drawGraph.call(t)}function p(t){let e,o=[],r=[];if(t=t||this.points,this.fillGraph&&this.nextPoints){if((e=f.getGraphPath.call(this,this.nextPoints))&&e.length){e[0][0]="L",o=f.getGraphPath.call(this,t),r=e.slice(0,o.length);for(let t=r.length-1;t>=0;t--)o.push(r[t])}}else o=f.getGraphPath.apply(this,arguments);return o}function s(t){let e=[];return(this.pointArrayMap||[]).forEach(o=>{e.push(t[o])}),e}function h(){let t=this.pointArrayMap,e=[],o;e=i(this),f.translate.apply(this,arguments),this.points.forEach(r=>{t.forEach((t,n)=>{o=r[t],this.dataModify&&(o=this.dataModify.modifyValue(o)),null!==o&&(r[e[n]]=this.yAxis.toPixels(o,!0))})})}t.compose=function(t){let r=t.prototype;return r.linesApiNames=r.linesApiNames||e.slice(),r.pointArrayMap=r.pointArrayMap||o.slice(),r.pointValKey=r.pointValKey||"top",r.areaLinesNames=r.areaLinesNames||n.slice(),r.drawGraph=l,r.getGraphPath=p,r.toYData=s,r.translate=h,t}}(e||(e={}));let y=e,{sma:m}=i().seriesTypes;function d(t,e){let o=t[0],r=0,n;for(n=1;n<t.length;n++)("max"===e&&t[n]>=o||"min"===e&&t[n]<=o)&&(o=t[n],r=n);return r}class g extends m{getValues(t,e){let o,r,n,a,i,l=e.period,p=t.xData,s=t.yData,h=s?s.length:0,c=[],f=[],y=[];for(a=l-1;a<h;a++)n=d((i=s.slice(a-l+1,a+2)).map(function(t){return u(t[2],t)}),"min"),o=d(i.map(function(t){return u(t[1],t)}),"max")/l*100,r=n/l*100,p[a+1]&&(c.push([p[a+1],o,r]),f.push(p[a+1]),y.push([o,r]));return{values:c,xData:f,yData:y}}}g.defaultOptions=c(m.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"}}),function(t,e){let o;for(o in t||(t={}),e)t[o]=e[o]}(g.prototype,{areaLinesNames:[],linesApiNames:["aroonDown"],nameBase:"Aroon",pointArrayMap:["y","aroonDown"],pointValKey:"y"}),y.compose(g),i().registerSeriesType("aroon",g);let A=n();export{A as default};