123456789101112131415161718192021 |
- /*
- Highcharts JS v10.3.3 (2023-01-20)
- Highcharts variwide module
- (c) 2010-2021 Torstein Honsi
- License: www.highcharts.com/license
- */
- (function(a){"object"===typeof module&&module.exports?(a["default"]=a,module.exports=a):"function"===typeof define&&define.amd?define("highcharts/modules/variwide",["highcharts"],function(g){a(g);a.Highcharts=g;return a}):a("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(a){function g(a,h,g,e){a.hasOwnProperty(h)||(a[h]=e.apply(null,g),"function"===typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:h,module:a[h]}})))}a=a?a._modules:{};g(a,
- "Series/Variwide/VariwideComposition.js",[a["Core/Utilities.js"]],function(a){function h(d){this.variwide&&this.cross&&this.cross.attr("stroke-width",d.point&&d.point.crosshairWidth)}function g(){var d=this;!this.horiz&&this.variwide&&this.chart.labelCollectors.push(function(){return d.tickPositions.filter(function(c){return d.ticks[c].label}).map(function(c,b){c=d.ticks[c].label;c.labelrank=d.zData[b];return c})})}function e(d){var c=this.axis,b=c.horiz?"x":"y";c.variwide&&(this[b+"Orig"]=d.pos[b],
- this.postTranslate(d.pos,b,this.pos))}function t(d,c,b){var a=this.axis,k=d[c]-a.pos;a.horiz||(k=a.len-k);k=a.series[0].postTranslate(b,k);a.horiz||(k=a.len-k);d[c]=a.pos+k}function p(a,c,b,f,k,u,m,v){var d=Array.prototype.slice.call(arguments,1),n=k?"x":"y";this.axis.variwide&&"number"===typeof this[n+"Orig"]&&(d[k?0:1]=this[n+"Orig"]);d=a.apply(this,d);this.axis.variwide&&this.axis.categories&&this.postTranslate(d,n,this.pos);return d}var f=a.addEvent,q=a.wrap,l=[];return{compose:function(a,c){-1===
- l.indexOf(a)&&(l.push(a),f(a,"afterDrawCrosshair",h),f(a,"afterRender",g));-1===l.indexOf(c)&&(l.push(c),f(c,"afterGetPosition",e),a=c.prototype,a.postTranslate=t,q(a,"getLabelPosition",p))}}});g(a,"Series/Variwide/VariwidePoint.js",[a["Core/Series/SeriesRegistry.js"],a["Core/Utilities.js"]],function(a,h){var g=this&&this.__extends||function(){var a=function(e,f){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,f){a.__proto__=f}||function(a,f){for(var d in f)f.hasOwnProperty(d)&&
- (a[d]=f[d])};return a(e,f)};return function(e,f){function g(){this.constructor=e}a(e,f);e.prototype=null===f?Object.create(f):(g.prototype=f.prototype,new g)}}(),e=h.isNumber;return function(a){function h(){var f=null!==a&&a.apply(this,arguments)||this;f.crosshairWidth=void 0;f.options=void 0;f.series=void 0;return f}g(h,a);h.prototype.isValid=function(){return e(this.y)&&e(this.z)};return h}(a.seriesTypes.column.prototype.pointClass)});g(a,"Series/Variwide/VariwideSeries.js",[a["Core/Series/SeriesRegistry.js"],
- a["Series/Variwide/VariwideComposition.js"],a["Series/Variwide/VariwidePoint.js"],a["Core/Utilities.js"]],function(a,g,r,e){var h=this&&this.__extends||function(){var a=function(c,b){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return a(c,b)};return function(c,b){function d(){this.constructor=c}a(c,b);c.prototype=null===b?Object.create(b):(d.prototype=b.prototype,new d)}}(),p=a.seriesTypes.column,
- f=e.extend,q=e.merge,l=e.pick;e=function(d){function c(){var a=null!==d&&d.apply(this,arguments)||this;a.data=void 0;a.options=void 0;a.points=void 0;a.relZ=void 0;a.totalZ=void 0;a.zData=void 0;return a}h(c,d);c.prototype.processData=function(c){this.totalZ=0;this.relZ=[];a.seriesTypes.column.prototype.processData.call(this,c);(this.xAxis.reversed?this.zData.slice().reverse():this.zData).forEach(function(a,c){this.relZ[c]=this.totalZ;this.totalZ+=a},this);this.xAxis.categories&&(this.xAxis.variwide=
- !0,this.xAxis.zData=this.zData)};c.prototype.postTranslate=function(a,c,d){var b=this.xAxis,m=this.relZ;a=b.reversed?m.length-a:a;var f=b.reversed?-1:1,e=b.toPixels(b.reversed?(b.dataMax||0)+b.pointRange:b.dataMin||0),g=b.toPixels(b.reversed?b.dataMin||0:(b.dataMax||0)+b.pointRange),k=Math.abs(g-e),h=this.totalZ;b=this.chart.inverted?g-(this.chart.plotTop-f*b.minPixelPadding):e-this.chart.plotLeft-f*b.minPixelPadding;e=a/m.length*k;g=(a+f)/m.length*k;var n=l(m[a],h)/h*k;m=l(m[a+f],h)/h*k;d&&(d.crosshairWidth=
- m-n);return b+n+(c-(b+e))*(m-n)/(g-e)};c.prototype.translate=function(){var b=this.options.crisp,c=this.xAxis;this.options.crisp=!1;a.seriesTypes.column.prototype.translate.call(this);this.options.crisp=b;var d=this.chart.inverted,f=this.borderWidth%2/2;this.points.forEach(function(a,b){if(c.variwide){var e=this.postTranslate(b,a.shapeArgs.x,a);b=this.postTranslate(b,a.shapeArgs.x+a.shapeArgs.width)}else e=a.plotX,b=c.translate(a.x+a.z,0,0,0,1);this.options.crisp&&(e=Math.round(e)-f,b=Math.round(b)-
- f);a.shapeArgs.x=e;a.shapeArgs.width=Math.max(b-e,1);a.plotX=(e+b)/2;d?a.tooltipPos[1]=c.len-a.shapeArgs.x-a.shapeArgs.width/2:a.tooltipPos[0]=a.shapeArgs.x+a.shapeArgs.width/2},this);this.options.stacking&&this.correctStackLabels()};c.prototype.correctStackLabels=function(){for(var a=this.options,c=this.yAxis,d,e,f,g=0,h=this.points;g<h.length;g++){var l=h[g];f=l.x;e=l.shapeArgs.width;(d=c.stacking.stacks[(this.negStacks&&l.y<(a.startFromThreshold?0:a.threshold)?"-":"")+this.stackKey])&&(d=d[f])&&
- !l.isNull&&d.setOffset(this.chart.plotLeft-(e/2||0),e||0,void 0,void 0,l.plotX,this.xAxis)}};c.compose=g.compose;c.defaultOptions=q(p.defaultOptions,{pointPadding:0,groupPadding:0});return c}(p);f(e.prototype,{irregularWidths:!0,pointArrayMap:["y","z"],parallelArrays:["x","y","z"],pointClass:r});a.registerSeriesType("variwide",e);"";return e});g(a,"masters/modules/variwide.src.js",[a["Core/Globals.js"],a["Series/Variwide/VariwideSeries.js"]],function(a,g){g.compose(a.Axis,a.Tick)})});
- //# sourceMappingURL=variwide.js.map
|