9 lines
102 KiB
JavaScript
9 lines
102 KiB
JavaScript
|
!/**
|
||
|
* Highstock JS v11.4.1 (2024-04-04)
|
||
|
*
|
||
|
* Highcharts Stock as a plugin for Highcharts
|
||
|
*
|
||
|
* (c) 2010-2024 Torstein Honsi
|
||
|
*
|
||
|
* 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/modules/stock",["highcharts"],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(t,e,i,s){t.hasOwnProperty(e)||(t[e]=s.apply(null,i),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:e,module:t[e]}})))}i(e,"Series/DataModifyComposition.js",[e["Core/Axis/Axis.js"],e["Core/Series/Point.js"],e["Core/Series/Series.js"],e["Core/Utilities.js"]],function(t,e,i,s){var o;let{tooltipFormatter:r}=e.prototype,{addEvent:a,arrayMax:n,arrayMin:l,correctFloat:h,defined:d,isArray:p,isNumber:c,isString:u,pick:g}=s;return function(t){function e(t,e,i){!this.isXAxis&&(this.series.forEach(function(i){"compare"===t&&"boolean"!=typeof e?i.setCompare(e,!1):"cumulative"!==t||u(e)||i.setCumulative(e,!1)}),g(i,!0)&&this.chart.redraw())}function i(t){let e=this,{numberFormatter:i}=e.series.chart,s=function(s){t=t.replace("{point."+s+"}",(e[s]>0&&"change"===s?"+":"")+i(e[s],g(e.series.tooltipOptions.changeDecimals,2)))};return d(e.change)&&s("change"),d(e.cumulativeSum)&&s("cumulativeSum"),r.apply(this,[t])}function s(){let t;let e=this.options.compare;("percent"===e||"value"===e||this.options.cumulative)&&(t=new y(this),"percent"===e||"value"===e?t.initCompare(e):t.initCumulative()),this.dataModify=t}function o(t){let e=t.dataExtremes,i=e.activeYData;if(this.dataModify&&e){let t;this.options.compare?t=[this.dataModify.modifyValue(e.dataMin),this.dataModify.modifyValue(e.dataMax)]:this.options.cumulative&&p(i)&&i.length>=2&&(t=y.getCumulativeExtremes(i)),t&&(e.dataMin=l(t),e.dataMax=n(t))}}function f(t,e){this.options.compare=this.userOptions.compare=t,this.update({},g(e,!0)),this.dataModify&&("value"===t||"percent"===t)?this.dataModify.initCompare(t):this.points.forEach(t=>{delete t.change})}function x(){if(this.xAxis&&this.processedYData&&this.dataModify){let t=this.processedXData,e=this.processedYData,i=e.length,s=!0===this.options.compareStart?0:1,o=-1,r;for(this.pointArrayMap&&(o=this.pointArrayMap.indexOf(this.options.pointValKey||this.pointValKey||"y")),r=0;r<i-s;r++){let i=e[r]&&o>-1?e[r][o]:e[r];if(c(i)&&0!==i&&t[r+s]>=(this.xAxis.min||0)){this.dataModify.compareValue=i;break}}}}function m(t,e){this.setModifier("compare",t,e)}function b(t,e){t=g(t,!1),this.options.cumulative=this.userOptions.cumulative=t,this.update({},g(e,!0)),this.dataModify?this.dataModify.initCumulative():this.points.forEach(t=>{delete t.cumulativeSum})}function v(t,e){this.setModifier("cumulative",t,e)}t.compose=function(t,r,n){let l=r.prototype,h=n.prototype,d=t.prototype;return d.setCompare||(d.setCompare=f,d.setCumulative=b,a(t,"afterInit",s),a(t,"afterGetExtremes",o),a(t,"afterProcessData",x)),l.setCompare||(l.setCompare=m,l.setModifier=e,l.setCumulative=v,h.tooltipFormatter=i),t};class y{constructor(t){this.series=t}modifyValue(){return 0}static getCumulativeExtremes(t){let e=1/0,i=-1/0;return t.reduce((t,s)=>{let o=t+s;return e=Math.min(e,o,t),i=Math.max(i,o,t),o}),[e,i]}initCompare(t){this.modifyValue=function(e,i){null===e&&(e=0);let s=this.compareValue;if(void 0!==e&&void 0!==s){if("value"===t?e-=s:e=e/s*100-(100===this.series.options.compareBase?0:100),void 0!==i){let t=this.series.points[i];t&&(t.change=e)}return e}return 0}}initCumulative(){this.modifyValue=function(t,e){if(null===t&&(t=0),void 0!==t&&void 0!==e){let i=e>0?this.series.points[e-1]:null;i&&i.cumulativeSum&&(t=h(i.cumulativeSum+t));let s=this.series.points[e];return s&&(s.cumulativeSum=t),t}return 0}}}t.Additions=y}(o||(o={})),o}),i(e,"Stock/Navigator/ChartNavigatorComposition.js",[e["Core/Globals.js"],e["Core/Utilities.js"]],function(t,e){let i;let{isTouchDevice:s}=t,{addEvent:o,merge:r,pick:a}=e,n=[];function l(){this.navigator&&this.navigator.setBaseSeries(null,!1)}function h(){let t,e,i;let s=this.legend,o=this.navigator;if(o){t=s&&s.options,e=o.xAxis,i=o.yAxis;let{scrollbarHeight:r,scrollB
|