highcharts
Version:
JavaScript charting framework
9 lines • 3.93 kB
JavaScript
/**
* Highstock JS v11.3.0 (2024-01-10)
*
* Indicator series type for Highcharts Stock
*
* (c) 2010-2024 Wojciech Chmiel
*
* License: www.highcharts.com/license
*/!function(t){"object"==typeof module&&module.exports?(t.default=t,module.exports=t):"function"==typeof define&&define.amd?define("highcharts/indicators/aroon-oscillator",["highcharts","highcharts/modules/stock"],function(e){return t(e),t.Highcharts=e,t}):t("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(t){"use strict";var e=t?t._modules:{};function o(t,e,o,i){t.hasOwnProperty(e)||(t[e]=i.apply(null,o),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:e,module:t[e]}})))}o(e,"Stock/Indicators/MultipleLinesComposition.js",[e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e){var o;let{sma:{prototype:i}}=t.seriesTypes,{defined:a,error:s,merge:n}=e;return function(t){let e=["bottomLine"],o=["top","bottom"],r=["top"];function l(t){return"plot"+t.charAt(0).toUpperCase()+t.slice(1)}function p(t,e){let o=[];return(t.pointArrayMap||[]).forEach(t=>{t!==e&&o.push(l(t))}),o}function h(){let t=this,e=t.pointValKey,o=t.linesApiNames,r=t.areaLinesNames,h=t.points,c=t.options,u=t.graph,f={options:{gapSize:c.gapSize}},d=[],y=p(t,e),g=h.length,m;if(y.forEach((t,e)=>{for(d[e]=[];g--;)m=h[g],d[e].push({x:m.x,plotX:m.plotX,plotY:m[t],isNull:!a(m[t])});g=h.length}),t.userOptions.fillColor&&r.length){let e=y.indexOf(l(r[0])),o=d[e],a=1===r.length?h:d[y.indexOf(l(r[1]))],s=t.color;t.points=a,t.nextPoints=o,t.color=t.userOptions.fillColor,t.options=n(h,f),t.graph=t.area,t.fillGraph=!0,i.drawGraph.call(t),t.area=t.graph,delete t.nextPoints,delete t.fillGraph,t.color=s}o.forEach((e,o)=>{d[o]?(t.points=d[o],c[e]?t.options=n(c[e].styles,f):s('Error: "There is no '+e+' in DOCS options declared. Check if linesApiNames are consistent with your DOCS line names."'),t.graph=t["graph"+e],i.drawGraph.call(t),t["graph"+e]=t.graph):s('Error: "'+e+" doesn't have equivalent in pointArrayMap. To many elements in linesApiNames relative to pointArrayMap.\"")}),t.points=h,t.options=c,t.graph=u,i.drawGraph.call(t)}function c(t){let e,o=[],a=[];if(t=t||this.points,this.fillGraph&&this.nextPoints){if((e=i.getGraphPath.call(this,this.nextPoints))&&e.length){e[0][0]="L",o=i.getGraphPath.call(this,t),a=e.slice(0,o.length);for(let t=a.length-1;t>=0;t--)o.push(a[t])}}else o=i.getGraphPath.apply(this,arguments);return o}function u(t){let e=[];return(this.pointArrayMap||[]).forEach(o=>{e.push(t[o])}),e}function f(){let t=this.pointArrayMap,e=[],o;e=p(this),i.translate.apply(this,arguments),this.points.forEach(i=>{t.forEach((t,a)=>{o=i[t],this.dataModify&&(o=this.dataModify.modifyValue(o)),null!==o&&(i[e[a]]=this.yAxis.toPixels(o,!0))})})}t.compose=function(t){let i=t.prototype;return i.linesApiNames=i.linesApiNames||e.slice(),i.pointArrayMap=i.pointArrayMap||o.slice(),i.pointValKey=i.pointValKey||"top",i.areaLinesNames=i.areaLinesNames||r.slice(),i.drawGraph=h,i.getGraphPath=c,i.toYData=u,i.translate=f,t}}(o||(o={})),o}),o(e,"Stock/Indicators/AroonOscillator/AroonOscillatorIndicator.js",[e["Stock/Indicators/MultipleLinesComposition.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,o){let{aroon:i}=e.seriesTypes,{extend:a,merge:s}=o;class n extends i{getValues(t,e){let o,i;let a=[],s=[],n=[],r=super.getValues.call(this,t,e);for(i=0;i<r.yData.length;i++)o=r.yData[i][0]-r.yData[i][1],a.push([r.xData[i],o]),s.push(r.xData[i]),n.push(o);return{values:a,xData:s,yData:n}}}return n.defaultOptions=s(i.defaultOptions,{tooltip:{pointFormat:'<span style="color:{point.color}">●</span><b> {series.name}</b>: {point.y}'}}),a(n.prototype,{nameBase:"Aroon Oscillator",linesApiNames:[],pointArrayMap:["y"],pointValKey:"y"}),t.compose(i),e.registerSeriesType("aroonoscillator",n),n}),o(e,"masters/indicators/aroon-oscillator.src.js",[],function(){})});