package.indicators.bollinger-bands.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of highcharts Show documentation
Show all versions of highcharts Show documentation
JavaScript charting framework
The newest version!
!/**
* Highstock JS v11.4.8 (2024-08-29)
*
* Indicator series type for Highcharts Stock
*
* (c) 2010-2024 Paweł Fus
*
* 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/bollinger-bands",["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 i(e,i,o,s){e.hasOwnProperty(i)||(e[i]=s.apply(null,o),"function"==typeof CustomEvent&&t.win.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:i,module:e[i]}})))}i(e,"Stock/Indicators/MultipleLinesComposition.js",[e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e){var i;let{sma:{prototype:o}}=t.seriesTypes,{defined:s,error:n,merge:a}=e;return function(t){let e=["bottomLine"],i=["top","bottom"],r=["top"];function l(t){return"plot"+t.charAt(0).toUpperCase()+t.slice(1)}function p(t,e){let i=[];return(t.pointArrayMap||[]).forEach(t=>{t!==e&&i.push(l(t))}),i}function h(){let t=this,e=t.pointValKey,i=t.linesApiNames,r=t.areaLinesNames,h=t.points,c=t.options,d=t.graph,u={options:{gapSize:c.gapSize}},f=[],m=p(t,e),y=h.length,g;if(m.forEach((t,e)=>{for(f[e]=[];y--;)g=h[y],f[e].push({x:g.x,plotX:g.plotX,plotY:g[t],isNull:!s(g[t])});y=h.length}),t.userOptions.fillColor&&r.length){let e=f[m.indexOf(l(r[0]))],i=1===r.length?h:f[m.indexOf(l(r[1]))],s=t.color;t.points=i,t.nextPoints=e,t.color=t.userOptions.fillColor,t.options=a(h,u),t.graph=t.area,t.fillGraph=!0,o.drawGraph.call(t),t.area=t.graph,delete t.nextPoints,delete t.fillGraph,t.color=s}i.forEach((e,i)=>{f[i]?(t.points=f[i],c[e]?t.options=a(c[e].styles,u):n('Error: "There is no '+e+' in DOCS options declared. Check if linesApiNames are consistent with your DOCS line names."'),t.graph=t["graph"+e],o.drawGraph.call(t),t["graph"+e]=t.graph):n('Error: "'+e+" doesn't have equivalent in pointArrayMap. To many elements in linesApiNames relative to pointArrayMap.\"")}),t.points=h,t.options=c,t.graph=d,o.drawGraph.call(t)}function c(t){let e,i=[],s=[];if(t=t||this.points,this.fillGraph&&this.nextPoints){if((e=o.getGraphPath.call(this,this.nextPoints))&&e.length){e[0][0]="L",i=o.getGraphPath.call(this,t),s=e.slice(0,i.length);for(let t=s.length-1;t>=0;t--)i.push(s[t])}}else i=o.getGraphPath.apply(this,arguments);return i}function d(t){let e=[];return(this.pointArrayMap||[]).forEach(i=>{e.push(t[i])}),e}function u(){let t=this.pointArrayMap,e=[],i;e=p(this),o.translate.apply(this,arguments),this.points.forEach(o=>{t.forEach((t,s)=>{i=o[t],this.dataModify&&(i=this.dataModify.modifyValue(i)),null!==i&&(o[e[s]]=this.yAxis.toPixels(i,!0))})})}t.compose=function(t){let o=t.prototype;return o.linesApiNames=o.linesApiNames||e.slice(),o.pointArrayMap=o.pointArrayMap||i.slice(),o.pointValKey=o.pointValKey||"top",o.areaLinesNames=o.areaLinesNames||r.slice(),o.drawGraph=h,o.getGraphPath=c,o.toYData=d,o.translate=u,t}}(i||(i={})),i}),i(e,"Stock/Indicators/BB/BBIndicator.js",[e["Stock/Indicators/MultipleLinesComposition.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,i){let{sma:o}=e.seriesTypes,{extend:s,isArray:n,merge:a}=i;class r extends o{init(){e.seriesTypes.sma.prototype.init.apply(this,arguments),this.options=a({topLine:{styles:{lineColor:this.color}},bottomLine:{styles:{lineColor:this.color}}},this.options)}getValues(t,i){let o,s,a,r,l,p,h,c,d;let u=i.period,f=i.standardDeviation,m=[],y=[],g=t.xData,b=t.yData,x=b?b.length:0,C=[];if(g.length● {series.name}
Top: {point.top}
Middle: {point.middle}
Bottom: {point.bottom}
'},marker:{enabled:!1},dataGrouping:{approximation:"averages"}}),s(r.prototype,{areaLinesNames:["top","bottom"],linesApiNames:["topLine","bottomLine"],nameComponents:["period","standardDeviation"],pointArrayMap:["top","middle","bottom"],pointValKey:"middle"}),t.compose(r),e.registerSeriesType("bb",r),r}),i(e,"masters/indicators/bollinger-bands.src.js",[e["Core/Globals.js"]],function(t){return t})});