oldie.js 12.5 KB
/*
 Highcharts JS v7.2.0 (2019-09-03)

 Old IE (v6, v7, v8) module for Highcharts v6+.

 (c) 2010-2019 Highsoft AS
 Author: Torstein Honsi

 License: www.highcharts.com/license
*/
(function(f){"object"===typeof module&&module.exports?(f["default"]=f,module.exports=f):"function"===typeof define&&define.amd?define("highcharts/modules/oldie",["highcharts"],function(k){f(k);f.Highcharts=k;return f}):f("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(f){function k(d,f,k,y){d.hasOwnProperty(f)||(d[f]=y.apply(null,k))}f=f?f._modules:{};k(f,"modules/oldie.src.js",[f["parts/Globals.js"],f["parts/Utilities.js"]],function(d,f){var k=f.defined,y=f.erase,M=f.isArray,J=f.isNumber,
D=f.isObject,p=f.pInt;var l=d.Chart;var E=d.createElement,t=d.css,u=d.deg2rad,K=d.discardElement,g=d.doc,F=d.extend;var z=d.extendClass;f=d.merge;var L=d.noop,A=d.pick,G=d.svg,w=d.SVGElement,v=d.SVGRenderer,r=d.win;d.getOptions().global.VMLRadialGradientURL="http://code.highcharts.com/7.2.0/gfx/vml-radial-gradient.png";g&&!g.defaultView&&(d.getStyle=function(a,b){var c={width:"clientWidth",height:"clientHeight"}[b];if(a.style[b])return p(a.style[b]);"opacity"===b&&(b="filter");if(c)return a.style.zoom=
1,Math.max(a[c]-2*d.getStyle(a,"padding"),0);a=a.currentStyle[b.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()})];"filter"===b&&(a=a.replace(/alpha\(opacity=([0-9]+)\)/,function(a,b){return b/100}));return""===a?1:p(a)});G||(d.addEvent(w,"afterInit",function(){"text"===this.element.nodeName&&this.css({position:"absolute"})}),d.Pointer.prototype.normalize=function(a,b){a=a||r.event;a.target||(a.target=a.srcElement);b||(this.chartPosition=b=d.offset(this.chart.container));return d.extend(a,
{chartX:Math.round(Math.max(a.x,a.clientX-b.left)),chartY:Math.round(a.y)})},l.prototype.ieSanitizeSVG=function(a){return a=a.replace(/<IMG /g,"<image ").replace(/<(\/?)TITLE>/g,"<$1title>").replace(/height=([^" ]+)/g,'height="$1"').replace(/width=([^" ]+)/g,'width="$1"').replace(/hc-svg-href="([^"]+)">/g,'xlink:href="$1"/>').replace(/ id=([^" >]+)/g,' id="$1"').replace(/class=([^" >]+)/g,'class="$1"').replace(/ transform /g," ").replace(/:(path|rect)/g,"$1").replace(/style="([^"]+)"/g,function(a){return a.toLowerCase()})},
l.prototype.isReadyToRender=function(){var a=this;return G||r!=r.top||"complete"===g.readyState?!0:(g.attachEvent("onreadystatechange",function(){g.detachEvent("onreadystatechange",a.firstRender);"complete"===g.readyState&&a.firstRender()}),!1)},g.createElementNS||(g.createElementNS=function(a,b){return g.createElement(b)}),d.addEventListenerPolyfill=function(a,b){function c(a){a.target=a.srcElement||r;b.call(e,a)}var e=this;e.attachEvent&&(e.hcEventsIE||(e.hcEventsIE={}),b.hcKey||(b.hcKey=d.uniqueKey()),
e.hcEventsIE[b.hcKey]=c,e.attachEvent("on"+a,c))},d.removeEventListenerPolyfill=function(a,b){this.detachEvent&&(b=this.hcEventsIE[b.hcKey],this.detachEvent("on"+a,b))},l={docMode8:g&&8===g.documentMode,init:function(a,b){var c=["<",b,' filled="f" stroked="f"'],e=["position: ","absolute",";"],m="div"===b;("shape"===b||m)&&e.push("left:0;top:0;width:1px;height:1px;");e.push("visibility: ",m?"hidden":"visible");c.push(' style="',e.join(""),'"/>');b&&(c=m||"span"===b||"img"===b?c.join(""):a.prepVML(c),
this.element=E(c));this.renderer=a},add:function(a){var b=this.renderer,c=this.element,e=b.box,m=a&&a.inverted;e=a?a.element||a:e;a&&(this.parentGroup=a);m&&b.invertChild(c,e);e.appendChild(c);this.added=!0;this.alignOnAdd&&!this.deferUpdateTransform&&this.updateTransform();if(this.onAdd)this.onAdd();this.className&&this.attr("class",this.className);return this},updateTransform:w.prototype.htmlUpdateTransform,setSpanRotation:function(){var a=this.rotation,b=Math.cos(a*u),c=Math.sin(a*u);t(this.element,
{filter:a?["progid:DXImageTransform.Microsoft.Matrix(M11=",b,", M12=",-c,", M21=",c,", M22=",b,", sizingMethod='auto expand')"].join(""):"none"})},getSpanCorrection:function(a,b,c,e,m){var d=e?Math.cos(e*u):1,f=e?Math.sin(e*u):0,q=A(this.elemHeight,this.element.offsetHeight);this.xCorr=0>d&&-a;this.yCorr=0>f&&-q;var h=0>d*f;this.xCorr+=f*b*(h?1-c:c);this.yCorr-=d*b*(e?h?c:1-c:1);m&&"left"!==m&&(this.xCorr-=a*c*(0>d?-1:1),e&&(this.yCorr-=q*c*(0>f?-1:1)),t(this.element,{textAlign:m}))},pathToVML:function(a){for(var b=
a.length,c=[];b--;)J(a[b])?c[b]=Math.round(10*a[b])-5:"Z"===a[b]?c[b]="x":(c[b]=a[b],!a.isArc||"wa"!==a[b]&&"at"!==a[b]||(c[b+5]===c[b+7]&&(c[b+7]+=a[b+7]>a[b+5]?1:-1),c[b+6]===c[b+8]&&(c[b+8]+=a[b+8]>a[b+6]?1:-1)));return c.join(" ")||"x"},clip:function(a){var b=this;if(a){var c=a.members;y(c,b);c.push(b);b.destroyClip=function(){y(c,b)};a=a.getCSS(b)}else b.destroyClip&&b.destroyClip(),a={clip:b.docMode8?"inherit":"rect(auto)"};return b.css(a)},css:w.prototype.htmlCss,safeRemoveChild:function(a){a.parentNode&&
K(a)},destroy:function(){this.destroyClip&&this.destroyClip();return w.prototype.destroy.apply(this)},on:function(a,b){this.element["on"+a]=function(){var a=r.event;a.target=a.srcElement;b(a)};return this},cutOffPath:function(a,b){a=a.split(/[ ,]/);var c=a.length;if(9===c||11===c)a[c-4]=a[c-2]=p(a[c-2])-10*b;return a.join(" ")},shadow:function(a,b,c){var e=[],m,d=this.element,f=this.renderer,q=d.style,h=d.path;h&&"string"!==typeof h.value&&(h="x");var g=h;if(a){var B=A(a.width,3);var n=(a.opacity||
.15)/B;for(m=1;3>=m;m++){var l=2*B+1-2*m;c&&(g=this.cutOffPath(h.value,l+.5));var k=['<shape isShadow="true" strokeweight="',l,'" filled="false" path="',g,'" coordsize="10 10" style="',d.style.cssText,'" />'];var x=E(f.prepVML(k),null,{left:p(q.left)+A(a.offsetX,1),top:p(q.top)+A(a.offsetY,1)});c&&(x.cutOff=l+1);k=['<stroke color="',a.color||"#000000",'" opacity="',n*m,'"/>'];E(f.prepVML(k),null,null,x);b?b.element.appendChild(x):d.parentNode.insertBefore(x,d);e.push(x)}this.shadows=e}return this},
updateShadows:L,setAttr:function(a,b){this.docMode8?this.element[a]=b:this.element.setAttribute(a,b)},getAttr:function(a){return this.docMode8?this.element[a]:this.element.getAttribute(a)},classSetter:function(a){(this.added?this.element:this).className=a},dashstyleSetter:function(a,b,c){(c.getElementsByTagName("stroke")[0]||E(this.renderer.prepVML(["<stroke/>"]),null,null,c))[b]=a||"solid";this[b]=a},dSetter:function(a,b,c){var e=this.shadows;a=a||[];this.d=a.join&&a.join(" ");c.path=a=this.pathToVML(a);
if(e)for(c=e.length;c--;)e[c].path=e[c].cutOff?this.cutOffPath(a,e[c].cutOff):a;this.setAttr(b,a)},fillSetter:function(a,b,c){var e=c.nodeName;"SPAN"===e?c.style.color=a:"IMG"!==e&&(c.filled="none"!==a,this.setAttr("fillcolor",this.renderer.color(a,c,b,this)))},"fill-opacitySetter":function(a,b,c){E(this.renderer.prepVML(["<",b.split("-")[0],' opacity="',a,'"/>']),null,null,c)},opacitySetter:L,rotationSetter:function(a,b,c){c=c.style;this[b]=c[b]=a;c.left=-Math.round(Math.sin(a*u)+1)+"px";c.top=Math.round(Math.cos(a*
u))+"px"},strokeSetter:function(a,b,c){this.setAttr("strokecolor",this.renderer.color(a,c,b,this))},"stroke-widthSetter":function(a,b,c){c.stroked=!!a;this[b]=a;J(a)&&(a+="px");this.setAttr("strokeweight",a)},titleSetter:function(a,b){this.setAttr(b,a)},visibilitySetter:function(a,b,c){"inherit"===a&&(a="visible");this.shadows&&this.shadows.forEach(function(c){c.style[b]=a});"DIV"===c.nodeName&&(a="hidden"===a?"-999em":0,this.docMode8||(c.style[b]=a?"visible":"hidden"),b="top");c.style[b]=a},xSetter:function(a,
b,c){this[b]=a;"x"===b?b="left":"y"===b&&(b="top");this.updateClipping?(this[b]=a,this.updateClipping()):c.style[b]=a},zIndexSetter:function(a,b,c){c.style[b]=a},fillGetter:function(){return this.getAttr("fillcolor")||""},strokeGetter:function(){return this.getAttr("strokecolor")||""},classGetter:function(){return this.getAttr("className")||""}},l["stroke-opacitySetter"]=l["fill-opacitySetter"],d.VMLElement=l=z(w,l),l.prototype.ySetter=l.prototype.widthSetter=l.prototype.heightSetter=l.prototype.xSetter,
l={Element:l,isIE8:-1<r.navigator.userAgent.indexOf("MSIE 8.0"),init:function(a,b,c){this.alignedObjects=[];var e=this.createElement("div").css({position:"relative"});var d=e.element;a.appendChild(e.element);this.isVML=!0;this.box=d;this.boxWrapper=e;this.gradients={};this.cache={};this.cacheKeys=[];this.imgCount=0;this.setSize(b,c,!1);if(!g.namespaces.hcv){g.namespaces.add("hcv","urn:schemas-microsoft-com:vml");try{g.createStyleSheet().cssText="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}catch(N){g.styleSheets[0].cssText+=
"hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}}},isHidden:function(){return!this.box.offsetWidth},clipRect:function(a,b,c,e){var d=this.createElement(),f=D(a);return F(d,{members:[],count:0,left:(f?a.x:a)+1,top:(f?a.y:b)+1,width:(f?a.width:c)-1,height:(f?a.height:e)-1,getCSS:function(a){var b=a.element,c=b.nodeName,e=a.inverted,d=this.top-("shape"===c?b.offsetTop:0),f=this.left;b=f+this.width;var m=d+this.height;d={clip:"rect("+Math.round(e?
f:d)+"px,"+Math.round(e?m:b)+"px,"+Math.round(e?b:m)+"px,"+Math.round(e?d:f)+"px)"};!e&&a.docMode8&&"DIV"===c&&F(d,{width:b+"px",height:m+"px"});return d},updateClipping:function(){d.members.forEach(function(a){a.element&&a.css(d.getCSS(a))})}})},color:function(a,b,c,e){var f=this,g=/^rgba/,l,q,h="none";a&&a.linearGradient?q="gradient":a&&a.radialGradient&&(q="pattern");if(q){var k,B,n=a.linearGradient||a.radialGradient,p,u,x,v,r="";a=a.stops;var w=[],y=function(){l=['<fill colors="'+w.join(",")+
'" opacity="',u,'" o:opacity2="',p,'" type="',q,'" ',r,'focus="100%" method="any" />'];E(f.prepVML(l),null,null,b)};var t=a[0];var z=a[a.length-1];0<t[0]&&a.unshift([0,t[1]]);1>z[0]&&a.push([1,z[1]]);a.forEach(function(a,b){g.test(a[1])?(H=d.color(a[1]),k=H.get("rgb"),B=H.get("a")):(k=a[1],B=1);w.push(100*a[0]+"% "+k);b?(u=B,x=k):(p=B,v=k)});if("fill"===c)if("gradient"===q)c=n.x1||n[0]||0,a=n.y1||n[1]||0,t=n.x2||n[2]||0,n=n.y2||n[3]||0,r='angle="'+(90-180*Math.atan((n-a)/(t-c))/Math.PI)+'"',y();else{h=
n.r;var A=2*h,D=2*h,F=n.cx,G=n.cy,I=b.radialReference,C;h=function(){I&&(C=e.getBBox(),F+=(I[0]-C.x)/C.width-.5,G+=(I[1]-C.y)/C.height-.5,A*=I[2]/C.width,D*=I[2]/C.height);r='src="'+d.getOptions().global.VMLRadialGradientURL+'" size="'+A+","+D+'" origin="0.5,0.5" position="'+F+","+G+'" color2="'+v+'" ';y()};e.added?h():e.onAdd=h;h=x}else h=k}else if(g.test(a)&&"IMG"!==b.tagName){var H=d.color(a);e[c+"-opacitySetter"](H.get("a"),c,b);h=H.get("rgb")}else h=b.getElementsByTagName(c),h.length&&(h[0].opacity=
1,h[0].type="solid"),h=a;return h},prepVML:function(a){var b=this.isIE8;a=a.join("");b?(a=a.replace("/>",' xmlns="urn:schemas-microsoft-com:vml" />'),a=-1===a.indexOf('style="')?a.replace("/>",' style="display:inline-block;behavior:url(#default#VML);" />'):a.replace('style="','style="display:inline-block;behavior:url(#default#VML);')):a=a.replace("<","<hcv:");return a},text:v.prototype.html,path:function(a){var b={coordsize:"10 10"};M(a)?b.d=a:D(a)&&F(b,a);return this.createElement("shape").attr(b)},
circle:function(a,b,c){var e=this.symbol("circle");D(a)&&(c=a.r,b=a.y,a=a.x);e.isCircle=!0;e.r=c;return e.attr({x:a,y:b})},g:function(a){var b;a&&(b={className:"highcharts-"+a,"class":"highcharts-"+a});return this.createElement("div").attr(b)},image:function(a,b,c,e,d){var f=this.createElement("img").attr({src:a});1<arguments.length&&f.attr({x:b,y:c,width:e,height:d});return f},createElement:function(a){return"rect"===a?this.symbol(a):v.prototype.createElement.call(this,a)},invertChild:function(a,
b){var c=this;b=b.style;var e="IMG"===a.tagName&&a.style;t(a,{flip:"x",left:p(b.width)-(e?p(e.top):1),top:p(b.height)-(e?p(e.left):1),rotation:-90});[].forEach.call(a.childNodes,function(b){c.invertChild(b,a)})},symbols:{arc:function(a,b,c,e,d){var f=d.start,m=d.end,g=d.r||c||e;c=d.innerR;e=Math.cos(f);var h=Math.sin(f),k=Math.cos(m),l=Math.sin(m);if(0===m-f)return["x"];f=["wa",a-g,b-g,a+g,b+g,a+g*e,b+g*h,a+g*k,b+g*l];d.open&&!c&&f.push("e","M",a,b);f.push("at",a-c,b-c,a+c,b+c,a+c*k,b+c*l,a+c*e,b+
c*h,"x","e");f.isArc=!0;return f},circle:function(a,b,c,e,d){d&&k(d.r)&&(c=e=2*d.r);d&&d.isCircle&&(a-=c/2,b-=e/2);return["wa",a,b,a+c,b+e,a+c,b+e/2,a+c,b+e/2,"e"]},rect:function(a,b,c,e,d){return v.prototype.symbols[k(d)&&d.r?"callout":"square"].call(0,a,b,c,e,d)}}},d.VMLRenderer=z=function(){this.init.apply(this,arguments)},z.prototype=f(v.prototype,l),d.Renderer=z);v.prototype.getSpanWidth=function(a,b){var c=a.getBBox(!0).width;!G&&this.forExport&&(c=this.measureSpanWidth(b.firstChild.data,a.styles));
return c};v.prototype.measureSpanWidth=function(a,b){var c=g.createElement("span");a=g.createTextNode(a);c.appendChild(a);t(c,b);this.box.appendChild(c);b=c.offsetWidth;K(c);return b}});k(f,"masters/modules/oldie.src.js",[],function(){})});
//# sourceMappingURL=oldie.js.map