fistcommit

This commit is contained in:
Kicap
2025-03-21 04:09:18 +08:00
commit 580ccbfd0d
1393 changed files with 534360 additions and 0 deletions

View File

@ -0,0 +1,47 @@
/*
Highcharts JS v5.0.2 (2016-10-26)
3D features for Highcharts JS
@license: www.highcharts.com/license
*/
(function(v){"object"===typeof module&&module.exports?module.exports=v:v(Highcharts)})(function(v){(function(b){var q=b.deg2rad,l=b.pick;b.perspective=function(p,u,y){var e=u.options.chart.options3d,g=y?u.inverted:!1,h=u.plotWidth/2,d=u.plotHeight/2,f=e.depth/2,n=l(e.depth,1)*l(e.viewDistance,0),c=u.scale3d||1,a=q*e.beta*(g?-1:1),e=q*e.alpha*(g?-1:1),k=Math.cos(e),t=Math.cos(-a),z=Math.sin(e),A=Math.sin(-a);y||(h+=u.plotLeft,d+=u.plotTop);return b.map(p,function(a){var b,e;e=(g?a.y:a.x)-h;var l=(g?
a.x:a.y)-d,p=(a.z||0)-f;b=t*e-A*p;a=-z*A*e+k*l-t*z*p;e=k*A*e+z*l+k*t*p;l=0<n&&n<Number.POSITIVE_INFINITY?n/(e+f+n):1;b=b*l*c+h;a=a*l*c+d;return{x:g?a:b,y:g?b:a,z:e*c+f}})}})(v);(function(b){function q(a){var c=0,m,b;for(m=0;m<a.length;m++)b=(m+1)%a.length,c+=a[m].x*a[b].y-a[b].x*a[m].y;return c/2}function l(a){var b=0,m;for(m=0;m<a.length;m++)b+=a[m].z;return a.length?b/a.length:0}function p(a,b,m,c,k,d,E,e){var B=[],F=d-k;return d>k&&d-k>Math.PI/2+.0001?(B=B.concat(p(a,b,m,c,k,k+Math.PI/2,E,e)),
B=B.concat(p(a,b,m,c,k+Math.PI/2,d,E,e))):d<k&&k-d>Math.PI/2+.0001?(B=B.concat(p(a,b,m,c,k,k-Math.PI/2,E,e)),B=B.concat(p(a,b,m,c,k-Math.PI/2,d,E,e))):["C",a+m*Math.cos(k)-m*w*F*Math.sin(k)+E,b+c*Math.sin(k)+c*w*F*Math.cos(k)+e,a+m*Math.cos(d)+m*w*F*Math.sin(d)+E,b+c*Math.sin(d)-c*w*F*Math.cos(d)+e,a+m*Math.cos(d)+E,b+c*Math.sin(d)+e]}var u=Math.cos,y=Math.PI,e=Math.sin,g=b.animObject,h=b.charts,d=b.color,f=b.defined,n=b.deg2rad,c=b.each,a=b.extend,k=b.inArray,t=b.map,z=b.merge,A=b.perspective,v=
b.pick,D=b.SVGElement,C=b.SVGRenderer,r=b.wrap,w=4*(Math.sqrt(2)-1)/3/(y/2);r(C.prototype,"init",function(a){a.apply(this,[].slice.call(arguments,1));c([{name:"darker",slope:.6},{name:"brighter",slope:1.4}],function(a){this.definition({tagName:"filter",id:"highcharts-"+a.name,children:[{tagName:"feComponentTransfer",children:[{tagName:"feFuncR",type:"linear",slope:a.slope},{tagName:"feFuncG",type:"linear",slope:a.slope},{tagName:"feFuncB",type:"linear",slope:a.slope}]}]})},this)});C.prototype.toLinePath=
function(a,b){var m=[];c(a,function(a){m.push("L",a.x,a.y)});a.length&&(m[0]="M",b&&m.push("Z"));return m};C.prototype.cuboid=function(a){var c=this.g();a=this.cuboidPath(a);c.front=this.path(a[0]).attr({"class":"highcharts-3d-front",zIndex:a[3]}).add(c);c.top=this.path(a[1]).attr({"class":"highcharts-3d-top",zIndex:a[4]}).add(c);c.side=this.path(a[2]).attr({"class":"highcharts-3d-side",zIndex:a[5]}).add(c);c.fillSetter=function(a){this.front.attr({fill:a});this.top.attr({fill:d(a).brighten(.1).get()});
this.side.attr({fill:d(a).brighten(-.1).get()});this.color=a;return this};c.opacitySetter=function(a){this.front.attr({opacity:a});this.top.attr({opacity:a});this.side.attr({opacity:a});return this};c.attr=function(a){if(a.shapeArgs||f(a.x))a=this.renderer.cuboidPath(a.shapeArgs||a),this.front.attr({d:a[0],zIndex:a[3]}),this.top.attr({d:a[1],zIndex:a[4]}),this.side.attr({d:a[2],zIndex:a[5]});else return b.SVGElement.prototype.attr.call(this,a);return this};c.animate=function(a,c,b){f(a.x)&&f(a.y)?
(a=this.renderer.cuboidPath(a),this.front.attr({zIndex:a[3]}).animate({d:a[0]},c,b),this.top.attr({zIndex:a[4]}).animate({d:a[1]},c,b),this.side.attr({zIndex:a[5]}).animate({d:a[2]},c,b),this.attr({zIndex:-a[6]})):a.opacity?(this.front.animate(a,c,b),this.top.animate(a,c,b),this.side.animate(a,c,b)):D.prototype.animate.call(this,a,c,b);return this};c.destroy=function(){this.front.destroy();this.top.destroy();this.side.destroy();return null};c.attr({zIndex:-a[6]});return c};C.prototype.cuboidPath=
function(a){function c(a){return n[a]}var b=a.x,k=a.y,d=a.z,e=a.height,E=a.width,f=a.depth,n=[{x:b,y:k,z:d},{x:b+E,y:k,z:d},{x:b+E,y:k+e,z:d},{x:b,y:k+e,z:d},{x:b,y:k+e,z:d+f},{x:b+E,y:k+e,z:d+f},{x:b+E,y:k,z:d+f},{x:b,y:k,z:d+f}],n=A(n,h[this.chartIndex],a.insidePlotArea),d=function(a,b){var k=[];a=t(a,c);b=t(b,c);0>q(a)?k=a:0>q(b)&&(k=b);return k};a=d([3,2,1,0],[7,6,5,4]);b=[4,5,2,3];k=d([1,6,7,0],b);d=d([1,2,5,6],[0,7,4,3]);return[this.toLinePath(a,!0),this.toLinePath(k,!0),this.toLinePath(d,!0),
l(a),l(k),l(d),9E9*l(t(b,c))]};b.SVGRenderer.prototype.arc3d=function(b){function e(a){var b=!1,c={},d;for(d in a)-1!==k(d,h)&&(c[d]=a[d],delete a[d],b=!0);return b?c:!1}var m=this.g(),f=m.renderer,h="x y r innerR start end".split(" ");b=z(b);b.alpha*=n;b.beta*=n;m.top=f.path();m.side1=f.path();m.side2=f.path();m.inn=f.path();m.out=f.path();m.onAdd=function(){var a=m.parentGroup,b=m.attr("class");m.top.add(m);c(["out","inn","side1","side2"],function(c){m[c].addClass(b+" highcharts-3d-side").add(a)})};
m.setPaths=function(a){var b=m.renderer.arc3dPath(a),c=100*b.zTop;m.attribs=a;m.top.attr({d:b.top,zIndex:b.zTop});m.inn.attr({d:b.inn,zIndex:b.zInn});m.out.attr({d:b.out,zIndex:b.zOut});m.side1.attr({d:b.side1,zIndex:b.zSide1});m.side2.attr({d:b.side2,zIndex:b.zSide2});m.zIndex=c;m.attr({zIndex:c});a.center&&(m.top.setRadialReference(a.center),delete a.center)};m.setPaths(b);m.fillSetter=function(a){var b=d(a).brighten(-.1).get();this.fill=a;this.side1.attr({fill:b});this.side2.attr({fill:b});this.inn.attr({fill:b});
this.out.attr({fill:b});this.top.attr({fill:a});return this};c(["opacity","translateX","translateY","visibility"],function(a){m[a+"Setter"]=function(a,b){m[b]=a;c(["out","inn","side1","side2","top"],function(c){m[c].attr(b,a)})}});r(m,"attr",function(b,c,k){var d;"object"===typeof c&&(d=e(c))&&(a(m.attribs,d),m.setPaths(m.attribs));return b.call(this,c,k)});r(m,"animate",function(a,b,c,k){var d,m=this.attribs,f;delete b.center;delete b.z;delete b.depth;delete b.alpha;delete b.beta;f=g(v(c,this.renderer.globalAnimation));
f.duration&&(b=z(b),d=e(b),b.dummy=1,d&&(f.step=function(a,b){function c(a){return m[a]+(v(d[a],m[a])-m[a])*b.pos}"dummy"===b.prop&&b.elem.setPaths(z(m,{x:c("x"),y:c("y"),r:c("r"),innerR:c("innerR"),start:c("start"),end:c("end")}))}),c=f);return a.call(this,b,c,k)});m.destroy=function(){this.top.destroy();this.out.destroy();this.inn.destroy();this.side1.destroy();this.side2.destroy();D.prototype.destroy.call(this)};m.hide=function(){this.top.hide();this.out.hide();this.inn.hide();this.side1.hide();
this.side2.hide()};m.show=function(){this.top.show();this.out.show();this.inn.show();this.side1.show();this.side2.show()};return m};C.prototype.arc3dPath=function(a){function b(a){a%=2*Math.PI;a>Math.PI&&(a=2*Math.PI-a);return a}var c=a.x,d=a.y,k=a.start,f=a.end-.00001,n=a.r,h=a.innerR,l=a.depth,g=a.alpha,t=a.beta,z=Math.cos(k),B=Math.sin(k);a=Math.cos(f);var q=Math.sin(f),x=n*Math.cos(t),n=n*Math.cos(g),A=h*Math.cos(t),w=h*Math.cos(g),h=l*Math.sin(t),r=l*Math.sin(g),l=["M",c+x*z,d+n*B],l=l.concat(p(c,
d,x,n,k,f,0,0)),l=l.concat(["L",c+A*a,d+w*q]),l=l.concat(p(c,d,A,w,f,k,0,0)),l=l.concat(["Z"]),C=0<t?Math.PI/2:0,t=0<g?0:Math.PI/2,C=k>-C?k:f>-C?-C:k,v=f<y-t?f:k<y-t?y-t:f,D=2*y-t,g=["M",c+x*u(C),d+n*e(C)],g=g.concat(p(c,d,x,n,C,v,0,0));f>D&&k<D?(g=g.concat(["L",c+x*u(v)+h,d+n*e(v)+r]),g=g.concat(p(c,d,x,n,v,D,h,r)),g=g.concat(["L",c+x*u(D),d+n*e(D)]),g=g.concat(p(c,d,x,n,D,f,0,0)),g=g.concat(["L",c+x*u(f)+h,d+n*e(f)+r]),g=g.concat(p(c,d,x,n,f,D,h,r)),g=g.concat(["L",c+x*u(D),d+n*e(D)]),g=g.concat(p(c,
d,x,n,D,v,0,0))):f>y-t&&k<y-t&&(g=g.concat(["L",c+x*Math.cos(v)+h,d+n*Math.sin(v)+r]),g=g.concat(p(c,d,x,n,v,f,h,r)),g=g.concat(["L",c+x*Math.cos(f),d+n*Math.sin(f)]),g=g.concat(p(c,d,x,n,f,v,0,0)));g=g.concat(["L",c+x*Math.cos(v)+h,d+n*Math.sin(v)+r]);g=g.concat(p(c,d,x,n,v,C,h,r));g=g.concat(["Z"]);t=["M",c+A*z,d+w*B];t=t.concat(p(c,d,A,w,k,f,0,0));t=t.concat(["L",c+A*Math.cos(f)+h,d+w*Math.sin(f)+r]);t=t.concat(p(c,d,A,w,f,k,h,r));t=t.concat(["Z"]);z=["M",c+x*z,d+n*B,"L",c+x*z+h,d+n*B+r,"L",c+
A*z+h,d+w*B+r,"L",c+A*z,d+w*B,"Z"];c=["M",c+x*a,d+n*q,"L",c+x*a+h,d+n*q+r,"L",c+A*a+h,d+w*q+r,"L",c+A*a,d+w*q,"Z"];q=Math.atan2(r,-h);d=Math.abs(f+q);a=Math.abs(k+q);k=Math.abs((k+f)/2+q);d=b(d);a=b(a);k=b(k);k*=1E5;f=1E5*a;d*=1E5;return{top:l,zTop:1E5*Math.PI+1,out:g,zOut:Math.max(k,f,d),inn:t,zInn:Math.max(k,f,d),side1:z,zSide1:.99*d,side2:c,zSide2:.99*f}}})(v);(function(b){function q(b,f){var d=b.plotLeft,c=b.plotWidth+d,a=b.plotTop,k=b.plotHeight+a,e=d+b.plotWidth/2,g=a+b.plotHeight/2,h=Number.MAX_VALUE,
l=-Number.MAX_VALUE,q=Number.MAX_VALUE,u=-Number.MAX_VALUE,r,w=1;r=[{x:d,y:a,z:0},{x:d,y:a,z:f}];p([0,1],function(a){r.push({x:c,y:r[a].y,z:r[a].z})});p([0,1,2,3],function(a){r.push({x:r[a].x,y:k,z:r[a].z})});r=y(r,b,!1);p(r,function(a){h=Math.min(h,a.x);l=Math.max(l,a.x);q=Math.min(q,a.y);u=Math.max(u,a.y)});d>h&&(w=Math.min(w,1-Math.abs((d+e)/(h+e))%1));c<l&&(w=Math.min(w,(c-e)/(l-e)));a>q&&(w=0>q?Math.min(w,(a+g)/(-q+a+g)):Math.min(w,1-(a+g)/(q+g)%1));k<u&&(w=Math.min(w,Math.abs((k-g)/(u-g))));
return w}var l=b.Chart,p=b.each,u=b.merge,y=b.perspective,e=b.pick,g=b.wrap;l.prototype.is3d=function(){return this.options.chart.options3d&&this.options.chart.options3d.enabled};l.prototype.propsRequireDirtyBox.push("chart.options3d");l.prototype.propsRequireUpdateSeries.push("chart.options3d");b.wrap(b.Chart.prototype,"isInsidePlot",function(b){return this.is3d()||b.apply(this,[].slice.call(arguments,1))});var h=b.getOptions();u(!0,h,{chart:{options3d:{enabled:!1,alpha:0,beta:0,depth:100,fitToPlot:!0,
viewDistance:25,frame:{bottom:{size:1},side:{size:1},back:{size:1}}}},defs:{style:{textContent:h.defs.style.textContent+"\n.highcharts-3d-top{filter: url(#highcharts-brighter)}\n.highcharts-3d-side{filter: url(#highcharts-darker)}"}}});g(l.prototype,"setClassName",function(b){b.apply(this,[].slice.call(arguments,1));this.is3d()&&(this.container.className+=" highcharts-3d-chart")});b.wrap(b.Chart.prototype,"setChartSize",function(b){var d=this.options.chart.options3d;b.apply(this,[].slice.call(arguments,
1));if(this.is3d()){var e=this.inverted,c=this.clipBox,a=this.margin;c[e?"y":"x"]=-(a[3]||0);c[e?"x":"y"]=-(a[0]||0);c[e?"height":"width"]=this.chartWidth+(a[3]||0)+(a[1]||0);c[e?"width":"height"]=this.chartHeight+(a[0]||0)+(a[2]||0);this.scale3d=1;!0===d.fitToPlot&&(this.scale3d=q(this,d.depth))}});g(l.prototype,"redraw",function(b){this.is3d()&&(this.isDirtyBox=!0);b.apply(this,[].slice.call(arguments,1))});g(l.prototype,"renderSeries",function(b){var d=this.series.length;if(this.is3d())for(;d--;)b=
this.series[d],b.translate(),b.render();else b.call(this)});l.prototype.retrieveStacks=function(b){var d=this.series,g={},c,a=1;p(this.series,function(k){c=e(k.options.stack,b?0:d.length-1-k.index);g[c]?g[c].series.push(k):(g[c]={series:[k],position:a},a++)});g.totalStacks=a+1;return g}})(v);(function(b){var q,l=b.Axis,p=b.Chart,u=b.each,y=b.extend,e=b.merge,g=b.perspective,h=b.pick,d=b.splat,f=b.Tick,n=b.wrap;n(l.prototype,"setOptions",function(b,a){b.call(this,a);this.chart.is3d()&&(b=this.options,
b.tickWidth=h(b.tickWidth,0),b.gridLineWidth=h(b.gridLineWidth,1))});n(l.prototype,"render",function(b){b.apply(this,[].slice.call(arguments,1));if(this.chart.is3d()){var a=this.chart,c=a.renderer,d=a.options.chart.options3d,f=d.frame,e=f.bottom,g=f.back,f=f.side,h=d.depth,n=this.height,l=this.width,p=this.left,q=this.top;this.isZAxis||(this.horiz?(e={x:p,y:q+(a.xAxis[0].opposite?-e.size:n),z:0,width:l,height:e.size,depth:h,insidePlotArea:!1},this.bottomFrame?this.bottomFrame.animate(e):this.bottomFrame=
c.cuboid(e).attr({"class":"highcharts-3d-frame highcharts-3d-frame-bottom",zIndex:a.yAxis[0].reversed&&0<d.alpha?4:-1}).add()):(d={x:p+(a.yAxis[0].opposite?0:-f.size),y:q+(a.xAxis[0].opposite?-e.size:0),z:h,width:l+f.size,height:n+e.size,depth:g.size,insidePlotArea:!1},this.backFrame?this.backFrame.animate(d):this.backFrame=c.cuboid(d).attr({"class":"highcharts-3d-frame highcharts-3d-frame-back",zIndex:-3}).add(),a={x:p+(a.yAxis[0].opposite?l:-f.size),y:q+(a.xAxis[0].opposite?-e.size:0),z:0,width:f.size,
height:n+e.size,depth:h,insidePlotArea:!1},this.sideFrame?this.sideFrame.animate(a):this.sideFrame=c.cuboid(a).attr({"class":"highcharts-3d-frame highcharts-3d-frame-side",zIndex:-2}).add()))}});n(l.prototype,"getPlotLinePath",function(b){var a=b.apply(this,[].slice.call(arguments,1));if(!this.chart.is3d()||null===a)return a;var c=this.chart,d=c.options.chart.options3d,c=this.isZAxis?c.plotWidth:d.depth,d=this.opposite;this.horiz&&(d=!d);a=[this.swapZ({x:a[1],y:a[2],z:d?c:0}),this.swapZ({x:a[1],y:a[2],
z:c}),this.swapZ({x:a[4],y:a[5],z:c}),this.swapZ({x:a[4],y:a[5],z:d?0:c})];a=g(a,this.chart,!1);return a=this.chart.renderer.toLinePath(a,!1)});n(l.prototype,"getLinePath",function(b){return this.chart.is3d()?[]:b.apply(this,[].slice.call(arguments,1))});n(l.prototype,"getPlotBandPath",function(b){if(!this.chart.is3d())return b.apply(this,[].slice.call(arguments,1));var a=arguments,c=a[1],a=this.getPlotLinePath(a[2]);(c=this.getPlotLinePath(c))&&a?c.push("L",a[10],a[11],"L",a[7],a[8],"L",a[4],a[5],
"L",a[1],a[2]):c=null;return c});n(f.prototype,"getMarkPath",function(b){var a=b.apply(this,[].slice.call(arguments,1));if(!this.axis.chart.is3d())return a;a=[this.axis.swapZ({x:a[1],y:a[2],z:0}),this.axis.swapZ({x:a[4],y:a[5],z:0})];a=g(a,this.axis.chart,!1);return a=["M",a[0].x,a[0].y,"L",a[1].x,a[1].y]});n(f.prototype,"getLabelPosition",function(b){var a=b.apply(this,[].slice.call(arguments,1));this.axis.chart.is3d()&&(a=g([this.axis.swapZ({x:a.x,y:a.y,z:0})],this.axis.chart,!1)[0]);return a});
b.wrap(l.prototype,"getTitlePosition",function(b){var a=this.chart.is3d(),c,d;a&&(d=this.axisTitleMargin,this.axisTitleMargin=0);c=b.apply(this,[].slice.call(arguments,1));a&&(c=g([this.swapZ({x:c.x,y:c.y,z:0})],this.chart,!1)[0],c[this.horiz?"y":"x"]+=(this.horiz?1:-1)*(this.opposite?-1:1)*d,this.axisTitleMargin=d);return c});n(l.prototype,"drawCrosshair",function(b){var a=arguments;this.chart.is3d()&&a[2]&&(a[2]={plotX:a[2].plotXold||a[2].plotX,plotY:a[2].plotYold||a[2].plotY});b.apply(this,[].slice.call(a,
1))});l.prototype.swapZ=function(b,a){if(this.isZAxis){a=a?0:this.chart.plotLeft;var c=this.chart;return{x:a+(c.yAxis[0].opposite?b.z:c.xAxis[0].width-b.z),y:b.y,z:b.x-a}}return b};q=b.ZAxis=function(){this.isZAxis=!0;this.init.apply(this,arguments)};y(q.prototype,l.prototype);y(q.prototype,{setOptions:function(b){b=e({offset:0,lineWidth:0},b);l.prototype.setOptions.call(this,b);this.coll="zAxis"},setAxisSize:function(){l.prototype.setAxisSize.call(this);this.width=this.len=this.chart.options.chart.options3d.depth;
this.right=this.chart.chartWidth-this.width-this.left},getSeriesExtremes:function(){var b=this,a=b.chart;b.hasVisibleSeries=!1;b.dataMin=b.dataMax=b.ignoreMinPadding=b.ignoreMaxPadding=null;b.buildStacks&&b.buildStacks();u(b.series,function(c){if(c.visible||!a.options.chart.ignoreHiddenSeries)b.hasVisibleSeries=!0,c=c.zData,c.length&&(b.dataMin=Math.min(h(b.dataMin,c[0]),Math.min.apply(null,c)),b.dataMax=Math.max(h(b.dataMax,c[0]),Math.max.apply(null,c)))})}});n(p.prototype,"getAxes",function(b){var a=
this,c=this.options,c=c.zAxis=d(c.zAxis||{});b.call(this);a.is3d()&&(this.zAxis=[],u(c,function(b,c){b.index=c;b.isX=!0;(new q(a,b)).setScale()}))})})(v);(function(b){function q(b){if(this.chart.is3d()){var d=this.chart.options.plotOptions.column.grouping;void 0===d||d||void 0===this.group.zIndex||this.zIndexSet||(this.group.attr({zIndex:10*this.group.zIndex}),this.zIndexSet=!0)}b.apply(this,[].slice.call(arguments,1))}var l=b.each,p=b.perspective,u=b.pick,y=b.Series,e=b.seriesTypes,g=b.svg;b=b.wrap;
b(e.column.prototype,"translate",function(b){b.apply(this,[].slice.call(arguments,1));if(this.chart.is3d()){var d=this.chart,f=this.options,e=f.depth||25,c=(f.stacking?f.stack||0:this._i)*(e+(f.groupZPadding||1));!1!==f.grouping&&(c=0);c+=f.groupZPadding||1;l(this.data,function(a){if(null!==a.y){var b=a.shapeArgs,f=a.tooltipPos;a.shapeType="cuboid";b.z=c;b.depth=e;b.insidePlotArea=!0;f=p([{x:f[0],y:f[1],z:c}],d,!0)[0];a.tooltipPos=[f.x,f.y]}});this.z=c}});b(e.column.prototype,"animate",function(b){if(this.chart.is3d()){var d=
arguments[1],f=this.yAxis,e=this,c=this.yAxis.reversed;g&&(d?l(e.data,function(a){null!==a.y&&(a.height=a.shapeArgs.height,a.shapey=a.shapeArgs.y,a.shapeArgs.height=1,c||(a.shapeArgs.y=a.stackY?a.plotY+f.translate(a.stackY):a.plotY+(a.negative?-a.height:a.height)))}):(l(e.data,function(a){null!==a.y&&(a.shapeArgs.height=a.height,a.shapeArgs.y=a.shapey,a.graphic&&a.graphic.animate(a.shapeArgs,e.options.animation))}),this.drawDataLabels(),e.animate=null))}else b.apply(this,[].slice.call(arguments,1))});
b(e.column.prototype,"init",function(b){b.apply(this,[].slice.call(arguments,1));if(this.chart.is3d()){var d=this.options,f=d.grouping,e=d.stacking,c=u(this.yAxis.options.reversedStacks,!0),a=0;if(void 0===f||f){f=this.chart.retrieveStacks(e);a=d.stack||0;for(e=0;e<f[a].series.length&&f[a].series[e]!==this;e++);a=10*(f.totalStacks-f[a].position)+(c?e:-e);this.xAxis.reversed||(a=10*f.totalStacks-a)}d.zIndex=a}});b(y.prototype,"alignDataLabel",function(b){if(this.chart.is3d()&&("column"===this.type||
"columnrange"===this.type)){var d=arguments[4],e={x:d.x,y:d.y,z:this.z},e=p([e],this.chart,!0)[0];d.x=e.x;d.y=e.y}b.apply(this,[].slice.call(arguments,1))});e.columnrange&&b(e.columnrange.prototype,"drawPoints",q);b(e.column.prototype,"drawPoints",q)})(v);(function(b){var q=b.deg2rad,l=b.each,p=b.seriesTypes,u=b.svg;b=b.wrap;b(p.pie.prototype,"translate",function(b){b.apply(this,[].slice.call(arguments,1));if(this.chart.is3d()){var e=this,g=e.options,h=g.depth||0,d=e.chart.options.chart.options3d,
f=d.alpha,n=d.beta,c=g.stacking?(g.stack||0)*h:e._i*h,c=c+h/2;!1!==g.grouping&&(c=0);l(e.data,function(a){var b=a.shapeArgs;a.shapeType="arc3d";b.z=c;b.depth=.75*h;b.alpha=f;b.beta=n;b.center=e.center;b=(b.end+b.start)/2;a.slicedTranslation={translateX:Math.round(Math.cos(b)*g.slicedOffset*Math.cos(f*q)),translateY:Math.round(Math.sin(b)*g.slicedOffset*Math.cos(f*q))}})}});b(p.pie.prototype.pointClass.prototype,"haloPath",function(b){var e=arguments;return this.series.chart.is3d()?[]:b.call(this,
e[1])});b(p.pie.prototype,"drawPoints",function(b){b.apply(this,[].slice.call(arguments,1));this.chart.is3d()&&l(this.points,function(b){var e=b.graphic;if(e)e[b.y&&b.visible?"show":"hide"]()})});b(p.pie.prototype,"drawDataLabels",function(b){if(this.chart.is3d()){var e=this.chart.options.chart.options3d;l(this.data,function(b){var g=b.shapeArgs,d=g.r,f=(g.start+g.end)/2,n=b.labelPos,c=-d*(1-Math.cos((g.alpha||e.alpha)*q))*Math.sin(f),a=d*(Math.cos((g.beta||e.beta)*q)-1)*Math.cos(f);l([0,2,4],function(b){n[b]+=
a;n[b+1]+=c})})}b.apply(this,[].slice.call(arguments,1))});b(p.pie.prototype,"addPoint",function(b){b.apply(this,[].slice.call(arguments,1));this.chart.is3d()&&this.update(this.userOptions,!0)});b(p.pie.prototype,"animate",function(b){if(this.chart.is3d()){var e=arguments[1],g=this.options.animation,h=this.center,d=this.group,f=this.markerGroup;u&&(!0===g&&(g={}),e?(d.oldtranslateX=d.translateX,d.oldtranslateY=d.translateY,e={translateX:h[0],translateY:h[1],scaleX:.001,scaleY:.001},d.attr(e),f&&(f.attrSetters=
d.attrSetters,f.attr(e))):(e={translateX:d.oldtranslateX,translateY:d.oldtranslateY,scaleX:1,scaleY:1},d.animate(e,g),f&&f.animate(e,g),this.animate=null))}else b.apply(this,[].slice.call(arguments,1))})})(v);(function(b){var q=b.perspective,l=b.pick,p=b.seriesTypes;b=b.wrap;b(p.scatter.prototype,"translate",function(b){b.apply(this,[].slice.call(arguments,1));if(this.chart.is3d()){var p=this.chart,e=l(this.zAxis,p.options.zAxis[0]),g=[],h,d,f;for(f=0;f<this.data.length;f++)h=this.data[f],d=e.isLog&&
e.val2lin?e.val2lin(h.z):h.z,h.plotZ=e.translate(d),h.isInside=h.isInside?d>=e.min&&d<=e.max:!1,g.push({x:h.plotX,y:h.plotY,z:h.plotZ});p=q(g,p,!0);for(f=0;f<this.data.length;f++)h=this.data[f],e=p[f],h.plotXold=h.plotX,h.plotYold=h.plotY,h.plotZold=h.plotZ,h.plotX=e.x,h.plotY=e.y,h.plotZ=e.z}});b(p.scatter.prototype,"init",function(b,l,e){l.is3d()&&(this.axisTypes=["xAxis","yAxis","zAxis"],this.pointArrayMap=["x","y","z"],this.parallelArrays=["x","y","z"],this.directTouch=!0);b=b.apply(this,[l,e]);
this.chart.is3d()&&(this.tooltipOptions.pointFormat=this.userOptions.tooltip?this.userOptions.tooltip.pointFormat||"x: \x3cb\x3e{point.x}\x3c/b\x3e\x3cbr/\x3ey: \x3cb\x3e{point.y}\x3c/b\x3e\x3cbr/\x3ez: \x3cb\x3e{point.z}\x3c/b\x3e\x3cbr/\x3e":"x: \x3cb\x3e{point.x}\x3c/b\x3e\x3cbr/\x3ey: \x3cb\x3e{point.y}\x3c/b\x3e\x3cbr/\x3ez: \x3cb\x3e{point.z}\x3c/b\x3e\x3cbr/\x3e");return b})})(v)});

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,56 @@
/*
Highcharts JS v5.0.2 (2016-10-26)
(c) 2009-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(w){"object"===typeof module&&module.exports?module.exports=w:w(Highcharts)})(function(w){(function(a){function l(a,b,d){this.init(a,b,d)}var t=a.each,u=a.extend,g=a.merge,n=a.splat;u(l.prototype,{init:function(a,b,d){var k=this,h=k.defaultOptions;k.chart=b;k.options=a=g(h,b.angular?{background:{}}:void 0,a);(a=a.background)&&t([].concat(n(a)).reverse(),function(b){var c=d.userOptions;b=g(k.defaultBackgroundOptions,b);d.options.plotBands.unshift(b);c.plotBands=c.plotBands||[];c.plotBands!==
d.options.plotBands&&c.plotBands.unshift(b)})},defaultOptions:{center:["50%","50%"],size:"85%",startAngle:0},defaultBackgroundOptions:{className:"highcharts-pane",shape:"circle",from:-Number.MAX_VALUE,innerRadius:0,to:Number.MAX_VALUE,outerRadius:"105%"}});a.Pane=l})(w);(function(a){var l=a.CenteredSeriesMixin,t=a.each,u=a.extend,g=a.map,n=a.merge,r=a.noop,b=a.Pane,d=a.pick,k=a.pInt,h=a.splat,p=a.wrap,c,e,m=a.Axis.prototype;a=a.Tick.prototype;c={getOffset:r,redraw:function(){this.isDirty=!1},render:function(){this.isDirty=
!1},setScale:r,setCategories:r,setTitle:r};e={defaultRadialGaugeOptions:{labels:{align:"center",x:0,y:null},minorGridLineWidth:0,minorTickInterval:"auto",minorTickLength:10,minorTickPosition:"inside",minorTickWidth:1,tickLength:10,tickPosition:"inside",tickWidth:2,title:{rotation:0},zIndex:2},defaultRadialXOptions:{gridLineWidth:1,labels:{align:null,distance:15,x:0,y:null},maxPadding:0,minPadding:0,showLastLabel:!1,tickLength:0},defaultRadialYOptions:{gridLineInterpolation:"circle",labels:{align:"right",
x:-3,y:-2},showLastLabel:!1,title:{x:4,text:null,rotation:90}},setOptions:function(c){c=this.options=n(this.defaultOptions,this.defaultRadialOptions,c);c.plotBands||(c.plotBands=[])},getOffset:function(){m.getOffset.call(this);this.chart.axisOffset[this.side]=0;this.center=this.pane.center=l.getCenter.call(this.pane)},getLinePath:function(c,b){c=this.center;var q=this.chart,f=d(b,c[2]/2-this.offset);this.isCircular||void 0!==b?b=this.chart.renderer.symbols.arc(this.left+c[0],this.top+c[1],f,f,{start:this.startAngleRad,
end:this.endAngleRad,open:!0,innerR:0}):(b=this.postTranslate(this.angleRad,f),b=["M",c[0]+q.plotLeft,c[1]+q.plotTop,"L",b.x,b.y]);return b},setAxisTranslation:function(){m.setAxisTranslation.call(this);this.center&&(this.transA=this.isCircular?(this.endAngleRad-this.startAngleRad)/(this.max-this.min||1):this.center[2]/2/(this.max-this.min||1),this.minPixelPadding=this.isXAxis?this.transA*this.minPointOffset:0)},beforeSetTickPositions:function(){if(this.autoConnect=this.isCircular&&void 0===d(this.userMax,
this.options.max)&&this.endAngleRad-this.startAngleRad===2*Math.PI)this.max+=this.categories&&1||this.pointRange||this.closestPointRange||0},setAxisSize:function(){m.setAxisSize.call(this);this.isRadial&&(this.center=this.pane.center=l.getCenter.call(this.pane),this.isCircular&&(this.sector=this.endAngleRad-this.startAngleRad),this.len=this.width=this.height=this.center[2]*d(this.sector,1)/2)},getPosition:function(c,b){return this.postTranslate(this.isCircular?this.translate(c):this.angleRad,d(this.isCircular?
b:this.translate(c),this.center[2]/2)-this.offset)},postTranslate:function(c,b){var d=this.chart,f=this.center;c=this.startAngleRad+c;return{x:d.plotLeft+f[0]+Math.cos(c)*b,y:d.plotTop+f[1]+Math.sin(c)*b}},getPlotBandPath:function(c,b,e){var f=this.center,q=this.startAngleRad,h=f[2]/2,a=[d(e.outerRadius,"100%"),e.innerRadius,d(e.thickness,10)],m=Math.min(this.offset,0),p=/%$/,v,n=this.isCircular;"polygon"===this.options.gridLineInterpolation?f=this.getPlotLinePath(c).concat(this.getPlotLinePath(b,
!0)):(c=Math.max(c,this.min),b=Math.min(b,this.max),n||(a[0]=this.translate(c),a[1]=this.translate(b)),a=g(a,function(c){p.test(c)&&(c=k(c,10)*h/100);return c}),"circle"!==e.shape&&n?(c=q+this.translate(c),b=q+this.translate(b)):(c=-Math.PI/2,b=1.5*Math.PI,v=!0),a[0]-=m,a[2]-=m,f=this.chart.renderer.symbols.arc(this.left+f[0],this.top+f[1],a[0],a[0],{start:Math.min(c,b),end:Math.max(c,b),innerR:d(a[1],a[0]-a[2]),open:v}));return f},getPlotLinePath:function(c,b){var d=this,f=d.center,e=d.chart,k=d.getPosition(c),
a,q,h;d.isCircular?h=["M",f[0]+e.plotLeft,f[1]+e.plotTop,"L",k.x,k.y]:"circle"===d.options.gridLineInterpolation?(c=d.translate(c))&&(h=d.getLinePath(0,c)):(t(e.xAxis,function(c){c.pane===d.pane&&(a=c)}),h=[],c=d.translate(c),f=a.tickPositions,a.autoConnect&&(f=f.concat([f[0]])),b&&(f=[].concat(f).reverse()),t(f,function(b,d){q=a.getPosition(b,c);h.push(d?"L":"M",q.x,q.y)}));return h},getTitlePosition:function(){var c=this.center,b=this.chart,d=this.options.title;return{x:b.plotLeft+c[0]+(d.x||0),
y:b.plotTop+c[1]-{high:.5,middle:.25,low:0}[d.align]*c[2]+(d.y||0)}}};p(m,"init",function(k,f,a){var q=f.angular,m=f.polar,p=a.isX,v=q&&p,g,r=f.options,l=a.pane||0;if(q){if(u(this,v?c:e),g=!p)this.defaultRadialOptions=this.defaultRadialGaugeOptions}else m&&(u(this,e),this.defaultRadialOptions=(g=p)?this.defaultRadialXOptions:n(this.defaultYAxisOptions,this.defaultRadialYOptions));q||m?(this.isRadial=!0,f.inverted=!1,r.chart.zoomType=null):this.isRadial=!1;k.call(this,f,a);v||!q&&!m||(k=this.options,
f.panes||(f.panes=[]),this.pane=f=f.panes[l]=f.panes[l]||new b(h(r.pane)[l],f,this),f=f.options,this.angleRad=(k.angle||0)*Math.PI/180,this.startAngleRad=(f.startAngle-90)*Math.PI/180,this.endAngleRad=(d(f.endAngle,f.startAngle+360)-90)*Math.PI/180,this.offset=k.offset||0,this.isCircular=g)});p(m,"autoLabelAlign",function(c){if(!this.isRadial)return c.apply(this,[].slice.call(arguments,1))});p(a,"getPosition",function(c,b,d,k,e){var f=this.axis;return f.getPosition?f.getPosition(d):c.call(this,b,
d,k,e)});p(a,"getLabelPosition",function(c,b,k,e,a,h,m,p,n){var f=this.axis,q=h.y,v=20,y=h.align,g=(f.translate(this.pos)+f.startAngleRad+Math.PI/2)/Math.PI*180%360;f.isRadial?(c=f.getPosition(this.pos,f.center[2]/2+d(h.distance,-25)),"auto"===h.rotation?e.attr({rotation:g}):null===q&&(q=f.chart.renderer.fontMetrics(e.styles.fontSize).b-e.getBBox().height/2),null===y&&(f.isCircular?(this.label.getBBox().width>f.len*f.tickInterval/(f.max-f.min)&&(v=0),y=g>v&&g<180-v?"left":g>180+v&&g<360-v?"right":
"center"):y="center",e.attr({align:y})),c.x+=h.x,c.y+=q):c=c.call(this,b,k,e,a,h,m,p,n);return c});p(a,"getMarkPath",function(c,b,d,e,k,a,h){var f=this.axis;f.isRadial?(c=f.getPosition(this.pos,f.center[2]/2+e),b=["M",b,d,"L",c.x,c.y]):b=c.call(this,b,d,e,k,a,h);return b})})(w);(function(a){var l=a.each,t=a.noop,u=a.pick,g=a.Series,n=a.seriesType,r=a.seriesTypes;n("arearange","area",{marker:null,threshold:null,tooltip:{pointFormat:'\x3cspan class\x3d"highcharts-color-{series.colorIndex}"\x3e\u25cf\x3c/span\x3e {series.name}: \x3cb\x3e{point.low}\x3c/b\x3e - \x3cb\x3e{point.high}\x3c/b\x3e\x3cbr/\x3e'},
trackByArea:!0,dataLabels:{align:null,verticalAlign:null,xLow:0,xHigh:0,yLow:0,yHigh:0},states:{hover:{halo:!1}}},{pointArrayMap:["low","high"],dataLabelCollections:["dataLabel","dataLabelUpper"],toYData:function(b){return[b.low,b.high]},pointValKey:"low",deferTranslatePolar:!0,highToXY:function(b){var d=this.chart,k=this.xAxis.postTranslate(b.rectPlotX,this.yAxis.len-b.plotHigh);b.plotHighX=k.x-d.plotLeft;b.plotHigh=k.y-d.plotTop},translate:function(){var b=this,d=b.yAxis,k=!!b.modifyValue;r.area.prototype.translate.apply(b);
l(b.points,function(a){var h=a.low,c=a.high,e=a.plotY;null===c||null===h?a.isNull=!0:(a.plotLow=e,a.plotHigh=d.translate(k?b.modifyValue(c,a):c,0,1,0,1),k&&(a.yBottom=a.plotHigh))});this.chart.polar&&l(this.points,function(d){b.highToXY(d)})},getGraphPath:function(b){var d=[],a=[],h,p=r.area.prototype.getGraphPath,c,e,m;m=this.options;var q=m.step;b=b||this.points;for(h=b.length;h--;)c=b[h],c.isNull||m.connectEnds||b[h+1]&&!b[h+1].isNull||a.push({plotX:c.plotX,plotY:c.plotY,doCurve:!1}),e={polarPlotY:c.polarPlotY,
rectPlotX:c.rectPlotX,yBottom:c.yBottom,plotX:u(c.plotHighX,c.plotX),plotY:c.plotHigh,isNull:c.isNull},a.push(e),d.push(e),c.isNull||m.connectEnds||b[h-1]&&!b[h-1].isNull||a.push({plotX:c.plotX,plotY:c.plotY,doCurve:!1});b=p.call(this,b);q&&(!0===q&&(q="left"),m.step={left:"right",center:"center",right:"left"}[q]);d=p.call(this,d);a=p.call(this,a);m.step=q;m=[].concat(b,d);this.chart.polar||"M"!==a[0]||(a[0]="L");this.graphPath=m;this.areaPath=this.areaPath.concat(b,a);m.isArea=!0;m.xMap=b.xMap;this.areaPath.xMap=
b.xMap;return m},drawDataLabels:function(){var b=this.data,d=b.length,a,h=[],p=g.prototype,c=this.options.dataLabels,e=c.align,m=c.verticalAlign,q=c.inside,f,v,n=this.chart.inverted;if(c.enabled||this._hasPointLabels){for(a=d;a--;)if(f=b[a])v=q?f.plotHigh<f.plotLow:f.plotHigh>f.plotLow,f.y=f.high,f._plotY=f.plotY,f.plotY=f.plotHigh,h[a]=f.dataLabel,f.dataLabel=f.dataLabelUpper,f.below=v,n?e||(c.align=v?"right":"left"):m||(c.verticalAlign=v?"top":"bottom"),c.x=c.xHigh,c.y=c.yHigh;p.drawDataLabels&&
p.drawDataLabels.apply(this,arguments);for(a=d;a--;)if(f=b[a])v=q?f.plotHigh<f.plotLow:f.plotHigh>f.plotLow,f.dataLabelUpper=f.dataLabel,f.dataLabel=h[a],f.y=f.low,f.plotY=f._plotY,f.below=!v,n?e||(c.align=v?"left":"right"):m||(c.verticalAlign=v?"bottom":"top"),c.x=c.xLow,c.y=c.yLow;p.drawDataLabels&&p.drawDataLabels.apply(this,arguments)}c.align=e;c.verticalAlign=m},alignDataLabel:function(){r.column.prototype.alignDataLabel.apply(this,arguments)},setStackedPoints:t,getSymbol:t,drawPoints:t})})(w);
(function(a){var l=a.seriesType;l("areasplinerange","arearange",null,{getPointSpline:a.seriesTypes.spline.prototype.getPointSpline})})(w);(function(a){var l=a.defaultPlotOptions,t=a.each,u=a.merge,g=a.noop,n=a.pick,r=a.seriesType,b=a.seriesTypes.column.prototype;r("columnrange","arearange",u(l.column,l.arearange,{lineWidth:1,pointRange:null}),{translate:function(){var a=this,k=a.yAxis,h=a.xAxis,p=h.startAngleRad,c,e=a.chart,m=a.xAxis.isRadial,q;b.translate.apply(a);t(a.points,function(b){var d=b.shapeArgs,
f=a.options.minPointLength,g,l;b.plotHigh=q=k.translate(b.high,0,1,0,1);b.plotLow=b.plotY;l=q;g=n(b.rectPlotY,b.plotY)-q;Math.abs(g)<f?(f-=g,g+=f,l-=f/2):0>g&&(g*=-1,l-=g);m?(c=b.barX+p,b.shapeType="path",b.shapeArgs={d:a.polarArc(l+g,l,c,c+b.pointWidth)}):(d.height=g,d.y=l,b.tooltipPos=e.inverted?[k.len+k.pos-e.plotLeft-l-g/2,h.len+h.pos-e.plotTop-d.x-d.width/2,g]:[h.left-e.plotLeft+d.x+d.width/2,k.pos-e.plotTop+l+g/2,g])})},directTouch:!0,trackerGroups:["group","dataLabelsGroup"],drawGraph:g,crispCol:b.crispCol,
drawPoints:b.drawPoints,drawTracker:b.drawTracker,getColumnMetrics:b.getColumnMetrics,animate:function(){return b.animate.apply(this,arguments)},polarArc:function(){return b.polarArc.apply(this,arguments)},pointAttribs:b.pointAttribs})})(w);(function(a){var l=a.each,t=a.isNumber,u=a.merge,g=a.pick,n=a.pInt,r=a.Series,b=a.seriesType,d=a.TrackerMixin;b("gauge","line",{dataLabels:{enabled:!0,defer:!1,y:15,borderRadius:3,crop:!1,verticalAlign:"top",zIndex:2},dial:{},pivot:{},tooltip:{headerFormat:""},
showInLegend:!1},{angular:!0,directTouch:!0,drawGraph:a.noop,fixedBox:!0,forceDL:!0,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],translate:function(){var b=this.yAxis,a=this.options,d=b.center;this.generatePoints();l(this.points,function(c){var e=u(a.dial,c.dial),k=n(g(e.radius,80))*d[2]/200,h=n(g(e.baseLength,70))*k/100,f=n(g(e.rearLength,10))*k/100,p=e.baseWidth||3,l=e.topWidth||1,r=a.overshoot,x=b.startAngleRad+b.translate(c.y,null,null,null,!0);t(r)?(r=r/180*Math.PI,x=Math.max(b.startAngleRad-
r,Math.min(b.endAngleRad+r,x))):!1===a.wrap&&(x=Math.max(b.startAngleRad,Math.min(b.endAngleRad,x)));x=180*x/Math.PI;c.shapeType="path";c.shapeArgs={d:e.path||["M",-f,-p/2,"L",h,-p/2,k,-l/2,k,l/2,h,p/2,-f,p/2,"z"],translateX:d[0],translateY:d[1],rotation:x};c.plotX=d[0];c.plotY=d[1]})},drawPoints:function(){var b=this,a=b.yAxis.center,d=b.pivot,c=b.options,e=c.pivot,m=b.chart.renderer;l(b.points,function(a){var d=a.graphic,e=a.shapeArgs,k=e.d;u(c.dial,a.dial);d?(d.animate(e),e.d=k):a.graphic=m[a.shapeType](e).attr({rotation:e.rotation,
zIndex:1}).addClass("highcharts-dial").add(b.group)});d?d.animate({translateX:a[0],translateY:a[1]}):b.pivot=m.circle(0,0,g(e.radius,5)).attr({zIndex:2}).addClass("highcharts-pivot").translate(a[0],a[1]).add(b.group)},animate:function(b){var a=this;b||(l(a.points,function(b){var c=b.graphic;c&&(c.attr({rotation:180*a.yAxis.startAngleRad/Math.PI}),c.animate({rotation:b.shapeArgs.rotation},a.options.animation))}),a.animate=null)},render:function(){this.group=this.plotGroup("group","series",this.visible?
"visible":"hidden",this.options.zIndex,this.chart.seriesGroup);r.prototype.render.call(this);this.group.clip(this.chart.clipRect)},setData:function(b,a){r.prototype.setData.call(this,b,!1);this.processData();this.generatePoints();g(a,!0)&&this.chart.redraw()},drawTracker:d&&d.drawTrackerPoint},{setState:function(b){this.state=b}})})(w);(function(a){var l=a.each,t=a.noop,u=a.seriesType,g=a.seriesTypes;u("boxplot","column",{threshold:null,tooltip:{pointFormat:'\x3cspan class\x3d"highcharts-color-{point.colorIndex}"\x3e\u25cf\x3c/span\x3e \x3cb\x3e {series.name}\x3c/b\x3e\x3cbr/\x3eMaximum: {point.high}\x3cbr/\x3eUpper quartile: {point.q3}\x3cbr/\x3eMedian: {point.median}\x3cbr/\x3eLower quartile: {point.q1}\x3cbr/\x3eMinimum: {point.low}\x3cbr/\x3e'},
whiskerLength:"50%"},{pointArrayMap:["low","q1","median","q3","high"],toYData:function(a){return[a.low,a.q1,a.median,a.q3,a.high]},pointValKey:"high",drawDataLabels:t,translate:function(){var a=this.yAxis,r=this.pointArrayMap;g.column.prototype.translate.apply(this);l(this.points,function(b){l(r,function(d){null!==b[d]&&(b[d+"Plot"]=a.translate(b[d],0,1,0,1))})})},drawPoints:function(){var a=this,g=a.chart.renderer,b,d,k,h,p,c,e=0,m,q,f,v,y=!1!==a.doQuartiles,t,u=a.options.whiskerLength;l(a.points,
function(l){var n=l.graphic,r=n?"animate":"attr",x=l.shapeArgs;void 0!==l.plotY&&(m=x.width,q=Math.floor(x.x),f=q+m,v=Math.round(m/2),b=Math.floor(y?l.q1Plot:l.lowPlot),d=Math.floor(y?l.q3Plot:l.lowPlot),k=Math.floor(l.highPlot),h=Math.floor(l.lowPlot),n||(l.graphic=n=g.g("point").add(a.group),l.stem=g.path().addClass("highcharts-boxplot-stem").add(n),u&&(l.whiskers=g.path().addClass("highcharts-boxplot-whisker").add(n)),y&&(l.box=g.path(void 0).addClass("highcharts-boxplot-box").add(n)),l.medianShape=
g.path(void 0).addClass("highcharts-boxplot-median").add(n)),c=l.stem.strokeWidth()%2/2,e=q+v+c,l.stem[r]({d:["M",e,d,"L",e,k,"M",e,b,"L",e,h]}),y&&(c=l.box.strokeWidth()%2/2,b=Math.floor(b)+c,d=Math.floor(d)+c,q+=c,f+=c,l.box[r]({d:["M",q,d,"L",q,b,"L",f,b,"L",f,d,"L",q,d,"z"]})),u&&(c=l.whiskers.strokeWidth()%2/2,k+=c,h+=c,t=/%$/.test(u)?v*parseFloat(u)/100:u/2,l.whiskers[r]({d:["M",e-t,k,"L",e+t,k,"M",e-t,h,"L",e+t,h]})),p=Math.round(l.medianPlot),c=l.medianShape.strokeWidth()%2/2,p+=c,l.medianShape[r]({d:["M",
q,p,"L",f,p]}))})},setStackedPoints:t})})(w);(function(a){var l=a.each,t=a.noop,u=a.seriesType,g=a.seriesTypes;u("errorbar","boxplot",{grouping:!1,linkedTo:":previous",tooltip:{pointFormat:'\x3cspan style\x3d"color:{point.color}"\x3e\u25cf\x3c/span\x3e {series.name}: \x3cb\x3e{point.low}\x3c/b\x3e - \x3cb\x3e{point.high}\x3c/b\x3e\x3cbr/\x3e'},whiskerWidth:null},{type:"errorbar",pointArrayMap:["low","high"],toYData:function(a){return[a.low,a.high]},pointValKey:"high",doQuartiles:!1,drawDataLabels:g.arearange?
function(){var a=this.pointValKey;g.arearange.prototype.drawDataLabels.call(this);l(this.data,function(l){l.y=l[a]})}:t,getColumnMetrics:function(){return this.linkedParent&&this.linkedParent.columnMetrics||g.column.prototype.getColumnMetrics.call(this)}})})(w);(function(a){var l=a.correctFloat,t=a.isNumber,u=a.pick,g=a.Point,n=a.Series,r=a.seriesType,b=a.seriesTypes;r("waterfall","column",{dataLabels:{inside:!0}},{pointValKey:"y",translate:function(){var a=this.options,k=this.yAxis,h,p,c,e,m,q,f,
g,n,r=u(a.minPointLength,5),t=a.threshold,w=a.stacking;b.column.prototype.translate.apply(this);this.minPointLengthOffset=0;f=g=t;p=this.points;h=0;for(a=p.length;h<a;h++)c=p[h],q=this.processedYData[h],e=c.shapeArgs,n=(m=w&&k.stacks[(this.negStacks&&q<t?"-":"")+this.stackKey])?m[c.x].points[this.index+","+h]:[0,q],c.isSum?c.y=l(q):c.isIntermediateSum&&(c.y=l(q-g)),m=Math.max(f,f+c.y)+n[0],e.y=k.toPixels(m,!0),c.isSum?(e.y=k.toPixels(n[1],!0),e.height=Math.min(k.toPixels(n[0],!0),k.len)-e.y+this.minPointLengthOffset):
c.isIntermediateSum?(e.y=k.toPixels(n[1],!0),e.height=Math.min(k.toPixels(g,!0),k.len)-e.y+this.minPointLengthOffset,g=n[1]):(e.height=0<q?k.toPixels(f,!0)-e.y:k.toPixels(f,!0)-k.toPixels(f-q,!0),f+=q),0>e.height&&(e.y+=e.height,e.height*=-1),c.plotY=e.y=Math.round(e.y)-this.borderWidth%2/2,e.height=Math.max(Math.round(e.height),.001),c.yBottom=e.y+e.height,e.height<=r&&(e.height=r,this.minPointLengthOffset+=r),e.y-=this.minPointLengthOffset,e=c.plotY+(c.negative?e.height:0)-this.minPointLengthOffset,
this.chart.inverted?c.tooltipPos[0]=k.len-e:c.tooltipPos[1]=e},processData:function(b){var a=this.yData,d=this.options.data,p,c=a.length,e,m,q,f,g,r;m=e=q=f=this.options.threshold||0;for(r=0;r<c;r++)g=a[r],p=d&&d[r]?d[r]:{},"sum"===g||p.isSum?a[r]=l(m):"intermediateSum"===g||p.isIntermediateSum?a[r]=l(e):(m+=g,e+=g),q=Math.min(m,q),f=Math.max(m,f);n.prototype.processData.call(this,b);this.dataMin=q;this.dataMax=f},toYData:function(b){return b.isSum?0===b.x?null:"sum":b.isIntermediateSum?0===b.x?null:
"intermediateSum":b.y},getGraphPath:function(){return["M",0,0]},getCrispPath:function(){var b=this.data,a=b.length,h=this.graph.strokeWidth()+this.borderWidth,h=Math.round(h)%2/2,p=[],c,e,m;for(m=1;m<a;m++)e=b[m].shapeArgs,c=b[m-1].shapeArgs,e=["M",c.x+c.width,c.y+h,"L",e.x,c.y+h],0>b[m-1].y&&(e[2]+=c.height,e[5]+=c.height),p=p.concat(e);return p},drawGraph:function(){n.prototype.drawGraph.call(this);this.graph.attr({d:this.getCrispPath()})},getExtremes:a.noop},{getClassName:function(){var b=g.prototype.getClassName.call(this);
this.isSum?b+=" highcharts-sum":this.isIntermediateSum&&(b+=" highcharts-intermediate-sum");return b},isValid:function(){return t(this.y,!0)||this.isSum||this.isIntermediateSum}})})(w);(function(a){var l=a.Series,t=a.seriesType,u=a.seriesTypes;t("polygon","scatter",{marker:{enabled:!1,states:{hover:{enabled:!1}}},stickyTracking:!1,tooltip:{followPointer:!0,pointFormat:""},trackByArea:!0},{type:"polygon",getGraphPath:function(){for(var a=l.prototype.getGraphPath.call(this),n=a.length+1;n--;)(n===a.length||
"M"===a[n])&&0<n&&a.splice(n,0,"z");return this.areaPath=a},drawGraph:function(){u.area.prototype.drawGraph.call(this)},drawLegendSymbol:a.LegendSymbolMixin.drawRectangle,drawTracker:l.prototype.drawTracker,setStackedPoints:a.noop})})(w);(function(a){var l=a.arrayMax,t=a.arrayMin,u=a.Axis,g=a.each,n=a.isNumber,r=a.noop,b=a.pick,d=a.pInt,k=a.Point,h=a.seriesType,p=a.seriesTypes;h("bubble","scatter",{dataLabels:{formatter:function(){return this.point.z},inside:!0,verticalAlign:"middle"},marker:{radius:null,
states:{hover:{radiusPlus:0}}},minSize:8,maxSize:"20%",softThreshold:!1,states:{hover:{halo:{size:5}}},tooltip:{pointFormat:"({point.x}, {point.y}), Size: {point.z}"},turboThreshold:0,zThreshold:0,zoneAxis:"z"},{pointArrayMap:["y","z"],parallelArrays:["x","y","z"],trackerGroups:["group","dataLabelsGroup"],bubblePadding:!0,zoneAxis:"z",markerAttribs:null,getRadii:function(b,a,d,k){var c,e,m,h=this.zData,p=[],q=this.options,l="width"!==q.sizeBy,g=q.zThreshold,n=a-b;e=0;for(c=h.length;e<c;e++)m=h[e],
q.sizeByAbsoluteValue&&null!==m&&(m=Math.abs(m-g),a=Math.max(a-g,Math.abs(b-g)),b=0),null===m?m=null:m<b?m=d/2-1:(m=0<n?(m-b)/n:.5,l&&0<=m&&(m=Math.sqrt(m)),m=Math.ceil(d+m*(k-d))/2),p.push(m);this.radii=p},animate:function(b){var a=this.options.animation;b||(g(this.points,function(b){var c=b.graphic;b=b.shapeArgs;c&&b&&(c.attr("r",1),c.animate({r:b.r},a))}),this.animate=null)},translate:function(){var b,a=this.data,d,k,f=this.radii;p.scatter.prototype.translate.call(this);for(b=a.length;b--;)d=a[b],
k=f?f[b]:0,n(k)&&k>=this.minPxSize/2?(d.shapeType="circle",d.shapeArgs={x:d.plotX,y:d.plotY,r:k},d.dlBox={x:d.plotX-k,y:d.plotY-k,width:2*k,height:2*k}):d.shapeArgs=d.plotY=d.dlBox=void 0},drawLegendSymbol:function(b,a){var c=this.chart.renderer,d=c.fontMetrics(b.itemStyle.fontSize).f/2;a.legendSymbol=c.circle(d,b.baseline-d,d).attr({zIndex:3}).add(a.legendGroup);a.legendSymbol.isMarker=!0},drawPoints:p.column.prototype.drawPoints,alignDataLabel:p.column.prototype.alignDataLabel,buildKDTree:r,applyZones:r},
{haloPath:function(){return k.prototype.haloPath.call(this,this.shapeArgs.r+this.series.options.states.hover.halo.size)},ttBelow:!1});u.prototype.beforePadding=function(){var a=this,e=this.len,k=this.chart,h=0,f=e,p=this.isXAxis,r=p?"xData":"yData",u=this.min,w={},E=Math.min(k.plotWidth,k.plotHeight),A=Number.MAX_VALUE,B=-Number.MAX_VALUE,C=this.max-u,z=e/C,D=[];g(this.series,function(c){var e=c.options;!c.bubblePadding||!c.visible&&k.options.chart.ignoreHiddenSeries||(a.allowZoomOutside=!0,D.push(c),
p&&(g(["minSize","maxSize"],function(b){var a=e[b],c=/%$/.test(a),a=d(a);w[b]=c?E*a/100:a}),c.minPxSize=w.minSize,c.maxPxSize=w.maxSize,c=c.zData,c.length&&(A=b(e.zMin,Math.min(A,Math.max(t(c),!1===e.displayNegative?e.zThreshold:-Number.MAX_VALUE))),B=b(e.zMax,Math.max(B,l(c))))))});g(D,function(b){var c=b[r],d=c.length,e;p&&b.getRadii(A,B,b.minPxSize,b.maxPxSize);if(0<C)for(;d--;)n(c[d])&&a.dataMin<=c[d]&&c[d]<=a.dataMax&&(e=b.radii[d],h=Math.min((c[d]-u)*z-e,h),f=Math.max((c[d]-u)*z+e,f))});D.length&&
0<C&&!this.isLog&&(f-=e,z*=(e+h-f)/e,g([["min","userMin",h],["max","userMax",f]],function(c){void 0===b(a.options[c[0]],a[c[1]])&&(a[c[0]]+=c[2]/z)}))}})(w);(function(a){function l(b,a){var d=this.chart,h=this.options.animation,p=this.group,c=this.markerGroup,e=this.xAxis.center,m=d.plotLeft,g=d.plotTop;d.polar?d.renderer.isSVG&&(!0===h&&(h={}),a?(b={translateX:e[0]+m,translateY:e[1]+g,scaleX:.001,scaleY:.001},p.attr(b),c&&c.attr(b)):(b={translateX:m,translateY:g,scaleX:1,scaleY:1},p.animate(b,h),
c&&c.animate(b,h),this.animate=null)):b.call(this,a)}var t=a.each,u=a.pick,g=a.seriesTypes,n=a.wrap,r=a.Series.prototype;a=a.Pointer.prototype;r.searchPointByAngle=function(b){var a=this.chart,k=this.xAxis.pane.center;return this.searchKDTree({clientX:180+-180/Math.PI*Math.atan2(b.chartX-k[0]-a.plotLeft,b.chartY-k[1]-a.plotTop)})};n(r,"buildKDTree",function(b){this.chart.polar&&(this.kdByAngle?this.searchPoint=this.searchPointByAngle:this.kdDimensions=2);b.apply(this)});r.toXY=function(b){var a,k=
this.chart,h=b.plotX;a=b.plotY;b.rectPlotX=h;b.rectPlotY=a;a=this.xAxis.postTranslate(b.plotX,this.yAxis.len-a);b.plotX=b.polarPlotX=a.x-k.plotLeft;b.plotY=b.polarPlotY=a.y-k.plotTop;this.kdByAngle?(k=(h/Math.PI*180+this.xAxis.pane.options.startAngle)%360,0>k&&(k+=360),b.clientX=k):b.clientX=b.plotX};g.spline&&n(g.spline.prototype,"getPointSpline",function(a,d,k,h){var b,c,e,m,g,f,l;this.chart.polar?(b=k.plotX,c=k.plotY,a=d[h-1],e=d[h+1],this.connectEnds&&(a||(a=d[d.length-2]),e||(e=d[1])),a&&e&&
(m=a.plotX,g=a.plotY,d=e.plotX,f=e.plotY,m=(1.5*b+m)/2.5,g=(1.5*c+g)/2.5,e=(1.5*b+d)/2.5,l=(1.5*c+f)/2.5,d=Math.sqrt(Math.pow(m-b,2)+Math.pow(g-c,2)),f=Math.sqrt(Math.pow(e-b,2)+Math.pow(l-c,2)),m=Math.atan2(g-c,m-b),g=Math.atan2(l-c,e-b),l=Math.PI/2+(m+g)/2,Math.abs(m-l)>Math.PI/2&&(l-=Math.PI),m=b+Math.cos(l)*d,g=c+Math.sin(l)*d,e=b+Math.cos(Math.PI+l)*f,l=c+Math.sin(Math.PI+l)*f,k.rightContX=e,k.rightContY=l),h?(k=["C",a.rightContX||a.plotX,a.rightContY||a.plotY,m||b,g||c,b,c],a.rightContX=a.rightContY=
null):k=["M",b,c]):k=a.call(this,d,k,h);return k});n(r,"translate",function(a){var b=this.chart;a.call(this);if(b.polar&&(this.kdByAngle=b.tooltip&&b.tooltip.shared,!this.preventPostTranslate))for(a=this.points,b=a.length;b--;)this.toXY(a[b])});n(r,"getGraphPath",function(a,d){var b=this,h,g;if(this.chart.polar){d=d||this.points;for(h=0;h<d.length;h++)if(!d[h].isNull){g=h;break}!1!==this.options.connectEnds&&void 0!==g&&(this.connectEnds=!0,d.splice(d.length,0,d[g]));t(d,function(a){void 0===a.polarPlotY&&
b.toXY(a)})}return a.apply(this,[].slice.call(arguments,1))});n(r,"animate",l);g.column&&(g=g.column.prototype,g.polarArc=function(a,d,k,h){var b=this.xAxis.center,c=this.yAxis.len;return this.chart.renderer.symbols.arc(b[0],b[1],c-d,null,{start:k,end:h,innerR:c-u(a,c)})},n(g,"animate",l),n(g,"translate",function(a){var b=this.xAxis,k=b.startAngleRad,h,g,c;this.preventPostTranslate=!0;a.call(this);if(b.isRadial)for(h=this.points,c=h.length;c--;)g=h[c],a=g.barX+k,g.shapeType="path",g.shapeArgs={d:this.polarArc(g.yBottom,
g.plotY,a,a+g.pointWidth)},this.toXY(g),g.tooltipPos=[g.plotX,g.plotY],g.ttBelow=g.plotY>b.center[1]}),n(g,"alignDataLabel",function(a,d,g,h,l,c){this.chart.polar?(a=d.rectPlotX/Math.PI*180,null===h.align&&(h.align=20<a&&160>a?"left":200<a&&340>a?"right":"center"),null===h.verticalAlign&&(h.verticalAlign=45>a||315<a?"bottom":135<a&&225>a?"top":"middle"),r.alignDataLabel.call(this,d,g,h,l,c)):a.call(this,d,g,h,l,c)}));n(a,"getCoordinates",function(a,d){var b=this.chart,g={xAxis:[],yAxis:[]};b.polar?
t(b.axes,function(a){var c=a.isXAxis,e=a.center,h=d.chartX-e[0]-b.plotLeft,e=d.chartY-e[1]-b.plotTop;g[c?"xAxis":"yAxis"].push({axis:a,value:a.translate(c?Math.PI-Math.atan2(h,e):Math.sqrt(Math.pow(h,2)+Math.pow(e,2)),!0)})}):g=a.call(this,d);return g})})(w)});

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,343 @@
/*
Highcharts JS v5.0.2 (2016-10-26)
(c) 2009-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(L,a){"object"===typeof module&&module.exports?module.exports=L.document?a(L):a:L.Highcharts=a(L)})("undefined"!==typeof window?window:this,function(L){L=function(){var a=window,C=a.document,B=a.navigator&&a.navigator.userAgent||"",E=C&&C.createElementNS&&!!C.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,H=/(edge|msie|trident)/i.test(B)&&!window.opera,l=!E,d=/Firefox/.test(B),h=d&&4>parseInt(B.split("Firefox/")[1],10);return a.Highcharts?a.Highcharts.error(16,!0):{product:"Highcharts",
version:"5.0.2",deg2rad:2*Math.PI/360,doc:C,hasBidiBug:h,hasTouch:C&&void 0!==C.documentElement.ontouchstart,isMS:H,isWebKit:/AppleWebKit/.test(B),isFirefox:d,isTouchDevice:/(Mobile|Android|Windows Phone)/.test(B),SVG_NS:"http://www.w3.org/2000/svg",idCounter:0,chartCount:0,seriesTypes:{},symbolSizes:{},svg:E,vml:l,win:a,charts:[],marginNames:["plotTop","marginRight","marginBottom","plotLeft"],noop:function(){}}}();(function(a){var C=[],B=a.charts,E=a.doc,H=a.win;a.error=function(a,d){a="Highcharts error #"+
a+": www.highcharts.com/errors/"+a;if(d)throw Error(a);H.console&&console.log(a)};a.Fx=function(a,d,h){this.options=d;this.elem=a;this.prop=h};a.Fx.prototype={dSetter:function(){var a=this.paths[0],d=this.paths[1],h=[],g=this.now,t=a.length,m;if(1===g)h=this.toD;else if(t===d.length&&1>g)for(;t--;)m=parseFloat(a[t]),h[t]=isNaN(m)?a[t]:g*parseFloat(d[t]-m)+m;else h=d;this.elem.attr("d",h)},update:function(){var a=this.elem,d=this.prop,h=this.now,g=this.options.step;if(this[d+"Setter"])this[d+"Setter"]();
else a.attr?a.element&&a.attr(d,h):a.style[d]=h+this.unit;g&&g.call(a,h,this)},run:function(a,d,h){var g=this,l=function(a){return l.stopped?!1:g.step(a)},m;this.startTime=+new Date;this.start=a;this.end=d;this.unit=h;this.now=this.start;this.pos=0;l.elem=this.elem;l()&&1===C.push(l)&&(l.timerId=setInterval(function(){for(m=0;m<C.length;m++)C[m]()||C.splice(m--,1);C.length||clearInterval(l.timerId)},13))},step:function(a){var d=+new Date,l,g=this.options;l=this.elem;var t=g.complete,m=g.duration,
c=g.curAnim,e;if(l.attr&&!l.element)l=!1;else if(a||d>=m+this.startTime){this.now=this.end;this.pos=1;this.update();a=c[this.prop]=!0;for(e in c)!0!==c[e]&&(a=!1);a&&t&&t.call(l);l=!1}else this.pos=g.easing((d-this.startTime)/m),this.now=this.start+(this.end-this.start)*this.pos,this.update(),l=!0;return l},initPath:function(l,d,h){function g(a){for(q=a.length;q--;)"M"!==a[q]&&"L"!==a[q]||a.splice(q+1,0,a[q+1],a[q+2],a[q+1],a[q+2])}function t(a,f){for(;a.length<b;){a[0]=f[b-a.length];var c=a.slice(0,
A);[].splice.apply(a,[0,0].concat(c));w&&(c=a.slice(a.length-A),[].splice.apply(a,[a.length,0].concat(c)),q--)}a[0]="M"}function m(a,c){for(var e=(b-a.length)/A;0<e&&e--;)f=a.slice().splice(a.length/G-A,A*G),f[0]=c[b-A-e*A],x&&(f[A-6]=f[A-2],f[A-5]=f[A-1]),[].splice.apply(a,[a.length/G,0].concat(f)),w&&e--}d=d||"";var c,e=l.startX,p=l.endX,x=-1<d.indexOf("C"),A=x?7:3,b,f,q;d=d.split(" ");h=h.slice();var w=l.isArea,G=w?2:1,n;x&&(g(d),g(h));if(e&&p){for(q=0;q<e.length;q++)if(e[q]===p[0]){c=q;break}else if(e[0]===
p[p.length-e.length+q]){c=q;n=!0;break}void 0===c&&(d=[])}d.length&&a.isNumber(c)&&(b=h.length+c*G*A,n?(t(d,h),m(h,d)):(t(h,d),m(d,h)));return[d,h]}};a.extend=function(a,d){var l;a||(a={});for(l in d)a[l]=d[l];return a};a.merge=function(){var l,d=arguments,h,g={},t=function(d,c){var e,p;"object"!==typeof d&&(d={});for(p in c)c.hasOwnProperty(p)&&(e=c[p],a.isObject(e,!0)&&"renderTo"!==p&&"number"!==typeof e.nodeType?d[p]=t(d[p]||{},e):d[p]=c[p]);return d};!0===d[0]&&(g=d[1],d=Array.prototype.slice.call(d,
2));h=d.length;for(l=0;l<h;l++)g=t(g,d[l]);return g};a.pInt=function(a,d){return parseInt(a,d||10)};a.isString=function(a){return"string"===typeof a};a.isArray=function(a){a=Object.prototype.toString.call(a);return"[object Array]"===a||"[object Array Iterator]"===a};a.isObject=function(l,d){return l&&"object"===typeof l&&(!d||!a.isArray(l))};a.isNumber=function(a){return"number"===typeof a&&!isNaN(a)};a.erase=function(a,d){for(var l=a.length;l--;)if(a[l]===d){a.splice(l,1);break}};a.defined=function(a){return void 0!==
a&&null!==a};a.attr=function(l,d,h){var g,t;if(a.isString(d))a.defined(h)?l.setAttribute(d,h):l&&l.getAttribute&&(t=l.getAttribute(d));else if(a.defined(d)&&a.isObject(d))for(g in d)l.setAttribute(g,d[g]);return t};a.splat=function(l){return a.isArray(l)?l:[l]};a.syncTimeout=function(a,d,h){if(d)return setTimeout(a,d,h);a.call(0,h)};a.pick=function(){var a=arguments,d,h,g=a.length;for(d=0;d<g;d++)if(h=a[d],void 0!==h&&null!==h)return h};a.css=function(l,d){a.isMS&&!a.svg&&d&&void 0!==d.opacity&&(d.filter=
"alpha(opacity\x3d"+100*d.opacity+")");a.extend(l.style,d)};a.createElement=function(l,d,h,g,t){l=E.createElement(l);var m=a.css;d&&a.extend(l,d);t&&m(l,{padding:0,border:"none",margin:0});h&&m(l,h);g&&g.appendChild(l);return l};a.extendClass=function(l,d){var h=function(){};h.prototype=new l;a.extend(h.prototype,d);return h};a.pad=function(a,d,h){return Array((d||2)+1-String(a).length).join(h||0)+a};a.relativeLength=function(a,d){return/%$/.test(a)?d*parseFloat(a)/100:parseFloat(a)};a.wrap=function(a,
d,h){var g=a[d];a[d]=function(){var a=Array.prototype.slice.call(arguments);a.unshift(g);return h.apply(this,a)}};a.getTZOffset=function(l){var d=a.Date;return 6E4*(d.hcGetTimezoneOffset&&d.hcGetTimezoneOffset(l)||d.hcTimezoneOffset||0)};a.dateFormat=function(l,d,h){if(!a.defined(d)||isNaN(d))return a.defaultOptions.lang.invalidDate||"";l=a.pick(l,"%Y-%m-%d %H:%M:%S");var g=a.Date,t=new g(d-a.getTZOffset(d)),m,c=t[g.hcGetHours](),e=t[g.hcGetDay](),p=t[g.hcGetDate](),x=t[g.hcGetMonth](),A=t[g.hcGetFullYear](),
b=a.defaultOptions.lang,f=b.weekdays,q=b.shortWeekdays,w=a.pad,g=a.extend({a:q?q[e]:f[e].substr(0,3),A:f[e],d:w(p),e:w(p,2," "),w:e,b:b.shortMonths[x],B:b.months[x],m:w(x+1),y:A.toString().substr(2,2),Y:A,H:w(c),k:c,I:w(c%12||12),l:c%12||12,M:w(t[g.hcGetMinutes]()),p:12>c?"AM":"PM",P:12>c?"am":"pm",S:w(t.getSeconds()),L:w(Math.round(d%1E3),3)},a.dateFormats);for(m in g)for(;-1!==l.indexOf("%"+m);)l=l.replace("%"+m,"function"===typeof g[m]?g[m](d):g[m]);return h?l.substr(0,1).toUpperCase()+l.substr(1):
l};a.formatSingle=function(l,d){var h=/\.([0-9])/,g=a.defaultOptions.lang;/f$/.test(l)?(h=(h=l.match(h))?h[1]:-1,null!==d&&(d=a.numberFormat(d,h,g.decimalPoint,-1<l.indexOf(",")?g.thousandsSep:""))):d=a.dateFormat(l,d);return d};a.format=function(l,d){for(var h="{",g=!1,t,m,c,e,p=[],x;l;){h=l.indexOf(h);if(-1===h)break;t=l.slice(0,h);if(g){t=t.split(":");m=t.shift().split(".");e=m.length;x=d;for(c=0;c<e;c++)x=x[m[c]];t.length&&(x=a.formatSingle(t.join(":"),x));p.push(x)}else p.push(t);l=l.slice(h+
1);h=(g=!g)?"}":"{"}p.push(l);return p.join("")};a.getMagnitude=function(a){return Math.pow(10,Math.floor(Math.log(a)/Math.LN10))};a.normalizeTickInterval=function(l,d,h,g,t){var m,c=l;h=a.pick(h,1);m=l/h;d||(d=[1,2,2.5,5,10],!1===g&&(1===h?d=[1,2,5,10]:.1>=h&&(d=[1/h])));for(g=0;g<d.length&&!(c=d[g],t&&c*h>=l||!t&&m<=(d[g]+(d[g+1]||d[g]))/2);g++);return c*h};a.stableSort=function(a,d){var h=a.length,g,t;for(t=0;t<h;t++)a[t].safeI=t;a.sort(function(a,c){g=d(a,c);return 0===g?a.safeI-c.safeI:g});for(t=
0;t<h;t++)delete a[t].safeI};a.arrayMin=function(a){for(var d=a.length,h=a[0];d--;)a[d]<h&&(h=a[d]);return h};a.arrayMax=function(a){for(var d=a.length,h=a[0];d--;)a[d]>h&&(h=a[d]);return h};a.destroyObjectProperties=function(a,d){for(var h in a)a[h]&&a[h]!==d&&a[h].destroy&&a[h].destroy(),delete a[h]};a.discardElement=function(l){var d=a.garbageBin;d||(d=a.createElement("div"));l&&d.appendChild(l);d.innerHTML=""};a.correctFloat=function(a,d){return parseFloat(a.toPrecision(d||14))};a.setAnimation=
function(l,d){d.renderer.globalAnimation=a.pick(l,d.options.chart.animation,!0)};a.animObject=function(l){return a.isObject(l)?a.merge(l):{duration:l?500:0}};a.timeUnits={millisecond:1,second:1E3,minute:6E4,hour:36E5,day:864E5,week:6048E5,month:24192E5,year:314496E5};a.numberFormat=function(l,d,h,g){l=+l||0;d=+d;var t=a.defaultOptions.lang,m=(l.toString().split(".")[1]||"").length,c,e,p=Math.abs(l);-1===d?d=Math.min(m,20):a.isNumber(d)||(d=2);c=String(a.pInt(p.toFixed(d)));e=3<c.length?c.length%3:
0;h=a.pick(h,t.decimalPoint);g=a.pick(g,t.thousandsSep);l=(0>l?"-":"")+(e?c.substr(0,e)+g:"");l+=c.substr(e).replace(/(\d{3})(?=\d)/g,"$1"+g);d&&(g=Math.abs(p-c+Math.pow(10,-Math.max(d,m)-1)),l+=h+g.toFixed(d).slice(2));return l};Math.easeInOutSine=function(a){return-.5*(Math.cos(Math.PI*a)-1)};a.getStyle=function(l,d){return"width"===d?Math.min(l.offsetWidth,l.scrollWidth)-a.getStyle(l,"padding-left")-a.getStyle(l,"padding-right"):"height"===d?Math.min(l.offsetHeight,l.scrollHeight)-a.getStyle(l,
"padding-top")-a.getStyle(l,"padding-bottom"):(l=H.getComputedStyle(l,void 0))&&a.pInt(l.getPropertyValue(d))};a.inArray=function(a,d){return d.indexOf?d.indexOf(a):[].indexOf.call(d,a)};a.grep=function(a,d){return[].filter.call(a,d)};a.map=function(a,d){for(var h=[],g=0,t=a.length;g<t;g++)h[g]=d.call(a[g],a[g],g,a);return h};a.offset=function(a){var d=E.documentElement;a=a.getBoundingClientRect();return{top:a.top+(H.pageYOffset||d.scrollTop)-(d.clientTop||0),left:a.left+(H.pageXOffset||d.scrollLeft)-
(d.clientLeft||0)}};a.stop=function(a){for(var d=C.length;d--;)C[d].elem===a&&(C[d].stopped=!0)};a.each=function(a,d,h){return Array.prototype.forEach.call(a,d,h)};a.addEvent=function(a,d,h){function g(d){d.target=d.srcElement||H;h.call(a,d)}var t=a.hcEvents=a.hcEvents||{};a.addEventListener?a.addEventListener(d,h,!1):a.attachEvent&&(a.hcEventsIE||(a.hcEventsIE={}),a.hcEventsIE[h.toString()]=g,a.attachEvent("on"+d,g));t[d]||(t[d]=[]);t[d].push(h)};a.removeEvent=function(l,d,h){function g(a,c){l.removeEventListener?
l.removeEventListener(a,c,!1):l.attachEvent&&(c=l.hcEventsIE[c.toString()],l.detachEvent("on"+a,c))}function t(){var a,e;if(l.nodeName)for(e in d?(a={},a[d]=!0):a=c,a)if(c[e])for(a=c[e].length;a--;)g(e,c[e][a])}var m,c=l.hcEvents,e;c&&(d?(m=c[d]||[],h?(e=a.inArray(h,m),-1<e&&(m.splice(e,1),c[d]=m),g(d,h)):(t(),c[d]=[])):(t(),l.hcEvents={}))};a.fireEvent=function(l,d,h,g){var t;t=l.hcEvents;var m,c;h=h||{};if(E.createEvent&&(l.dispatchEvent||l.fireEvent))t=E.createEvent("Events"),t.initEvent(d,!0,
!0),a.extend(t,h),l.dispatchEvent?l.dispatchEvent(t):l.fireEvent(d,t);else if(t)for(t=t[d]||[],m=t.length,h.target||a.extend(h,{preventDefault:function(){h.defaultPrevented=!0},target:l,type:d}),d=0;d<m;d++)(c=t[d])&&!1===c.call(l,h)&&h.preventDefault();g&&!h.defaultPrevented&&g(h)};a.animate=function(l,d,h){var g,t="",m,c,e;a.isObject(h)||(g=arguments,h={duration:g[2],easing:g[3],complete:g[4]});a.isNumber(h.duration)||(h.duration=400);h.easing="function"===typeof h.easing?h.easing:Math[h.easing]||
Math.easeInOutSine;h.curAnim=a.merge(d);for(e in d)c=new a.Fx(l,h,e),m=null,"d"===e?(c.paths=c.initPath(l,l.d,d.d),c.toD=d.d,g=0,m=1):l.attr?g=l.attr(e):(g=parseFloat(a.getStyle(l,e))||0,"opacity"!==e&&(t="px")),m||(m=d[e]),m.match&&m.match("px")&&(m=m.replace(/px/g,"")),c.run(g,m,t)};a.seriesType=function(l,d,h,g,t){var m=a.getOptions(),c=a.seriesTypes;m.plotOptions[l]=a.merge(m.plotOptions[d],h);c[l]=a.extendClass(c[d]||function(){},g);c[l].prototype.type=l;t&&(c[l].prototype.pointClass=a.extendClass(a.Point,
t));return c[l]};H.jQuery&&(H.jQuery.fn.highcharts=function(){var l=[].slice.call(arguments);if(this[0])return l[0]?(new (a[a.isString(l[0])?l.shift():"Chart"])(this[0],l[0],l[1]),this):B[a.attr(this[0],"data-highcharts-chart")]});E&&!E.defaultView&&(a.getStyle=function(l,d){var h={width:"clientWidth",height:"clientHeight"}[d];if(l.style[d])return a.pInt(l.style[d]);"opacity"===d&&(d="filter");if(h)return l.style.zoom=1,Math.max(l[h]-2*a.getStyle(l,"padding"),0);l=l.currentStyle[d.replace(/\-(\w)/g,
function(a,d){return d.toUpperCase()})];"filter"===d&&(l=l.replace(/alpha\(opacity=([0-9]+)\)/,function(a,d){return d/100}));return""===l?1:a.pInt(l)});Array.prototype.forEach||(a.each=function(a,d,h){for(var g=0,t=a.length;g<t;g++)if(!1===d.call(h,a[g],g,a))return g});Array.prototype.indexOf||(a.inArray=function(a,d){var h,g=0;if(d)for(h=d.length;g<h;g++)if(d[g]===a)return g;return-1});Array.prototype.filter||(a.grep=function(a,d){for(var h=[],g=0,t=a.length;g<t;g++)d(a[g],g)&&h.push(a[g]);return h})})(L);
(function(a){var C=a.each,B=a.isNumber,E=a.map,H=a.merge,l=a.pInt;a.Color=function(d){if(!(this instanceof a.Color))return new a.Color(d);this.init(d)};a.Color.prototype={parsers:[{regex:/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/,parse:function(a){return[l(a[1]),l(a[2]),l(a[3]),parseFloat(a[4],10)]}},{regex:/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,parse:function(a){return[l(a[1],16),l(a[2],16),l(a[3],16),1]}},{regex:/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/,
parse:function(a){return[l(a[1]),l(a[2]),l(a[3]),1]}}],names:{white:"#ffffff",black:"#000000"},init:function(d){var h,g,t,m;if((this.input=d=this.names[d]||d)&&d.stops)this.stops=E(d.stops,function(c){return new a.Color(c[1])});else for(t=this.parsers.length;t--&&!g;)m=this.parsers[t],(h=m.regex.exec(d))&&(g=m.parse(h));this.rgba=g||[]},get:function(a){var d=this.input,g=this.rgba,t;this.stops?(t=H(d),t.stops=[].concat(t.stops),C(this.stops,function(d,c){t.stops[c]=[t.stops[c][0],d.get(a)]})):t=g&&
B(g[0])?"rgb"===a||!a&&1===g[3]?"rgb("+g[0]+","+g[1]+","+g[2]+")":"a"===a?g[3]:"rgba("+g.join(",")+")":d;return t},brighten:function(a){var d,g=this.rgba;if(this.stops)C(this.stops,function(d){d.brighten(a)});else if(B(a)&&0!==a)for(d=0;3>d;d++)g[d]+=l(255*a),0>g[d]&&(g[d]=0),255<g[d]&&(g[d]=255);return this},setOpacity:function(a){this.rgba[3]=a;return this}};a.color=function(d){return new a.Color(d)}})(L);(function(a){var C,B,E=a.addEvent,H=a.animate,l=a.attr,d=a.charts,h=a.color,g=a.css,t=a.createElement,
m=a.defined,c=a.deg2rad,e=a.destroyObjectProperties,p=a.doc,x=a.each,A=a.extend,b=a.erase,f=a.grep,q=a.hasTouch,w=a.isArray,G=a.isFirefox,n=a.isMS,D=a.isObject,K=a.isString,y=a.isWebKit,I=a.merge,r=a.noop,z=a.pick,F=a.pInt,N=a.removeEvent,k=a.splat,v=a.stop,Q=a.svg,R=a.SVG_NS,P=a.symbolSizes,M=a.win;C=a.SVGElement=function(){return this};C.prototype={opacity:1,SVG_NS:R,textProps:"direction fontSize fontWeight fontFamily fontStyle color lineHeight width textDecoration textOverflow textShadow".split(" "),
init:function(a,b){this.element="span"===b?t(b):p.createElementNS(this.SVG_NS,b);this.renderer=a},animate:function(a,b,k){b=z(b,this.renderer.globalAnimation,!0);v(this);b?(k&&(b.complete=k),H(this,a,b)):this.attr(a,null,k);return this},colorGradient:function(u,b,k){var v=this.renderer,J,f,c,e,r,q,O,d,n,z,p,g=[],M;u.linearGradient?f="linearGradient":u.radialGradient&&(f="radialGradient");if(f){c=u[f];r=v.gradients;O=u.stops;z=k.radialReference;w(c)&&(u[f]=c={x1:c[0],y1:c[1],x2:c[2],y2:c[3],gradientUnits:"userSpaceOnUse"});
"radialGradient"===f&&z&&!m(c.gradientUnits)&&(e=c,c=I(c,v.getRadialAttr(z,e),{gradientUnits:"userSpaceOnUse"}));for(p in c)"id"!==p&&g.push(p,c[p]);for(p in O)g.push(O[p]);g=g.join(",");r[g]?z=r[g].attr("id"):(c.id=z="highcharts-"+a.idCounter++,r[g]=q=v.createElement(f).attr(c).add(v.defs),q.radAttr=e,q.stops=[],x(O,function(u){0===u[1].indexOf("rgba")?(J=a.color(u[1]),d=J.get("rgb"),n=J.get("a")):(d=u[1],n=1);u=v.createElement("stop").attr({offset:u[0],"stop-color":d,"stop-opacity":n}).add(q);q.stops.push(u)}));
M="url("+v.url+"#"+z+")";k.setAttribute(b,M);k.gradient=g;u.toString=function(){return M}}},applyTextShadow:function(a){var u=this.element,b,k=-1!==a.indexOf("contrast"),v={},f=this.renderer.forExport,c=this.renderer.forExport||void 0!==u.style.textShadow&&!n;k&&(v.textShadow=a=a.replace(/contrast/g,this.renderer.getContrast(u.style.fill)));if(y||f)v.textRendering="geometricPrecision";c?this.css(v):(this.fakeTS=!0,this.ySetter=this.xSetter,b=[].slice.call(u.getElementsByTagName("tspan")),x(a.split(/\s?,\s?/g),
function(a){var k=u.firstChild,v,J;a=a.split(" ");v=a[a.length-1];(J=a[a.length-2])&&x(b,function(a,b){0===b&&(a.setAttribute("x",u.getAttribute("x")),b=u.getAttribute("y"),a.setAttribute("y",b||0),null===b&&u.setAttribute("y",0));a=a.cloneNode(1);l(a,{"class":"highcharts-text-shadow",fill:v,stroke:v,"stroke-opacity":1/Math.max(F(J),3),"stroke-width":J,"stroke-linejoin":"round"});u.insertBefore(a,k)})}))},attr:function(a,b,k){var u,v=this.element,J,f=this,c;"string"===typeof a&&void 0!==b&&(u=a,a=
{},a[u]=b);if("string"===typeof a)f=(this[a+"Getter"]||this._defaultGetter).call(this,a,v);else{for(u in a)b=a[u],c=!1,this.symbolName&&/^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(u)&&(J||(this.symbolAttr(a),J=!0),c=!0),!this.rotation||"x"!==u&&"y"!==u||(this.doTransform=!0),c||(c=this[u+"Setter"]||this._defaultSetter,c.call(this,b,u,v));this.doTransform&&(this.updateTransform(),this.doTransform=!1)}k&&k();return f},addClass:function(a,b){var u=this.attr("class")||"";-1===u.indexOf(a)&&
(b||(a=(u+(u?" ":"")+a).replace(" "," ")),this.attr("class",a));return this},hasClass:function(a){return-1!==l(this.element,"class").indexOf(a)},removeClass:function(a){l(this.element,"class",(l(this.element,"class")||"").replace(a,""));return this},symbolAttr:function(a){var u=this;x("x y r start end width height innerR anchorX anchorY".split(" "),function(b){u[b]=z(a[b],u[b])});u.attr({d:u.renderer.symbols[u.symbolName](u.x,u.y,u.width,u.height,u)})},clip:function(a){return this.attr("clip-path",
a?"url("+this.renderer.url+"#"+a.id+")":"none")},crisp:function(a,b){var u,k={},v;b=b||a.strokeWidth||0;v=Math.round(b)%2/2;a.x=Math.floor(a.x||this.x||0)+v;a.y=Math.floor(a.y||this.y||0)+v;a.width=Math.floor((a.width||this.width||0)-2*v);a.height=Math.floor((a.height||this.height||0)-2*v);m(a.strokeWidth)&&(a.strokeWidth=b);for(u in a)this[u]!==a[u]&&(this[u]=k[u]=a[u]);return k},css:function(a){var u=this.styles,b={},k=this.element,v,f,c="";v=!u;a&&a.color&&(a.fill=a.color);if(u)for(f in a)a[f]!==
u[f]&&(b[f]=a[f],v=!0);if(v){v=this.textWidth=a&&a.width&&"text"===k.nodeName.toLowerCase()&&F(a.width)||this.textWidth;u&&(a=A(u,b));this.styles=a;v&&!Q&&this.renderer.forExport&&delete a.width;if(n&&!Q)g(this.element,a);else{u=function(a,u){return"-"+u.toLowerCase()};for(f in a)c+=f.replace(/([A-Z])/g,u)+":"+a[f]+";";l(k,"style",c)}this.added&&v&&this.renderer.buildText(this)}return this},getStyle:function(a){return M.getComputedStyle(this.element||this,"").getPropertyValue(a)},strokeWidth:function(){var a=
this.getStyle("stroke-width"),b;a.indexOf("px")===a.length-2?a=F(a):(b=p.createElementNS(R,"rect"),l(b,{width:a,"stroke-width":0}),this.element.parentNode.appendChild(b),a=b.getBBox().width,b.parentNode.removeChild(b));return a},on:function(a,b){var u=this,k=u.element;q&&"click"===a?(k.ontouchstart=function(a){u.touchEventFired=Date.now();a.preventDefault();b.call(k,a)},k.onclick=function(a){(-1===M.navigator.userAgent.indexOf("Android")||1100<Date.now()-(u.touchEventFired||0))&&b.call(k,a)}):k["on"+
a]=b;return this},setRadialReference:function(a){var u=this.renderer.gradients[this.element.gradient];this.element.radialReference=a;u&&u.radAttr&&u.animate(this.renderer.getRadialAttr(a,u.radAttr));return this},translate:function(a,b){return this.attr({translateX:a,translateY:b})},invert:function(a){this.inverted=a;this.updateTransform();return this},updateTransform:function(){var a=this.translateX||0,b=this.translateY||0,k=this.scaleX,v=this.scaleY,f=this.inverted,c=this.rotation,e=this.element;
f&&(a+=this.attr("width"),b+=this.attr("height"));a=["translate("+a+","+b+")"];f?a.push("rotate(90) scale(-1,1)"):c&&a.push("rotate("+c+" "+(e.getAttribute("x")||0)+" "+(e.getAttribute("y")||0)+")");(m(k)||m(v))&&a.push("scale("+z(k,1)+" "+z(v,1)+")");a.length&&e.setAttribute("transform",a.join(" "))},toFront:function(){var a=this.element;a.parentNode.appendChild(a);return this},align:function(a,k,v){var u,f,c,e,J={};f=this.renderer;c=f.alignedObjects;var r,q;if(a){if(this.alignOptions=a,this.alignByTranslate=
k,!v||K(v))this.alignTo=u=v||"renderer",b(c,this),c.push(this),v=null}else a=this.alignOptions,k=this.alignByTranslate,u=this.alignTo;v=z(v,f[u],f);u=a.align;f=a.verticalAlign;c=(v.x||0)+(a.x||0);e=(v.y||0)+(a.y||0);"right"===u?r=1:"center"===u&&(r=2);r&&(c+=(v.width-(a.width||0))/r);J[k?"translateX":"x"]=Math.round(c);"bottom"===f?q=1:"middle"===f&&(q=2);q&&(e+=(v.height-(a.height||0))/q);J[k?"translateY":"y"]=Math.round(e);this[this.placed?"animate":"attr"](J);this.placed=!0;this.alignAttr=J;return this},
getBBox:function(a,b){var u,k=this.renderer,v,f=this.element,e=this.styles,r,J=this.textStr,q,d=f.style,g,p=k.cache,w=k.cacheKeys,M;b=z(b,this.rotation);v=b*c;r=f&&C.prototype.getStyle.call(f,"font-size");void 0!==J&&(M=J.toString().replace(/[0-9]/g,"0")+["",b||0,r,f.style.width].join());M&&!a&&(u=p[M]);if(!u){if(f.namespaceURI===this.SVG_NS||k.forExport){try{g=this.fakeTS&&function(a){x(f.querySelectorAll(".highcharts-text-shadow"),function(b){b.style.display=a})},G&&d.textShadow?(q=d.textShadow,
d.textShadow=""):g&&g("none"),u=f.getBBox?A({},f.getBBox()):{width:f.offsetWidth,height:f.offsetHeight},q?d.textShadow=q:g&&g("")}catch(U){}if(!u||0>u.width)u={width:0,height:0}}else u=this.htmlGetBBox();k.isSVG&&(a=u.width,k=u.height,n&&e&&"11px"===e.fontSize&&"16.9"===k.toPrecision(3)&&(u.height=k=14),b&&(u.width=Math.abs(k*Math.sin(v))+Math.abs(a*Math.cos(v)),u.height=Math.abs(k*Math.cos(v))+Math.abs(a*Math.sin(v))));if(M&&0<u.height){for(;250<w.length;)delete p[w.shift()];p[M]||w.push(M);p[M]=
u}}return u},show:function(a){return this.attr({visibility:a?"inherit":"visible"})},hide:function(){return this.attr({visibility:"hidden"})},fadeOut:function(a){var b=this;b.animate({opacity:0},{duration:a||150,complete:function(){b.attr({y:-9999})}})},add:function(a){var b=this.renderer,u=this.element,k;a&&(this.parentGroup=a);this.parentInverted=a&&a.inverted;void 0!==this.textStr&&b.buildText(this);this.added=!0;if(!a||a.handleZ||this.zIndex)k=this.zIndexSetter();k||(a?a.element:b.box).appendChild(u);
if(this.onAdd)this.onAdd();return this},safeRemoveChild:function(a){var b=a.parentNode;b&&b.removeChild(a)},destroy:function(){var a=this.element||{},k=this.renderer.isSVG&&"SPAN"===a.nodeName&&this.parentGroup,f,c;a.onclick=a.onmouseout=a.onmouseover=a.onmousemove=a.point=null;v(this);this.clipPath&&(this.clipPath=this.clipPath.destroy());if(this.stops){for(c=0;c<this.stops.length;c++)this.stops[c]=this.stops[c].destroy();this.stops=null}for(this.safeRemoveChild(a);k&&k.div&&0===k.div.childNodes.length;)a=
k.parentGroup,this.safeRemoveChild(k.div),delete k.div,k=a;this.alignTo&&b(this.renderer.alignedObjects,this);for(f in this)delete this[f];return null},xGetter:function(a){"circle"===this.element.nodeName&&("x"===a?a="cx":"y"===a&&(a="cy"));return this._defaultGetter(a)},_defaultGetter:function(a){a=z(this[a],this.element?this.element.getAttribute(a):null,0);/^[\-0-9\.]+$/.test(a)&&(a=parseFloat(a));return a},dSetter:function(a,b,k){a&&a.join&&(a=a.join(" "));/(NaN| {2}|^$)/.test(a)&&(a="M 0 0");
k.setAttribute(b,a);this[b]=a},alignSetter:function(a){this.element.setAttribute("text-anchor",{left:"start",center:"middle",right:"end"}[a])},opacitySetter:function(a,b,k){this[b]=a;k.setAttribute(b,a)},titleSetter:function(a){var b=this.element.getElementsByTagName("title")[0];b||(b=p.createElementNS(this.SVG_NS,"title"),this.element.appendChild(b));b.firstChild&&b.removeChild(b.firstChild);b.appendChild(p.createTextNode(String(z(a),"").replace(/<[^>]*>/g,"")))},textSetter:function(a){a!==this.textStr&&
(delete this.bBox,this.textStr=a,this.added&&this.renderer.buildText(this))},fillSetter:function(a,b,k){"string"===typeof a?k.setAttribute(b,a):a&&this.colorGradient(a,b,k)},visibilitySetter:function(a,b,k){"inherit"===a?k.removeAttribute(b):k.setAttribute(b,a)},zIndexSetter:function(a,b){var k=this.renderer,u=this.parentGroup,v=(u||k).element||k.box,f,c=this.element,e;f=this.added;var r;m(a)&&(c.zIndex=a,a=+a,this[b]===a&&(f=!1),this[b]=a);if(f){(a=this.zIndex)&&u&&(u.handleZ=!0);b=v.childNodes;
for(r=0;r<b.length&&!e;r++)u=b[r],f=u.zIndex,u!==c&&(F(f)>a||!m(a)&&m(f)||0>a&&!m(f)&&v!==k.box)&&(v.insertBefore(c,u),e=!0);e||v.appendChild(c)}return e},_defaultSetter:function(a,b,k){k.setAttribute(b,a)}};C.prototype.yGetter=C.prototype.xGetter;C.prototype.translateXSetter=C.prototype.translateYSetter=C.prototype.rotationSetter=C.prototype.verticalAlignSetter=C.prototype.scaleXSetter=C.prototype.scaleYSetter=function(a,b){this[b]=a;this.doTransform=!0};B=a.SVGRenderer=function(){this.init.apply(this,
arguments)};B.prototype={Element:C,SVG_NS:R,init:function(a,b,k,v,f,c){var u;v=this.createElement("svg").attr({version:"1.1","class":"highcharts-root"});u=v.element;a.appendChild(u);-1===a.innerHTML.indexOf("xmlns")&&l(u,"xmlns",this.SVG_NS);this.isSVG=!0;this.box=u;this.boxWrapper=v;this.alignedObjects=[];this.url=(G||y)&&p.getElementsByTagName("base").length?M.location.href.replace(/#.*?$/,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"";this.createElement("desc").add().element.appendChild(p.createTextNode("Created with Highcharts 5.0.2"));
this.defs=this.createElement("defs").add();this.allowHTML=c;this.forExport=f;this.gradients={};this.cache={};this.cacheKeys=[];this.imgCount=0;this.setSize(b,k,!1);var e;G&&a.getBoundingClientRect&&(this.subPixelFix=b=function(){g(a,{left:0,top:0});e=a.getBoundingClientRect();g(a,{left:Math.ceil(e.left)-e.left+"px",top:Math.ceil(e.top)-e.top+"px"})},b(),E(M,"resize",b))},definition:function(a){function b(a,v){var f;x(k(a),function(a){var k=u.createElement(a.tagName),c,e={};for(c in a)"tagName"!==
c&&"children"!==c&&"textContent"!==c&&(e[c]=a[c]);k.attr(e);k.add(v||u.defs);a.textContent&&k.element.appendChild(p.createTextNode(a.textContent));b(a.children||[],k);f=k});return f}var u=this;return b(a)},isHidden:function(){return!this.boxWrapper.getBBox().width},destroy:function(){var a=this.defs;this.box=null;this.boxWrapper=this.boxWrapper.destroy();e(this.gradients||{});this.gradients=null;a&&(this.defs=a.destroy());this.subPixelFix&&N(M,"resize",this.subPixelFix);return this.alignedObjects=
null},createElement:function(a){var b=new this.Element;b.init(this,a);return b},draw:r,getRadialAttr:function(a,b){return{cx:a[0]-a[2]/2+b.cx*a[2],cy:a[1]-a[2]/2+b.cy*a[2],r:b.r*a[2]}},buildText:function(a){for(var b=a.element,k=this,v=k.forExport,u=z(a.textStr,"").toString(),c=-1!==u.indexOf("\x3c"),e=b.childNodes,r,q,d,n,w=l(b,"x"),M=a.styles,m=a.textWidth,y=M&&M.lineHeight,t=M&&M.textShadow,h=M&&"ellipsis"===M.textOverflow,A=e.length,D=m&&!a.added&&this.box,G=function(a){return y?F(y):k.fontMetrics(void 0,
a).h};A--;)b.removeChild(e[A]);c||t||h||m||-1!==u.indexOf(" ")?(r=/<.*class="([^"]+)".*>/,q=/<.*style="([^"]+)".*>/,d=/<.*href="(http[^"]+)".*>/,D&&D.appendChild(b),u=c?u.replace(/<(b|strong)>/g,'\x3cspan style\x3d"font-weight:bold"\x3e').replace(/<(i|em)>/g,'\x3cspan style\x3d"font-style:italic"\x3e').replace(/<a/g,"\x3cspan").replace(/<\/(b|strong|i|em|a)>/g,"\x3c/span\x3e").split(/<br.*?>/g):[u],u=f(u,function(a){return""!==a}),x(u,function(u,f){var c,e=0;u=u.replace(/^\s+|\s+$/g,"").replace(/<span/g,
"|||\x3cspan").replace(/<\/span>/g,"\x3c/span\x3e|||");c=u.split("|||");x(c,function(u){if(""!==u||1===c.length){var z={},J=p.createElementNS(k.SVG_NS,"tspan"),x,y;r.test(u)&&(x=u.match(r)[1],l(J,"class",x));q.test(u)&&(y=u.match(q)[1].replace(/(;| |^)color([ :])/,"$1fill$2"),l(J,"style",y));d.test(u)&&!v&&(l(J,"onclick",'location.href\x3d"'+u.match(d)[1]+'"'),g(J,{cursor:"pointer"}));u=(u.replace(/<(.|\n)*?>/g,"")||" ").replace(/&lt;/g,"\x3c").replace(/&gt;/g,"\x3e");if(" "!==u){J.appendChild(p.createTextNode(u));
e?z.dx=0:f&&null!==w&&(z.x=w);l(J,z);b.appendChild(J);!e&&f&&(!Q&&v&&g(J,{display:"block"}),l(J,"dy",G(J)));if(m){z=u.replace(/([^\^])-/g,"$1- ").split(" ");x="nowrap"===M.whiteSpace;for(var t=1<c.length||f||1<z.length&&!x,O,F,D=[],A=G(J),K=a.rotation,N=u,I=N.length;(t||h)&&(z.length||D.length);)a.rotation=0,O=a.getBBox(!0),F=O.width,!Q&&k.forExport&&(F=k.measureSpanWidth(J.firstChild.data,a.styles)),O=F>m,void 0===n&&(n=O),h&&n?(I/=2,""===N||!O&&.5>I?z=[]:(N=u.substring(0,N.length+(O?-1:1)*Math.ceil(I)),
z=[N+(3<m?"\u2026":"")],J.removeChild(J.firstChild))):O&&1!==z.length?(J.removeChild(J.firstChild),D.unshift(z.pop())):(z=D,D=[],z.length&&!x&&(J=p.createElementNS(R,"tspan"),l(J,{dy:A,x:w}),y&&l(J,"style",y),b.appendChild(J)),F>m&&(m=F)),z.length&&J.appendChild(p.createTextNode(z.join(" ").replace(/- /g,"-")));a.rotation=K}e++}}})}),n&&a.attr("title",a.textStr),D&&D.removeChild(b),t&&a.applyTextShadow&&a.applyTextShadow(t)):b.appendChild(p.createTextNode(u.replace(/&lt;/g,"\x3c").replace(/&gt;/g,
"\x3e")))},getContrast:function(a){a=h(a).rgba;return 510<a[0]+a[1]+a[2]?"#000000":"#FFFFFF"},button:function(a,b,k,v,f,c,e,r,q){var u=this.label(a,b,k,q,null,null,null,null,"button"),d=0;u.attr(I({padding:8,r:2},f));E(u.element,n?"mouseover":"mouseenter",function(){3!==d&&u.setState(1)});E(u.element,n?"mouseout":"mouseleave",function(){3!==d&&u.setState(d)});u.setState=function(a){1!==a&&(u.state=d=a);u.removeClass(/highcharts-button-(normal|hover|pressed|disabled)/).addClass("highcharts-button-"+
["normal","hover","pressed","disabled"][a||0])};return u.on("click",function(a){3!==d&&v.call(u,a)})},crispLine:function(a,b){a[1]===a[4]&&(a[1]=a[4]=Math.round(a[1])-b%2/2);a[2]===a[5]&&(a[2]=a[5]=Math.round(a[2])+b%2/2);return a},path:function(a){var b={};w(a)?b.d=a:D(a)&&A(b,a);return this.createElement("path").attr(b)},circle:function(a,b,k){a=D(a)?a:{x:a,y:b,r:k};b=this.createElement("circle");b.xSetter=b.ySetter=function(a,b,k){k.setAttribute("c"+b,a)};return b.attr(a)},arc:function(a,b,k,v,
f,c){D(a)&&(b=a.y,k=a.r,v=a.innerR,f=a.start,c=a.end,a=a.x);a=this.symbol("arc",a||0,b||0,k||0,k||0,{innerR:v||0,start:f||0,end:c||0});a.r=k;return a},rect:function(a,b,k,v,f,c){f=D(a)?a.r:f;c=this.createElement("rect");a=D(a)?a:void 0===a?{}:{x:a,y:b,width:Math.max(k,0),height:Math.max(v,0)};f&&(a.r=f);c.rSetter=function(a,b,k){l(k,{rx:a,ry:a})};return c.attr(a)},setSize:function(a,b,k){var v=this.alignedObjects,u=v.length;this.width=a;this.height=b;for(this.boxWrapper.animate({width:a,height:b},
{step:function(){this.attr({viewBox:"0 0 "+this.attr("width")+" "+this.attr("height")})},duration:z(k,!0)?void 0:0});u--;)v[u].align()},g:function(a){var b=this.createElement("g");return a?b.attr({"class":"highcharts-"+a}):b},image:function(a,b,k,v,f){var u={preserveAspectRatio:"none"};1<arguments.length&&A(u,{x:b,y:k,width:v,height:f});u=this.createElement("image").attr(u);u.element.setAttributeNS?u.element.setAttributeNS("http://www.w3.org/1999/xlink","href",a):u.element.setAttribute("hc-svg-href",
a);return u},symbol:function(a,b,k,v,f,c){var u=this,e,r=this.symbols[a],q=m(b)&&r&&r(Math.round(b),Math.round(k),v,f,c),n=/^url\((.*?)\)$/,w,M;r?(e=this.path(q),A(e,{symbolName:a,x:b,y:k,width:v,height:f}),c&&A(e,c)):n.test(a)&&(w=a.match(n)[1],e=this.image(w),e.imgwidth=z(P[w]&&P[w].width,c&&c.width),e.imgheight=z(P[w]&&P[w].height,c&&c.height),M=function(){e.attr({width:e.width,height:e.height})},x(["width","height"],function(a){e[a+"Setter"]=function(a,b){var k={},v=this["img"+b],u="width"===
b?"translateX":"translateY";this[b]=a;m(v)&&(this.element&&this.element.setAttribute(b,v),this.alignByTranslate||(k[u]=((this[b]||0)-v)/2,this.attr(k)))}}),m(b)&&e.attr({x:b,y:k}),e.isImg=!0,m(e.imgwidth)&&m(e.imgheight)?M():(e.attr({width:0,height:0}),t("img",{onload:function(){var a=d[u.chartIndex];0===this.width&&(g(this,{position:"absolute",top:"-999em"}),p.body.appendChild(this));P[w]={width:this.width,height:this.height};e.imgwidth=this.width;e.imgheight=this.height;e.element&&M();this.parentNode&&
this.parentNode.removeChild(this);u.imgCount--;if(!u.imgCount&&a&&a.onload)a.onload()},src:w}),this.imgCount++));return e},symbols:{circle:function(a,b,k,v){var f=.166*k;return["M",a+k/2,b,"C",a+k+f,b,a+k+f,b+v,a+k/2,b+v,"C",a-f,b+v,a-f,b,a+k/2,b,"Z"]},square:function(a,b,k,v){return["M",a,b,"L",a+k,b,a+k,b+v,a,b+v,"Z"]},triangle:function(a,b,k,v){return["M",a+k/2,b,"L",a+k,b+v,a,b+v,"Z"]},"triangle-down":function(a,b,k,v){return["M",a,b,"L",a+k,b,a+k/2,b+v,"Z"]},diamond:function(a,b,k,v){return["M",
a+k/2,b,"L",a+k,b+v/2,a+k/2,b+v,a,b+v/2,"Z"]},arc:function(a,b,k,v,f){var c=f.start;k=f.r||k||v;var u=f.end-.001;v=f.innerR;var e=f.open,r=Math.cos(c),q=Math.sin(c),d=Math.cos(u),u=Math.sin(u);f=f.end-c<Math.PI?0:1;return["M",a+k*r,b+k*q,"A",k,k,0,f,1,a+k*d,b+k*u,e?"M":"L",a+v*d,b+v*u,"A",v,v,0,f,0,a+v*r,b+v*q,e?"":"Z"]},callout:function(a,b,k,v,f){var c=Math.min(f&&f.r||0,k,v),e=c+6,u=f&&f.anchorX;f=f&&f.anchorY;var r;r=["M",a+c,b,"L",a+k-c,b,"C",a+k,b,a+k,b,a+k,b+c,"L",a+k,b+v-c,"C",a+k,b+v,a+k,
b+v,a+k-c,b+v,"L",a+c,b+v,"C",a,b+v,a,b+v,a,b+v-c,"L",a,b+c,"C",a,b,a,b,a+c,b];u&&u>k&&f>b+e&&f<b+v-e?r.splice(13,3,"L",a+k,f-6,a+k+6,f,a+k,f+6,a+k,b+v-c):u&&0>u&&f>b+e&&f<b+v-e?r.splice(33,3,"L",a,f+6,a-6,f,a,f-6,a,b+c):f&&f>v&&u>a+e&&u<a+k-e?r.splice(23,3,"L",u+6,b+v,u,b+v+6,u-6,b+v,a+c,b+v):f&&0>f&&u>a+e&&u<a+k-e&&r.splice(3,3,"L",u-6,b,u,b-6,u+6,b,k-c,b);return r}},clipRect:function(b,k,v,f){var c="highcharts-"+a.idCounter++,e=this.createElement("clipPath").attr({id:c}).add(this.defs);b=this.rect(b,
k,v,f,0).add(e);b.id=c;b.clipPath=e;b.count=0;return b},text:function(a,b,k,v){var f=!Q&&this.forExport,c={};if(v&&(this.allowHTML||!this.forExport))return this.html(a,b,k);c.x=Math.round(b||0);k&&(c.y=Math.round(k));if(a||0===a)c.text=a;a=this.createElement("text").attr(c);f&&a.css({position:"absolute"});v||(a.xSetter=function(a,b,k){var v=k.getElementsByTagName("tspan"),f,c=k.getAttribute(b),e;for(e=0;e<v.length;e++)f=v[e],f.getAttribute(b)===c&&f.setAttribute(b,a);k.setAttribute(b,a)});return a},
fontMetrics:function(a,b){a=b&&C.prototype.getStyle.call(b,"font-size");a=/px/.test(a)?F(a):/em/.test(a)?12*parseFloat(a):12;b=24>a?a+3:Math.round(1.2*a);return{h:b,b:Math.round(.8*b),f:a}},rotCorr:function(a,b,k){var v=a;b&&k&&(v=Math.max(v*Math.cos(b*c),4));return{x:-a/3*Math.sin(b*c),y:v}},label:function(a,b,k,v,f,c,e,r,q){var u=this,d=u.g("button"!==q&&"label"),n=d.text=u.text("",0,0,e).attr({zIndex:1}),z,g,p=0,w=3,M=0,y,t,h,F,D,G={},R,K=/^url\((.*?)\)$/.test(v),Q=K,J,l,O,P;q&&d.addClass("highcharts-"+
q);Q=!0;J=function(){return z.strokeWidth()%2/2};l=function(){var a=n.element.style,b={};g=(void 0===y||void 0===t||D)&&m(n.textStr)&&n.getBBox();d.width=(y||g.width||0)+2*w+M;d.height=(t||g.height||0)+2*w;R=w+u.fontMetrics(a&&a.fontSize,n).b;Q&&(z||(d.box=z=u.symbols[v]||K?u.symbol(v):u.rect(),z.addClass(("button"===q?"":"highcharts-label-box")+(q?" highcharts-"+q+"-box":"")),z.add(d),a=J(),b.x=a,b.y=(r?-R:0)+a),b.width=Math.round(d.width),b.height=Math.round(d.height),z.attr(A(b,G)),G={})};O=function(){var a=
M+w,b;b=r?0:R;m(y)&&g&&("center"===D||"right"===D)&&(a+={center:.5,right:1}[D]*(y-g.width));if(a!==n.x||b!==n.y)n.attr("x",a),void 0!==b&&n.attr("y",b);n.x=a;n.y=b};P=function(a,b){z?z.attr(a,b):G[a]=b};d.onAdd=function(){n.add(d);d.attr({text:a||0===a?a:"",x:b,y:k});z&&m(f)&&d.attr({anchorX:f,anchorY:c})};d.widthSetter=function(a){y=a};d.heightSetter=function(a){t=a};d["text-alignSetter"]=function(a){D=a};d.paddingSetter=function(a){m(a)&&a!==w&&(w=d.padding=a,O())};d.paddingLeftSetter=function(a){m(a)&&
a!==M&&(M=a,O())};d.alignSetter=function(a){a={left:0,center:.5,right:1}[a];a!==p&&(p=a,g&&d.attr({x:h}))};d.textSetter=function(a){void 0!==a&&n.textSetter(a);l();O()};d["stroke-widthSetter"]=function(a,b){a&&(Q=!0);this["stroke-width"]=a;P(b,a)};d.rSetter=function(a,b){P(b,a)};d.anchorXSetter=function(a,b){f=a;P(b,Math.round(a)-J()-h)};d.anchorYSetter=function(a,b){c=a;P(b,a-F)};d.xSetter=function(a){d.x=a;p&&(a-=p*((y||g.width)+2*w));h=Math.round(a);d.attr("translateX",h)};d.ySetter=function(a){F=
d.y=Math.round(a);d.attr("translateY",F)};var T=d.css;return A(d,{css:function(a){if(a){var b={};a=I(a);x(d.textProps,function(k){void 0!==a[k]&&(b[k]=a[k],delete a[k])});n.css(b)}return T.call(d,a)},getBBox:function(){return{width:g.width+2*w,height:g.height+2*w,x:g.x-w,y:g.y-w}},destroy:function(){N(d.element,"mouseenter");N(d.element,"mouseleave");n&&(n=n.destroy());z&&(z=z.destroy());C.prototype.destroy.call(d);d=u=l=O=P=null}})}};a.Renderer=B})(L);(function(a){var C=a.attr,B=a.createElement,
E=a.css,H=a.defined,l=a.each,d=a.extend,h=a.isFirefox,g=a.isMS,t=a.isWebKit,m=a.pInt,c=a.SVGRenderer,e=a.win,p=a.wrap;d(a.SVGElement.prototype,{htmlCss:function(a){var c=this.element;if(c=a&&"SPAN"===c.tagName&&a.width)delete a.width,this.textWidth=c,this.updateTransform();a&&"ellipsis"===a.textOverflow&&(a.whiteSpace="nowrap",a.overflow="hidden");this.styles=d(this.styles,a);E(this.element,a);return this},htmlGetBBox:function(){var a=this.element;"text"===a.nodeName&&(a.style.position="absolute");
return{x:a.offsetLeft,y:a.offsetTop,width:a.offsetWidth,height:a.offsetHeight}},htmlUpdateTransform:function(){if(this.added){var a=this.renderer,c=this.element,b=this.x||0,f=this.y||0,e=this.textAlign||"left",d={left:0,center:.5,right:1}[e],g=this.styles;E(c,{marginLeft:this.translateX||0,marginTop:this.translateY||0});this.inverted&&l(c.childNodes,function(b){a.invertChild(b,c)});if("SPAN"===c.tagName){var n=this.rotation,p=m(this.textWidth),h=g&&g.whiteSpace,y=[n,e,c.innerHTML,this.textWidth,this.textAlign].join();
y!==this.cTT&&(g=a.fontMetrics(c.style.fontSize).b,H(n)&&this.setSpanRotation(n,d,g),E(c,{width:"",whiteSpace:h||"nowrap"}),c.offsetWidth>p&&/[ \-]/.test(c.textContent||c.innerText)&&E(c,{width:p+"px",display:"block",whiteSpace:h||"normal"}),this.getSpanCorrection(c.offsetWidth,g,d,n,e));E(c,{left:b+(this.xCorr||0)+"px",top:f+(this.yCorr||0)+"px"});t&&(g=c.offsetHeight);this.cTT=y}}else this.alignOnAdd=!0},setSpanRotation:function(a,c,b){var f={},d=g?"-ms-transform":t?"-webkit-transform":h?"MozTransform":
e.opera?"-o-transform":"";f[d]=f.transform="rotate("+a+"deg)";f[d+(h?"Origin":"-origin")]=f.transformOrigin=100*c+"% "+b+"px";E(this.element,f)},getSpanCorrection:function(a,c,b){this.xCorr=-a*b;this.yCorr=-c}});d(c.prototype,{html:function(a,c,b){var f=this.createElement("span"),e=f.element,g=f.renderer,m=g.isSVG,n=function(a,b){l(["opacity","visibility"],function(f){p(a,f+"Setter",function(a,f,c,e){a.call(this,f,c,e);b[c]=f})})};f.textSetter=function(a){a!==e.innerHTML&&delete this.bBox;e.innerHTML=
this.textStr=a;f.htmlUpdateTransform()};m&&n(f,f.element.style);f.xSetter=f.ySetter=f.alignSetter=f.rotationSetter=function(a,b){"align"===b&&(b="textAlign");f[b]=a;f.htmlUpdateTransform()};f.attr({text:a,x:Math.round(c),y:Math.round(b)}).css({position:"absolute"});e.style.whiteSpace="nowrap";f.css=f.htmlCss;m&&(f.add=function(a){var b,c=g.box.parentNode,q=[];if(this.parentGroup=a){if(b=a.div,!b){for(;a;)q.push(a),a=a.parentGroup;l(q.reverse(),function(a){var f,e=C(a.element,"class");e&&(e={className:e});
b=a.div=a.div||B("div",e,{position:"absolute",left:(a.translateX||0)+"px",top:(a.translateY||0)+"px",display:a.display,opacity:a.opacity,pointerEvents:a.styles&&a.styles.pointerEvents},b||c);f=b.style;d(a,{translateXSetter:function(b,k){f.left=b+"px";a[k]=b;a.doTransform=!0},translateYSetter:function(b,k){f.top=b+"px";a[k]=b;a.doTransform=!0}});n(a,f)})}}else b=c;b.appendChild(e);f.added=!0;f.alignOnAdd&&f.htmlUpdateTransform();return f});return f}})})(L);(function(a){function C(){var h=a.defaultOptions.global,
g,t=h.useUTC,m=t?"getUTC":"get",c=t?"setUTC":"set";a.Date=g=h.Date||d.Date;g.hcTimezoneOffset=t&&h.timezoneOffset;g.hcGetTimezoneOffset=t&&h.getTimezoneOffset;g.hcMakeTime=function(a,c,d,m,b,f){var e;t?(e=g.UTC.apply(0,arguments),e+=E(e)):e=(new g(a,c,l(d,1),l(m,0),l(b,0),l(f,0))).getTime();return e};B("Minutes Hours Day Date Month FullYear".split(" "),function(a){g["hcGet"+a]=m+a});B("Milliseconds Seconds Minutes Hours Date Month FullYear".split(" "),function(a){g["hcSet"+a]=c+a})}var B=a.each,E=
a.getTZOffset,H=a.merge,l=a.pick,d=a.win;a.defaultOptions={symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),decimalPoint:".",numericSymbols:"kMGTPE".split(""),resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",
thousandsSep:" "},global:{useUTC:!0},chart:{borderRadius:0,colorCount:10,defaultSeriesType:"line",ignoreHiddenSeries:!0,spacing:[10,10,15,10],resetZoomButton:{theme:{zIndex:20},position:{align:"right",x:-10,y:10}},width:null,height:null},defs:{dropShadow:{tagName:"filter",id:"drop-shadow",opacity:.5,children:[{tagName:"feGaussianBlur",in:"SourceAlpha",stdDeviation:1},{tagName:"feOffset",dx:1,dy:1},{tagName:"feComponentTransfer",children:[{tagName:"feFuncA",type:"linear",slope:.3}]},{tagName:"feMerge",
children:[{tagName:"feMergeNode"},{tagName:"feMergeNode",in:"SourceGraphic"}]}]},style:{tagName:"style",textContent:".highcharts-tooltip{filter:url(#drop-shadow)}"}},title:{text:"Chart title",align:"center",margin:15,widthAdjust:-44},subtitle:{text:"",align:"center",widthAdjust:-44},plotOptions:{},labels:{style:{position:"absolute",color:"#333333"}},legend:{enabled:!0,align:"center",layout:"horizontal",labelFormatter:function(){return this.name},borderColor:"#999999",borderRadius:0,navigation:{},
itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},squareSymbol:!0,symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{}},loading:{},tooltip:{enabled:!0,animation:a.svg,borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %b %e, %H:%M:%S.%L",second:"%A, %b %e, %H:%M:%S",minute:"%A, %b %e, %H:%M",hour:"%A, %b %e, %H:%M",day:"%A, %b %e, %Y",week:"Week from %A, %b %e, %Y",month:"%B %Y",year:"%Y"},footerFormat:"",padding:8,snap:a.isTouchDevice?25:10,headerFormat:'\x3cspan class\x3d"highcharts-header"\x3e{point.key}\x3c/span\x3e\x3cbr/\x3e',
pointFormat:'\x3cspan class\x3d"highcharts-color-{point.colorIndex}"\x3e\u25cf\x3c/span\x3e {series.name}: \x3cb\x3e{point.y}\x3c/b\x3e\x3cbr/\x3e'},credits:{enabled:!0,href:"http://www.highcharts.com",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},text:"Highcharts.com"}};a.setOptions=function(d){a.defaultOptions=H(!0,a.defaultOptions,d);C();return a.defaultOptions};a.getOptions=function(){return a.defaultOptions};a.defaultPlotOptions=a.defaultOptions.plotOptions;C()})(L);(function(a){var C=
a.arrayMax,B=a.arrayMin,E=a.defined,H=a.destroyObjectProperties,l=a.each,d=a.erase,h=a.merge,g=a.pick;a.PlotLineOrBand=function(a,d){this.axis=a;d&&(this.options=d,this.id=d.id)};a.PlotLineOrBand.prototype={render:function(){var a=this,d=a.axis,c=d.horiz,e=a.options,p=e.label,x=a.label,A=e.to,b=e.from,f=e.value,q=E(b)&&E(A),w=E(f),G=a.svgElem,n=!G,D=[],K,y=g(e.zIndex,0),l=e.events,D={"class":"highcharts-plot-"+(q?"band ":"line ")+(e.className||"")},r={},z=d.chart.renderer,F=q?"bands":"lines",N;N=
d.log2lin;d.isLog&&(b=N(b),A=N(A),f=N(f));r.zIndex=y;F+="-"+y;(N=d[F])||(d[F]=N=z.g("plot-"+F).attr(r).add());n&&(a.svgElem=G=z.path().attr(D).add(N));if(w)D=d.getPlotLinePath(f,G.strokeWidth());else if(q)D=d.getPlotBandPath(b,A,e);else return;if(n&&D&&D.length){if(G.attr({d:D}),l)for(K in e=function(b){G.on(b,function(k){l[b].apply(a,[k])})},l)e(K)}else G&&(D?(G.show(),G.animate({d:D})):(G.hide(),x&&(a.label=x=x.destroy())));p&&E(p.text)&&D&&D.length&&0<d.width&&0<d.height&&!D.flat?(p=h({align:c&&
q&&"center",x:c?!q&&4:10,verticalAlign:!c&&q&&"middle",y:c?q?16:10:q?6:-4,rotation:c&&!q&&90},p),this.renderLabel(p,D,q,y)):x&&x.hide();return a},renderLabel:function(a,d,c,e){var g=this.label,x=this.axis.chart.renderer;g||(g={align:a.textAlign||a.align,rotation:a.rotation,"class":"highcharts-plot-"+(c?"band":"line")+"-label "+(a.className||"")},g.zIndex=e,this.label=g=x.text(a.text,0,0,a.useHTML).attr(g).add());e=[d[1],d[4],c?d[6]:d[1]];d=[d[2],d[5],c?d[7]:d[2]];c=B(e);x=B(d);g.align(a,!1,{x:c,y:x,
width:C(e)-c,height:C(d)-x});g.show()},destroy:function(){d(this.axis.plotLinesAndBands,this);delete this.axis;H(this)}};a.AxisPlotLineOrBandExtension={getPlotBandPath:function(a,d){d=this.getPlotLinePath(d,null,null,!0);(a=this.getPlotLinePath(a,null,null,!0))&&d?(a.flat=a.toString()===d.toString(),a.push(d[4],d[5],d[1],d[2])):a=null;return a},addPlotBand:function(a){return this.addPlotBandOrLine(a,"plotBands")},addPlotLine:function(a){return this.addPlotBandOrLine(a,"plotLines")},addPlotBandOrLine:function(d,
g){var c=(new a.PlotLineOrBand(this,d)).render(),e=this.userOptions;c&&(g&&(e[g]=e[g]||[],e[g].push(d)),this.plotLinesAndBands.push(c));return c},removePlotBandOrLine:function(a){for(var g=this.plotLinesAndBands,c=this.options,e=this.userOptions,p=g.length;p--;)g[p].id===a&&g[p].destroy();l([c.plotLines||[],e.plotLines||[],c.plotBands||[],e.plotBands||[]],function(c){for(p=c.length;p--;)c[p].id===a&&d(c,c[p])})}}})(L);(function(a){var C=a.correctFloat,B=a.defined,E=a.destroyObjectProperties,H=a.isNumber,
l=a.pick,d=a.stop,h=a.deg2rad;a.Tick=function(a,d,h,c){this.axis=a;this.pos=d;this.type=h||"";this.isNew=!0;h||c||this.addLabel()};a.Tick.prototype={addLabel:function(){var a=this.axis,d=a.options,h=a.chart,c=a.categories,e=a.names,p=this.pos,x=d.labels,A=a.tickPositions,b=p===A[0],f=p===A[A.length-1],e=c?l(c[p],e[p],p):p,c=this.label,A=A.info,q;a.isDatetimeAxis&&A&&(q=d.dateTimeLabelFormats[A.higherRanks[p]||A.unitName]);this.isFirst=b;this.isLast=f;d=a.labelFormatter.call({axis:a,chart:h,isFirst:b,
isLast:f,dateTimeLabelFormat:q,value:a.isLog?C(a.lin2log(e)):e});B(c)?c&&c.attr({text:d}):(this.labelLength=(this.label=c=B(d)&&x.enabled?h.renderer.text(d,0,0,x.useHTML).add(a.labelGroup):null)&&c.getBBox().width,this.rotation=0)},getLabelSize:function(){return this.label?this.label.getBBox()[this.axis.horiz?"height":"width"]:0},handleOverflow:function(a){var d=this.axis,g=a.x,c=d.chart.chartWidth,e=d.chart.spacing,p=l(d.labelLeft,Math.min(d.pos,e[3])),e=l(d.labelRight,Math.max(d.pos+d.len,c-e[1])),
x=this.label,A=this.rotation,b={left:0,center:.5,right:1}[d.labelAlign],f=x.getBBox().width,q=d.getSlotWidth(),w=q,G=1,n,D={};if(A)0>A&&g-b*f<p?n=Math.round(g/Math.cos(A*h)-p):0<A&&g+b*f>e&&(n=Math.round((c-g)/Math.cos(A*h)));else if(c=g+(1-b)*f,g-b*f<p?w=a.x+w*(1-b)-p:c>e&&(w=e-a.x+w*b,G=-1),w=Math.min(q,w),w<q&&"center"===d.labelAlign&&(a.x+=G*(q-w-b*(q-Math.min(f,w)))),f>w||d.autoRotation&&(x.styles||{}).width)n=w;n&&(D.width=n,(d.options.labels.style||{}).textOverflow||(D.textOverflow="ellipsis"),
x.css(D))},getPosition:function(a,d,h,c){var e=this.axis,g=e.chart,x=c&&g.oldChartHeight||g.chartHeight;return{x:a?e.translate(d+h,null,null,c)+e.transB:e.left+e.offset+(e.opposite?(c&&g.oldChartWidth||g.chartWidth)-e.right-e.left:0),y:a?x-e.bottom+e.offset-(e.opposite?e.height:0):x-e.translate(d+h,null,null,c)-e.transB}},getLabelPosition:function(a,d,m,c,e,p,x,A){var b=this.axis,f=b.transA,q=b.reversed,g=b.staggerLines,G=b.tickRotCorr||{x:0,y:0},n=e.y;B(n)||(n=0===b.side?m.rotation?-8:-m.getBBox().height:
2===b.side?G.y+8:Math.cos(m.rotation*h)*(G.y-m.getBBox(!1,0).height/2));a=a+e.x+G.x-(p&&c?p*f*(q?-1:1):0);d=d+n-(p&&!c?p*f*(q?1:-1):0);g&&(m=x/(A||1)%g,b.opposite&&(m=g-m-1),d+=b.labelOffset/g*m);return{x:a,y:Math.round(d)}},getMarkPath:function(a,d,h,c,e,p){return p.crispLine(["M",a,d,"L",a+(e?0:-h),d+(e?h:0)],c)},render:function(a,h,m){var c=this.axis,e=c.options,g=c.chart.renderer,x=c.horiz,A=this.type,b=this.label,f=this.pos,q=e.labels,w=this.gridLine,G=c.tickSize(A?A+"Tick":"tick"),n=this.mark,
D=!n,K=q.step,y={},t=!0,r=c.tickmarkOffset,z=this.getPosition(x,f,r,h),F=z.x,z=z.y,N=x&&F===c.pos+c.len||!x&&z===c.pos?-1:1;m=l(m,1);this.isActive=!0;w||(A||(y.zIndex=1),h&&(y.opacity=0),this.gridLine=w=g.path().attr(y).addClass("highcharts-"+(A?A+"-":"")+"grid-line").add(c.gridGroup));if(!h&&w&&(f=c.getPlotLinePath(f+r,w.strokeWidth()*N,h,!0)))w[this.isNew?"attr":"animate"]({d:f,opacity:m});G&&(c.opposite&&(G[0]=-G[0]),D&&(this.mark=n=g.path().addClass("highcharts-"+(A?A+"-":"")+"tick").add(c.axisGroup)),
n[D?"attr":"animate"]({d:this.getMarkPath(F,z,G[0],n.strokeWidth()*N,x,g),opacity:m}));b&&H(F)&&(b.xy=z=this.getLabelPosition(F,z,b,x,q,r,a,K),this.isFirst&&!this.isLast&&!l(e.showFirstLabel,1)||this.isLast&&!this.isFirst&&!l(e.showLastLabel,1)?t=!1:!x||c.isRadial||q.step||q.rotation||h||0===m||this.handleOverflow(z),K&&a%K&&(t=!1),t&&H(z.y)?(z.opacity=m,b[this.isNew?"attr":"animate"](z)):(d(b),b.attr("y",-9999)),this.isNew=!1)},destroy:function(){E(this,this.axis)}}})(L);(function(a){var C=a.addEvent,
B=a.animObject,E=a.arrayMax,H=a.arrayMin,l=a.AxisPlotLineOrBandExtension,d=a.correctFloat,h=a.defaultOptions,g=a.defined,t=a.deg2rad,m=a.destroyObjectProperties,c=a.each,e=a.error,p=a.extend,x=a.fireEvent,A=a.format,b=a.getMagnitude,f=a.grep,q=a.inArray,w=a.isArray,G=a.isNumber,n=a.isString,D=a.merge,K=a.normalizeTickInterval,y=a.pick,I=a.PlotLineOrBand,r=a.removeEvent,z=a.splat,F=a.syncTimeout,N=a.Tick;a.Axis=function(){this.init.apply(this,arguments)};a.Axis.prototype={defaultOptions:{dateTimeLabelFormats:{millisecond:"%H:%M:%S.%L",
second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e. %b",week:"%e. %b",month:"%b '%y",year:"%Y"},endOnTick:!1,labels:{enabled:!0,x:0},minPadding:.01,maxPadding:.01,minorTickLength:2,minorTickPosition:"outside",startOfWeek:1,startOnTick:!1,tickLength:10,tickmarkPlacement:"between",tickPixelInterval:100,tickPosition:"outside",title:{align:"middle"},type:"linear"},defaultYAxisOptions:{endOnTick:!0,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8},maxPadding:.05,minPadding:.05,startOnTick:!0,title:{rotation:270,
text:"Values"},stackLabels:{enabled:!1,formatter:function(){return a.numberFormat(this.total,-1)}}},defaultLeftAxisOptions:{labels:{x:-15},title:{rotation:270}},defaultRightAxisOptions:{labels:{x:15},title:{rotation:90}},defaultBottomAxisOptions:{labels:{autoRotation:[-45],x:0},title:{rotation:0}},defaultTopAxisOptions:{labels:{autoRotation:[-45],x:0},title:{rotation:0}},init:function(a,b){var k=b.isX;this.chart=a;this.horiz=a.inverted?!k:k;this.isXAxis=k;this.coll=this.coll||(k?"xAxis":"yAxis");
this.opposite=b.opposite;this.side=b.side||(this.horiz?this.opposite?0:2:this.opposite?1:3);this.setOptions(b);var v=this.options,f=v.type;this.labelFormatter=v.labels.formatter||this.defaultLabelFormatter;this.userOptions=b;this.minPixelPadding=0;this.reversed=v.reversed;this.visible=!1!==v.visible;this.zoomEnabled=!1!==v.zoomEnabled;this.hasNames="category"===f||!0===v.categories;this.categories=v.categories||this.hasNames;this.names=this.names||[];this.isLog="logarithmic"===f;this.isDatetimeAxis=
"datetime"===f;this.isLinked=g(v.linkedTo);this.ticks={};this.labelEdge=[];this.minorTicks={};this.plotLinesAndBands=[];this.alternateBands={};this.len=0;this.minRange=this.userMinRange=v.minRange||v.maxZoom;this.range=v.range;this.offset=v.offset||0;this.stacks={};this.oldStacks={};this.stacksTouched=0;this.min=this.max=null;this.crosshair=y(v.crosshair,z(a.options.tooltip.crosshairs)[k?0:1],!1);var c;b=this.options.events;-1===q(this,a.axes)&&(k?a.axes.splice(a.xAxis.length,0,this):a.axes.push(this),
a[this.coll].push(this));this.series=this.series||[];a.inverted&&k&&void 0===this.reversed&&(this.reversed=!0);this.removePlotLine=this.removePlotBand=this.removePlotBandOrLine;for(c in b)C(this,c,b[c]);this.isLog&&(this.val2lin=this.log2lin,this.lin2val=this.lin2log)},setOptions:function(a){this.options=D(this.defaultOptions,"yAxis"===this.coll&&this.defaultYAxisOptions,[this.defaultTopAxisOptions,this.defaultRightAxisOptions,this.defaultBottomAxisOptions,this.defaultLeftAxisOptions][this.side],
D(h[this.coll],a))},defaultLabelFormatter:function(){var b=this.axis,v=this.value,f=b.categories,c=this.dateTimeLabelFormat,d=h.lang.numericSymbols,e=d&&d.length,u,r=b.options.labels.format,b=b.isLog?v:b.tickInterval;if(r)u=A(r,this);else if(f)u=v;else if(c)u=a.dateFormat(c,v);else if(e&&1E3<=b)for(;e--&&void 0===u;)f=Math.pow(1E3,e+1),b>=f&&0===10*v%f&&null!==d[e]&&0!==v&&(u=a.numberFormat(v/f,-1)+d[e]);void 0===u&&(u=1E4<=Math.abs(v)?a.numberFormat(v,-1):a.numberFormat(v,-1,void 0,""));return u},
getSeriesExtremes:function(){var a=this,b=a.chart;a.hasVisibleSeries=!1;a.dataMin=a.dataMax=a.threshold=null;a.softThreshold=!a.isXAxis;a.buildStacks&&a.buildStacks();c(a.series,function(k){if(k.visible||!b.options.chart.ignoreHiddenSeries){var v=k.options,c=v.threshold,d;a.hasVisibleSeries=!0;a.isLog&&0>=c&&(c=null);if(a.isXAxis)v=k.xData,v.length&&(k=H(v),G(k)||k instanceof Date||(v=f(v,function(a){return G(a)}),k=H(v)),a.dataMin=Math.min(y(a.dataMin,v[0]),k),a.dataMax=Math.max(y(a.dataMax,v[0]),
E(v)));else if(k.getExtremes(),d=k.dataMax,k=k.dataMin,g(k)&&g(d)&&(a.dataMin=Math.min(y(a.dataMin,k),k),a.dataMax=Math.max(y(a.dataMax,d),d)),g(c)&&(a.threshold=c),!v.softThreshold||a.isLog)a.softThreshold=!1}})},translate:function(a,b,f,c,d,e){var k=this.linkedParent||this,v=1,r=0,q=c?k.oldTransA:k.transA;c=c?k.oldMin:k.min;var n=k.minPixelPadding;d=(k.isOrdinal||k.isBroken||k.isLog&&d)&&k.lin2val;q||(q=k.transA);f&&(v*=-1,r=k.len);k.reversed&&(v*=-1,r-=v*(k.sector||k.len));b?(a=(a*v+r-n)/q+c,d&&
(a=k.lin2val(a))):(d&&(a=k.val2lin(a)),"between"===e&&(e=.5),a=v*(a-c)*q+r+v*n+(G(e)?q*e*k.pointRange:0));return a},toPixels:function(a,b){return this.translate(a,!1,!this.horiz,null,!0)+(b?0:this.pos)},toValue:function(a,b){return this.translate(a-(b?0:this.pos),!0,!this.horiz,null,!0)},getPlotLinePath:function(a,b,f,c,d){var k=this.chart,v=this.left,e=this.top,r,q,n=f&&k.oldChartHeight||k.chartHeight,g=f&&k.oldChartWidth||k.chartWidth,z;r=this.transB;var w=function(a,b,k){if(a<b||a>k)c?a=Math.min(Math.max(b,
a),k):z=!0;return a};d=y(d,this.translate(a,null,null,f));a=f=Math.round(d+r);r=q=Math.round(n-d-r);G(d)?this.horiz?(r=e,q=n-this.bottom,a=f=w(a,v,v+this.width)):(a=v,f=g-this.right,r=q=w(r,e,e+this.height)):z=!0;return z&&!c?null:k.renderer.crispLine(["M",a,r,"L",f,q],b||1)},getLinearTickPositions:function(a,b,f){var k,v=d(Math.floor(b/a)*a),c=d(Math.ceil(f/a)*a),e=[];if(b===f&&G(b))return[b];for(b=v;b<=c;){e.push(b);b=d(b+a);if(b===k)break;k=b}return e},getMinorTickPositions:function(){var a=this.options,
b=this.tickPositions,f=this.minorTickInterval,c=[],d,e=this.pointRangePadding||0;d=this.min-e;var e=this.max+e,r=e-d;if(r&&r/f<this.len/3)if(this.isLog)for(e=b.length,d=1;d<e;d++)c=c.concat(this.getLogTickPositions(f,b[d-1],b[d],!0));else if(this.isDatetimeAxis&&"auto"===a.minorTickInterval)c=c.concat(this.getTimeTicks(this.normalizeTimeTickInterval(f),d,e,a.startOfWeek));else for(b=d+(b[0]-d)%f;b<=e;b+=f)c.push(b);0!==c.length&&this.trimTicks(c,a.startOnTick,a.endOnTick);return c},adjustForMinRange:function(){var a=
this.options,b=this.min,f=this.max,d,e=this.dataMax-this.dataMin>=this.minRange,r,u,q,n,z,w;this.isXAxis&&void 0===this.minRange&&!this.isLog&&(g(a.min)||g(a.max)?this.minRange=null:(c(this.series,function(a){n=a.xData;for(u=z=a.xIncrement?1:n.length-1;0<u;u--)if(q=n[u]-n[u-1],void 0===r||q<r)r=q}),this.minRange=Math.min(5*r,this.dataMax-this.dataMin)));f-b<this.minRange&&(w=this.minRange,d=(w-f+b)/2,d=[b-d,y(a.min,b-d)],e&&(d[2]=this.isLog?this.log2lin(this.dataMin):this.dataMin),b=E(d),f=[b+w,y(a.max,
b+w)],e&&(f[2]=this.isLog?this.log2lin(this.dataMax):this.dataMax),f=H(f),f-b<w&&(d[0]=f-w,d[1]=y(a.min,f-w),b=E(d)));this.min=b;this.max=f},getClosest:function(){var a;this.categories?a=1:c(this.series,function(b){var k=b.closestPointRange;!b.noSharedTooltip&&g(k)&&(a=g(a)?Math.min(a,k):k)});return a},nameToX:function(a){var b=w(this.categories),k=b?this.categories:this.names,f=a.options.x,c;a.series.requireSorting=!1;g(f)||(f=!1===this.options.uniqueNames?a.series.autoIncrement():q(a.name,k));-1===
f?b||(c=k.length):c=f;this.names[c]=a.name;return c},updateNames:function(){var a=this;0<this.names.length&&(this.names.length=0,this.minRange=void 0,c(this.series||[],function(b){if(!b.points||b.isDirtyData)b.processData(),b.generatePoints();c(b.points,function(k,f){var c;k.options&&void 0===k.options.x&&(c=a.nameToX(k),c!==k.x&&(k.x=c,b.xData[f]=c))})}))},setAxisTranslation:function(a){var b=this,k=b.max-b.min,f=b.axisPointRange||0,d,e=0,r=0,q=b.linkedParent,g=!!b.categories,z=b.transA,w=b.isXAxis;
if(w||g||f)q?(e=q.minPointOffset,r=q.pointRangePadding):(d=b.getClosest(),c(b.series,function(a){var k=g?1:w?y(a.options.pointRange,d,0):b.axisPointRange||0;a=a.options.pointPlacement;f=Math.max(f,k);b.single||(e=Math.max(e,n(a)?0:k/2),r=Math.max(r,"on"===a?0:k))})),q=b.ordinalSlope&&d?b.ordinalSlope/d:1,b.minPointOffset=e*=q,b.pointRangePadding=r*=q,b.pointRange=Math.min(f,k),w&&(b.closestPointRange=d);a&&(b.oldTransA=z);b.translationSlope=b.transA=z=b.len/(k+r||1);b.transB=b.horiz?b.left:b.bottom;
b.minPixelPadding=z*e},minFromRange:function(){return this.max-this.range},setTickInterval:function(a){var k=this,f=k.chart,r=k.options,q=k.isLog,n=k.log2lin,u=k.isDatetimeAxis,z=k.isXAxis,w=k.isLinked,p=r.maxPadding,h=r.minPadding,F=r.tickInterval,D=r.tickPixelInterval,m=k.categories,A=k.threshold,N=k.softThreshold,l,t,I,C;u||m||w||this.getTickAmount();I=y(k.userMin,r.min);C=y(k.userMax,r.max);w?(k.linkedParent=f[k.coll][r.linkedTo],f=k.linkedParent.getExtremes(),k.min=y(f.min,f.dataMin),k.max=y(f.max,
f.dataMax),r.type!==k.linkedParent.options.type&&e(11,1)):(!N&&g(A)&&(k.dataMin>=A?(l=A,h=0):k.dataMax<=A&&(t=A,p=0)),k.min=y(I,l,k.dataMin),k.max=y(C,t,k.dataMax));q&&(!a&&0>=Math.min(k.min,y(k.dataMin,k.min))&&e(10,1),k.min=d(n(k.min),15),k.max=d(n(k.max),15));k.range&&g(k.max)&&(k.userMin=k.min=I=Math.max(k.min,k.minFromRange()),k.userMax=C=k.max,k.range=null);x(k,"foundExtremes");k.beforePadding&&k.beforePadding();k.adjustForMinRange();!(m||k.axisPointRange||k.usePercentage||w)&&g(k.min)&&g(k.max)&&
(n=k.max-k.min)&&(!g(I)&&h&&(k.min-=n*h),!g(C)&&p&&(k.max+=n*p));G(r.floor)?k.min=Math.max(k.min,r.floor):G(r.softMin)&&(k.min=Math.min(k.min,r.softMin));G(r.ceiling)?k.max=Math.min(k.max,r.ceiling):G(r.softMax)&&(k.max=Math.max(k.max,r.softMax));N&&g(k.dataMin)&&(A=A||0,!g(I)&&k.min<A&&k.dataMin>=A?k.min=A:!g(C)&&k.max>A&&k.dataMax<=A&&(k.max=A));k.tickInterval=k.min===k.max||void 0===k.min||void 0===k.max?1:w&&!F&&D===k.linkedParent.options.tickPixelInterval?F=k.linkedParent.tickInterval:y(F,this.tickAmount?
(k.max-k.min)/Math.max(this.tickAmount-1,1):void 0,m?1:(k.max-k.min)*D/Math.max(k.len,D));z&&!a&&c(k.series,function(a){a.processData(k.min!==k.oldMin||k.max!==k.oldMax)});k.setAxisTranslation(!0);k.beforeSetTickPositions&&k.beforeSetTickPositions();k.postProcessTickInterval&&(k.tickInterval=k.postProcessTickInterval(k.tickInterval));k.pointRange&&!F&&(k.tickInterval=Math.max(k.pointRange,k.tickInterval));a=y(r.minTickInterval,k.isDatetimeAxis&&k.closestPointRange);!F&&k.tickInterval<a&&(k.tickInterval=
a);u||q||F||(k.tickInterval=K(k.tickInterval,null,b(k.tickInterval),y(r.allowDecimals,!(.5<k.tickInterval&&5>k.tickInterval&&1E3<k.max&&9999>k.max)),!!this.tickAmount));this.tickAmount||(k.tickInterval=k.unsquish());this.setTickPositions()},setTickPositions:function(){var a=this.options,b,f=a.tickPositions,c=a.tickPositioner,d=a.startOnTick,e=a.endOnTick,r;this.tickmarkOffset=this.categories&&"between"===a.tickmarkPlacement&&1===this.tickInterval?.5:0;this.minorTickInterval="auto"===a.minorTickInterval&&
this.tickInterval?this.tickInterval/5:a.minorTickInterval;this.tickPositions=b=f&&f.slice();!b&&(b=this.isDatetimeAxis?this.getTimeTicks(this.normalizeTimeTickInterval(this.tickInterval,a.units),this.min,this.max,a.startOfWeek,this.ordinalPositions,this.closestPointRange,!0):this.isLog?this.getLogTickPositions(this.tickInterval,this.min,this.max):this.getLinearTickPositions(this.tickInterval,this.min,this.max),b.length>this.len&&(b=[b[0],b.pop()]),this.tickPositions=b,c&&(c=c.apply(this,[this.min,
this.max])))&&(this.tickPositions=b=c);this.isLinked||(this.trimTicks(b,d,e),this.min===this.max&&g(this.min)&&!this.tickAmount&&(r=!0,this.min-=.5,this.max+=.5),this.single=r,f||c||this.adjustTickAmount())},trimTicks:function(a,b,f){var k=a[0],c=a[a.length-1],d=this.minPointOffset||0;if(b)this.min=k;else for(;this.min-d>a[0];)a.shift();if(f)this.max=c;else for(;this.max+d<a[a.length-1];)a.pop();0===a.length&&g(k)&&a.push((c+k)/2)},alignToOthers:function(){var a={},b,f=this.options;!1!==this.chart.options.chart.alignTicks&&
!1!==f.alignTicks&&c(this.chart[this.coll],function(k){var f=k.options,f=[k.horiz?f.left:f.top,f.width,f.height,f.pane].join();k.series.length&&(a[f]?b=!0:a[f]=1)});return b},getTickAmount:function(){var a=this.options,b=a.tickAmount,f=a.tickPixelInterval;!g(a.tickInterval)&&this.len<f&&!this.isRadial&&!this.isLog&&a.startOnTick&&a.endOnTick&&(b=2);!b&&this.alignToOthers()&&(b=Math.ceil(this.len/f)+1);4>b&&(this.finalTickAmt=b,b=5);this.tickAmount=b},adjustTickAmount:function(){var a=this.tickInterval,
b=this.tickPositions,f=this.tickAmount,c=this.finalTickAmt,e=b&&b.length;if(e<f){for(;b.length<f;)b.push(d(b[b.length-1]+a));this.transA*=(e-1)/(f-1);this.max=b[b.length-1]}else e>f&&(this.tickInterval*=2,this.setTickPositions());if(g(c)){for(a=f=b.length;a--;)(3===c&&1===a%2||2>=c&&0<a&&a<f-1)&&b.splice(a,1);this.finalTickAmt=void 0}},setScale:function(){var a,b;this.oldMin=this.min;this.oldMax=this.max;this.oldAxisLength=this.len;this.setAxisSize();b=this.len!==this.oldAxisLength;c(this.series,
function(b){if(b.isDirtyData||b.isDirty||b.xAxis.isDirty)a=!0});b||a||this.isLinked||this.forceRedraw||this.userMin!==this.oldUserMin||this.userMax!==this.oldUserMax||this.alignToOthers()?(this.resetStacks&&this.resetStacks(),this.forceRedraw=!1,this.getSeriesExtremes(),this.setTickInterval(),this.oldUserMin=this.userMin,this.oldUserMax=this.userMax,this.isDirty||(this.isDirty=b||this.min!==this.oldMin||this.max!==this.oldMax)):this.cleanStacks&&this.cleanStacks()},setExtremes:function(a,b,f,d,e){var k=
this,r=k.chart;f=y(f,!0);c(k.series,function(a){delete a.kdTree});e=p(e,{min:a,max:b});x(k,"setExtremes",e,function(){k.userMin=a;k.userMax=b;k.eventArgs=e;f&&r.redraw(d)})},zoom:function(a,b){var k=this.dataMin,f=this.dataMax,c=this.options,d=Math.min(k,y(c.min,k)),c=Math.max(f,y(c.max,f));if(a!==this.min||b!==this.max)this.allowZoomOutside||(g(k)&&a<=d&&(a=d),g(f)&&b>=c&&(b=c)),this.displayBtn=void 0!==a||void 0!==b,this.setExtremes(a,b,!1,void 0,{trigger:"zoom"});return!0},setAxisSize:function(){var a=
this.chart,b=this.options,f=b.offsetLeft||0,c=this.horiz,d=y(b.width,a.plotWidth-f+(b.offsetRight||0)),e=y(b.height,a.plotHeight),r=y(b.top,a.plotTop),b=y(b.left,a.plotLeft+f),f=/%$/;f.test(e)&&(e=Math.round(parseFloat(e)/100*a.plotHeight));f.test(r)&&(r=Math.round(parseFloat(r)/100*a.plotHeight+a.plotTop));this.left=b;this.top=r;this.width=d;this.height=e;this.bottom=a.chartHeight-e-r;this.right=a.chartWidth-d-b;this.len=Math.max(c?d:e,0);this.pos=c?b:r},getExtremes:function(){var a=this.isLog,b=
this.lin2log;return{min:a?d(b(this.min)):this.min,max:a?d(b(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},getThreshold:function(a){var b=this.isLog,k=this.lin2log,f=b?k(this.min):this.min,b=b?k(this.max):this.max;null===a?a=f:f>a?a=f:b<a&&(a=b);return this.translate(a,0,1,0,1)},autoLabelAlign:function(a){a=(y(a,0)-90*this.side+720)%360;return 15<a&&165>a?"right":195<a&&345>a?"left":"center"},tickSize:function(a){var b=this.options,k=b[a+
"Length"],f=y(b[a+"Width"],"tick"===a&&this.isXAxis?1:0);if(f&&k)return"inside"===b[a+"Position"]&&(k=-k),[k,f]},labelMetrics:function(){return this.chart.renderer.fontMetrics(this.options.labels.style&&this.options.labels.style.fontSize,this.ticks[0]&&this.ticks[0].label)},unsquish:function(){var a=this.options.labels,b=this.horiz,f=this.tickInterval,d=f,e=this.len/(((this.categories?1:0)+this.max-this.min)/f),r,q=a.rotation,n=this.labelMetrics(),z,w=Number.MAX_VALUE,p,h=function(a){a/=e||1;a=1<
a?Math.ceil(a):1;return a*f};b?(p=!a.staggerLines&&!a.step&&(g(q)?[q]:e<y(a.autoRotationLimit,80)&&a.autoRotation))&&c(p,function(a){var b;if(a===q||a&&-90<=a&&90>=a)z=h(Math.abs(n.h/Math.sin(t*a))),b=z+Math.abs(a/360),b<w&&(w=b,r=a,d=z)}):a.step||(d=h(n.h));this.autoRotation=p;this.labelRotation=y(r,q);return d},getSlotWidth:function(){var a=this.chart,b=this.horiz,f=this.options.labels,c=Math.max(this.tickPositions.length-(this.categories?0:1),1),d=a.margin[3];return b&&2>(f.step||0)&&!f.rotation&&
(this.staggerLines||1)*a.plotWidth/c||!b&&(d&&d-a.spacing[3]||.33*a.chartWidth)},renderUnsquish:function(){var a=this.chart,b=a.renderer,f=this.tickPositions,d=this.ticks,e=this.options.labels,r=this.horiz,q=this.getSlotWidth(),z=Math.max(1,Math.round(q-2*(e.padding||5))),g={},w=this.labelMetrics(),p=e.style&&e.style.textOverflow,h,y=0,x,F;n(e.rotation)||(g.rotation=e.rotation||0);c(f,function(a){(a=d[a])&&a.labelLength>y&&(y=a.labelLength)});this.maxLabelLength=y;if(this.autoRotation)y>z&&y>w.h?
g.rotation=this.labelRotation:this.labelRotation=0;else if(q&&(h={width:z+"px"},!p))for(h.textOverflow="clip",x=f.length;!r&&x--;)if(F=f[x],z=d[F].label)z.styles&&"ellipsis"===z.styles.textOverflow?z.css({textOverflow:"clip"}):d[F].labelLength>q&&z.css({width:q+"px"}),z.getBBox().height>this.len/f.length-(w.h-w.f)&&(z.specCss={textOverflow:"ellipsis"});g.rotation&&(h={width:(y>.5*a.chartHeight?.33*a.chartHeight:a.chartHeight)+"px"},p||(h.textOverflow="ellipsis"));if(this.labelAlign=e.align||this.autoLabelAlign(this.labelRotation))g.align=
this.labelAlign;c(f,function(a){var b=(a=d[a])&&a.label;b&&(b.attr(g),h&&b.css(D(h,b.specCss)),delete b.specCss,a.rotation=g.rotation)});this.tickRotCorr=b.rotCorr(w.b,this.labelRotation||0,0!==this.side)},hasData:function(){return this.hasVisibleSeries||g(this.min)&&g(this.max)&&!!this.tickPositions},getOffset:function(){var a=this,b=a.chart,f=b.renderer,d=a.options,e=a.tickPositions,r=a.ticks,q=a.horiz,n=a.side,z=b.inverted?[1,0,3,2][n]:n,w,p,h=0,x,F=0,D=d.title,A=d.labels,G=0,m=a.opposite,K=b.axisOffset,
b=b.clipOffset,l=[-1,1,1,-1][n],t,I=d.className,C=a.axisParent,B=this.tickSize("tick");w=a.hasData();a.showAxis=p=w||y(d.showEmpty,!0);a.staggerLines=a.horiz&&A.staggerLines;a.axisGroup||(a.gridGroup=f.g("grid").attr({zIndex:d.gridZIndex||1}).addClass("highcharts-"+this.coll.toLowerCase()+"-grid "+(I||"")).add(C),a.axisGroup=f.g("axis").attr({zIndex:d.zIndex||2}).addClass("highcharts-"+this.coll.toLowerCase()+" "+(I||"")).add(C),a.labelGroup=f.g("axis-labels").attr({zIndex:A.zIndex||7}).addClass("highcharts-"+
a.coll.toLowerCase()+"-labels "+(I||"")).add(C));if(w||a.isLinked)c(e,function(b){r[b]?r[b].addLabel():r[b]=new N(a,b)}),a.renderUnsquish(),!1===A.reserveSpace||0!==n&&2!==n&&{1:"left",3:"right"}[n]!==a.labelAlign&&"center"!==a.labelAlign||c(e,function(a){G=Math.max(r[a].getLabelSize(),G)}),a.staggerLines&&(G*=a.staggerLines,a.labelOffset=G*(a.opposite?-1:1));else for(t in r)r[t].destroy(),delete r[t];D&&D.text&&!1!==D.enabled&&(a.axisTitle||((t=D.textAlign)||(t=(q?{low:"left",middle:"center",high:"right"}:
{low:m?"right":"left",middle:"center",high:m?"left":"right"})[D.align]),a.axisTitle=f.text(D.text,0,0,D.useHTML).attr({zIndex:7,rotation:D.rotation||0,align:t}).addClass("highcharts-axis-title").add(a.axisGroup),a.axisTitle.isNew=!0),p&&(h=a.axisTitle.getBBox()[q?"height":"width"],x=D.offset,F=g(x)?0:y(D.margin,q?5:10)),a.axisTitle[p?"show":"hide"](!0));a.renderLine();a.offset=l*y(d.offset,K[n]);a.tickRotCorr=a.tickRotCorr||{x:0,y:0};f=0===n?-a.labelMetrics().h:2===n?a.tickRotCorr.y:0;F=Math.abs(G)+
F;G&&(F=F-f+l*(q?y(A.y,a.tickRotCorr.y+8*l):A.x));a.axisTitleMargin=y(x,F);K[n]=Math.max(K[n],a.axisTitleMargin+h+l*a.offset,F,w&&e.length&&B?B[0]:0);d=d.offset?0:2*Math.floor(a.axisLine.strokeWidth()/2);b[z]=Math.max(b[z],d)},getLinePath:function(a){var b=this.chart,f=this.opposite,k=this.offset,c=this.horiz,d=this.left+(f?this.width:0)+k,k=b.chartHeight-this.bottom-(f?this.height:0)+k;f&&(a*=-1);return b.renderer.crispLine(["M",c?this.left:d,c?k:this.top,"L",c?b.chartWidth-this.right:d,c?k:b.chartHeight-
this.bottom],a)},renderLine:function(){this.axisLine||(this.axisLine=this.chart.renderer.path().addClass("highcharts-axis-line").add(this.axisGroup))},getTitlePosition:function(){var a=this.horiz,b=this.left,f=this.top,c=this.len,d=this.options.title,e=a?b:f,r=this.opposite,q=this.offset,n=d.x||0,z=d.y||0,g=this.chart.renderer.fontMetrics(d.style&&d.style.fontSize,this.axisTitle).f,c={low:e+(a?0:c),middle:e+c/2,high:e+(a?c:0)}[d.align],b=(a?f+this.height:b)+(a?1:-1)*(r?-1:1)*this.axisTitleMargin+
(2===this.side?g:0);return{x:a?c+n:b+(r?this.width:0)+q+n,y:a?b+z-(r?this.height:0)+q:c+z}},render:function(){var a=this,b=a.chart,f=b.renderer,d=a.options,e=a.isLog,r=a.lin2log,q=a.isLinked,n=a.tickPositions,z=a.axisTitle,g=a.ticks,w=a.minorTicks,p=a.alternateBands,h=d.stackLabels,y=d.alternateGridColor,x=a.tickmarkOffset,D=a.axisLine,A=b.hasRendered&&G(a.oldMin),m=a.showAxis,K=B(f.globalAnimation),l,t;a.labelEdge.length=0;a.overlap=!1;c([g,w,p],function(a){for(var b in a)a[b].isActive=!1});if(a.hasData()||
q)a.minorTickInterval&&!a.categories&&c(a.getMinorTickPositions(),function(b){w[b]||(w[b]=new N(a,b,"minor"));A&&w[b].isNew&&w[b].render(null,!0);w[b].render(null,!1,1)}),n.length&&(c(n,function(b,f){if(!q||b>=a.min&&b<=a.max)g[b]||(g[b]=new N(a,b)),A&&g[b].isNew&&g[b].render(f,!0,.1),g[b].render(f)}),x&&(0===a.min||a.single)&&(g[-1]||(g[-1]=new N(a,-1,null,!0)),g[-1].render(-1))),y&&c(n,function(f,c){t=void 0!==n[c+1]?n[c+1]+x:a.max-x;0===c%2&&f<a.max&&t<=a.max+(b.polar?-x:x)&&(p[f]||(p[f]=new I(a)),
l=f+x,p[f].options={from:e?r(l):l,to:e?r(t):t,color:y},p[f].render(),p[f].isActive=!0)}),a._addedPlotLB||(c((d.plotLines||[]).concat(d.plotBands||[]),function(b){a.addPlotBandOrLine(b)}),a._addedPlotLB=!0);c([g,w,p],function(a){var f,c,k=[],d=K.duration;for(f in a)a[f].isActive||(a[f].render(f,!1,0),a[f].isActive=!1,k.push(f));F(function(){for(c=k.length;c--;)a[k[c]]&&!a[k[c]].isActive&&(a[k[c]].destroy(),delete a[k[c]])},a!==p&&b.hasRendered&&d?d:0)});D&&(D[D.isPlaced?"animate":"attr"]({d:this.getLinePath(D.strokeWidth())}),
D.isPlaced=!0,D[m?"show":"hide"](!0));z&&m&&(z[z.isNew?"attr":"animate"](a.getTitlePosition()),z.isNew=!1);h&&h.enabled&&a.renderStackTotals();a.isDirty=!1},redraw:function(){this.visible&&(this.render(),c(this.plotLinesAndBands,function(a){a.render()}));c(this.series,function(a){a.isDirty=!0})},destroy:function(a){var b=this,f=b.stacks,d,k=b.plotLinesAndBands,e;a||r(b);for(d in f)m(f[d]),f[d]=null;c([b.ticks,b.minorTicks,b.alternateBands],function(a){m(a)});if(k)for(a=k.length;a--;)k[a].destroy();
c("stackTotalGroup axisLine axisTitle axisGroup gridGroup labelGroup cross".split(" "),function(a){b[a]&&(b[a]=b[a].destroy())});k="extKey hcEvents names series userMax userMin".split(" ");for(e in b)b.hasOwnProperty(e)&&-1===q(e,k)&&delete b[e]},drawCrosshair:function(a,b){var f,c=this.crosshair,d=y(c.snap,!0),k,e=this.cross;a||(a=this.cross&&this.cross.e);this.crosshair&&!1!==(g(b)||!d)?(d?g(b)&&(k=this.isXAxis?b.plotX:this.len-b.plotY):k=a&&(this.horiz?a.chartX-this.pos:this.len-a.chartY+this.pos),
g(k)&&(f=this.getPlotLinePath(b&&(this.isXAxis?b.x:y(b.stackY,b.y)),null,null,null,k)||null),g(f)?(b=this.categories&&!this.isRadial,e||(this.cross=e=this.chart.renderer.path().addClass("highcharts-crosshair highcharts-crosshair-"+(b?"category ":"thin ")+c.className).attr({zIndex:y(c.zIndex,2)}).add()),e.show().attr({d:f}),b&&!c.width&&e.attr({"stroke-width":this.transA}),this.cross.e=a):this.hideCrosshair()):this.hideCrosshair()},hideCrosshair:function(){this.cross&&this.cross.hide()}};p(a.Axis.prototype,
l)})(L);(function(a){var C=a.Axis,B=a.Date,E=a.dateFormat,H=a.defaultOptions,l=a.defined,d=a.each,h=a.extend,g=a.getMagnitude,t=a.getTZOffset,m=a.normalizeTickInterval,c=a.pick,e=a.timeUnits;C.prototype.getTimeTicks=function(a,g,A,b){var f=[],q={},w=H.global.useUTC,p,n=new B(g-t(g)),x,m=B.hcMakeTime,y=a.unitRange,I=a.count,r;if(l(g)){n[B.hcSetMilliseconds](y>=e.second?0:I*Math.floor(n.getMilliseconds()/I));if(y>=e.second)n[B.hcSetSeconds](y>=e.minute?0:I*Math.floor(n.getSeconds()/I));if(y>=e.minute)n[B.hcSetMinutes](y>=
e.hour?0:I*Math.floor(n[B.hcGetMinutes]()/I));y>=e.hour&&(n[B.hcSetHours](y>=e.day?0:I*Math.floor(n[B.hcGetHours]()/I)),x=n[B.hcGetHours]());if(y>=e.day)n[B.hcSetDate](y>=e.month?1:I*Math.floor(n[B.hcGetDate]()/I));y>=e.month&&(n[B.hcSetMonth](y>=e.year?0:I*Math.floor(n[B.hcGetMonth]()/I)),p=n[B.hcGetFullYear]());if(y>=e.year)n[B.hcSetFullYear](p-p%I);if(y===e.week)n[B.hcSetDate](n[B.hcGetDate]()-n[B.hcGetDay]()+c(b,1));b=1;if(B.hcTimezoneOffset||B.hcGetTimezoneOffset)r=(!w||!!B.hcGetTimezoneOffset)&&
(A-g>4*e.month||t(g)!==t(A)),n=n.getTime(),n=new B(n+t(n));p=n[B.hcGetFullYear]();g=n.getTime();w=n[B.hcGetMonth]();for(n=n[B.hcGetDate]();g<A;)f.push(g),g=y===e.year?m(p+b*I,0):y===e.month?m(p,w+b*I):!r||y!==e.day&&y!==e.week?r&&y===e.hour?m(p,w,n,x+b*I):g+y*I:m(p,w,n+b*I*(y===e.day?1:7)),b++;f.push(g);y<=e.hour&&d(f,function(a){"000000000"===E("%H%M%S%L",a)&&(q[a]="day")})}f.info=h(a,{higherRanks:q,totalRange:y*I});return f};C.prototype.normalizeTimeTickInterval=function(a,c){var d=c||[["millisecond",
[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2]],["week",[1,2]],["month",[1,2,3,4,6]],["year",null]];c=d[d.length-1];var b=e[c[0]],f=c[1],q;for(q=0;q<d.length&&!(c=d[q],b=e[c[0]],f=c[1],d[q+1]&&a<=(b*f[f.length-1]+e[d[q+1][0]])/2);q++);b===e.year&&a<5*b&&(f=[1,2,5]);a=m(a/b,f,"year"===c[0]?Math.max(g(a/b),1):1);return{unitRange:b,count:a,unitName:c[0]}}})(L);(function(a){var C=a.Axis,B=a.getMagnitude,E=a.map,H=a.normalizeTickInterval,
l=a.pick;C.prototype.getLogTickPositions=function(a,h,g,t){var d=this.options,c=this.len,e=this.lin2log,p=this.log2lin,x=[];t||(this._minorAutoInterval=null);if(.5<=a)a=Math.round(a),x=this.getLinearTickPositions(a,h,g);else if(.08<=a)for(var c=Math.floor(h),A,b,f,q,w,d=.3<a?[1,2,4]:.15<a?[1,2,4,6,8]:[1,2,3,4,5,6,7,8,9];c<g+1&&!w;c++)for(b=d.length,A=0;A<b&&!w;A++)f=p(e(c)*d[A]),f>h&&(!t||q<=g)&&void 0!==q&&x.push(q),q>g&&(w=!0),q=f;else h=e(h),g=e(g),a=d[t?"minorTickInterval":"tickInterval"],a=l("auto"===
a?null:a,this._minorAutoInterval,d.tickPixelInterval/(t?5:1)*(g-h)/((t?c/this.tickPositions.length:c)||1)),a=H(a,null,B(a)),x=E(this.getLinearTickPositions(a,h,g),p),t||(this._minorAutoInterval=a/5);t||(this.tickInterval=a);return x};C.prototype.log2lin=function(a){return Math.log(a)/Math.LN10};C.prototype.lin2log=function(a){return Math.pow(10,a)}})(L);(function(a){var C=a.dateFormat,B=a.each,E=a.extend,H=a.format,l=a.isNumber,d=a.map,h=a.merge,g=a.pick,t=a.splat,m=a.stop,c=a.syncTimeout,e=a.timeUnits;
a.Tooltip=function(){this.init.apply(this,arguments)};a.Tooltip.prototype={init:function(a,c){this.chart=a;this.options=c;this.crosshairs=[];this.now={x:0,y:0};this.isHidden=!0;this.split=c.split&&!a.inverted;this.shared=c.shared||this.split},cleanSplit:function(a){B(this.chart.series,function(c){var d=c&&c.tt;d&&(!d.isActive||a?c.tt=d.destroy():d.isActive=!1)})},getLabel:function(){var a=this.chart.renderer,c=this.options;this.label||(this.label=this.split?a.g("tooltip"):a.label("",0,0,c.shape||
"callout",null,null,c.useHTML,null,"tooltip").attr({padding:c.padding,r:c.borderRadius}),this.label.attr({zIndex:8}).add());return this.label},update:function(a){this.destroy();this.init(this.chart,h(!0,this.options,a))},destroy:function(){this.label&&(this.label=this.label.destroy());this.split&&this.tt&&(this.cleanSplit(this.chart,!0),this.tt=this.tt.destroy());clearTimeout(this.hideTimer);clearTimeout(this.tooltipTimeout)},move:function(a,c,d,b){var f=this,e=f.now,g=!1!==f.options.animation&&!f.isHidden&&
(1<Math.abs(a-e.x)||1<Math.abs(c-e.y)),p=f.followPointer||1<f.len;E(e,{x:g?(2*e.x+a)/3:a,y:g?(e.y+c)/2:c,anchorX:p?void 0:g?(2*e.anchorX+d)/3:d,anchorY:p?void 0:g?(e.anchorY+b)/2:b});f.getLabel().attr(e);g&&(clearTimeout(this.tooltipTimeout),this.tooltipTimeout=setTimeout(function(){f&&f.move(a,c,d,b)},32))},hide:function(a){var d=this;clearTimeout(this.hideTimer);a=g(a,this.options.hideDelay,500);this.isHidden||(this.hideTimer=c(function(){d.getLabel()[a?"fadeOut":"hide"]();d.isHidden=!0},a))},getAnchor:function(a,
c){var e,b=this.chart,f=b.inverted,q=b.plotTop,g=b.plotLeft,p=0,n=0,h,m;a=t(a);e=a[0].tooltipPos;this.followPointer&&c&&(void 0===c.chartX&&(c=b.pointer.normalize(c)),e=[c.chartX-b.plotLeft,c.chartY-q]);e||(B(a,function(a){h=a.series.yAxis;m=a.series.xAxis;p+=a.plotX+(!f&&m?m.left-g:0);n+=(a.plotLow?(a.plotLow+a.plotHigh)/2:a.plotY)+(!f&&h?h.top-q:0)}),p/=a.length,n/=a.length,e=[f?b.plotWidth-n:p,this.shared&&!f&&1<a.length&&c?c.chartY-q:f?b.plotHeight-p:n]);return d(e,Math.round)},getPosition:function(a,
c,d){var b=this.chart,f=this.distance,e={},w=d.h||0,p,n=["y",b.chartHeight,c,d.plotY+b.plotTop,b.plotTop,b.plotTop+b.plotHeight],h=["x",b.chartWidth,a,d.plotX+b.plotLeft,b.plotLeft,b.plotLeft+b.plotWidth],m=!this.followPointer&&g(d.ttBelow,!b.inverted===!!d.negative),y=function(a,b,c,d,r,n){var k=c<d-f,g=d+f+c<b,q=d-f-c;d+=f;if(m&&g)e[a]=d;else if(!m&&k)e[a]=q;else if(k)e[a]=Math.min(n-c,0>q-w?q:q-w);else if(g)e[a]=Math.max(r,d+w+c>b?d:d+w);else return!1},x=function(a,b,c,d){var k;d<f||d>b-f?k=!1:
e[a]=d<c/2?1:d>b-c/2?b-c-2:d-c/2;return k},r=function(a){var b=n;n=h;h=b;p=a},z=function(){!1!==y.apply(0,n)?!1!==x.apply(0,h)||p||(r(!0),z()):p?e.x=e.y=0:(r(!0),z())};(b.inverted||1<this.len)&&r();z();return e},defaultFormatter:function(a){var c=this.points||t(this),d;d=[a.tooltipFooterHeaderFormatter(c[0])];d=d.concat(a.bodyFormatter(c));d.push(a.tooltipFooterHeaderFormatter(c[0],!0));return d},refresh:function(a,c){var d=this.chart,b=this.getLabel(),f,e,w={},h,n=[];h=this.options.formatter||this.defaultFormatter;
var w=d.hoverPoints,p=this.shared;clearTimeout(this.hideTimer);this.followPointer=t(a)[0].series.tooltipOptions.followPointer;e=this.getAnchor(a,c);c=e[0];f=e[1];!p||a.series&&a.series.noSharedTooltip?w=a.getLabelConfig():(d.hoverPoints=a,w&&B(w,function(a){a.setState()}),B(a,function(a){a.setState("hover");n.push(a.getLabelConfig())}),w={x:a[0].category,y:a[0].y},w.points=n,this.len=n.length,a=a[0]);h=h.call(w,this);w=a.series;this.distance=g(w.tooltipOptions.distance,16);!1===h?this.hide():(this.isHidden&&
(m(b),b.attr({opacity:1}).show()),this.split?this.renderSplit(h,d.hoverPoints):(b.attr({text:h.join?h.join(""):h}),b.removeClass(/highcharts-color-[\d]+/g).addClass("highcharts-color-"+g(a.colorIndex,w.colorIndex)),this.updatePosition({plotX:c,plotY:f,negative:a.negative,ttBelow:a.ttBelow,h:e[2]||0})),this.isHidden=!1)},renderSplit:function(c,d){var e=this,b=[],f=this.chart,q=f.renderer,w=!0,h=this.options,n,p=this.getLabel();B(c.slice(0,c.length-1),function(a,c){c=d[c-1]||{isHeader:!0,plotX:d[0].plotX};
var y=c.series||e,r=y.tt,z="highcharts-color-"+g(c.colorIndex,(c.series||{}).colorIndex,"none");r||(y.tt=r=q.label(null,null,null,c.isHeader&&"callout").addClass("highcharts-tooltip-box "+z).attr({padding:h.padding,r:h.borderRadius}).add(p),c.series&&(r.connector=q.path().addClass("highcharts-tooltip-connector "+z).add(r)));r.isActive=!0;r.attr({text:a});a=r.getBBox();z=a.width+r.strokeWidth();c.isHeader?(n=a.height,z=Math.max(0,Math.min(c.plotX+f.plotLeft-z/2,f.chartWidth-z))):z=c.plotX+f.plotLeft-
g(h.distance,16)-z;0>z&&(w=!1);a=(c.series&&c.series.yAxis&&c.series.yAxis.pos)+(c.plotY||0);a-=f.plotTop;b.push({target:c.isHeader?f.plotHeight+n:a,rank:c.isHeader?1:0,size:y.tt.getBBox().height+1,point:c,x:z,tt:r})});this.cleanSplit();a.distribute(b,f.plotHeight+n);B(b,function(a){var b=a.point,c=a.tt,d;d={visibility:void 0===a.pos?"hidden":"inherit",x:w||b.isHeader?a.x:b.plotX+f.plotLeft+g(h.distance,16),y:a.pos+f.plotTop};b.isHeader&&(d.anchorX=b.plotX+f.plotLeft,d.anchorY=d.y-100);c.attr(d);
b.isHeader||c.connector.attr({d:["M",b.plotX+f.plotLeft-d.x,b.plotY+b.series.yAxis.pos-d.y,"L",(w?-1:1)*g(h.distance,16)+b.plotX+f.plotLeft-d.x,a.pos+f.plotTop+c.getBBox().height/2-d.y]})})},updatePosition:function(a){var c=this.chart,d=this.getLabel(),d=(this.options.positioner||this.getPosition).call(this,d.width,d.height,a);this.move(Math.round(d.x),Math.round(d.y||0),a.plotX+c.plotLeft,a.plotY+c.plotTop)},getXDateFormat:function(a,c,d){var b;c=c.dateTimeLabelFormats;var f=d&&d.closestPointRange,
g,w={millisecond:15,second:12,minute:9,hour:6,day:3},h,n="millisecond";if(f){h=C("%m-%d %H:%M:%S.%L",a.x);for(g in e){if(f===e.week&&+C("%w",a.x)===d.options.startOfWeek&&"00:00:00.000"===h.substr(6)){g="week";break}if(e[g]>f){g=n;break}if(w[g]&&h.substr(w[g])!=="01-01 00:00:00.000".substr(w[g]))break;"week"!==g&&(n=g)}g&&(b=c[g])}else b=c.day;return b||c.year},tooltipFooterHeaderFormatter:function(a,c){var d=c?"footer":"header";c=a.series;var b=c.tooltipOptions,f=b.xDateFormat,e=c.xAxis,g=e&&"datetime"===
e.options.type&&l(a.key),d=b[d+"Format"];g&&!f&&(f=this.getXDateFormat(a,b,e));g&&f&&(d=d.replace("{point.key}","{point.key:"+f+"}"));return H(d,{point:a,series:c})},bodyFormatter:function(a){return d(a,function(a){var c=a.series.tooltipOptions;return(c.pointFormatter||a.point.tooltipFormatter).call(a.point,c.pointFormat)})}}})(L);(function(a){var C=a.addEvent,B=a.attr,E=a.charts,H=a.css,l=a.defined,d=a.doc,h=a.each,g=a.extend,t=a.fireEvent,m=a.offset,c=a.pick,e=a.removeEvent,p=a.splat,x=a.Tooltip,
A=a.win;a.Pointer=function(a,c){this.init(a,c)};a.Pointer.prototype={init:function(a,f){this.options=f;this.chart=a;this.runChartClick=f.chart.events&&!!f.chart.events.click;this.pinchDown=[];this.lastValidTouch={};x&&f.tooltip.enabled&&(a.tooltip=new x(a,f.tooltip),this.followTouchMove=c(f.tooltip.followTouchMove,!0));this.setDOMEvents()},zoomOption:function(){var a=this.chart,c=a.options.chart.zoomType,d=/x/.test(c),c=/y/.test(c),a=a.inverted;this.zoomX=d;this.zoomY=c;this.zoomHor=d&&!a||c&&a;this.zoomVert=
c&&!a||d&&a;this.hasZoom=d||c},normalize:function(a,c){var b,f;a=a||A.event;a.target||(a.target=a.srcElement);f=a.touches?a.touches.length?a.touches.item(0):a.changedTouches[0]:a;c||(this.chartPosition=c=m(this.chart.container));void 0===f.pageX?(b=Math.max(a.x,a.clientX-c.left),c=a.y):(b=f.pageX-c.left,c=f.pageY-c.top);return g(a,{chartX:Math.round(b),chartY:Math.round(c)})},getCoordinates:function(a){var b={xAxis:[],yAxis:[]};h(this.chart.axes,function(c){b[c.isXAxis?"xAxis":"yAxis"].push({axis:c,
value:c.toValue(a[c.horiz?"chartX":"chartY"])})});return b},runPointActions:function(b){var f=this.chart,e=f.series,g=f.tooltip,p=g?g.shared:!1,n=!0,D=f.hoverPoint,m=f.hoverSeries,y,l,r,z=[],F;if(!p&&!m)for(y=0;y<e.length;y++)if(e[y].directTouch||!e[y].options.stickyTracking)e=[];m&&(p?m.noSharedTooltip:m.directTouch)&&D?z=[D]:(p||!m||m.options.stickyTracking||(e=[m]),h(e,function(a){l=a.noSharedTooltip&&p;r=!p&&a.directTouch;a.visible&&!l&&!r&&c(a.options.enableMouseTracking,!0)&&(F=a.searchPoint(b,
!l&&1===a.kdDimensions))&&F.series&&z.push(F)}),z.sort(function(a,b){var c=a.distX-b.distX,f=a.dist-b.dist;return 0!==c&&p?c:0!==f?f:a.series.group.zIndex>b.series.group.zIndex?-1:1}));if(p)for(y=z.length;y--;)(z[y].x!==z[0].x||z[y].series.noSharedTooltip)&&z.splice(y,1);if(z[0]&&(z[0]!==this.prevKDPoint||g&&g.isHidden)){if(p&&!z[0].series.noSharedTooltip){for(y=0;y<z.length;y++)z[y].onMouseOver(b,z[y]!==(m&&m.directTouch&&D||z[0]));z.length&&g&&g.refresh(z.sort(function(a,b){return a.series.index-
b.series.index}),b)}else if(g&&g.refresh(z[0],b),!m||!m.directTouch)z[0].onMouseOver(b);this.prevKDPoint=z[0];n=!1}n&&(e=m&&m.tooltipOptions.followPointer,g&&e&&!g.isHidden&&(e=g.getAnchor([{}],b),g.updatePosition({plotX:e[0],plotY:e[1]})));this._onDocumentMouseMove||(this._onDocumentMouseMove=function(b){if(E[a.hoverChartIndex])E[a.hoverChartIndex].pointer.onDocumentMouseMove(b)},C(d,"mousemove",this._onDocumentMouseMove));h(p?z:[c(D,z[0])],function(a){h(f.axes,function(c){(!a||a.series&&a.series[c.coll]===
c)&&c.drawCrosshair(b,a)})})},reset:function(a,c){var b=this.chart,f=b.hoverSeries,g=b.hoverPoint,n=b.hoverPoints,m=b.tooltip,l=m&&m.shared?n:g;a&&l&&h(p(l),function(b){b.series.isCartesian&&void 0===b.plotX&&(a=!1)});if(a)m&&l&&(m.refresh(l),g&&(g.setState(g.state,!0),h(b.axes,function(a){a.crosshair&&a.drawCrosshair(null,g)})));else{if(g)g.onMouseOut();n&&h(n,function(a){a.setState()});if(f)f.onMouseOut();m&&m.hide(c);this._onDocumentMouseMove&&(e(d,"mousemove",this._onDocumentMouseMove),this._onDocumentMouseMove=
null);h(b.axes,function(a){a.hideCrosshair()});this.hoverX=this.prevKDPoint=b.hoverPoints=b.hoverPoint=null}},scaleGroups:function(a,c){var b=this.chart,f;h(b.series,function(d){f=a||d.getPlotBox();d.xAxis&&d.xAxis.zoomEnabled&&d.group&&(d.group.attr(f),d.markerGroup&&(d.markerGroup.attr(f),d.markerGroup.clip(c?b.clipRect:null)),d.dataLabelsGroup&&d.dataLabelsGroup.attr(f))});b.clipRect.attr(c||b.clipBox)},dragStart:function(a){var b=this.chart;b.mouseIsDown=a.type;b.cancelClick=!1;b.mouseDownX=this.mouseDownX=
a.chartX;b.mouseDownY=this.mouseDownY=a.chartY},drag:function(a){var b=this.chart,c=b.options.chart,d=a.chartX,e=a.chartY,g=this.zoomHor,h=this.zoomVert,p=b.plotLeft,m=b.plotTop,l=b.plotWidth,r=b.plotHeight,z,F=this.selectionMarker,t=this.mouseDownX,k=this.mouseDownY,v=c.panKey&&a[c.panKey+"Key"];F&&F.touch||(d<p?d=p:d>p+l&&(d=p+l),e<m?e=m:e>m+r&&(e=m+r),this.hasDragged=Math.sqrt(Math.pow(t-d,2)+Math.pow(k-e,2)),10<this.hasDragged&&(z=b.isInsidePlot(t-p,k-m),b.hasCartesianSeries&&(this.zoomX||this.zoomY)&&
z&&!v&&!F&&(this.selectionMarker=F=b.renderer.rect(p,m,g?1:l,h?1:r,0).attr({"class":"highcharts-selection-marker",zIndex:7}).add()),F&&g&&(d-=t,F.attr({width:Math.abs(d),x:(0<d?0:d)+t})),F&&h&&(d=e-k,F.attr({height:Math.abs(d),y:(0<d?0:d)+k})),z&&!F&&c.panning&&b.pan(a,c.panning)))},drop:function(a){var b=this,c=this.chart,d=this.hasPinched;if(this.selectionMarker){var e={originalEvent:a,xAxis:[],yAxis:[]},n=this.selectionMarker,p=n.attr?n.attr("x"):n.x,m=n.attr?n.attr("y"):n.y,y=n.attr?n.attr("width"):
n.width,x=n.attr?n.attr("height"):n.height,r;if(this.hasDragged||d)h(c.axes,function(c){if(c.zoomEnabled&&l(c.min)&&(d||b[{xAxis:"zoomX",yAxis:"zoomY"}[c.coll]])){var f=c.horiz,g="touchend"===a.type?c.minPixelPadding:0,k=c.toValue((f?p:m)+g),f=c.toValue((f?p+y:m+x)-g);e[c.coll].push({axis:c,min:Math.min(k,f),max:Math.max(k,f)});r=!0}}),r&&t(c,"selection",e,function(a){c.zoom(g(a,d?{animation:!1}:null))});this.selectionMarker=this.selectionMarker.destroy();d&&this.scaleGroups()}c&&(H(c.container,{cursor:c._cursor}),
c.cancelClick=10<this.hasDragged,c.mouseIsDown=this.hasDragged=this.hasPinched=!1,this.pinchDown=[])},onContainerMouseDown:function(a){a=this.normalize(a);this.zoomOption();a.preventDefault&&a.preventDefault();this.dragStart(a)},onDocumentMouseUp:function(b){E[a.hoverChartIndex]&&E[a.hoverChartIndex].pointer.drop(b)},onDocumentMouseMove:function(a){var b=this.chart,c=this.chartPosition;a=this.normalize(a,c);!c||this.inClass(a.target,"highcharts-tracker")||b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-
b.plotTop)||this.reset()},onContainerMouseLeave:function(b){var c=E[a.hoverChartIndex];c&&(b.relatedTarget||b.toElement)&&(c.pointer.reset(),c.pointer.chartPosition=null)},onContainerMouseMove:function(b){var c=this.chart;l(a.hoverChartIndex)&&E[a.hoverChartIndex]&&E[a.hoverChartIndex].mouseIsDown||(a.hoverChartIndex=c.index);b=this.normalize(b);b.returnValue=!1;"mousedown"===c.mouseIsDown&&this.drag(b);!this.inClass(b.target,"highcharts-tracker")&&!c.isInsidePlot(b.chartX-c.plotLeft,b.chartY-c.plotTop)||
c.openMenu||this.runPointActions(b)},inClass:function(a,c){for(var b;a;){if(b=B(a,"class")){if(-1!==b.indexOf(c))return!0;if(-1!==b.indexOf("highcharts-container"))return!1}a=a.parentNode}},onTrackerMouseOut:function(a){var b=this.chart.hoverSeries;a=a.relatedTarget||a.toElement;if(!(!b||!a||b.options.stickyTracking||this.inClass(a,"highcharts-tooltip")||this.inClass(a,"highcharts-series-"+b.index)&&this.inClass(a,"highcharts-tracker")))b.onMouseOut()},onContainerClick:function(a){var b=this.chart,
c=b.hoverPoint,d=b.plotLeft,e=b.plotTop;a=this.normalize(a);b.cancelClick||(c&&this.inClass(a.target,"highcharts-tracker")?(t(c.series,"click",g(a,{point:c})),b.hoverPoint&&c.firePointEvent("click",a)):(g(a,this.getCoordinates(a)),b.isInsidePlot(a.chartX-d,a.chartY-e)&&t(b,"click",a)))},setDOMEvents:function(){var b=this,c=b.chart.container;c.onmousedown=function(a){b.onContainerMouseDown(a)};c.onmousemove=function(a){b.onContainerMouseMove(a)};c.onclick=function(a){b.onContainerClick(a)};C(c,"mouseleave",
b.onContainerMouseLeave);1===a.chartCount&&C(d,"mouseup",b.onDocumentMouseUp);a.hasTouch&&(c.ontouchstart=function(a){b.onContainerTouchStart(a)},c.ontouchmove=function(a){b.onContainerTouchMove(a)},1===a.chartCount&&C(d,"touchend",b.onDocumentTouchEnd))},destroy:function(){var b;e(this.chart.container,"mouseleave",this.onContainerMouseLeave);a.chartCount||(e(d,"mouseup",this.onDocumentMouseUp),e(d,"touchend",this.onDocumentTouchEnd));clearInterval(this.tooltipTimeout);for(b in this)this[b]=null}}})(L);
(function(a){var C=a.charts,B=a.each,E=a.extend,H=a.map,l=a.noop,d=a.pick;E(a.Pointer.prototype,{pinchTranslate:function(a,d,l,m,c,e){(this.zoomHor||this.pinchHor)&&this.pinchTranslateDirection(!0,a,d,l,m,c,e);(this.zoomVert||this.pinchVert)&&this.pinchTranslateDirection(!1,a,d,l,m,c,e)},pinchTranslateDirection:function(a,d,l,m,c,e,p,x){var g=this.chart,b=a?"x":"y",f=a?"X":"Y",h="chart"+f,w=a?"width":"height",t=g["plot"+(a?"Left":"Top")],n,D,K=x||1,y=g.inverted,I=g.bounds[a?"h":"v"],r=1===d.length,
z=d[0][h],F=l[0][h],N=!r&&d[1][h],k=!r&&l[1][h],v;l=function(){!r&&20<Math.abs(z-N)&&(K=x||Math.abs(F-k)/Math.abs(z-N));D=(t-F)/K+z;n=g["plot"+(a?"Width":"Height")]/K};l();d=D;d<I.min?(d=I.min,v=!0):d+n>I.max&&(d=I.max-n,v=!0);v?(F-=.8*(F-p[b][0]),r||(k-=.8*(k-p[b][1])),l()):p[b]=[F,k];y||(e[b]=D-t,e[w]=n);e=y?1/K:K;c[w]=n;c[b]=d;m[y?a?"scaleY":"scaleX":"scale"+f]=K;m["translate"+f]=e*t+(F-e*z)},pinch:function(a){var g=this,h=g.chart,m=g.pinchDown,c=a.touches,e=c.length,p=g.lastValidTouch,x=g.hasZoom,
A=g.selectionMarker,b={},f=1===e&&(g.inClass(a.target,"highcharts-tracker")&&h.runTrackerClick||g.runChartClick),q={};1<e&&(g.initiated=!0);x&&g.initiated&&!f&&a.preventDefault();H(c,function(a){return g.normalize(a)});"touchstart"===a.type?(B(c,function(a,b){m[b]={chartX:a.chartX,chartY:a.chartY}}),p.x=[m[0].chartX,m[1]&&m[1].chartX],p.y=[m[0].chartY,m[1]&&m[1].chartY],B(h.axes,function(a){if(a.zoomEnabled){var b=h.bounds[a.horiz?"h":"v"],c=a.minPixelPadding,f=a.toPixels(d(a.options.min,a.dataMin)),
e=a.toPixels(d(a.options.max,a.dataMax)),g=Math.max(f,e);b.min=Math.min(a.pos,Math.min(f,e)-c);b.max=Math.max(a.pos+a.len,g+c)}}),g.res=!0):m.length&&(A||(g.selectionMarker=A=E({destroy:l,touch:!0},h.plotBox)),g.pinchTranslate(m,c,b,A,q,p),g.hasPinched=x,g.scaleGroups(b,q),!x&&g.followTouchMove&&1===e?this.runPointActions(g.normalize(a)):g.res&&(g.res=!1,this.reset(!1,0)))},touch:function(h,g){var l=this.chart,m;a.hoverChartIndex=l.index;1===h.touches.length?(h=this.normalize(h),l.isInsidePlot(h.chartX-
l.plotLeft,h.chartY-l.plotTop)&&!l.openMenu?(g&&this.runPointActions(h),"touchmove"===h.type&&(g=this.pinchDown,m=g[0]?4<=Math.sqrt(Math.pow(g[0].chartX-h.chartX,2)+Math.pow(g[0].chartY-h.chartY,2)):!1),d(m,!0)&&this.pinch(h)):g&&this.reset()):2===h.touches.length&&this.pinch(h)},onContainerTouchStart:function(a){this.zoomOption();this.touch(a,!0)},onContainerTouchMove:function(a){this.touch(a)},onDocumentTouchEnd:function(d){C[a.hoverChartIndex]&&C[a.hoverChartIndex].pointer.drop(d)}})})(L);(function(a){var C=
a.addEvent,B=a.charts,E=a.css,H=a.doc,l=a.extend,d=a.noop,h=a.Pointer,g=a.removeEvent,t=a.win,m=a.wrap;if(t.PointerEvent||t.MSPointerEvent){var c={},e=!!t.PointerEvent,p=function(){var a,b=[];b.item=function(a){return this[a]};for(a in c)c.hasOwnProperty(a)&&b.push({pageX:c[a].pageX,pageY:c[a].pageY,target:c[a].target});return b},x=function(c,b,f,e){"touch"!==c.pointerType&&c.pointerType!==c.MSPOINTER_TYPE_TOUCH||!B[a.hoverChartIndex]||(e(c),e=B[a.hoverChartIndex].pointer,e[b]({type:f,target:c.currentTarget,
preventDefault:d,touches:p()}))};l(h.prototype,{onContainerPointerDown:function(a){x(a,"onContainerTouchStart","touchstart",function(a){c[a.pointerId]={pageX:a.pageX,pageY:a.pageY,target:a.currentTarget}})},onContainerPointerMove:function(a){x(a,"onContainerTouchMove","touchmove",function(a){c[a.pointerId]={pageX:a.pageX,pageY:a.pageY};c[a.pointerId].target||(c[a.pointerId].target=a.currentTarget)})},onDocumentPointerUp:function(a){x(a,"onDocumentTouchEnd","touchend",function(a){delete c[a.pointerId]})},
batchMSEvents:function(a){a(this.chart.container,e?"pointerdown":"MSPointerDown",this.onContainerPointerDown);a(this.chart.container,e?"pointermove":"MSPointerMove",this.onContainerPointerMove);a(H,e?"pointerup":"MSPointerUp",this.onDocumentPointerUp)}});m(h.prototype,"init",function(a,b,c){a.call(this,b,c);this.hasZoom&&E(b.container,{"-ms-touch-action":"none","touch-action":"none"})});m(h.prototype,"setDOMEvents",function(a){a.apply(this);(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(C)});
m(h.prototype,"destroy",function(a){this.batchMSEvents(g);a.call(this)})}})(L);(function(a){var C,B=a.addEvent,E=a.css,H=a.discardElement,l=a.defined,d=a.each,h=a.extend,g=a.isFirefox,t=a.marginNames,m=a.merge,c=a.pick,e=a.setAnimation,p=a.stableSort,x=a.win,A=a.wrap;C=a.Legend=function(a,c){this.init(a,c)};C.prototype={init:function(a,c){this.chart=a;this.setOptions(c);c.enabled&&(this.render(),B(this.chart,"endResize",function(){this.legend.positionCheckboxes()}))},setOptions:function(a){var b=
c(a.padding,8);this.options=a;this.itemMarginTop=a.itemMarginTop||0;this.initialItemX=this.padding=b;this.initialItemY=b-5;this.itemHeight=this.maxItemWidth=0;this.symbolWidth=c(a.symbolWidth,16);this.pages=[]},update:function(a,d){var b=this.chart;this.setOptions(m(!0,this.options,a));this.destroy();b.isDirtyLegend=b.isDirtyBox=!0;c(d,!0)&&b.redraw()},colorizeItem:function(a,c){a.legendGroup[c?"removeClass":"addClass"]("highcharts-legend-item-hidden")},positionItem:function(a){var b=this.options,
c=b.symbolPadding,b=!b.rtl,d=a._legendItemPos,e=d[0],d=d[1],g=a.checkbox;(a=a.legendGroup)&&a.element&&a.translate(b?e:this.legendWidth-e-2*c-4,d);g&&(g.x=e,g.y=d)},destroyItem:function(a){var b=a.checkbox;d(["legendItem","legendLine","legendSymbol","legendGroup"],function(b){a[b]&&(a[b]=a[b].destroy())});b&&H(a.checkbox)},destroy:function(){var a=this.group,c=this.box;c&&(this.box=c.destroy());d(this.getAllItems(),function(a){d(["legendItem","legendGroup"],function(b){a[b]&&(a[b]=a[b].destroy())})});
a&&(this.group=a.destroy())},positionCheckboxes:function(a){var b=this.group.alignAttr,c,e=this.clipHeight||this.legendHeight,g=this.titleHeight;b&&(c=b.translateY,d(this.allItems,function(d){var f=d.checkbox,n;f&&(n=c+g+f.y+(a||0)+3,E(f,{left:b.translateX+d.checkboxOffset+f.x-20+"px",top:n+"px",display:n>c-6&&n<c+e-6?"":"none"}))}))},renderTitle:function(){var a=this.padding,c=this.options.title,d=0;c.text&&(this.title||(this.title=this.chart.renderer.label(c.text,a-3,a-4,null,null,null,null,null,
"legend-title").attr({zIndex:1}).add(this.group)),a=this.title.getBBox(),d=a.height,this.offsetWidth=a.width,this.contentGroup.attr({translateY:d}));this.titleHeight=d},setText:function(b){var c=this.options;b.legendItem.attr({text:c.labelFormat?a.format(c.labelFormat,b):c.labelFormatter.call(b)})},renderItem:function(a){var b=this.chart,d=b.renderer,e=this.options,g="horizontal"===e.layout,n=this.symbolWidth,h=e.symbolPadding,p=this.padding,m=g?c(e.itemDistance,20):0,l=!e.rtl,r=e.width,z=e.itemMarginBottom||
0,F=this.itemMarginTop,x=this.initialItemX,k=a.legendItem,v=!a.series,t=!v&&a.series.drawLegendSymbol?a.series:a,A=t.options,A=this.createCheckboxForItem&&A&&A.showCheckbox,C=e.useHTML;k||(a.legendGroup=d.g("legend-item").addClass("highcharts-"+t.type+"-series highcharts-color-"+a.colorIndex+" "+(a.options.className||"")+(v?"highcharts-series-"+a.index:"")).attr({zIndex:1}).add(this.scrollGroup),a.legendItem=k=d.text("",l?n+h:-h,this.baseline||0,C).attr({align:l?"left":"right",zIndex:2}).add(a.legendGroup),
this.baseline||(this.fontMetrics=d.fontMetrics(12,k),this.baseline=this.fontMetrics.f+3+F,k.attr("y",this.baseline)),t.drawLegendSymbol(this,a),this.setItemEvents&&this.setItemEvents(a,k,C),A&&this.createCheckboxForItem(a));this.colorizeItem(a,a.visible);this.setText(a);d=k.getBBox();n=a.checkboxOffset=e.itemWidth||a.legendItemWidth||n+h+d.width+m+(A?20:0);this.itemHeight=h=Math.round(a.legendItemHeight||d.height);g&&this.itemX-x+n>(r||b.chartWidth-2*p-x-e.x)&&(this.itemX=x,this.itemY+=F+this.lastLineHeight+
z,this.lastLineHeight=0);this.maxItemWidth=Math.max(this.maxItemWidth,n);this.lastItemY=F+this.itemY+z;this.lastLineHeight=Math.max(h,this.lastLineHeight);a._legendItemPos=[this.itemX,this.itemY];g?this.itemX+=n:(this.itemY+=F+h+z,this.lastLineHeight=h);this.offsetWidth=r||Math.max((g?this.itemX-x-m:n)+p,this.offsetWidth)},getAllItems:function(){var a=[];d(this.chart.series,function(b){var d=b&&b.options;b&&c(d.showInLegend,l(d.linkedTo)?!1:void 0,!0)&&(a=a.concat(b.legendItems||("point"===d.legendType?
b.data:b)))});return a},adjustMargins:function(a,e){var b=this.chart,f=this.options,g=f.align.charAt(0)+f.verticalAlign.charAt(0)+f.layout.charAt(0);f.floating||d([/(lth|ct|rth)/,/(rtv|rm|rbv)/,/(rbh|cb|lbh)/,/(lbv|lm|ltv)/],function(d,h){d.test(g)&&!l(a[h])&&(b[t[h]]=Math.max(b[t[h]],b.legend[(h+1)%2?"legendHeight":"legendWidth"]+[1,-1,-1,1][h]*f[h%2?"x":"y"]+c(f.margin,12)+e[h]))})},render:function(){var a=this,c=a.chart,e=c.renderer,g=a.group,m,n,l,x,y=a.box,t=a.options,r=a.padding;a.itemX=a.initialItemX;
a.itemY=a.initialItemY;a.offsetWidth=0;a.lastItemY=0;g||(a.group=g=e.g("legend").attr({zIndex:7}).add(),a.contentGroup=e.g().attr({zIndex:1}).add(g),a.scrollGroup=e.g().add(a.contentGroup));a.renderTitle();m=a.getAllItems();p(m,function(a,b){return(a.options&&a.options.legendIndex||0)-(b.options&&b.options.legendIndex||0)});t.reversed&&m.reverse();a.allItems=m;a.display=n=!!m.length;a.lastLineHeight=0;d(m,function(b){a.renderItem(b)});l=(t.width||a.offsetWidth)+r;x=a.lastItemY+a.lastLineHeight+a.titleHeight;
x=a.handleOverflow(x);x+=r;y||(a.box=y=e.rect().addClass("highcharts-legend-box").attr({r:t.borderRadius}).add(g),y.isNew=!0);0<l&&0<x&&(y[y.isNew?"attr":"animate"](y.crisp({x:0,y:0,width:l,height:x},y.strokeWidth())),y.isNew=!1);y[n?"show":"hide"]();"none"===g.getStyle("display")&&(l=x=0);a.legendWidth=l;a.legendHeight=x;d(m,function(b){a.positionItem(b)});n&&g.align(h({width:l,height:x},t),!0,"spacingBox");c.isResizing||this.positionCheckboxes()},handleOverflow:function(a){var b=this,e=this.chart,
g=e.renderer,h=this.options,n=h.y,n=e.spacingBox.height+("top"===h.verticalAlign?-n:n)-this.padding,p=h.maxHeight,m,l=this.clipRect,x=h.navigation,r=c(x.animation,!0),z=x.arrowSize||12,F=this.nav,t=this.pages,k=this.padding,v,A=this.allItems,R=function(a){l.attr({height:a});b.contentGroup.div&&(b.contentGroup.div.style.clip="rect("+k+"px,9999px,"+(k+a)+"px,0)")};"horizontal"===h.layout&&(n/=2);p&&(n=Math.min(n,p));t.length=0;a>n&&!1!==x.enabled?(this.clipHeight=m=Math.max(n-20-this.titleHeight-k,
0),this.currentPage=c(this.currentPage,1),this.fullHeight=a,d(A,function(a,b){var c=a._legendItemPos[1];a=Math.round(a.legendItem.getBBox().height);var d=t.length;if(!d||c-t[d-1]>m&&(v||c)!==t[d-1])t.push(v||c),d++;b===A.length-1&&c+a-t[d-1]>m&&t.push(c);c!==v&&(v=c)}),l||(l=b.clipRect=g.clipRect(0,k,9999,0),b.contentGroup.clip(l)),R(m),F||(this.nav=F=g.g().attr({zIndex:1}).add(this.group),this.up=g.symbol("triangle",0,0,z,z).on("click",function(){b.scroll(-1,r)}).add(F),this.pager=g.text("",15,10).addClass("highcharts-legend-navigation").add(F),
this.down=g.symbol("triangle-down",0,0,z,z).on("click",function(){b.scroll(1,r)}).add(F)),b.scroll(0),a=n):F&&(R(e.chartHeight),F.hide(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0);return a},scroll:function(a,c){var b=this.pages,d=b.length;a=this.currentPage+a;var f=this.clipHeight,g=this.pager,h=this.padding;a>d&&(a=d);0<a&&(void 0!==c&&e(c,this.chart),this.nav.attr({translateX:h,translateY:f+this.padding+7+this.titleHeight,visibility:"visible"}),this.up.attr({"class":1===a?"highcharts-legend-nav-inactive":
"highcharts-legend-nav-active"}),g.attr({text:a+"/"+d}),this.down.attr({x:18+this.pager.getBBox().width,"class":a===d?"highcharts-legend-nav-inactive":"highcharts-legend-nav-active"}),c=-b[a-1]+this.initialItemY,this.scrollGroup.animate({translateY:c}),this.currentPage=a,this.positionCheckboxes(c))}};a.LegendSymbolMixin={drawRectangle:function(a,d){var b=a.options,e=b.symbolHeight||a.fontMetrics.f,b=b.squareSymbol;d.legendSymbol=this.chart.renderer.rect(b?(a.symbolWidth-e)/2:0,a.baseline-e+1,b?e:
a.symbolWidth,e,c(a.options.symbolRadius,e/2)).addClass("highcharts-point").attr({zIndex:3}).add(d.legendGroup)},drawLineMarker:function(a){var b=this.options.marker,c=a.symbolWidth,d=this.chart.renderer,e=this.legendGroup,g=a.baseline-Math.round(.3*a.fontMetrics.b);this.legendLine=d.path(["M",0,g,"L",c,g]).addClass("highcharts-graph").attr({}).add(e);b&&!1!==b.enabled&&(a=0===this.symbol.indexOf("url")?0:b.radius,this.legendSymbol=b=d.symbol(this.symbol,c/2-a,g-a,2*a,2*a,b).addClass("highcharts-point").add(e),
b.isMarker=!0)}};(/Trident\/7\.0/.test(x.navigator.userAgent)||g)&&A(C.prototype,"positionItem",function(a,c){var b=this,d=function(){c._legendItemPos&&a.call(b,c)};d();setTimeout(d)})})(L);(function(a){var C=a.addEvent,B=a.animObject,E=a.attr,H=a.doc,l=a.Axis,d=a.createElement,h=a.defaultOptions,g=a.discardElement,t=a.charts,m=a.css,c=a.defined,e=a.each,p=a.error,x=a.extend,A=a.fireEvent,b=a.getStyle,f=a.grep,q=a.isNumber,w=a.isObject,G=a.isString,n=a.Legend,D=a.marginNames,K=a.merge,y=a.Pointer,
I=a.pick,r=a.pInt,z=a.removeEvent,F=a.seriesTypes,N=a.splat,k=a.svg,v=a.syncTimeout,Q=a.win,R=a.Renderer,P=a.Chart=function(){this.getArgs.apply(this,arguments)};a.chart=function(a,b,c){return new P(a,b,c)};P.prototype={callbacks:[],getArgs:function(){var a=[].slice.call(arguments);if(G(a[0])||a[0].nodeName)this.renderTo=a.shift();this.init(a[0],a[1])},init:function(b,c){var d,e=b.series;b.series=null;d=K(h,b);d.series=b.series=e;this.userOptions=b;this.respRules=[];b=d.chart;e=b.events;this.margin=
[];this.spacing=[];this.bounds={h:{},v:{}};this.callback=c;this.isResizing=0;this.options=d;this.axes=[];this.series=[];this.hasCartesianSeries=b.showAxes;var f;this.index=t.length;t.push(this);a.chartCount++;if(e)for(f in e)C(this,f,e[f]);this.xAxis=[];this.yAxis=[];this.pointCount=this.colorCounter=this.symbolCounter=0;this.firstRender()},initSeries:function(a){var b=this.options.chart;(b=F[a.type||b.type||b.defaultSeriesType])||p(17,!0);b=new b;b.init(this,a);return b},isInsidePlot:function(a,
b,c){var d=c?b:a;a=c?a:b;return 0<=d&&d<=this.plotWidth&&0<=a&&a<=this.plotHeight},redraw:function(b){var c=this.axes,d=this.series,f=this.pointer,k=this.legend,g=this.isDirtyLegend,r,n,z=this.hasCartesianSeries,h=this.isDirtyBox,p=d.length,m=p,v=this.renderer,l=v.isHidden(),F=[];a.setAnimation(b,this);l&&this.cloneRenderTo();for(this.layOutTitles();m--;)if(b=d[m],b.options.stacking&&(r=!0,b.isDirty)){n=!0;break}if(n)for(m=p;m--;)b=d[m],b.options.stacking&&(b.isDirty=!0);e(d,function(a){a.isDirty&&
"point"===a.options.legendType&&(a.updateTotals&&a.updateTotals(),g=!0);a.isDirtyData&&A(a,"updatedData")});g&&k.options.enabled&&(k.render(),this.isDirtyLegend=!1);r&&this.getStacks();z&&e(c,function(a){a.updateNames();a.setScale()});this.getMargins();z&&(e(c,function(a){a.isDirty&&(h=!0)}),e(c,function(a){var b=a.min+","+a.max;a.extKey!==b&&(a.extKey=b,F.push(function(){A(a,"afterSetExtremes",x(a.eventArgs,a.getExtremes()));delete a.eventArgs}));(h||r)&&a.redraw()}));h&&this.drawChartBox();e(d,
function(a){(h||a.isDirty)&&a.visible&&a.redraw()});f&&f.reset(!0);v.draw();A(this,"redraw");l&&this.cloneRenderTo(!0);e(F,function(a){a.call()})},get:function(a){var b=this.axes,c=this.series,d,e;for(d=0;d<b.length;d++)if(b[d].options.id===a)return b[d];for(d=0;d<c.length;d++)if(c[d].options.id===a)return c[d];for(d=0;d<c.length;d++)for(e=c[d].points||[],b=0;b<e.length;b++)if(e[b].id===a)return e[b];return null},getAxes:function(){var a=this,b=this.options,c=b.xAxis=N(b.xAxis||{}),b=b.yAxis=N(b.yAxis||
{});e(c,function(a,b){a.index=b;a.isX=!0});e(b,function(a,b){a.index=b});c=c.concat(b);e(c,function(b){new l(a,b)})},getSelectedPoints:function(){var a=[];e(this.series,function(b){a=a.concat(f(b.points||[],function(a){return a.selected}))});return a},getSelectedSeries:function(){return f(this.series,function(a){return a.selected})},setTitle:function(a,b,c){var d=this,f=d.options,k;k=f.title=K(f.title,a);f=f.subtitle=K(f.subtitle,b);e([["title",a,k],["subtitle",b,f]],function(a,b){var c=a[0],e=d[c],
f=a[1];a=a[2];e&&f&&(d[c]=e=e.destroy());a&&a.text&&!e&&(d[c]=d.renderer.text(a.text,0,0,a.useHTML).attr({align:a.align,"class":"highcharts-"+c,zIndex:a.zIndex||4}).add(),d[c].update=function(a){d.setTitle(!b&&a,b&&a)})});d.layOutTitles(c)},layOutTitles:function(a){var b=0,c,d=this.renderer,f=this.spacingBox;e(["title","subtitle"],function(a){var c=this[a],e=this.options[a],k;c&&(k=d.fontMetrics(k,c).b,c.css({width:(e.width||f.width+e.widthAdjust)+"px"}).align(x({y:b+k+("title"===a?-3:2)},e),!1,"spacingBox"),
e.floating||e.verticalAlign||(b=Math.ceil(b+c.getBBox().height)))},this);c=this.titleOffset!==b;this.titleOffset=b;!this.isDirtyBox&&c&&(this.isDirtyBox=c,this.hasRendered&&I(a,!0)&&this.isDirtyBox&&this.redraw())},getChartSize:function(){var a=this.options.chart,d=a.width,a=a.height,e=this.renderToClone||this.renderTo;c(d)||(this.containerWidth=b(e,"width"));c(a)||(this.containerHeight=b(e,"height"));this.chartWidth=Math.max(0,d||this.containerWidth||600);this.chartHeight=Math.max(0,I(a,19<this.containerHeight?
this.containerHeight:400))},cloneRenderTo:function(a){var b=this.renderToClone,c=this.container;if(a){if(b){for(;b.childNodes.length;)this.renderTo.appendChild(b.firstChild);g(b);delete this.renderToClone}}else c&&c.parentNode===this.renderTo&&this.renderTo.removeChild(c),this.renderToClone=b=this.renderTo.cloneNode(0),m(b,{position:"absolute",top:"-9999px",display:"block"}),b.style.setProperty&&b.style.setProperty("display","block","important"),H.body.appendChild(b),c&&b.appendChild(c)},setClassName:function(a){this.container.className=
"highcharts-container "+(a||"")},getContainer:function(){var b,c=this.options,e=c.chart,f,k;b=this.renderTo;var g="highcharts-"+a.idCounter++,n;b||(this.renderTo=b=e.renderTo);G(b)&&(this.renderTo=b=H.getElementById(b));b||p(13,!0);f=r(E(b,"data-highcharts-chart"));q(f)&&t[f]&&t[f].hasRendered&&t[f].destroy();E(b,"data-highcharts-chart",this.index);b.innerHTML="";e.skipClone||b.offsetWidth||this.cloneRenderTo();this.getChartSize();f=this.chartWidth;k=this.chartHeight;this.container=b=d("div",{id:g},
void 0,this.renderToClone||b);this._cursor=b.style.cursor;this.renderer=new (a[e.renderer]||R)(b,f,k,null,e.forExport,c.exporting&&c.exporting.allowHTML);this.setClassName(e.className);for(n in c.defs)this.renderer.definition(c.defs[n]);this.renderer.chartIndex=this.index},getMargins:function(a){var b=this.spacing,d=this.margin,e=this.titleOffset;this.resetMargins();e&&!c(d[0])&&(this.plotTop=Math.max(this.plotTop,e+this.options.title.margin+b[0]));this.legend.display&&this.legend.adjustMargins(d,
b);this.extraBottomMargin&&(this.marginBottom+=this.extraBottomMargin);this.extraTopMargin&&(this.plotTop+=this.extraTopMargin);a||this.getAxisMargins()},getAxisMargins:function(){var a=this,b=a.axisOffset=[0,0,0,0],d=a.margin;a.hasCartesianSeries&&e(a.axes,function(a){a.visible&&a.getOffset()});e(D,function(e,f){c(d[f])||(a[e]+=b[f])});a.setChartSize()},reflow:function(a){var d=this,e=d.options.chart,f=d.renderTo,k=c(e.width),g=e.width||b(f,"width"),e=e.height||b(f,"height"),f=a?a.target:Q;if(!k&&
!d.isPrinting&&g&&e&&(f===Q||f===H)){if(g!==d.containerWidth||e!==d.containerHeight)clearTimeout(d.reflowTimeout),d.reflowTimeout=v(function(){d.container&&d.setSize(void 0,void 0,!1)},a?100:0);d.containerWidth=g;d.containerHeight=e}},initReflow:function(){var a=this,b=function(b){a.reflow(b)};C(Q,"resize",b);C(a,"destroy",function(){z(Q,"resize",b)})},setSize:function(b,c,d){var f=this,k=f.renderer;f.isResizing+=1;a.setAnimation(d,f);f.oldChartHeight=f.chartHeight;f.oldChartWidth=f.chartWidth;void 0!==
b&&(f.options.chart.width=b);void 0!==c&&(f.options.chart.height=c);f.getChartSize();f.setChartSize(!0);k.setSize(f.chartWidth,f.chartHeight,d);e(f.axes,function(a){a.isDirty=!0;a.setScale()});f.isDirtyLegend=!0;f.isDirtyBox=!0;f.layOutTitles();f.getMargins();f.setResponsive&&f.setResponsive(!1);f.redraw(d);f.oldChartHeight=null;A(f,"resize");v(function(){f&&A(f,"endResize",null,function(){--f.isResizing})},B(void 0).duration)},setChartSize:function(a){var b=this.inverted,c=this.renderer,d=this.chartWidth,
f=this.chartHeight,k=this.options.chart,g=this.spacing,r=this.clipOffset,n,z,h,p;this.plotLeft=n=Math.round(this.plotLeft);this.plotTop=z=Math.round(this.plotTop);this.plotWidth=h=Math.max(0,Math.round(d-n-this.marginRight));this.plotHeight=p=Math.max(0,Math.round(f-z-this.marginBottom));this.plotSizeX=b?p:h;this.plotSizeY=b?h:p;this.plotBorderWidth=k.plotBorderWidth||0;this.spacingBox=c.spacingBox={x:g[3],y:g[0],width:d-g[3]-g[1],height:f-g[0]-g[2]};this.plotBox=c.plotBox={x:n,y:z,width:h,height:p};
d=2*Math.floor(this.plotBorderWidth/2);b=Math.ceil(Math.max(d,r[3])/2);c=Math.ceil(Math.max(d,r[0])/2);this.clipBox={x:b,y:c,width:Math.floor(this.plotSizeX-Math.max(d,r[1])/2-b),height:Math.max(0,Math.floor(this.plotSizeY-Math.max(d,r[2])/2-c))};a||e(this.axes,function(a){a.setAxisSize();a.setAxisTranslation()})},resetMargins:function(){var a=this,b=a.options.chart;e(["margin","spacing"],function(c){var d=b[c],f=w(d)?d:[d,d,d,d];e(["Top","Right","Bottom","Left"],function(d,e){a[c][e]=I(b[c+d],f[e])})});
e(D,function(b,c){a[b]=I(a.margin[c],a.spacing[c])});a.axisOffset=[0,0,0,0];a.clipOffset=[0,0,0,0]},drawChartBox:function(){var a=this.options.chart,b=this.renderer,c=this.chartWidth,d=this.chartHeight,e=this.chartBackground,f=this.plotBackground,k=this.plotBorder,g,r,n=this.plotLeft,z=this.plotTop,h=this.plotWidth,p=this.plotHeight,m=this.plotBox,v=this.clipRect,l=this.clipBox,F="animate";e||(this.chartBackground=e=b.rect().addClass("highcharts-background").add(),F="attr");g=r=e.strokeWidth();e[F]({x:r/
2,y:r/2,width:c-r-g%2,height:d-r-g%2,r:a.borderRadius});F="animate";f||(F="attr",this.plotBackground=f=b.rect().addClass("highcharts-plot-background").add());f[F](m);v?v.animate({width:l.width,height:l.height}):this.clipRect=b.clipRect(l);F="animate";k||(F="attr",this.plotBorder=k=b.rect().addClass("highcharts-plot-border").attr({zIndex:1}).add());k[F](k.crisp({x:n,y:z,width:h,height:p},-k.strokeWidth()));this.isDirtyBox=!1},propFromSeries:function(){var a=this,b=a.options.chart,c,d=a.options.series,
f,k;e(["inverted","angular","polar"],function(e){c=F[b.type||b.defaultSeriesType];k=b[e]||c&&c.prototype[e];for(f=d&&d.length;!k&&f--;)(c=F[d[f].type])&&c.prototype[e]&&(k=!0);a[e]=k})},linkSeries:function(){var a=this,b=a.series;e(b,function(a){a.linkedSeries.length=0});e(b,function(b){var c=b.options.linkedTo;G(c)&&(c=":previous"===c?a.series[b.index-1]:a.get(c))&&c.linkedParent!==b&&(c.linkedSeries.push(b),b.linkedParent=c,b.visible=I(b.options.visible,c.options.visible,b.visible))})},renderSeries:function(){e(this.series,
function(a){a.translate();a.render()})},renderLabels:function(){var a=this,b=a.options.labels;b.items&&e(b.items,function(c){var d=x(b.style,c.style),e=r(d.left)+a.plotLeft,f=r(d.top)+a.plotTop+12;delete d.left;delete d.top;a.renderer.text(c.html,e,f).attr({zIndex:2}).css(d).add()})},render:function(){var a=this.axes,b=this.renderer,c=this.options,d,f,k;this.setTitle();this.legend=new n(this,c.legend);this.getStacks&&this.getStacks();this.getMargins(!0);this.setChartSize();c=this.plotWidth;d=this.plotHeight-=
21;e(a,function(a){a.setScale()});this.getAxisMargins();f=1.1<c/this.plotWidth;k=1.05<d/this.plotHeight;if(f||k)e(a,function(a){(a.horiz&&f||!a.horiz&&k)&&a.setTickInterval(!0)}),this.getMargins();this.drawChartBox();this.hasCartesianSeries&&e(a,function(a){a.visible&&a.render()});this.seriesGroup||(this.seriesGroup=b.g("series-group").attr({zIndex:3}).add());this.renderSeries();this.renderLabels();this.addCredits();this.setResponsive&&this.setResponsive();this.hasRendered=!0},addCredits:function(a){var b=
this;a=K(!0,this.options.credits,a);a.enabled&&!this.credits&&(this.credits=this.renderer.text(a.text+(this.mapCredits||""),0,0).addClass("highcharts-credits").on("click",function(){a.href&&(Q.location.href=a.href)}).attr({align:a.position.align,zIndex:8}).add().align(a.position),this.credits.update=function(a){b.credits=b.credits.destroy();b.addCredits(a)})},destroy:function(){var b=this,c=b.axes,d=b.series,f=b.container,k,r=f&&f.parentNode;A(b,"destroy");t[b.index]=void 0;a.chartCount--;b.renderTo.removeAttribute("data-highcharts-chart");
z(b);for(k=c.length;k--;)c[k]=c[k].destroy();this.scroller&&this.scroller.destroy&&this.scroller.destroy();for(k=d.length;k--;)d[k]=d[k].destroy();e("title subtitle chartBackground plotBackground plotBGImage plotBorder seriesGroup clipRect credits pointer rangeSelector legend resetZoomButton tooltip renderer".split(" "),function(a){var c=b[a];c&&c.destroy&&(b[a]=c.destroy())});f&&(f.innerHTML="",z(f),r&&g(f));for(k in b)delete b[k]},isReadyToRender:function(){var a=this;return k||Q!=Q.top||"complete"===
H.readyState?!0:(H.attachEvent("onreadystatechange",function(){H.detachEvent("onreadystatechange",a.firstRender);"complete"===H.readyState&&a.firstRender()}),!1)},firstRender:function(){var a=this,b=a.options;if(a.isReadyToRender()){a.getContainer();A(a,"init");a.resetMargins();a.setChartSize();a.propFromSeries();a.getAxes();e(b.series||[],function(b){a.initSeries(b)});a.linkSeries();A(a,"beforeRender");y&&(a.pointer=new y(a,b));a.render();a.renderer.draw();if(!a.renderer.imgCount&&a.onload)a.onload();
a.cloneRenderTo(!0)}},onload:function(){e([this.callback].concat(this.callbacks),function(a){a&&void 0!==this.index&&a.apply(this,[this])},this);A(this,"load");!1!==this.options.chart.reflow&&this.initReflow();this.onload=null}}})(L);(function(a){var C,B=a.each,E=a.extend,H=a.erase,l=a.fireEvent,d=a.format,h=a.isArray,g=a.isNumber,t=a.pick,m=a.removeEvent;C=a.Point=function(){};C.prototype={init:function(a,d,g){var c=a.chart.options.chart.colorCount;this.series=a;this.applyOptions(d,g);a.options.colorByPoint?
(d=a.colorCounter,a.colorCounter++,a.colorCounter===c&&(a.colorCounter=0)):d=a.colorIndex;this.colorIndex=t(this.colorIndex,d);a.chart.pointCount++;return this},applyOptions:function(a,d){var c=this.series,e=c.options.pointValKey||c.pointValKey;a=C.prototype.optionsToObject.call(this,a);E(this,a);this.options=this.options?E(this.options,a):a;a.group&&delete this.group;e&&(this.y=this[e]);this.isNull=t(this.isValid&&!this.isValid(),null===this.x||!g(this.y,!0));this.selected&&(this.state="select");
"name"in this&&void 0===d&&c.xAxis&&c.xAxis.hasNames&&(this.x=c.xAxis.nameToX(this));void 0===this.x&&c&&(this.x=void 0===d?c.autoIncrement(this):d);return this},optionsToObject:function(a){var c={},d=this.series,m=d.options.keys,l=m||d.pointArrayMap||["y"],b=l.length,f=0,q=0;if(g(a)||null===a)c[l[0]]=a;else if(h(a))for(!m&&a.length>b&&(d=typeof a[0],"string"===d?c.name=a[0]:"number"===d&&(c.x=a[0]),f++);q<b;)m&&void 0===a[f]||(c[l[q]]=a[f]),f++,q++;else"object"===typeof a&&(c=a,a.dataLabels&&(d._hasPointLabels=
!0),a.marker&&(d._hasPointMarkers=!0));return c},getClassName:function(){return"highcharts-point"+(this.selected?" highcharts-point-select":"")+(this.negative?" highcharts-negative":"")+(this.isNull?" highcharts-null-point":"")+(void 0!==this.colorIndex?" highcharts-color-"+this.colorIndex:"")+(this.options.className?" "+this.options.className:"")},getZone:function(){var a=this.series,d=a.zones,a=a.zoneAxis||"y",g=0,h;for(h=d[g];this[a]>=h.value;)h=d[++g];h&&h.color&&!this.options.color&&(this.color=
h.color);return h},destroy:function(){var a=this.series.chart,d=a.hoverPoints,g;a.pointCount--;d&&(this.setState(),H(d,this),d.length||(a.hoverPoints=null));if(this===a.hoverPoint)this.onMouseOut();if(this.graphic||this.dataLabel)m(this),this.destroyElements();this.legendItem&&a.legend.destroyItem(this);for(g in this)this[g]=null},destroyElements:function(){for(var a=["graphic","dataLabel","dataLabelUpper","connector","shadowGroup"],d,g=6;g--;)d=a[g],this[d]&&(this[d]=this[d].destroy())},getLabelConfig:function(){return{x:this.category,
y:this.y,color:this.color,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},tooltipFormatter:function(a){var c=this.series,g=c.tooltipOptions,h=t(g.valueDecimals,""),m=g.valuePrefix||"",b=g.valueSuffix||"";B(c.pointArrayMap||["y"],function(c){c="{point."+c;if(m||b)a=a.replace(c+"}",m+c+"}"+b);a=a.replace(c+"}",c+":,."+h+"f}")});return d(a,{point:this,series:this.series})},firePointEvent:function(a,d,g){var c=this,e=this.series.options;
(e.point.events[a]||c.options&&c.options.events&&c.options.events[a])&&this.importEvents();"click"===a&&e.allowPointSelect&&(g=function(a){c.select&&c.select(null,a.ctrlKey||a.metaKey||a.shiftKey)});l(this,a,d,g)},visible:!0}})(L);(function(a){var C=a.addEvent,B=a.animObject,E=a.arrayMax,H=a.arrayMin,l=a.correctFloat,d=a.Date,h=a.defaultOptions,g=a.defined,t=a.each,m=a.erase,c=a.error,e=a.extend,p=a.fireEvent,x=a.grep,A=a.isArray,b=a.isNumber,f=a.isString,q=a.merge,w=a.pick,G=a.removeEvent,n=a.splat,
D=a.stableSort,K=a.SVGElement,y=a.syncTimeout,I=a.win;a.Series=a.seriesType("line",null,{allowPointSelect:!1,showCheckbox:!1,animation:{duration:1E3},events:{},marker:{radius:4,states:{hover:{animation:{duration:50},enabled:!0,radiusPlus:2}}},point:{events:{}},dataLabels:{align:"center",formatter:function(){return null===this.y?"":a.numberFormat(this.y,-1)},verticalAlign:"bottom",x:0,y:0,padding:5},cropThreshold:300,pointRange:0,softThreshold:!0,states:{hover:{lineWidthPlus:1,marker:{},halo:{size:10}},
select:{marker:{}}},stickyTracking:!0,turboThreshold:1E3},{isCartesian:!0,pointClass:a.Point,sorted:!0,requireSorting:!0,directTouch:!1,axisTypes:["xAxis","yAxis"],colorCounter:0,parallelArrays:["x","y"],coll:"series",init:function(a,b){var c=this,d,f,g=a.series,r=function(a,b){return w(a.options.index,a._i)-w(b.options.index,b._i)};c.chart=a;c.options=b=c.setOptions(b);c.linkedSeries=[];c.bindAxes();e(c,{name:b.name,state:"",visible:!1!==b.visible,selected:!0===b.selected});f=b.events;for(d in f)C(c,
d,f[d]);if(f&&f.click||b.point&&b.point.events&&b.point.events.click||b.allowPointSelect)a.runTrackerClick=!0;c.getColor();c.getSymbol();t(c.parallelArrays,function(a){c[a+"Data"]=[]});c.setData(b.data,!1);c.isCartesian&&(a.hasCartesianSeries=!0);g.push(c);c._i=g.length-1;D(g,r);this.yAxis&&D(this.yAxis.series,r);t(g,function(a,b){a.index=b;a.name=a.name||"Series "+(b+1)})},bindAxes:function(){var a=this,b=a.options,d=a.chart,e;t(a.axisTypes||[],function(f){t(d[f],function(c){e=c.options;if(b[f]===
e.index||void 0!==b[f]&&b[f]===e.id||void 0===b[f]&&0===e.index)c.series.push(a),a[f]=c,c.isDirty=!0});a[f]||a.optionalAxis===f||c(18,!0)})},updateParallelArrays:function(a,c){var d=a.series,e=arguments,f=b(c)?function(b){var e="y"===b&&d.toYData?d.toYData(a):a[b];d[b+"Data"][c]=e}:function(a){Array.prototype[c].apply(d[a+"Data"],Array.prototype.slice.call(e,2))};t(d.parallelArrays,f)},autoIncrement:function(){var a=this.options,b=this.xIncrement,c,e=a.pointIntervalUnit,b=w(b,a.pointStart,0);this.pointInterval=
c=w(this.pointInterval,a.pointInterval,1);e&&(a=new d(b),"day"===e?a=+a[d.hcSetDate](a[d.hcGetDate]()+c):"month"===e?a=+a[d.hcSetMonth](a[d.hcGetMonth]()+c):"year"===e&&(a=+a[d.hcSetFullYear](a[d.hcGetFullYear]()+c)),c=a-b);this.xIncrement=b+c;return b},setOptions:function(a){var b=this.chart,c=b.options.plotOptions,b=b.userOptions||{},d=b.plotOptions||{},e=c[this.type];this.userOptions=a;c=q(e,c.series,a);this.tooltipOptions=q(h.tooltip,h.plotOptions[this.type].tooltip,b.tooltip,d.series&&d.series.tooltip,
d[this.type]&&d[this.type].tooltip,a.tooltip);null===e.marker&&delete c.marker;this.zoneAxis=c.zoneAxis;a=this.zones=(c.zones||[]).slice();!c.negativeColor&&!c.negativeFillColor||c.zones||a.push({value:c[this.zoneAxis+"Threshold"]||c.threshold||0,className:"highcharts-negative"});a.length&&g(a[a.length-1].value)&&a.push({});return c},getCyclic:function(a,b,c){var d,e=this.userOptions,f=a+"Index",r=a+"Counter",n=c?c.length:w(this.chart.options.chart[a+"Count"],this.chart[a+"Count"]);b||(d=w(e[f],e["_"+
f]),g(d)||(e["_"+f]=d=this.chart[r]%n,this.chart[r]+=1),c&&(b=c[d]));void 0!==d&&(this[f]=d);this[a]=b},getColor:function(){this.getCyclic("color")},getSymbol:function(){this.getCyclic("symbol",this.options.marker.symbol,this.chart.options.symbols)},drawLegendSymbol:a.LegendSymbolMixin.drawLineMarker,setData:function(a,d,e,g){var k=this,r=k.points,n=r&&r.length||0,h,z=k.options,m=k.chart,p=null,l=k.xAxis,q=z.turboThreshold,y=this.xData,D=this.yData,x=(h=k.pointArrayMap)&&h.length;a=a||[];h=a.length;
d=w(d,!0);if(!1!==g&&h&&n===h&&!k.cropped&&!k.hasGroupedData&&k.visible)t(a,function(a,b){r[b].update&&a!==z.data[b]&&r[b].update(a,!1,null,!1)});else{k.xIncrement=null;k.colorCounter=0;t(this.parallelArrays,function(a){k[a+"Data"].length=0});if(q&&h>q){for(e=0;null===p&&e<h;)p=a[e],e++;if(b(p))for(e=0;e<h;e++)y[e]=this.autoIncrement(),D[e]=a[e];else if(A(p))if(x)for(e=0;e<h;e++)p=a[e],y[e]=p[0],D[e]=p.slice(1,x+1);else for(e=0;e<h;e++)p=a[e],y[e]=p[0],D[e]=p[1];else c(12)}else for(e=0;e<h;e++)void 0!==
a[e]&&(p={series:k},k.pointClass.prototype.applyOptions.apply(p,[a[e]]),k.updateParallelArrays(p,e));f(D[0])&&c(14,!0);k.data=[];k.options.data=k.userOptions.data=a;for(e=n;e--;)r[e]&&r[e].destroy&&r[e].destroy();l&&(l.minRange=l.userMinRange);k.isDirty=m.isDirtyBox=!0;k.isDirtyData=!!r;e=!1}"point"===z.legendType&&(this.processData(),this.generatePoints());d&&m.redraw(e)},processData:function(a){var b=this.xData,d=this.yData,e=b.length,f;f=0;var g,r,n=this.xAxis,h,m=this.options;h=m.cropThreshold;
var p=this.getExtremesFromAll||m.getExtremesFromAll,l=this.isCartesian,m=n&&n.val2lin,q=n&&n.isLog,y,w;if(l&&!this.isDirty&&!n.isDirty&&!this.yAxis.isDirty&&!a)return!1;n&&(a=n.getExtremes(),y=a.min,w=a.max);if(l&&this.sorted&&!p&&(!h||e>h||this.forceCrop))if(b[e-1]<y||b[0]>w)b=[],d=[];else if(b[0]<y||b[e-1]>w)f=this.cropData(this.xData,this.yData,y,w),b=f.xData,d=f.yData,f=f.start,g=!0;for(h=b.length||1;--h;)e=q?m(b[h])-m(b[h-1]):b[h]-b[h-1],0<e&&(void 0===r||e<r)?r=e:0>e&&this.requireSorting&&c(15);
this.cropped=g;this.cropStart=f;this.processedXData=b;this.processedYData=d;this.closestPointRange=r},cropData:function(a,b,c,d){var e=a.length,f=0,g=e,r=w(this.cropShoulder,1),n;for(n=0;n<e;n++)if(a[n]>=c){f=Math.max(0,n-r);break}for(c=n;c<e;c++)if(a[c]>d){g=c+r;break}return{xData:a.slice(f,g),yData:b.slice(f,g),start:f,end:g}},generatePoints:function(){var a=this.options.data,b=this.data,c,d=this.processedXData,e=this.processedYData,f=this.pointClass,g=d.length,h=this.cropStart||0,m,p=this.hasGroupedData,
l,y=[],q;b||p||(b=[],b.length=a.length,b=this.data=b);for(q=0;q<g;q++)m=h+q,p?(y[q]=(new f).init(this,[d[q]].concat(n(e[q]))),y[q].dataGroup=this.groupMap[q]):(b[m]?l=b[m]:void 0!==a[m]&&(b[m]=l=(new f).init(this,a[m],d[q])),y[q]=l),y[q].index=m;if(b&&(g!==(c=b.length)||p))for(q=0;q<c;q++)q!==h||p||(q+=g),b[q]&&(b[q].destroyElements(),b[q].plotX=void 0);this.data=b;this.points=y},getExtremes:function(a){var c=this.yAxis,d=this.processedXData,e,f=[],g=0;e=this.xAxis.getExtremes();var r=e.min,n=e.max,
h,m,p,l;a=a||this.stackedYData||this.processedYData||[];e=a.length;for(l=0;l<e;l++)if(m=d[l],p=a[l],h=(b(p,!0)||A(p))&&(!c.isLog||p.length||0<p),m=this.getExtremesFromAll||this.options.getExtremesFromAll||this.cropped||(d[l+1]||m)>=r&&(d[l-1]||m)<=n,h&&m)if(h=p.length)for(;h--;)null!==p[h]&&(f[g++]=p[h]);else f[g++]=p;this.dataMin=H(f);this.dataMax=E(f)},translate:function(){this.processedXData||this.processData();this.generatePoints();for(var a=this.options,c=a.stacking,d=this.xAxis,e=d.categories,
f=this.yAxis,n=this.points,h=n.length,m=!!this.modifyValue,p=a.pointPlacement,q="between"===p||b(p),y=a.threshold,t=a.startFromThreshold?y:0,D,x,A,I,K=Number.MAX_VALUE,a=0;a<h;a++){var G=n[a],C=G.x,B=G.y;x=G.low;var E=c&&f.stacks[(this.negStacks&&B<(t?0:y)?"-":"")+this.stackKey],H;f.isLog&&null!==B&&0>=B&&(G.isNull=!0);G.plotX=D=l(Math.min(Math.max(-1E5,d.translate(C,0,0,0,1,p,"flags"===this.type)),1E5));c&&this.visible&&!G.isNull&&E&&E[C]&&(I=this.getStackIndicator(I,C,this.index),H=E[C],B=H.points[I.key],
x=B[0],B=B[1],x===t&&I.key===E[C].base&&(x=w(y,f.min)),f.isLog&&0>=x&&(x=null),G.total=G.stackTotal=H.total,G.percentage=H.total&&G.y/H.total*100,G.stackY=B,H.setOffset(this.pointXOffset||0,this.barW||0));G.yBottom=g(x)?f.translate(x,0,1,0,1):null;m&&(B=this.modifyValue(B,G));G.plotY=x="number"===typeof B&&Infinity!==B?Math.min(Math.max(-1E5,f.translate(B,0,1,0,1)),1E5):void 0;G.isInside=void 0!==x&&0<=x&&x<=f.len&&0<=D&&D<=d.len;G.clientX=q?l(d.translate(C,0,0,0,1,p)):D;G.negative=G.y<(y||0);G.category=
e&&void 0!==e[G.x]?e[G.x]:G.x;G.isNull||(void 0!==A&&(K=Math.min(K,Math.abs(D-A))),A=D)}this.closestPointRangePx=K},getValidPoints:function(a,b){var c=this.chart;return x(a||this.points||[],function(a){return b&&!c.isInsidePlot(a.plotX,a.plotY,c.inverted)?!1:!a.isNull})},setClip:function(a){var b=this.chart,c=this.options,d=b.renderer,e=b.inverted,f=this.clipBox,g=f||b.clipBox,n=this.sharedClipKey||["_sharedClip",a&&a.duration,a&&a.easing,g.height,c.xAxis,c.yAxis].join(),r=b[n],h=b[n+"m"];r||(a&&
(g.width=0,b[n+"m"]=h=d.clipRect(-99,e?-b.plotLeft:-b.plotTop,99,e?b.chartWidth:b.chartHeight)),b[n]=r=d.clipRect(g),r.count={length:0});a&&!r.count[this.index]&&(r.count[this.index]=!0,r.count.length+=1);!1!==c.clip&&(this.group.clip(a||f?r:b.clipRect),this.markerGroup.clip(h),this.sharedClipKey=n);a||(r.count[this.index]&&(delete r.count[this.index],--r.count.length),0===r.count.length&&n&&b[n]&&(f||(b[n]=b[n].destroy()),b[n+"m"]&&(b[n+"m"]=b[n+"m"].destroy())))},animate:function(a){var b=this.chart,
c=B(this.options.animation),d;a?this.setClip(c):(d=this.sharedClipKey,(a=b[d])&&a.animate({width:b.plotSizeX},c),b[d+"m"]&&b[d+"m"].animate({width:b.plotSizeX+99},c),this.animate=null)},afterAnimate:function(){this.setClip();p(this,"afterAnimate")},drawPoints:function(){var a=this.points,c=this.chart,d,e,f,g,n=this.options.marker,h,m,p,l,q=this.markerGroup,y=w(n.enabled,this.xAxis.isRadial?!0:null,this.closestPointRangePx>2*n.radius);if(!1!==n.enabled||this._hasPointMarkers)for(e=a.length;e--;)f=
a[e],d=f.plotY,g=f.graphic,h=f.marker||{},m=!!f.marker,p=y&&void 0===h.enabled||h.enabled,l=f.isInside,p&&b(d)&&null!==f.y?(d=w(h.symbol,this.symbol),f.hasImage=0===d.indexOf("url"),p=this.markerAttribs(f,f.selected&&"select"),g?g[l?"show":"hide"](!0).animate(p):l&&(0<p.width||f.hasImage)&&(f.graphic=g=c.renderer.symbol(d,p.x,p.y,p.width,p.height,m?h:n).add(q)),g&&g.addClass(f.getClassName(),!0)):g&&(f.graphic=g.destroy())},markerAttribs:function(a,b){var c=this.options.marker,d=a&&a.options,e=d&&
d.marker||{},d=w(e.radius,c.radius);b&&(c=c.states[b],b=e.states&&e.states[b],d=w(b&&b.radius,c&&c.radius,d+(c&&c.radiusPlus||0)));a.hasImage&&(d=0);a={x:Math.floor(a.plotX)-d,y:a.plotY-d};d&&(a.width=a.height=2*d);return a},destroy:function(){var a=this,b=a.chart,c=/AppleWebKit\/533/.test(I.navigator.userAgent),d,e=a.data||[],f,g,n;p(a,"destroy");G(a);t(a.axisTypes||[],function(b){(n=a[b])&&n.series&&(m(n.series,a),n.isDirty=n.forceRedraw=!0)});a.legendItem&&a.chart.legend.destroyItem(a);for(d=e.length;d--;)(f=
e[d])&&f.destroy&&f.destroy();a.points=null;clearTimeout(a.animationTimeout);for(g in a)a[g]instanceof K&&!a[g].survive&&(d=c&&"group"===g?"hide":"destroy",a[g][d]());b.hoverSeries===a&&(b.hoverSeries=null);m(b.series,a);for(g in a)delete a[g]},getGraphPath:function(a,b,c){var d=this,e=d.options,f=e.step,n,h=[],r=[],m;a=a||d.points;(n=a.reversed)&&a.reverse();(f={right:1,center:2}[f]||f&&3)&&n&&(f=4-f);!e.connectNulls||b||c||(a=this.getValidPoints(a));t(a,function(k,n){var p=k.plotX,l=k.plotY,q=a[n-
1];(k.leftCliff||q&&q.rightCliff)&&!c&&(m=!0);k.isNull&&!g(b)&&0<n?m=!e.connectNulls:k.isNull&&!b?m=!0:(0===n||m?n=["M",k.plotX,k.plotY]:d.getPointSpline?n=d.getPointSpline(a,k,n):f?(n=1===f?["L",q.plotX,l]:2===f?["L",(q.plotX+p)/2,q.plotY,"L",(q.plotX+p)/2,l]:["L",p,q.plotY],n.push("L",p,l)):n=["L",p,l],r.push(k.x),f&&r.push(k.x),h.push.apply(h,n),m=!1)});h.xMap=r;return d.graphPath=h},drawGraph:function(){var a=this,b=(this.gappedPath||this.getGraphPath).call(this),c=[["graph","highcharts-graph"]];
t(this.zones,function(a,b){c.push(["zone-graph-"+b,"highcharts-graph highcharts-zone-graph-"+b+" "+(a.className||"")])});t(c,function(c,d){d=c[0];var e=a[d];e?(e.endX=b.xMap,e.animate({d:b})):b.length&&(a[d]=a.chart.renderer.path(b).addClass(c[1]).attr({zIndex:1}).add(a.group));e&&(e.startX=b.xMap,e.isArea=b.isArea)})},applyZones:function(){var a=this,b=this.chart,c=b.renderer,d=this.zones,e,f,g=this.clips||[],n,h=this.graph,m=this.area,p=Math.max(b.chartWidth,b.chartHeight),l=this[(this.zoneAxis||
"y")+"Axis"],q,y,D=b.inverted,x,A,I,G,K=!1;d.length&&(h||m)&&l&&void 0!==l.min&&(y=l.reversed,x=l.horiz,h&&h.hide(),m&&m.hide(),q=l.getExtremes(),t(d,function(d,k){e=y?x?b.plotWidth:0:x?0:l.toPixels(q.min);e=Math.min(Math.max(w(f,e),0),p);f=Math.min(Math.max(Math.round(l.toPixels(w(d.value,q.max),!0)),0),p);K&&(e=f=l.toPixels(q.max));A=Math.abs(e-f);I=Math.min(e,f);G=Math.max(e,f);l.isXAxis?(n={x:D?G:I,y:0,width:A,height:p},x||(n.x=b.plotHeight-n.x)):(n={x:0,y:D?G:I,width:p,height:A},x&&(n.y=b.plotWidth-
n.y));g[k]?g[k].animate(n):(g[k]=c.clipRect(n),h&&a["zone-graph-"+k].clip(g[k]),m&&a["zone-area-"+k].clip(g[k]));K=d.value>q.max}),this.clips=g)},invertGroups:function(a){function b(){var b={width:c.yAxis.len,height:c.xAxis.len};t(["group","markerGroup"],function(d){c[d]&&c[d].attr(b).invert(a)})}var c=this,d=c.chart;c.xAxis&&(C(d,"resize",b),C(c,"destroy",function(){G(d,"resize",b)}),b(a),c.invertGroups=b)},plotGroup:function(a,b,c,d,e){var f=this[a],g=!f;g&&(this[a]=f=this.chart.renderer.g(b).attr({zIndex:d||
.1}).add(e),f.addClass("highcharts-series-"+this.index+" highcharts-"+this.type+"-series highcharts-color-"+this.colorIndex+" "+(this.options.className||"")));f.attr({visibility:c})[g?"attr":"animate"](this.getPlotBox());return f},getPlotBox:function(){var a=this.chart,b=this.xAxis,c=this.yAxis;a.inverted&&(b=c,c=this.xAxis);return{translateX:b?b.left:a.plotLeft,translateY:c?c.top:a.plotTop,scaleX:1,scaleY:1}},render:function(){var a=this,b=a.chart,c,d=a.options,e=!!a.animate&&b.renderer.isSVG&&B(d.animation).duration,
f=a.visible?"inherit":"hidden",g=d.zIndex,n=a.hasRendered,h=b.seriesGroup,m=b.inverted;c=a.plotGroup("group","series",f,g,h);a.markerGroup=a.plotGroup("markerGroup","markers",f,g,h);e&&a.animate(!0);c.inverted=a.isCartesian?m:!1;a.drawGraph&&(a.drawGraph(),a.applyZones());a.drawDataLabels&&a.drawDataLabels();a.visible&&a.drawPoints();a.drawTracker&&!1!==a.options.enableMouseTracking&&a.drawTracker();a.invertGroups(m);!1===d.clip||a.sharedClipKey||n||c.clip(b.clipRect);e&&a.animate();n||(a.animationTimeout=
y(function(){a.afterAnimate()},e));a.isDirty=a.isDirtyData=!1;a.hasRendered=!0},redraw:function(){var a=this.chart,b=this.isDirty||this.isDirtyData,c=this.group,d=this.xAxis,e=this.yAxis;c&&(a.inverted&&c.attr({width:a.plotWidth,height:a.plotHeight}),c.animate({translateX:w(d&&d.left,a.plotLeft),translateY:w(e&&e.top,a.plotTop)}));this.translate();this.render();b&&delete this.kdTree},kdDimensions:1,kdAxisArray:["clientX","plotY"],searchPoint:function(a,b){var c=this.xAxis,d=this.yAxis,e=this.chart.inverted;
return this.searchKDTree({clientX:e?c.len-a.chartY+c.pos:a.chartX-c.pos,plotY:e?d.len-a.chartX+d.pos:a.chartY-d.pos},b)},buildKDTree:function(){function a(c,d,e){var f,g;if(g=c&&c.length)return f=b.kdAxisArray[d%e],c.sort(function(a,b){return a[f]-b[f]}),g=Math.floor(g/2),{point:c[g],left:a(c.slice(0,g),d+1,e),right:a(c.slice(g+1),d+1,e)}}var b=this,c=b.kdDimensions;delete b.kdTree;y(function(){b.kdTree=a(b.getValidPoints(null,!b.directTouch),c,c)},b.options.kdNow?0:1)},searchKDTree:function(a,b){function c(a,
b,k,h){var m=b.point,p=d.kdAxisArray[k%h],l,r,q=m;r=g(a[e])&&g(m[e])?Math.pow(a[e]-m[e],2):null;l=g(a[f])&&g(m[f])?Math.pow(a[f]-m[f],2):null;l=(r||0)+(l||0);m.dist=g(l)?Math.sqrt(l):Number.MAX_VALUE;m.distX=g(r)?Math.sqrt(r):Number.MAX_VALUE;p=a[p]-m[p];l=0>p?"left":"right";r=0>p?"right":"left";b[l]&&(l=c(a,b[l],k+1,h),q=l[n]<q[n]?l:m);b[r]&&Math.sqrt(p*p)<q[n]&&(a=c(a,b[r],k+1,h),q=a[n]<q[n]?a:q);return q}var d=this,e=this.kdAxisArray[0],f=this.kdAxisArray[1],n=b?"distX":"dist";this.kdTree||this.buildKDTree();
if(this.kdTree)return c(a,this.kdTree,this.kdDimensions,this.kdDimensions)}})})(L);(function(a){function C(a,c,d,g,h){var e=a.chart.inverted;this.axis=a;this.isNegative=d;this.options=c;this.x=g;this.total=null;this.points={};this.stack=h;this.rightCliff=this.leftCliff=0;this.alignOptions={align:c.align||(e?d?"left":"right":"center"),verticalAlign:c.verticalAlign||(e?"middle":d?"bottom":"top"),y:t(c.y,e?4:d?14:-6),x:t(c.x,e?d?-6:6:0)};this.textAlign=c.textAlign||(e?d?"right":"left":"center")}var B=
a.Axis,E=a.Chart,H=a.correctFloat,l=a.defined,d=a.destroyObjectProperties,h=a.each,g=a.format,t=a.pick;a=a.Series;C.prototype={destroy:function(){d(this,this.axis)},render:function(a){var c=this.options,d=c.format,d=d?g(d,this):c.formatter.call(this);this.label?this.label.attr({text:d,visibility:"hidden"}):this.label=this.axis.chart.renderer.text(d,null,null,c.useHTML).css(c.style).attr({align:this.textAlign,rotation:c.rotation,visibility:"hidden"}).add(a)},setOffset:function(a,c){var d=this.axis,
g=d.chart,h=g.inverted,m=d.reversed,m=this.isNegative&&!m||!this.isNegative&&m,b=d.translate(d.usePercentage?100:this.total,0,0,0,1),d=d.translate(0),d=Math.abs(b-d);a=g.xAxis[0].translate(this.x)+a;var f=g.plotHeight,h={x:h?m?b:b-d:a,y:h?f-a-c:m?f-b-d:f-b,width:h?d:c,height:h?c:d};if(c=this.label)c.align(this.alignOptions,null,h),h=c.alignAttr,c[!1===this.options.crop||g.isInsidePlot(h.x,h.y)?"show":"hide"](!0)}};E.prototype.getStacks=function(){var a=this;h(a.yAxis,function(a){a.stacks&&a.hasVisibleSeries&&
(a.oldStacks=a.stacks)});h(a.series,function(c){!c.options.stacking||!0!==c.visible&&!1!==a.options.chart.ignoreHiddenSeries||(c.stackKey=c.type+t(c.options.stack,""))})};B.prototype.buildStacks=function(){var a=this.series,c,d=t(this.options.reversedStacks,!0),g=a.length,h;if(!this.isXAxis){this.usePercentage=!1;for(h=g;h--;)a[d?h:g-h-1].setStackedPoints();for(h=g;h--;)c=a[d?h:g-h-1],c.setStackCliffs&&c.setStackCliffs();if(this.usePercentage)for(h=0;h<g;h++)a[h].setPercentStacks()}};B.prototype.renderStackTotals=
function(){var a=this.chart,c=a.renderer,d=this.stacks,g,h,l=this.stackTotalGroup;l||(this.stackTotalGroup=l=c.g("stack-labels").attr({visibility:"visible",zIndex:6}).add());l.translate(a.plotLeft,a.plotTop);for(g in d)for(h in a=d[g],a)a[h].render(l)};B.prototype.resetStacks=function(){var a=this.stacks,c,d;if(!this.isXAxis)for(c in a)for(d in a[c])a[c][d].touched<this.stacksTouched?(a[c][d].destroy(),delete a[c][d]):(a[c][d].total=null,a[c][d].cum=0)};B.prototype.cleanStacks=function(){var a,c,
d;if(!this.isXAxis)for(c in this.oldStacks&&(a=this.stacks=this.oldStacks),a)for(d in a[c])a[c][d].cum=a[c][d].total};a.prototype.setStackedPoints=function(){if(this.options.stacking&&(!0===this.visible||!1===this.chart.options.chart.ignoreHiddenSeries)){var a=this.processedXData,c=this.processedYData,d=[],g=c.length,h=this.options,A=h.threshold,b=h.startFromThreshold?A:0,f=h.stack,h=h.stacking,q=this.stackKey,w="-"+q,G=this.negStacks,n=this.yAxis,D=n.stacks,K=n.oldStacks,y,I,r,z,F,B,k;n.stacksTouched+=
1;for(F=0;F<g;F++)B=a[F],k=c[F],y=this.getStackIndicator(y,B,this.index),z=y.key,r=(I=G&&k<(b?0:A))?w:q,D[r]||(D[r]={}),D[r][B]||(K[r]&&K[r][B]?(D[r][B]=K[r][B],D[r][B].total=null):D[r][B]=new C(n,n.options.stackLabels,I,B,f)),r=D[r][B],null!==k&&(r.points[z]=r.points[this.index]=[t(r.cum,b)],l(r.cum)||(r.base=z),r.touched=n.stacksTouched,0<y.index&&!1===this.singleStacks&&(r.points[z][0]=r.points[this.index+","+B+",0"][0])),"percent"===h?(I=I?q:w,G&&D[I]&&D[I][B]?(I=D[I][B],r.total=I.total=Math.max(I.total,
r.total)+Math.abs(k)||0):r.total=H(r.total+(Math.abs(k)||0))):r.total=H(r.total+(k||0)),r.cum=t(r.cum,b)+(k||0),null!==k&&(r.points[z].push(r.cum),d[F]=r.cum);"percent"===h&&(n.usePercentage=!0);this.stackedYData=d;n.oldStacks={}}};a.prototype.setPercentStacks=function(){var a=this,c=a.stackKey,d=a.yAxis.stacks,g=a.processedXData,l;h([c,"-"+c],function(c){for(var b=g.length,e,h;b--;)if(e=g[b],l=a.getStackIndicator(l,e,a.index,c),e=(h=d[c]&&d[c][e])&&h.points[l.key])h=h.total?100/h.total:0,e[0]=H(e[0]*
h),e[1]=H(e[1]*h),a.stackedYData[b]=e[1]})};a.prototype.getStackIndicator=function(a,c,d,g){!l(a)||a.x!==c||g&&a.key!==g?a={x:c,index:0,key:g}:a.index++;a.key=[d,c,a.index].join();return a}})(L);(function(a){var C=a.addEvent,B=a.Axis,E=a.createElement,H=a.css,l=a.defined,d=a.each,h=a.erase,g=a.extend,t=a.fireEvent,m=a.inArray,c=a.isNumber,e=a.isObject,p=a.merge,x=a.pick,A=a.Point,b=a.Series,f=a.seriesTypes,q=a.setAnimation,w=a.splat;g(a.Chart.prototype,{addSeries:function(a,b,c){var d,e=this;a&&(b=
x(b,!0),t(e,"addSeries",{options:a},function(){d=e.initSeries(a);e.isDirtyLegend=!0;e.linkSeries();b&&e.redraw(c)}));return d},addAxis:function(a,b,c,d){var e=b?"xAxis":"yAxis",f=this.options;a=p(a,{index:this[e].length,isX:b});new B(this,a);f[e]=w(f[e]||{});f[e].push(a);x(c,!0)&&this.redraw(d)},showLoading:function(a){var b=this,c=b.options,d=b.loadingDiv,e=function(){d&&H(d,{left:b.plotLeft+"px",top:b.plotTop+"px",width:b.plotWidth+"px",height:b.plotHeight+"px"})};d||(b.loadingDiv=d=E("div",{className:"highcharts-loading highcharts-loading-hidden"},
null,b.container),b.loadingSpan=E("span",{className:"highcharts-loading-inner"},null,d),C(b,"redraw",e));d.className="highcharts-loading";b.loadingSpan.innerHTML=a||c.lang.loading;b.loadingShown=!0;e()},hideLoading:function(){var a=this.loadingDiv;a&&(a.className="highcharts-loading highcharts-loading-hidden");this.loadingShown=!1},propsRequireDirtyBox:"backgroundColor borderColor borderWidth margin marginTop marginRight marginBottom marginLeft spacing spacingTop spacingRight spacingBottom spacingLeft borderRadius plotBackgroundColor plotBackgroundImage plotBorderColor plotBorderWidth plotShadow shadow".split(" "),
propsRequireUpdateSeries:["chart.polar","chart.ignoreHiddenSeries","chart.type","colors","plotOptions"],update:function(a,b){var e,f={credits:"addCredits",title:"setTitle",subtitle:"setSubtitle"},g=a.chart,h,n;if(g){p(!0,this.options.chart,g);"className"in g&&this.setClassName(g.className);if("inverted"in g||"polar"in g)this.propFromSeries(),h=!0;for(e in g)g.hasOwnProperty(e)&&(-1!==m("chart."+e,this.propsRequireUpdateSeries)&&(n=!0),-1!==m(e,this.propsRequireDirtyBox)&&(this.isDirtyBox=!0))}for(e in a){if(this[e]&&
"function"===typeof this[e].update)this[e].update(a[e],!1);else if("function"===typeof this[f[e]])this[f[e]](a[e]);"chart"!==e&&-1!==m(e,this.propsRequireUpdateSeries)&&(n=!0)}a.plotOptions&&p(!0,this.options.plotOptions,a.plotOptions);d(["xAxis","yAxis","series"],function(b){a[b]&&d(w(a[b]),function(a){var c=l(a.id)&&this.get(a.id)||this[b][0];c&&c.coll===b&&c.update(a,!1)},this)},this);h&&d(this.axes,function(a){a.update({},!1)});n&&d(this.series,function(a){a.update({},!1)});a.loading&&p(!0,this.options.loading,
a.loading);e=g&&g.width;g=g&&g.height;c(e)&&e!==this.chartWidth||c(g)&&g!==this.chartHeight?this.setSize(e,g):x(b,!0)&&this.redraw()},setSubtitle:function(a){this.setTitle(void 0,a)}});g(A.prototype,{update:function(a,b,c,d){function f(){g.applyOptions(a);null===g.y&&n&&(g.graphic=n.destroy());e(a,!0)&&(n&&n.element&&a&&a.marker&&a.marker.symbol&&(g.graphic=n.destroy()),a&&a.dataLabels&&g.dataLabel&&(g.dataLabel=g.dataLabel.destroy()));l=g.index;h.updateParallelArrays(g,l);k.data[l]=e(k.data[l],!0)?
g.options:a;h.isDirty=h.isDirtyData=!0;!h.fixedBox&&h.hasCartesianSeries&&(p.isDirtyBox=!0);"point"===k.legendType&&(p.isDirtyLegend=!0);b&&p.redraw(c)}var g=this,h=g.series,n=g.graphic,l,p=h.chart,k=h.options;b=x(b,!0);!1===d?f():g.firePointEvent("update",{options:a},f)},remove:function(a,b){this.series.removePoint(m(this,this.series.data),a,b)}});g(b.prototype,{addPoint:function(a,b,c,d){var e=this.options,f=this.data,g=this.chart,h=this.xAxis&&this.xAxis.names,n=e.data,l,k,p=this.xData,m,q;b=x(b,
!0);l={series:this};this.pointClass.prototype.applyOptions.apply(l,[a]);q=l.x;m=p.length;if(this.requireSorting&&q<p[m-1])for(k=!0;m&&p[m-1]>q;)m--;this.updateParallelArrays(l,"splice",m,0,0);this.updateParallelArrays(l,m);h&&l.name&&(h[q]=l.name);n.splice(m,0,a);k&&(this.data.splice(m,0,null),this.processData());"point"===e.legendType&&this.generatePoints();c&&(f[0]&&f[0].remove?f[0].remove(!1):(f.shift(),this.updateParallelArrays(l,"shift"),n.shift()));this.isDirtyData=this.isDirty=!0;b&&g.redraw(d)},
removePoint:function(a,b,c){var d=this,e=d.data,f=e[a],g=d.points,h=d.chart,n=function(){g&&g.length===e.length&&g.splice(a,1);e.splice(a,1);d.options.data.splice(a,1);d.updateParallelArrays(f||{series:d},"splice",a,1);f&&f.destroy();d.isDirty=!0;d.isDirtyData=!0;b&&h.redraw()};q(c,h);b=x(b,!0);f?f.firePointEvent("remove",null,n):n()},remove:function(a,b,c){function d(){e.destroy();f.isDirtyLegend=f.isDirtyBox=!0;f.linkSeries();x(a,!0)&&f.redraw(b)}var e=this,f=e.chart;!1!==c?t(e,"remove",null,d):
d()},update:function(a,b){var c=this,e=this.chart,h=this.userOptions,n=this.type,l=a.type||h.type||e.options.chart.type,m=f[n].prototype,q=["group","markerGroup","dataLabelsGroup"],w;if(l&&l!==n||void 0!==a.zIndex)q.length=0;d(q,function(a){q[a]=c[a];delete c[a]});a=p(h,{animation:!1,index:this.index,pointStart:this.xData[0]},{data:this.options.data},a);this.remove(!1,null,!1);for(w in m)this[w]=void 0;g(this,f[l||n].prototype);d(q,function(a){c[a]=q[a]});this.init(e,a);e.linkSeries();x(b,!0)&&e.redraw(!1)}});
g(B.prototype,{update:function(a,b){var c=this.chart;a=c.options[this.coll][this.options.index]=p(this.userOptions,a);this.destroy(!0);this.init(c,g(a,{events:void 0}));c.isDirtyBox=!0;x(b,!0)&&c.redraw()},remove:function(a){for(var b=this.chart,c=this.coll,e=this.series,f=e.length;f--;)e[f]&&e[f].remove(!1);h(b.axes,this);h(b[c],this);b.options[c].splice(this.options.index,1);d(b[c],function(a,b){a.options.index=b});this.destroy();b.isDirtyBox=!0;x(a,!0)&&b.redraw()},setTitle:function(a,b){this.update({title:a},
b)},setCategories:function(a,b){this.update({categories:a},b)}})})(L);(function(a){var C=a.each,B=a.map,E=a.pick,H=a.Series,l=a.seriesType;l("area","line",{softThreshold:!1,threshold:0},{singleStacks:!1,getStackPoints:function(){var a=[],h=[],g=this.xAxis,l=this.yAxis,m=l.stacks[this.stackKey],c={},e=this.points,p=this.index,x=l.series,A=x.length,b,f=E(l.options.reversedStacks,!0)?1:-1,q,w;if(this.options.stacking){for(q=0;q<e.length;q++)c[e[q].x]=e[q];for(w in m)null!==m[w].total&&h.push(w);h.sort(function(a,
b){return a-b});b=B(x,function(){return this.visible});C(h,function(d,e){var n=0,w,t;if(c[d]&&!c[d].isNull)a.push(c[d]),C([-1,1],function(a){var g=1===a?"rightNull":"leftNull",n=0,l=m[h[e+a]];if(l)for(q=p;0<=q&&q<A;)w=l.points[q],w||(q===p?c[d][g]=!0:b[q]&&(t=m[d].points[q])&&(n-=t[1]-t[0])),q+=f;c[d][1===a?"rightCliff":"leftCliff"]=n});else{for(q=p;0<=q&&q<A;){if(w=m[d].points[q]){n=w[1];break}q+=f}n=l.toPixels(n,!0);a.push({isNull:!0,plotX:g.toPixels(d,!0),plotY:n,yBottom:n})}})}return a},getGraphPath:function(a){var d=
H.prototype.getGraphPath,g=this.options,l=g.stacking,m=this.yAxis,c,e,p=[],x=[],A=this.index,b,f=m.stacks[this.stackKey],q=g.threshold,w=m.getThreshold(g.threshold),G,g=g.connectNulls||"percent"===l,n=function(c,d,e){var g=a[c];c=l&&f[g.x].points[A];var h=g[e+"Null"]||0;e=g[e+"Cliff"]||0;var n,t,g=!0;e||h?(n=(h?c[0]:c[1])+e,t=c[0]+e,g=!!h):!l&&a[d]&&a[d].isNull&&(n=t=q);void 0!==n&&(x.push({plotX:b,plotY:null===n?w:m.getThreshold(n),isNull:g}),p.push({plotX:b,plotY:null===t?w:m.getThreshold(t),doCurve:!1}))};
a=a||this.points;l&&(a=this.getStackPoints());for(c=0;c<a.length;c++)if(e=a[c].isNull,b=E(a[c].rectPlotX,a[c].plotX),G=E(a[c].yBottom,w),!e||g)g||n(c,c-1,"left"),e&&!l&&g||(x.push(a[c]),p.push({x:c,plotX:b,plotY:G})),g||n(c,c+1,"right");c=d.call(this,x,!0,!0);p.reversed=!0;e=d.call(this,p,!0,!0);e.length&&(e[0]="L");e=c.concat(e);d=d.call(this,x,!1,g);e.xMap=c.xMap;this.areaPath=e;return d},drawGraph:function(){this.areaPath=[];H.prototype.drawGraph.apply(this);var a=this,h=this.areaPath,g=this.options,
l=[["area","highcharts-area"]];C(this.zones,function(a,c){l.push(["zone-area-"+c,"highcharts-area highcharts-zone-area-"+c+" "+a.className])});C(l,function(d){var c=d[0],e=a[c];e?(e.endX=h.xMap,e.animate({d:h})):(e=a[c]=a.chart.renderer.path(h).addClass(d[1]).attr({zIndex:0}).add(a.group),e.isArea=!0);e.startX=h.xMap;e.shiftUnit=g.step?2:1})},drawLegendSymbol:a.LegendSymbolMixin.drawRectangle})})(L);(function(a){var C=a.extendClass,B=a.merge,E=a.pick,H=a.Series,l=a.seriesTypes;a.defaultPlotOptions.spline=
B(a.defaultPlotOptions.line);l.spline=C(H,{type:"spline",getPointSpline:function(a,h,g){var d=h.plotX,l=h.plotY,c=a[g-1];g=a[g+1];var e,p,x,A;if(c&&!c.isNull&&!1!==c.doCurve&&g&&!g.isNull&&!1!==g.doCurve){a=c.plotY;x=g.plotX;g=g.plotY;var b=0;e=(1.5*d+c.plotX)/2.5;p=(1.5*l+a)/2.5;x=(1.5*d+x)/2.5;A=(1.5*l+g)/2.5;x!==e&&(b=(A-p)*(x-d)/(x-e)+l-A);p+=b;A+=b;p>a&&p>l?(p=Math.max(a,l),A=2*l-p):p<a&&p<l&&(p=Math.min(a,l),A=2*l-p);A>g&&A>l?(A=Math.max(g,l),p=2*l-A):A<g&&A<l&&(A=Math.min(g,l),p=2*l-A);h.rightContX=
x;h.rightContY=A}h=["C",E(c.rightContX,c.plotX),E(c.rightContY,c.plotY),E(e,d),E(p,l),d,l];c.rightContX=c.rightContY=null;return h}})})(L);(function(a){var C=a.seriesTypes.area.prototype,B=a.seriesType;B("areaspline","spline",a.defaultPlotOptions.area,{getStackPoints:C.getStackPoints,getGraphPath:C.getGraphPath,setStackCliffs:C.setStackCliffs,drawGraph:C.drawGraph,drawLegendSymbol:a.LegendSymbolMixin.drawRectangle})})(L);(function(a){var C=a.animObject,B=a.each,E=a.extend,H=a.isNumber,l=a.merge,d=
a.pick,h=a.Series,g=a.seriesType,t=a.stop,m=a.svg;g("column","line",{borderRadius:0,groupPadding:.2,marker:null,pointPadding:.1,minPointLength:0,cropThreshold:50,pointRange:null,states:{hover:{halo:!1}},dataLabels:{align:null,verticalAlign:null,y:null},softThreshold:!1,startFromThreshold:!0,stickyTracking:!1,tooltip:{distance:6},threshold:0},{cropShoulder:0,directTouch:!0,trackerGroups:["group","dataLabelsGroup"],negStacks:!0,init:function(){h.prototype.init.apply(this,arguments);var a=this,d=a.chart;
d.hasRendered&&B(d.series,function(c){c.type===a.type&&(c.isDirty=!0)})},getColumnMetrics:function(){var a=this,e=a.options,g=a.xAxis,h=a.yAxis,l=g.reversed,b,f={},m=0;!1===e.grouping?m=1:B(a.chart.series,function(c){var d=c.options,e=c.yAxis,g;c.type===a.type&&c.visible&&h.len===e.len&&h.pos===e.pos&&(d.stacking?(b=c.stackKey,void 0===f[b]&&(f[b]=m++),g=f[b]):!1!==d.grouping&&(g=m++),c.columnIndex=g)});var w=Math.min(Math.abs(g.transA)*(g.ordinalSlope||e.pointRange||g.closestPointRange||g.tickInterval||
1),g.len),t=w*e.groupPadding,n=(w-2*t)/m,e=Math.min(e.maxPointWidth||g.len,d(e.pointWidth,n*(1-2*e.pointPadding)));a.columnMetrics={width:e,offset:(n-e)/2+(t+((a.columnIndex||0)+(l?1:0))*n-w/2)*(l?-1:1)};return a.columnMetrics},crispCol:function(a,d,g,h){var c=this.chart,b=this.borderWidth,e=-(b%2?.5:0),b=b%2?.5:1;c.inverted&&c.renderer.isVML&&(b+=1);g=Math.round(a+g)+e;a=Math.round(a)+e;h=Math.round(d+h)+b;e=.5>=Math.abs(d)&&.5<h;d=Math.round(d)+b;h-=d;e&&h&&(--d,h+=1);return{x:a,y:d,width:g-a,height:h}},
translate:function(){var a=this,e=a.chart,g=a.options,l=a.dense=2>a.closestPointRange*a.xAxis.transA,l=a.borderWidth=d(g.borderWidth,l?0:1),m=a.yAxis,b=a.translatedThreshold=m.getThreshold(g.threshold),f=d(g.minPointLength,5),q=a.getColumnMetrics(),w=q.width,t=a.barW=Math.max(w,1+2*l),n=a.pointXOffset=q.offset;e.inverted&&(b-=.5);g.pointPadding&&(t=Math.ceil(t));h.prototype.translate.apply(a);B(a.points,function(c){var g=d(c.yBottom,b),h=999+Math.abs(g),h=Math.min(Math.max(-h,c.plotY),m.len+h),l=
c.plotX+n,p=t,q=Math.min(h,g),x,D=Math.max(h,g)-q;Math.abs(D)<f&&f&&(D=f,x=!m.reversed&&!c.negative||m.reversed&&c.negative,q=Math.abs(q-b)>f?g-f:b-(x?f:0));c.barX=l;c.pointWidth=w;c.tooltipPos=e.inverted?[m.len+m.pos-e.plotLeft-h,a.xAxis.len-l-p/2,D]:[l+p/2,h+m.pos-e.plotTop,D];c.shapeType="rect";c.shapeArgs=a.crispCol.apply(a,c.isNull?[c.plotX,m.len/2,0,0]:[l,q,p,D])})},getSymbol:a.noop,drawLegendSymbol:a.LegendSymbolMixin.drawRectangle,drawGraph:function(){this.group[this.dense?"addClass":"removeClass"]("highcharts-dense-data")},
drawPoints:function(){var a=this,d=this.chart,g=d.renderer,h=a.options.animationLimit||250,m;B(a.points,function(b){var c=b.graphic;H(b.plotY)&&null!==b.y?(m=b.shapeArgs,c?(t(c),c[d.pointCount<h?"animate":"attr"](l(m))):b.graphic=g[b.shapeType](m).attr({"class":b.getClassName()}).add(b.group||a.group)):c&&(b.graphic=c.destroy())})},animate:function(a){var c=this,d=this.yAxis,g=c.options,h=this.chart.inverted,b={};m&&(a?(b.scaleY=.001,a=Math.min(d.pos+d.len,Math.max(d.pos,d.toPixels(g.threshold))),
h?b.translateX=a-d.len:b.translateY=a,c.group.attr(b)):(b[h?"translateX":"translateY"]=d.pos,c.group.animate(b,E(C(c.options.animation),{step:function(a,b){c.group.attr({scaleY:Math.max(.001,b.pos)})}})),c.animate=null))},remove:function(){var a=this,d=a.chart;d.hasRendered&&B(d.series,function(c){c.type===a.type&&(c.isDirty=!0)});h.prototype.remove.apply(a,arguments)}})})(L);(function(a){a=a.seriesType;a("bar","column",null,{inverted:!0})})(L);(function(a){var C=a.Series;a=a.seriesType;a("scatter",
"line",{lineWidth:0,marker:{enabled:!0},tooltip:{headerFormat:'\x3cspan style\x3d"color:{point.color}"\x3e\u25cf\x3c/span\x3e \x3cspan style\x3d"font-size: 0.85em"\x3e {series.name}\x3c/span\x3e\x3cbr/\x3e',pointFormat:"x: \x3cb\x3e{point.x}\x3c/b\x3e\x3cbr/\x3ey: \x3cb\x3e{point.y}\x3c/b\x3e\x3cbr/\x3e"}},{sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group","markerGroup","dataLabelsGroup"],takeOrdinalPosition:!1,kdDimensions:2,drawGraph:function(){this.options.lineWidth&&C.prototype.drawGraph.call(this)}})})(L);
(function(a){var C=a.pick,B=a.relativeLength;a.CenteredSeriesMixin={getCenter:function(){var a=this.options,H=this.chart,l=2*(a.slicedOffset||0),d=H.plotWidth-2*l,H=H.plotHeight-2*l,h=a.center,h=[C(h[0],"50%"),C(h[1],"50%"),a.size||"100%",a.innerSize||0],g=Math.min(d,H),t,m;for(t=0;4>t;++t)m=h[t],a=2>t||2===t&&/%$/.test(m),h[t]=B(m,[d,H,g,h[2]][t])+(a?l:0);h[3]>h[2]&&(h[3]=h[2]);return h}}})(L);(function(a){var C=a.addEvent,B=a.defined,E=a.each,H=a.extend,l=a.inArray,d=a.noop,h=a.pick,g=a.Point,t=
a.Series,m=a.seriesType,c=a.setAnimation;m("pie","line",{center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{distance:30,enabled:!0,formatter:function(){return null===this.y?void 0:this.point.name},x:0},ignoreHiddenPoint:!0,legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,stickyTracking:!1,tooltip:{followPointer:!0}},{isCartesian:!1,requireSorting:!1,directTouch:!0,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],axisTypes:[],pointAttribs:a.seriesTypes.column.prototype.pointAttribs,
animate:function(a){var c=this,d=c.points,e=c.startAngleRad;a||(E(d,function(a){var b=a.graphic,d=a.shapeArgs;b&&(b.attr({r:a.startR||c.center[3]/2,start:e,end:e}),b.animate({r:d.r,start:d.start,end:d.end},c.options.animation))}),c.animate=null)},updateTotals:function(){var a,c=0,d=this.points,g=d.length,b,f=this.options.ignoreHiddenPoint;for(a=0;a<g;a++)b=d[a],0>b.y&&(b.y=null),c+=f&&!b.visible?0:b.y;this.total=c;for(a=0;a<g;a++)b=d[a],b.percentage=0<c&&(b.visible||!f)?b.y/c*100:0,b.total=c},generatePoints:function(){t.prototype.generatePoints.call(this);
this.updateTotals()},translate:function(a){this.generatePoints();var c=0,d=this.options,e=d.slicedOffset,b=e+(d.borderWidth||0),f,g,l,m=d.startAngle||0,n=this.startAngleRad=Math.PI/180*(m-90),m=(this.endAngleRad=Math.PI/180*(h(d.endAngle,m+360)-90))-n,t=this.points,K=d.dataLabels.distance,d=d.ignoreHiddenPoint,y,I=t.length,r;a||(this.center=a=this.getCenter());this.getX=function(b,c){l=Math.asin(Math.min((b-a[1])/(a[2]/2+K),1));return a[0]+(c?-1:1)*Math.cos(l)*(a[2]/2+K)};for(y=0;y<I;y++){r=t[y];
f=n+c*m;if(!d||r.visible)c+=r.percentage/100;g=n+c*m;r.shapeType="arc";r.shapeArgs={x:a[0],y:a[1],r:a[2]/2,innerR:a[3]/2,start:Math.round(1E3*f)/1E3,end:Math.round(1E3*g)/1E3};l=(g+f)/2;l>1.5*Math.PI?l-=2*Math.PI:l<-Math.PI/2&&(l+=2*Math.PI);r.slicedTranslation={translateX:Math.round(Math.cos(l)*e),translateY:Math.round(Math.sin(l)*e)};f=Math.cos(l)*a[2]/2;g=Math.sin(l)*a[2]/2;r.tooltipPos=[a[0]+.7*f,a[1]+.7*g];r.half=l<-Math.PI/2||l>Math.PI/2?1:0;r.angle=l;b=Math.min(b,K/5);r.labelPos=[a[0]+f+Math.cos(l)*
K,a[1]+g+Math.sin(l)*K,a[0]+f+Math.cos(l)*b,a[1]+g+Math.sin(l)*b,a[0]+f,a[1]+g,0>K?"center":r.half?"right":"left",l]}},drawGraph:null,drawPoints:function(){var a=this,c=a.chart.renderer,d,g,b;E(a.points,function(e){null!==e.y&&(g=e.graphic,b=e.shapeArgs,d=e.sliced?e.slicedTranslation:{},g?g.setRadialReference(a.center).animate(H(b,d)):(e.graphic=g=c[e.shapeType](b).addClass(e.getClassName()).setRadialReference(a.center).attr(d).add(a.group),e.visible||g.attr({visibility:"hidden"})))})},searchPoint:d,
sortByAngle:function(a,c){a.sort(function(a,d){return void 0!==a.angle&&(d.angle-a.angle)*c})},drawLegendSymbol:a.LegendSymbolMixin.drawRectangle,getCenter:a.CenteredSeriesMixin.getCenter,getSymbol:d},{init:function(){g.prototype.init.apply(this,arguments);var a=this,c;a.name=h(a.name,"Slice");c=function(c){a.slice("select"===c.type)};C(a,"select",c);C(a,"unselect",c);return a},setVisible:function(a,c){var d=this,e=d.series,b=e.chart,f=e.options.ignoreHiddenPoint;c=h(c,f);a!==d.visible&&(d.visible=
d.options.visible=a=void 0===a?!d.visible:a,e.options.data[l(d,e.data)]=d.options,E(["graphic","dataLabel","connector","shadowGroup"],function(b){if(d[b])d[b][a?"show":"hide"](!0)}),d.legendItem&&b.legend.colorizeItem(d,a),a||"hover"!==d.state||d.setState(""),f&&(e.isDirty=!0),c&&b.redraw())},slice:function(a,d,g){var e=this.series;c(g,e.chart);h(d,!0);this.sliced=this.options.sliced=a=B(a)?a:!this.sliced;e.options.data[l(this,e.data)]=this.options;this.graphic.animate(a?this.slicedTranslation:{translateX:0,
translateY:0})},haloPath:function(a){var c=this.shapeArgs;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(c.x,c.y,c.r+a,c.r+a,{innerR:this.shapeArgs.r,start:c.start,end:c.end})}})})(L);(function(a){var C=a.addEvent,B=a.arrayMax,E=a.defined,H=a.each,l=a.extend,d=a.format,h=a.map,g=a.merge,t=a.noop,m=a.pick,c=a.relativeLength,e=a.Series,p=a.seriesTypes,x=a.stableSort,A=a.stop;a.distribute=function(a,c){function b(a,b){return a.target-b.target}var d,e=!0,f=a,g=[],l;l=0;for(d=
a.length;d--;)l+=a[d].size;if(l>c){x(a,function(a,b){return(b.rank||0)-(a.rank||0)});for(l=d=0;l<=c;)l+=a[d].size,d++;g=a.splice(d-1,a.length)}x(a,b);for(a=h(a,function(a){return{size:a.size,targets:[a.target]}});e;){for(d=a.length;d--;)e=a[d],l=(Math.min.apply(0,e.targets)+Math.max.apply(0,e.targets))/2,e.pos=Math.min(Math.max(0,l-e.size/2),c-e.size);d=a.length;for(e=!1;d--;)0<d&&a[d-1].pos+a[d-1].size>a[d].pos&&(a[d-1].size+=a[d].size,a[d-1].targets=a[d-1].targets.concat(a[d].targets),a[d-1].pos+
a[d-1].size>c&&(a[d-1].pos=c-a[d-1].size),a.splice(d,1),e=!0)}d=0;H(a,function(a){var b=0;H(a.targets,function(){f[d].pos=a.pos+b;b+=f[d].size;d++})});f.push.apply(f,g);x(f,b)};e.prototype.drawDataLabels=function(){var a=this,c=a.options,e=c.dataLabels,h=a.points,l,n,p=a.hasRendered||0,t,y,x=m(e.defer,!0),r=a.chart.renderer;if(e.enabled||a._hasPointLabels)a.dlProcessOptions&&a.dlProcessOptions(e),y=a.plotGroup("dataLabelsGroup","data-labels",x&&!p?"hidden":"visible",e.zIndex||6),x&&(y.attr({opacity:+p}),
p||C(a,"afterAnimate",function(){a.visible&&y.show(!0);y[c.animation?"animate":"attr"]({opacity:1},{duration:200})})),n=e,H(h,function(b){var c,f=b.dataLabel,h,p,q=b.connector,w=!0;l=b.dlOptions||b.options&&b.options.dataLabels;c=m(l&&l.enabled,n.enabled)&&null!==b.y;if(f&&!c)b.dataLabel=f.destroy();else if(c){e=g(n,l);c=e.rotation;h=b.getLabelConfig();t=e.format?d(e.format,h):e.formatter.call(h,e);if(f)E(t)?(f.attr({text:t}),w=!1):(b.dataLabel=f=f.destroy(),q&&(b.connector=q.destroy()));else if(E(t)){f=
{r:e.borderRadius||0,rotation:c,padding:e.padding,zIndex:1};for(p in f)void 0===f[p]&&delete f[p];f=b.dataLabel=r[c?"text":"label"](t,0,-9999,e.shape,null,null,e.useHTML,null,"data-label").attr(f);f.addClass("highcharts-data-label-color-"+b.colorIndex+" "+(e.className||""));f.add(y)}f&&a.alignDataLabel(b,f,e,null,w)}})};e.prototype.alignDataLabel=function(a,c,d,e,g){var b=this.chart,f=b.inverted,h=m(a.plotX,-9999),p=m(a.plotY,-9999),q=c.getBBox(),r,t=d.rotation,w=d.align,x=this.visible&&(a.series.forceDL||
b.isInsidePlot(h,Math.round(p),f)||e&&b.isInsidePlot(h,f?e.x+1:e.y+e.height-1,f)),k="justify"===m(d.overflow,"justify");x&&(r=b.renderer.fontMetrics(void 0,c).b,e=l({x:f?b.plotWidth-p:h,y:Math.round(f?b.plotHeight-h:p),width:0,height:0},e),l(d,{width:q.width,height:q.height}),t?(k=!1,f=b.renderer.rotCorr(r,t),f={x:e.x+d.x+e.width/2+f.x,y:e.y+d.y+{top:0,middle:.5,bottom:1}[d.verticalAlign]*e.height},c[g?"attr":"animate"](f).attr({align:w}),h=(t+720)%360,h=180<h&&360>h,"left"===w?f.y-=h?q.height:0:
"center"===w?(f.x-=q.width/2,f.y-=q.height/2):"right"===w&&(f.x-=q.width,f.y-=h?0:q.height)):(c.align(d,null,e),f=c.alignAttr),k?this.justifyDataLabel(c,d,f,q,e,g):m(d.crop,!0)&&(x=b.isInsidePlot(f.x,f.y)&&b.isInsidePlot(f.x+q.width,f.y+q.height)),d.shape&&!t&&c.attr({anchorX:a.plotX,anchorY:a.plotY}));x||(A(c),c.attr({y:-9999}),c.placed=!1)};e.prototype.justifyDataLabel=function(a,c,d,e,g,h){var b=this.chart,f=c.align,n=c.verticalAlign,l,m,p=a.box?0:a.padding||0;l=d.x+p;0>l&&("right"===f?c.align=
"left":c.x=-l,m=!0);l=d.x+e.width-p;l>b.plotWidth&&("left"===f?c.align="right":c.x=b.plotWidth-l,m=!0);l=d.y+p;0>l&&("bottom"===n?c.verticalAlign="top":c.y=-l,m=!0);l=d.y+e.height-p;l>b.plotHeight&&("top"===n?c.verticalAlign="bottom":c.y=b.plotHeight-l,m=!0);m&&(a.placed=!h,a.align(c,null,g))};p.pie&&(p.pie.prototype.drawDataLabels=function(){var b=this,c=b.data,d,g=b.chart,l=b.options.dataLabels,n=m(l.connectorPadding,10),p=m(l.connectorWidth,1),t=g.plotWidth,y=g.plotHeight,x,r=l.distance,z=b.center,
A=z[2]/2,C=z[1],k=0<r,v,E,L,P,M=[[],[]],u,J,O,T,S=[0,0,0,0];b.visible&&(l.enabled||b._hasPointLabels)&&(e.prototype.drawDataLabels.apply(b),H(c,function(a){a.dataLabel&&a.visible&&(M[a.half].push(a),a.dataLabel._pos=null)}),H(M,function(c,e){var f,k,m=c.length,p,q,w;if(m)for(b.sortByAngle(c,e-.5),0<r&&(f=Math.max(0,C-A-r),k=Math.min(C+A+r,g.plotHeight),p=h(c,function(a){if(a.dataLabel)return w=a.dataLabel.getBBox().height||21,{target:a.labelPos[1]-f+w/2,size:w,rank:a.y}}),a.distribute(p,k+w-f)),T=
0;T<m;T++)d=c[T],L=d.labelPos,v=d.dataLabel,O=!1===d.visible?"hidden":"inherit",q=L[1],p?void 0===p[T].pos?O="hidden":(P=p[T].size,J=f+p[T].pos):J=q,u=l.justify?z[0]+(e?-1:1)*(A+r):b.getX(J<f+2||J>k-2?q:J,e),v._attr={visibility:O,align:L[6]},v._pos={x:u+l.x+({left:n,right:-n}[L[6]]||0),y:J+l.y-10},L.x=u,L.y=J,null===b.options.size&&(E=v.width,u-E<n?S[3]=Math.max(Math.round(E-u+n),S[3]):u+E>t-n&&(S[1]=Math.max(Math.round(u+E-t+n),S[1])),0>J-P/2?S[0]=Math.max(Math.round(-J+P/2),S[0]):J+P/2>y&&(S[2]=
Math.max(Math.round(J+P/2-y),S[2])))}),0===B(S)||this.verifyDataLabelOverflow(S))&&(this.placeDataLabels(),k&&p&&H(this.points,function(a){var c;x=a.connector;if((v=a.dataLabel)&&v._pos&&a.visible){O=v._attr.visibility;if(c=!x)a.connector=x=g.renderer.path().addClass("highcharts-data-label-connector highcharts-color-"+a.colorIndex).add(b.dataLabelsGroup);x[c?"attr":"animate"]({d:b.connectorPath(a.labelPos)});x.attr("visibility",O)}else x&&(a.connector=x.destroy())}))},p.pie.prototype.connectorPath=
function(a){var b=a.x,c=a.y;return m(this.options.softConnector,!0)?["M",b+("left"===a[6]?5:-5),c,"C",b,c,2*a[2]-a[4],2*a[3]-a[5],a[2],a[3],"L",a[4],a[5]]:["M",b+("left"===a[6]?5:-5),c,"L",a[2],a[3],"L",a[4],a[5]]},p.pie.prototype.placeDataLabels=function(){H(this.points,function(a){var b=a.dataLabel;b&&a.visible&&((a=b._pos)?(b.attr(b._attr),b[b.moved?"animate":"attr"](a),b.moved=!0):b&&b.attr({y:-9999}))})},p.pie.prototype.alignDataLabel=t,p.pie.prototype.verifyDataLabelOverflow=function(a){var b=
this.center,d=this.options,e=d.center,g=d.minSize||80,h,l;null!==e[0]?h=Math.max(b[2]-Math.max(a[1],a[3]),g):(h=Math.max(b[2]-a[1]-a[3],g),b[0]+=(a[3]-a[1])/2);null!==e[1]?h=Math.max(Math.min(h,b[2]-Math.max(a[0],a[2])),g):(h=Math.max(Math.min(h,b[2]-a[0]-a[2]),g),b[1]+=(a[0]-a[2])/2);h<b[2]?(b[2]=h,b[3]=Math.min(c(d.innerSize||0,h),h),this.translate(b),this.drawDataLabels&&this.drawDataLabels()):l=!0;return l});p.column&&(p.column.prototype.alignDataLabel=function(a,c,d,h,l){var b=this.chart.inverted,
f=a.series,p=a.dlBox||a.shapeArgs,t=m(a.below,a.plotY>m(this.translatedThreshold,f.yAxis.len)),q=m(d.inside,!!this.options.stacking);p&&(h=g(p),0>h.y&&(h.height+=h.y,h.y=0),p=h.y+h.height-f.yAxis.len,0<p&&(h.height-=p),b&&(h={x:f.yAxis.len-h.y-h.height,y:f.xAxis.len-h.x-h.width,width:h.height,height:h.width}),q||(b?(h.x+=t?0:h.width,h.width=0):(h.y+=t?h.height:0,h.height=0)));d.align=m(d.align,!b||q?"center":t?"right":"left");d.verticalAlign=m(d.verticalAlign,b||q?"middle":t?"top":"bottom");e.prototype.alignDataLabel.call(this,
a,c,d,h,l)})})(L);(function(a){var C=a.Chart,B=a.each,E=a.pick,H=a.addEvent;C.prototype.callbacks.push(function(a){function d(){var d=[];B(a.series,function(a){var g=a.options.dataLabels,h=a.dataLabelCollections||["dataLabel"];(g.enabled||a._hasPointLabels)&&!g.allowOverlap&&a.visible&&B(h,function(c){B(a.points,function(a){a[c]&&(a[c].labelrank=E(a.labelrank,a.shapeArgs&&a.shapeArgs.height),d.push(a[c]))})})});a.hideOverlappingLabels(d)}d();H(a,"redraw",d)});C.prototype.hideOverlappingLabels=function(a){var d=
a.length,h,g,l,m,c,e,p,x,A,b=function(a,b,c,d,e,g,h,l){return!(e>a+c||e+h<a||g>b+d||g+l<b)};for(g=0;g<d;g++)if(h=a[g])h.oldOpacity=h.opacity,h.newOpacity=1;a.sort(function(a,b){return(b.labelrank||0)-(a.labelrank||0)});for(g=0;g<d;g++)for(l=a[g],h=g+1;h<d;++h)if(m=a[h],l&&m&&l.placed&&m.placed&&0!==l.newOpacity&&0!==m.newOpacity&&(c=l.alignAttr,e=m.alignAttr,p=l.parentGroup,x=m.parentGroup,A=2*(l.box?0:l.padding),c=b(c.x+p.translateX,c.y+p.translateY,l.width-A,l.height-A,e.x+x.translateX,e.y+x.translateY,
m.width-A,m.height-A)))(l.labelrank<m.labelrank?l:m).newOpacity=0;B(a,function(a){var b,c;a&&(c=a.newOpacity,a.oldOpacity!==c&&a.placed&&(c?a.show(!0):b=function(){a.hide()},a.alignAttr.opacity=c,a[a.isOld?"animate":"attr"](a.alignAttr,null,b)),a.isOld=!0)})}})(L);(function(a){var C=a.addEvent,B=a.Chart,E=a.createElement,H=a.css,l=a.defaultOptions,d=a.defaultPlotOptions,h=a.each,g=a.extend,t=a.fireEvent,m=a.hasTouch,c=a.inArray,e=a.isObject,p=a.Legend,x=a.merge,A=a.pick,b=a.Point,f=a.Series,q=a.seriesTypes,
w=a.svg,G;G=a.TrackerMixin={drawTrackerPoint:function(){var a=this,b=a.chart,c=b.pointer,d=function(a){for(var c=a.target,d;c&&!d;)d=c.point,c=c.parentNode;if(void 0!==d&&d!==b.hoverPoint)d.onMouseOver(a)};h(a.points,function(a){a.graphic&&(a.graphic.element.point=a);a.dataLabel&&(a.dataLabel.element.point=a)});a._hasTracking||(h(a.trackerGroups,function(b){if(a[b]&&(a[b].addClass("highcharts-tracker").on("mouseover",d).on("mouseout",function(a){c.onTrackerMouseOut(a)}),m))a[b].on("touchstart",d)}),
a._hasTracking=!0)},drawTrackerGraph:function(){var a=this,b=a.options.trackByArea,c=[].concat(b?a.areaPath:a.graphPath),d=c.length,e=a.chart,f=e.pointer,g=e.renderer,l=e.options.tooltip.snap,p=a.tracker,k,q=function(){if(e.hoverSeries!==a)a.onMouseOver()},t="rgba(192,192,192,"+(w?.0001:.002)+")";if(d&&!b)for(k=d+1;k--;)"M"===c[k]&&c.splice(k+1,0,c[k+1]-l,c[k+2],"L"),(k&&"M"===c[k]||k===d)&&c.splice(k,0,"L",c[k-2]+l,c[k-1]);p?p.attr({d:c}):a.graph&&(a.tracker=g.path(c).attr({"stroke-linejoin":"round",
visibility:a.visible?"visible":"hidden",stroke:t,fill:b?t:"none","stroke-width":a.graph.strokeWidth()+(b?0:2*l),zIndex:2}).add(a.group),h([a.tracker,a.markerGroup],function(a){a.addClass("highcharts-tracker").on("mouseover",q).on("mouseout",function(a){f.onTrackerMouseOut(a)});if(m)a.on("touchstart",q)}))}};q.column&&(q.column.prototype.drawTracker=G.drawTrackerPoint);q.pie&&(q.pie.prototype.drawTracker=G.drawTrackerPoint);q.scatter&&(q.scatter.prototype.drawTracker=G.drawTrackerPoint);g(p.prototype,
{setItemEvents:function(a,b,c){var d=this.chart,e="highcharts-legend-"+(a.series?"point":"series")+"-active";(c?b:a.legendGroup).on("mouseover",function(){a.setState("hover");d.seriesGroup.addClass(e)}).on("mouseout",function(){d.seriesGroup.removeClass(e);a.setState()}).on("click",function(b){var c=function(){a.setVisible&&a.setVisible()};b={browserEvent:b};a.firePointEvent?a.firePointEvent("legendItemClick",b,c):t(a,"legendItemClick",b,c)})},createCheckboxForItem:function(a){a.checkbox=E("input",
{type:"checkbox",checked:a.selected,defaultChecked:a.selected},this.options.itemCheckboxStyle,this.chart.container);C(a.checkbox,"click",function(b){t(a.series||a,"checkboxClick",{checked:b.target.checked,item:a},function(){a.select()})})}});g(B.prototype,{showResetZoom:function(){var a=this,b=l.lang,c=a.options.chart.resetZoomButton,d=c.theme,e=d.states,f="chart"===c.relativeTo?null:"plotBox";this.resetZoomButton=a.renderer.button(b.resetZoom,null,null,function(){a.zoomOut()},d,e&&e.hover).attr({align:c.position.align,
title:b.resetZoomTitle}).addClass("highcharts-reset-zoom").add().align(c.position,!1,f)},zoomOut:function(){var a=this;t(a,"selection",{resetSelection:!0},function(){a.zoom()})},zoom:function(a){var b,c=this.pointer,d=!1,f;!a||a.resetSelection?h(this.axes,function(a){b=a.zoom()}):h(a.xAxis.concat(a.yAxis),function(a){var e=a.axis,f=e.isXAxis;if(c[f?"zoomX":"zoomY"]||c[f?"pinchX":"pinchY"])b=e.zoom(a.min,a.max),e.displayBtn&&(d=!0)});f=this.resetZoomButton;d&&!f?this.showResetZoom():!d&&e(f)&&(this.resetZoomButton=
f.destroy());b&&this.redraw(A(this.options.chart.animation,a&&a.animation,100>this.pointCount))},pan:function(a,b){var c=this,d=c.hoverPoints,e;d&&h(d,function(a){a.setState()});h("xy"===b?[1,0]:[1],function(b){b=c[b?"xAxis":"yAxis"][0];var d=b.horiz,f=a[d?"chartX":"chartY"],d=d?"mouseDownX":"mouseDownY",g=c[d],h=(b.pointRange||0)/2,l=b.getExtremes(),n=b.toValue(g-f,!0)+h,h=b.toValue(g+b.len-f,!0)-h,g=g>f;b.series.length&&(g||n>Math.min(l.dataMin,l.min))&&(!g||h<Math.max(l.dataMax,l.max))&&(b.setExtremes(n,
h,!1,!1,{trigger:"pan"}),e=!0);c[d]=f});e&&c.redraw(!1);H(c.container,{cursor:"move"})}});g(b.prototype,{select:function(a,b){var d=this,e=d.series,f=e.chart;a=A(a,!d.selected);d.firePointEvent(a?"select":"unselect",{accumulate:b},function(){d.selected=d.options.selected=a;e.options.data[c(d,e.data)]=d.options;d.setState(a&&"select");b||h(f.getSelectedPoints(),function(a){a.selected&&a!==d&&(a.selected=a.options.selected=!1,e.options.data[c(a,e.data)]=a.options,a.setState(""),a.firePointEvent("unselect"))})})},
onMouseOver:function(a,b){var c=this.series,d=c.chart,e=d.tooltip,f=d.hoverPoint;if(this.series){if(!b){if(f&&f!==this)f.onMouseOut();if(d.hoverSeries!==c)c.onMouseOver();d.hoverPoint=this}!e||e.shared&&!c.noSharedTooltip?e||this.setState("hover"):(this.setState("hover"),e.refresh(this,a));this.firePointEvent("mouseOver")}},onMouseOut:function(){var a=this.series.chart,b=a.hoverPoints;this.firePointEvent("mouseOut");b&&-1!==c(this,b)||(this.setState(),a.hoverPoint=null)},importEvents:function(){if(!this.hasImportedEvents){var a=
x(this.series.options.point,this.options).events,b;this.events=a;for(b in a)C(this,b,a[b]);this.hasImportedEvents=!0}},setState:function(b,c){var e=Math.floor(this.plotX),f=this.plotY,g=this.series,h=g.options.states[b]||{},l=d[g.type].marker&&g.options.marker,n=l&&!1===l.enabled,m=l&&l.states&&l.states[b]||{},k=!1===m.enabled,p=g.stateMarkerGraphic,q=this.marker||{},t=g.chart,x=g.halo,w;b=b||"";if(!(b===this.state&&!c||this.selected&&"select"!==b||!1===h.enabled||b&&(k||n&&!1===m.enabled)||b&&q.states&&
q.states[b]&&!1===q.states[b].enabled)){l&&g.markerAttribs&&(w=g.markerAttribs(this,b));if(this.graphic)this.state&&this.graphic.removeClass("highcharts-point-"+this.state),b&&this.graphic.addClass("highcharts-point-"+b),w&&this.graphic.animate(w,A(t.options.chart.animation,m.animation,l.animation)),p&&p.hide();else{if(b&&m)if(l=q.symbol||g.symbol,p&&p.currentSymbol!==l&&(p=p.destroy()),p)p[c?"animate":"attr"]({x:w.x,y:w.y});else l&&(g.stateMarkerGraphic=p=t.renderer.symbol(l,w.x,w.y,w.width,w.height).add(g.markerGroup),
p.currentSymbol=l);p&&(p[b&&t.isInsidePlot(e,f,t.inverted)?"show":"hide"](),p.element.point=this)}(e=h.halo)&&e.size?(x||(g.halo=x=t.renderer.path().add(g.markerGroup||g.group)),a.stop(x),x[c?"animate":"attr"]({d:this.haloPath(e.size)}),x.attr({"class":"highcharts-halo highcharts-color-"+A(this.colorIndex,g.colorIndex)})):x&&x.animate({d:this.haloPath(0)});this.state=b}},haloPath:function(a){return this.series.chart.renderer.symbols.circle(Math.floor(this.plotX)-a,this.plotY-a,2*a,2*a)}});g(f.prototype,
{onMouseOver:function(){var a=this.chart,b=a.hoverSeries;if(b&&b!==this)b.onMouseOut();this.options.events.mouseOver&&t(this,"mouseOver");this.setState("hover");a.hoverSeries=this},onMouseOut:function(){var a=this.options,b=this.chart,c=b.tooltip,d=b.hoverPoint;b.hoverSeries=null;if(d)d.onMouseOut();this&&a.events.mouseOut&&t(this,"mouseOut");!c||a.stickyTracking||c.shared&&!this.noSharedTooltip||c.hide();this.setState()},setState:function(a){var b=this;a=a||"";b.state!==a&&(h([b.group,b.markerGroup],
function(c){c&&(b.state&&c.removeClass("highcharts-series-"+b.state),a&&c.addClass("highcharts-series-"+a))}),b.state=a)},setVisible:function(a,b){var c=this,d=c.chart,e=c.legendItem,f,g=d.options.chart.ignoreHiddenSeries,l=c.visible;f=(c.visible=a=c.options.visible=c.userOptions.visible=void 0===a?!l:a)?"show":"hide";h(["group","dataLabelsGroup","markerGroup","tracker","tt"],function(a){if(c[a])c[a][f]()});if(d.hoverSeries===c||(d.hoverPoint&&d.hoverPoint.series)===c)c.onMouseOut();e&&d.legend.colorizeItem(c,
a);c.isDirty=!0;c.options.stacking&&h(d.series,function(a){a.options.stacking&&a.visible&&(a.isDirty=!0)});h(c.linkedSeries,function(b){b.setVisible(a,!1)});g&&(d.isDirtyBox=!0);!1!==b&&d.redraw();t(c,f)},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},select:function(a){this.selected=a=void 0===a?!this.selected:a;this.checkbox&&(this.checkbox.checked=a);t(this,a?"select":"unselect")},drawTracker:G.drawTrackerGraph})})(L);(function(a){var C=a.Chart,B=a.each,E=a.inArray,H=
a.isObject,l=a.pick,d=a.splat;C.prototype.setResponsive=function(a){var d=this.options.responsive;d&&d.rules&&B(d.rules,function(d){this.matchResponsiveRule(d,a)},this)};C.prototype.matchResponsiveRule=function(d,g){var h=this.respRules,m=d.condition,c;c=d.callback||function(){return this.chartWidth<=l(m.maxWidth,Number.MAX_VALUE)&&this.chartHeight<=l(m.maxHeight,Number.MAX_VALUE)&&this.chartWidth>=l(m.minWidth,0)&&this.chartHeight>=l(m.minHeight,0)};void 0===d._id&&(d._id=a.idCounter++);c=c.call(this);
!h[d._id]&&c?d.chartOptions&&(h[d._id]=this.currentOptions(d.chartOptions),this.update(d.chartOptions,g)):h[d._id]&&!c&&(this.update(h[d._id],g),delete h[d._id])};C.prototype.currentOptions=function(a){function g(a,c,e){var h,l;for(h in a)if(-1<E(h,["series","xAxis","yAxis"]))for(a[h]=d(a[h]),e[h]=[],l=0;l<a[h].length;l++)e[h][l]={},g(a[h][l],c[h][l],e[h][l]);else H(a[h])?(e[h]={},g(a[h],c[h]||{},e[h])):e[h]=c[h]||null}var h={};g(a,this.options,h);return h}})(L);return L});

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,46 @@
/*
Highcharts JS v5.0.2 (2016-10-26)
Accessibility module
(c) 2010-2016 Highsoft AS
Author: Oystein Moseng
License: www.highcharts.com/license
*/
(function(h){"object"===typeof module&&module.exports?module.exports=h:h(Highcharts)})(function(h){(function(e){function h(a){for(var b=a.childNodes.length;b--;)a.appendChild(a.childNodes[b])}function q(a){var b;a&&a.onclick&&(b=l.createEvent("Events"),b.initEvent("click",!0,!1),a.onclick(b))}var y=e.win,l=y.document,g=e.each,A=e.erase,v=e.addEvent,B=e.removeEvent,w=e.fireEvent,C=e.dateFormat,u=e.merge,r={"default":["series","data point","data points"],line:["line","data point","data points"],spline:["line",
"data point","data points"],area:["line","data point","data points"],areaspline:["line","data point","data points"],pie:["pie","slice","slices"],column:["column series","column","columns"],bar:["bar series","bar","bars"],scatter:["scatter series","data point","data points"],boxplot:["boxplot series","box","boxes"],arearange:["arearange series","data point","data points"],areasplinerange:["areasplinerange series","data point","data points"],bubble:["bubble series","bubble","bubbles"],columnrange:["columnrange series",
"column","columns"],errorbar:["errorbar series","errorbar","errorbars"],funnel:["funnel","data point","data points"],pyramid:["pyramid","data point","data points"],waterfall:["waterfall series","column","columns"],map:["map","area","areas"],mapline:["line","data point","data points"],mappoint:["point series","data point","data points"],mapbubble:["bubble series","bubble","bubbles"]},D={boxplot:" Box plot charts are typically used to display groups of statistical data. Each data point in the chart can have up to 5 values: minimum, lower quartile, median, upper quartile and maximum. ",
arearange:" Arearange charts are line charts displaying a range between a lower and higher value for each point. ",areasplinerange:" These charts are line charts displaying a range between a lower and higher value for each point. ",bubble:" Bubble charts are scatter charts where each data point also has a size value. ",columnrange:" Columnrange charts are column charts displaying a range between a lower and higher value for each point. ",errorbar:" Errorbar series are used to display the variability of the data. ",
funnel:" Funnel charts are used to display reduction of data in stages. ",pyramid:" Pyramid charts consist of a single pyramid with item heights corresponding to each point value. ",waterfall:" A waterfall chart is a column chart where each column contributes towards a total end value. "},E="name id category x value y".split(" "),z="z open high q3 median q1 low close".split(" ");e.setOptions({accessibility:{enabled:!0,pointDescriptionThreshold:30,keyboardNavigation:{enabled:!0}}});e.wrap(e.Series.prototype,
"render",function(a){a.apply(this,Array.prototype.slice.call(arguments,1));this.chart.options.accessibility.enabled&&this.setA11yDescription()});e.Series.prototype.setA11yDescription=function(){var a=this.chart.options.accessibility,b=this.points&&this.points.length&&this.points[0].graphic&&this.points[0].graphic.element,d=b&&b.parentNode||this.graph&&this.graph.element||this.group&&this.group.element;d&&(d.lastChild===b&&h(d),this.points&&(this.points.length<a.pointDescriptionThreshold||!1===a.pointDescriptionThreshold)&&
g(this.points,function(c){c.graphic&&(c.graphic.element.setAttribute("role","img"),c.graphic.element.setAttribute("tabindex","-1"),c.graphic.element.setAttribute("aria-label",a.pointDescriptionFormatter&&a.pointDescriptionFormatter(c)||c.buildPointInfoString()))}),1<this.chart.series.length||a.describeSingleSeries)&&(d.setAttribute("role","region"),d.setAttribute("tabindex","-1"),d.setAttribute("aria-label",a.seriesDescriptionFormatter&&a.seriesDescriptionFormatter(this)||this.buildSeriesInfoString()))};
e.Series.prototype.buildSeriesInfoString=function(){var a=r[this.type]||r.default,b=this.description||this.options.description;return(this.name?this.name+", ":"")+(1===this.chart.types.length?a[0]:"series")+" "+(this.index+1)+" of "+this.chart.series.length+(1===this.chart.types.length?" with ":". "+a[0]+" with ")+(this.points.length+" "+(1===this.points.length?a[1]:a[2]))+(b?". "+b:"")+(1<this.chart.yAxis.length&&this.yAxis?". Y axis, "+this.yAxis.getDescription():"")+(1<this.chart.xAxis.length&&
this.xAxis?". X axis, "+this.xAxis.getDescription():"")};e.Point.prototype.buildPointInfoString=function(){var a=this,b=a.series,d=b.chart.options.accessibility,c="",f=!1,x=b.xAxis&&b.xAxis.isDatetimeAxis,b=x&&C(d.pointDateFormatter&&d.pointDateFormatter(a)||d.pointDateFormat||e.Tooltip.prototype.getXDateFormat(a,b.chart.options.tooltip,b.xAxis),a.x);g(z,function(c){void 0!==a[c]&&(f=!0)});f?(x&&(c=b),g(E.concat(z),function(b){void 0===a[b]||x&&"x"===b||(c+=(c?". ":"")+b+", "+this[b])})):c=(this.name||
b||this.category||this.id||"x, "+this.x)+", "+(void 0!==this.value?this.value:this.y);return this.index+1+". "+c+"."+(this.description?" "+this.description:"")};e.Axis.prototype.getDescription=function(){return this.userOptions&&this.userOptions.description||this.axisTitle&&this.axisTitle.textStr||this.options.id||this.categories&&"categories"||"values"};e.Axis.prototype.panStep=function(a,b){var d=b||3;b=this.getExtremes();var c=(b.max-b.min)/d*a,d=b.max+c,c=b.min+c,f=d-c;0>a&&c<b.dataMin?(c=b.dataMin,
d=c+f):0<a&&d>b.dataMax&&(d=b.dataMax,c=d-f);this.setExtremes(c,d)};e.wrap(e.Series.prototype,"init",function(a){a.apply(this,Array.prototype.slice.call(arguments,1));var b=this.chart;b.options.accessibility.enabled&&(b.types=b.types||[],0>b.types.indexOf(this.type)&&b.types.push(this.type),v(this,"remove",function(){var a=this,c=!1;g(b.series,function(f){f!==a&&0>b.types.indexOf(a.type)&&(c=!0)});c||A(b.types,a.type)}))});e.Chart.prototype.getTypeDescription=function(){var a=this.types&&this.types[0],
b=this.series[0]&&this.series[0].mapTitle;if(a){if("map"===a)return b?"Map of "+b:"Map of unspecified region.";if(1<this.types.length)return"Combination chart.";if(-1<["spline","area","areaspline"].indexOf(a))return"Line chart."}else return"Empty chart.";return a+" chart."+(D[a]||"")};e.Chart.prototype.getAxesDescription=function(){var a=this.xAxis.length,b=this.yAxis.length,d={},c;if(a)if(d.xAxis="The chart has "+a+(1<a?" X axes":" X axis")+" displaying ",2>a)d.xAxis+=this.xAxis[0].getDescription()+
".";else{for(c=0;c<a-1;++c)d.xAxis+=(c?", ":"")+this.xAxis[c].getDescription();d.xAxis+=" and "+this.xAxis[c].getDescription()+"."}if(b)if(d.yAxis="The chart has "+b+(1<b?" Y axes":" Y axis")+" displaying ",2>b)d.yAxis+=this.yAxis[0].getDescription()+".";else{for(c=0;c<b-1;++c)d.yAxis+=(c?", ":"")+this.yAxis[c].getDescription();d.yAxis+=" and "+this.yAxis[c].getDescription()+"."}return d};e.Chart.prototype.addAccessibleContextMenuAttribs=function(){var a=this.exportDivElements;a&&(g(a,function(b){"DIV"!==
b.tagName||b.children&&b.children.length||(b.setAttribute("role","menuitem"),b.setAttribute("tabindex",-1))}),a[0].parentNode.setAttribute("role","menu"),a[0].parentNode.setAttribute("aria-label","Chart export"))};e.Point.prototype.highlight=function(){var a=this.series.chart;this.graphic&&this.graphic.element.focus&&this.graphic.element.focus();this.isNull?a.tooltip.hide(0):(this.onMouseOver(),a.tooltip.refresh(a.tooltip.shared?[this]:this));a.highlightedPoint=this;return this};e.Chart.prototype.highlightAdjacentPoint=
function(a){var b=this.series,d=this.highlightedPoint,c=d&&d.index||0;if(!b[0]||!b[0].points)return!1;if(!d)return b[0].points[0].highlight();if(d.series.points[c]!==d)for(var f=0;f<d.series.points.length;++f)if(d.series.points[f]===d){c=f;break}b=b[d.series.index+(a?1:-1)];d=d.series.points[c+(a?1:-1)]||b&&b.points[a?0:b.points.length-1];return void 0===d?!1:d.isNull&&this.options.accessibility.keyboardNavigation&&this.options.accessibility.keyboardNavigation.skipNullPoints?(this.highlightedPoint=
d,this.highlightAdjacentPoint(a)):d.highlight()};e.Chart.prototype.showExportMenu=function(){this.exportSVGElements&&this.exportSVGElements[0]&&(this.exportSVGElements[0].element.onclick(),this.highlightExportItem(0))};e.Chart.prototype.highlightExportItem=function(a){var b=this.exportDivElements&&this.exportDivElements[a],d=this.exportDivElements&&this.exportDivElements[this.highlightedExportItem];if(b&&"DIV"===b.tagName&&(!b.children||!b.children.length)){b.focus&&b.focus();if(d&&d.onmouseout)d.onmouseout();
if(b.onmouseover)b.onmouseover();this.highlightedExportItem=a;return!0}};e.Chart.prototype.highlightRangeSelectorButton=function(a){var b=this.rangeSelector.buttons;b[this.highlightedRangeSelectorItemIx]&&b[this.highlightedRangeSelectorItemIx].setState(this.oldRangeSelectorItemState||0);this.highlightedRangeSelectorItemIx=a;return b[a]?(b[a].element.focus&&b[a].element.focus(),this.oldRangeSelectorItemState=b[a].state,b[a].setState(2),!0):!1};e.Chart.prototype.highlightLegendItem=function(a){var b=
this.legend.allItems;b[this.highlightedLegendItemIx]&&w(b[this.highlightedLegendItemIx].legendGroup.element,"mouseout");this.highlightedLegendItemIx=a;return b[a]?(b[a].legendGroup.element.focus&&b[a].legendGroup.element.focus(),w(b[a].legendGroup.element,"mouseover"),!0):!1};e.Chart.prototype.hideExportMenu=function(){var a=this.exportDivElements;if(a){g(a,function(b){w(b,"mouseleave")});if(a[this.highlightedExportItem]&&a[this.highlightedExportItem].onmouseout)a[this.highlightedExportItem].onmouseout();
this.highlightedExportItem=0;this.renderTo.focus()}};e.Chart.prototype.addKeyboardNavEvents=function(){function a(c){this.keyCodeMap=c.keyCodeMap;this.move=c.move;this.validate=c.validate;this.init=c.init;this.transformTabs=!1!==c.transformTabs}function b(b,d){return new a(u({keyCodeMap:b,move:function(b){c.keyboardNavigationModuleIndex+=b;var a=c.keyboardNavigationModules[c.keyboardNavigationModuleIndex];if(a){if(a.validate&&!a.validate())return this.move(b);if(a.init)return a.init(b),!0}c.keyboardNavigationModuleIndex=
0;c.slipNextTab=!0;return!1}},d))}function d(b){b=b||y.event;var a=c.keyboardNavigationModules[c.keyboardNavigationModuleIndex];9===(b.which||b.keyCode)&&c.slipNextTab?c.slipNextTab=!1:(c.slipNextTab=!1,a&&a.run(b)&&b.preventDefault())}var c=this;a.prototype={run:function(c){var b=this,a=c.which||c.keyCode,f=!1,a=this.transformTabs&&9===a?c.shiftKey?37:39:a;g(this.keyCodeMap,function(d){-1<d[0].indexOf(a)&&(f=!1===d[1].call(b,a,c)?!1:!0)});return f}};c.keyboardNavigationModules=[b([[[37,39],function(b){if(!c.highlightAdjacentPoint(39===
b))return this.move(39===b?1:-1)}],[[38,40],function(b){var a;if(c.highlightedPoint)if((a=c.series[c.highlightedPoint.series.index+(38===b?-1:1)])&&a.points[0])a.points[0].highlight();else return this.move(40===b?1:-1)}],[[13,32],function(){c.highlightedPoint&&c.highlightedPoint.firePointEvent("click")}]],{init:function(b){var a=c.series&&c.series[c.series.length-1],a=a&&a.points&&a.points[a.points.length-1];0>b&&a&&a.highlight()}}),b([[[37,38],function(){for(var a=c.highlightedExportItem||0,b=!0,
d=c.series;a--;)if(c.highlightExportItem(a)){b=!1;break}if(b)return c.hideExportMenu(),d&&d.length&&(a=d[d.length-1],a.points.length&&a.points[a.points.length-1].highlight()),this.move(-1)}],[[39,40],function(){for(var a=!0,b=(c.highlightedExportItem||0)+1;b<c.exportDivElements.length;++b)if(c.highlightExportItem(b)){a=!1;break}if(a)return c.hideExportMenu(),this.move(1)}],[[13,32],function(){q(c.exportDivElements[c.highlightedExportItem])}]],{validate:function(){return c.exportChart&&!(c.options.exporting&&
!1===c.options.exporting.enabled)},init:function(a){c.highlightedPoint=null;c.showExportMenu();if(0>a&&c.exportDivElements)for(a=c.exportDivElements.length;-1<a&&!c.highlightExportItem(a);--a);}}),b([[[38,40,37,39],function(a){c[38===a||40===a?"yAxis":"xAxis"][0].panStep(39>a?-1:1)}],[[9],function(a,b){c.mapNavButtons[c.focusedMapNavButtonIx].setState(0);if(b.shiftKey&&!c.focusedMapNavButtonIx||!b.shiftKey&&c.focusedMapNavButtonIx)return c.mapZoom(),this.move(b.shiftKey?-1:1);c.focusedMapNavButtonIx+=
b.shiftKey?-1:1;a=c.mapNavButtons[c.focusedMapNavButtonIx];a.element.focus&&a.element.focus();a.setState(2)}],[[13,32],function(){q(c.mapNavButtons[c.focusedMapNavButtonIx].element)}]],{validate:function(){return c.mapZoom&&c.mapNavButtons&&2===c.mapNavButtons.length},transformTabs:!1,init:function(a){var b=c.mapNavButtons[0],d=c.mapNavButtons[1],b=0<a?b:d;g(c.mapNavButtons,function(a,c){a.element.setAttribute("tabindex",-1);a.element.setAttribute("role","button");a.element.setAttribute("aria-label",
"Zoom "+(c?"out":"")+"chart")});b.element.focus&&b.element.focus();b.setState(2);c.focusedMapNavButtonIx=0<a?0:1}}),b([[[37,39,38,40],function(a){a=37===a||38===a?-1:1;if(!c.highlightRangeSelectorButton(c.highlightedRangeSelectorItemIx+a))return this.move(a)}],[[13,32],function(){3!==c.oldRangeSelectorItemState&&q(c.rangeSelector.buttons[c.highlightedRangeSelectorItemIx].element)}]],{validate:function(){return c.rangeSelector&&c.rangeSelector.buttons&&c.rangeSelector.buttons.length},init:function(a){g(c.rangeSelector.buttons,
function(a){a.element.setAttribute("tabindex","-1");a.element.setAttribute("role","button");a.element.setAttribute("aria-label","Select range "+(a.text&&a.text.textStr))});c.highlightRangeSelectorButton(0<a?0:c.rangeSelector.buttons.length-1)}}),b([[[9,38,40],function(a,b){a=9===a&&b.shiftKey||38===a?-1:1;b=c.highlightedInputRangeIx+=a;if(1<b||0>b)return this.move(a);c.rangeSelector[b?"maxInput":"minInput"].focus()}]],{validate:function(){return c.rangeSelector&&c.rangeSelector.inputGroup&&"hidden"!==
c.rangeSelector.inputGroup.element.getAttribute("visibility")&&!1!==c.options.rangeSelector.inputEnabled&&c.rangeSelector.minInput&&c.rangeSelector.maxInput},transformTabs:!1,init:function(a){c.highlightedInputRangeIx=0<a?0:1;c.rangeSelector[c.highlightedInputRangeIx?"maxInput":"minInput"].focus()}}),b([[[37,39,38,40],function(a){a=37===a||38===a?-1:1;if(!c.highlightLegendItem(c.highlightedLegendItemIx+a))return this.move(a)}],[[13,32],function(){q(c.legend.allItems[c.highlightedLegendItemIx].legendItem.element.parentNode)}]],
{validate:function(){return c.legend&&c.legend.allItems&&!c.colorAxis},init:function(a){g(c.legend.allItems,function(a){a.legendGroup.element.setAttribute("tabindex","-1");a.legendGroup.element.setAttribute("role","button");a.legendGroup.element.setAttribute("aria-label","Toggle visibility of series "+a.name)});c.highlightLegendItem(0<a?0:c.legend.allItems.length-1)}})];c.keyboardNavigationModuleIndex=0;c.renderTo.tabIndex||c.renderTo.setAttribute("tabindex","0");v(c.renderTo,"keydown",d);v(c,"destroy",
function(){B(c.renderTo,"keydown",d)})};e.Chart.prototype.addScreenReaderRegion=function(a){var b=this,d=b.series,c=b.options,e=c.accessibility,g=b.screenReaderRegion=l.createElement("div"),h=l.createElement("h3"),n=l.createElement("a"),p=l.createElement("h3"),t={position:"absolute",left:"-9999px",top:"auto",width:"1px",height:"1px",overflow:"hidden"},k=b.types||[],k=(1===k.length&&"pie"===k[0]||"map"===k[0])&&{}||b.getAxesDescription(),m=d[0]&&r[d[0].type]||r.default;g.setAttribute("role","region");
g.setAttribute("aria-label","Chart screen reader information.");g.innerHTML=e.screenReaderSectionFormatter&&e.screenReaderSectionFormatter(b)||'\x3cdiv tabindex\x3d"0"\x3eUse regions/landmarks to skip ahead to chart'+(1<d.length?" and navigate between data series":"")+".\x3c/div\x3e\x3ch3\x3eSummary.\x3c/h3\x3e\x3cdiv\x3e"+(c.title.text||"Chart")+(c.subtitle&&c.subtitle.text?". "+c.subtitle.text:"")+"\x3c/div\x3e\x3ch3\x3eLong description.\x3c/h3\x3e\x3cdiv\x3e"+(c.chart.description||"No description available.")+
"\x3c/div\x3e\x3ch3\x3eStructure.\x3c/h3\x3e\x3cdiv\x3eChart type: "+(c.chart.typeDescription||b.getTypeDescription())+"\x3c/div\x3e"+(1===d.length?"\x3cdiv\x3e"+m[0]+" with "+d[0].points.length+" "+(1===d[0].points.length?m[1]:m[2])+".\x3c/div\x3e":"")+(k.xAxis?"\x3cdiv\x3e"+k.xAxis+"\x3c/div\x3e":"")+(k.yAxis?"\x3cdiv\x3e"+k.yAxis+"\x3c/div\x3e":"");b.getCSV&&(n.innerHTML="View as data table.",n.href="#"+a,n.setAttribute("tabindex","-1"),n.onclick=e.onTableAnchorClick||function(){b.viewData();l.getElementById(a).focus()},
h.appendChild(n),g.appendChild(h));p.innerHTML="Chart graphic.";b.renderTo.insertBefore(p,b.renderTo.firstChild);b.renderTo.insertBefore(g,b.renderTo.firstChild);u(!0,p.style,t);u(!0,g.style,t)};e.Chart.prototype.callbacks.push(function(a){var b=a.options,d=b.accessibility;if(d.enabled){var c=l.createElementNS("http://www.w3.org/2000/svg","title"),f=l.createElementNS("http://www.w3.org/2000/svg","g"),h=a.container.getElementsByTagName("desc")[0],q=a.container.getElementsByTagName("text"),n="highcharts-title-"+
a.index,p="highcharts-data-table-"+a.index,t=b.title.text||"Chart",k=b.exporting&&b.exporting.csv&&b.exporting.csv.columnHeaderFormatter,m=[];c.textContent=t;c.id=n;h.parentNode.insertBefore(c,h);a.renderTo.setAttribute("role","region");a.renderTo.setAttribute("aria-label",t+". Use up and down arrows to navigate.");if(a.exportSVGElements&&a.exportSVGElements[0]&&a.exportSVGElements[0].element){var r=a.exportSVGElements[0].element.onclick,c=a.exportSVGElements[0].element.parentNode;a.exportSVGElements[0].element.onclick=
function(){r.apply(this,Array.prototype.slice.call(arguments));a.addAccessibleContextMenuAttribs();a.highlightExportItem(0)};a.exportSVGElements[0].element.setAttribute("role","button");a.exportSVGElements[0].element.setAttribute("aria-label","View export menu");f.appendChild(a.exportSVGElements[0].element);f.setAttribute("role","region");f.setAttribute("aria-label","Chart export menu");c.appendChild(f)}a.rangeSelector&&g(["minInput","maxInput"],function(b,c){a.rangeSelector[b]&&(a.rangeSelector[b].setAttribute("tabindex",
"-1"),a.rangeSelector[b].setAttribute("role","textbox"),a.rangeSelector[b].setAttribute("aria-label","Select "+(c?"end":"start")+" date."))});g(q,function(a){a.setAttribute("aria-hidden","true")});a.addScreenReaderRegion(p);d.keyboardNavigation&&a.addKeyboardNavEvents();u(!0,b.exporting,{csv:{columnHeaderFormatter:function(a,b,c){var d=m[m.length-1];1<c&&(d&&d.text)!==a.name&&m.push({text:a.name,span:c});return k?k.call(this,a,b,c):1<c?b:a.name}}});e.wrap(a,"getTable",function(a){return a.apply(this,
Array.prototype.slice.call(arguments,1)).replace("\x3ctable\x3e",'\x3ctable id\x3d"'+p+'" summary\x3d"Table representation of chart"\x3e\x3ccaption\x3e'+t+"\x3c/caption\x3e")});e.wrap(a,"viewData",function(a){if(!this.insertedTable){a.apply(this,Array.prototype.slice.call(arguments,1));var b=l.getElementById(p),c=b.getElementsByTagName("tbody")[0],d=c.firstChild.children,e="\x3ctr\x3e\x3ctd\x3e\x3c/td\x3e",f,h;b.setAttribute("tabindex","-1");g(c.children,function(a){f=a.firstChild;h=l.createElement("th");
h.setAttribute("scope","row");h.innerHTML=f.innerHTML;f.parentNode.replaceChild(h,f)});g(d,function(a){"TH"===a.tagName&&a.setAttribute("scope","col")});m.length&&(g(m,function(a){e+='\x3cth scope\x3d"col" colspan\x3d"'+a.span+'"\x3e'+a.text+"\x3c/th\x3e"}),c.insertAdjacentHTML("afterbegin",e))}})}})})(h)});

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,14 @@
/*
Highcharts JS v5.0.2 (2016-10-26)
(c) 2009-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(n){"object"===typeof module&&module.exports?module.exports=n:n(Highcharts)})(function(n){(function(f){var q=f.defined,k=f.isNumber,n=f.inArray,v=f.isArray,w=f.merge,B=f.Chart,x=f.extend,C=f.each,r,D;D=["path","rect","circle"];r={top:0,left:0,center:.5,middle:.5,bottom:1,right:1};var E=function(){this.init.apply(this,arguments)};E.prototype={init:function(a,d){var c=d.shape&&d.shape.type;this.chart=a;var b;b={xAxis:0,yAxis:0,title:{style:{},text:"",x:0,y:0},shape:{params:{stroke:"#000000",
fill:"transparent",strokeWidth:2}}};a={circle:{params:{x:0,y:0}}};a[c]&&(b.shape=w(b.shape,a[c]));this.options=w({},b,d)},render:function(a){var d=this.chart,c=this.chart.renderer,b=this.group,f=this.title,e=this.shape,h=this.options,k=h.title,p=h.shape;b||(b=this.group=c.g());!e&&p&&-1!==n(p.type,D)&&(e=this.shape=c[h.shape.type](p.params),e.add(b));!f&&k&&(f=this.title=c.label(k),f.add(b));b.add(d.annotations.group);this.linkObjects();!1!==a&&this.redraw()},redraw:function(){var a=this.options,
d=this.chart,c=this.group,b=this.title,F=this.shape,e=this.linkedObject,h=d.xAxis[a.xAxis],d=d.yAxis[a.yAxis],y=a.width,p=a.height,z=r[a.anchorY],A=r[a.anchorX],t,l,g,u;e&&(t=e instanceof f.Point?"point":e instanceof f.Series?"series":null,"point"===t?(a.xValue=e.x,a.yValue=e.y,l=e.series):"series"===t&&(l=e),c.visibility!==l.group.visibility&&c.attr({visibility:l.group.visibility}));e=q(a.xValue)?h.toPixels(a.xValue+h.minPointOffset)-h.minPixelPadding:a.x;l=q(a.yValue)?d.toPixels(a.yValue):a.y;if(k(e)&&
k(l)){b&&(b.attr(a.title),b.css(a.title.style));if(F){b=x({},a.shape.params);if("values"===a.units){for(g in b)-1<n(g,["width","x"])?b[g]=h.translate(b[g]):-1<n(g,["height","y"])&&(b[g]=d.translate(b[g]));b.width&&(b.width-=h.toPixels(0)-h.left);b.x&&(b.x+=h.minPixelPadding);if("path"===a.shape.type){g=b.d;t=e;for(var v=l,w=g.length,m=0;m<w;)k(g[m])&&k(g[m+1])?(g[m]=h.toPixels(g[m])-t,g[m+1]=d.toPixels(g[m+1])-v,m+=2):m+=1}}"circle"===a.shape.type&&(b.x+=b.r,b.y+=b.r);F.attr(b)}c.bBox=null;k(y)||
(u=c.getBBox(),y=u.width);k(p)||(u||(u=c.getBBox()),p=u.height);k(A)||(A=r.center);k(z)||(z=r.center);e-=y*A;l-=p*z;q(c.translateX)&&q(c.translateY)?c.animate({translateX:e,translateY:l}):c.translate(e,l)}},destroy:function(){var a=this,d=this.chart.annotations.allItems,c=d.indexOf(a);-1<c&&d.splice(c,1);C(["title","shape","group"],function(b){a[b]&&(a[b].destroy(),a[b]=null)});a.group=a.title=a.shape=a.chart=a.options=null},update:function(a,d){x(this.options,a);this.linkObjects();this.render(d)},
linkObjects:function(){var a=this.chart,d=this.linkedObject,c=d&&(d.id||d.options.id),b=this.options.linkedTo;q(b)?q(d)&&b===c||(this.linkedObject=a.get(b)):this.linkedObject=null}};x(B.prototype,{annotations:{add:function(a,d){var c=this.allItems,b=this.chart,f,e;v(a)||(a=[a]);for(e=a.length;e--;)f=new E(b,a[e]),c.push(f),f.render(d)},redraw:function(){C(this.allItems,function(a){a.redraw()})}}});B.prototype.callbacks.push(function(a){var d=a.options.annotations,c;c=a.renderer.g("annotations");c.attr({zIndex:7});
c.add();a.annotations.allItems=[];a.annotations.chart=a;a.annotations.group=c;v(d)&&0<d.length&&a.annotations.add(a.options.annotations);f.addEvent(a,"redraw",function(){a.annotations.redraw()})})})(n)});

View File

@ -0,0 +1,408 @@
/**
* @license Highcharts JS v5.0.2 (2016-10-26)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
'use strict';
var defined = H.defined,
isNumber = H.isNumber,
inArray = H.inArray,
isArray = H.isArray,
merge = H.merge,
Chart = H.Chart,
extend = H.extend,
each = H.each;
var ALIGN_FACTOR,
ALLOWED_SHAPES;
ALLOWED_SHAPES = ['path', 'rect', 'circle'];
ALIGN_FACTOR = {
top: 0,
left: 0,
center: 0.5,
middle: 0.5,
bottom: 1,
right: 1
};
function defaultOptions(shapeType) {
var shapeOptions,
options;
options = {
xAxis: 0,
yAxis: 0,
title: {
style: {},
text: '',
x: 0,
y: 0
},
shape: {
params: {
stroke: '#000000',
fill: 'transparent',
strokeWidth: 2
}
}
};
shapeOptions = {
circle: {
params: {
x: 0,
y: 0
}
}
};
if (shapeOptions[shapeType]) {
options.shape = merge(options.shape, shapeOptions[shapeType]);
}
return options;
}
function translatePath(d, xAxis, yAxis, xOffset, yOffset) {
var len = d.length,
i = 0;
while (i < len) {
if (isNumber(d[i]) && isNumber(d[i + 1])) {
d[i] = xAxis.toPixels(d[i]) - xOffset;
d[i + 1] = yAxis.toPixels(d[i + 1]) - yOffset;
i += 2;
} else {
i += 1;
}
}
return d;
}
// Define annotation prototype
var Annotation = function() {
this.init.apply(this, arguments);
};
Annotation.prototype = {
/*
* Initialize the annotation
*/
init: function(chart, options) {
var shapeType = options.shape && options.shape.type;
this.chart = chart;
this.options = merge({}, defaultOptions(shapeType), options);
},
/*
* Render the annotation
*/
render: function(redraw) {
var annotation = this,
chart = this.chart,
renderer = annotation.chart.renderer,
group = annotation.group,
title = annotation.title,
shape = annotation.shape,
options = annotation.options,
titleOptions = options.title,
shapeOptions = options.shape;
if (!group) {
group = annotation.group = renderer.g();
}
if (!shape && shapeOptions && inArray(shapeOptions.type, ALLOWED_SHAPES) !== -1) {
shape = annotation.shape = renderer[options.shape.type](shapeOptions.params);
shape.add(group);
}
if (!title && titleOptions) {
title = annotation.title = renderer.label(titleOptions);
title.add(group);
}
group.add(chart.annotations.group);
// link annotations to point or series
annotation.linkObjects();
if (redraw !== false) {
annotation.redraw();
}
},
/*
* Redraw the annotation title or shape after options update
*/
redraw: function() {
var options = this.options,
chart = this.chart,
group = this.group,
title = this.title,
shape = this.shape,
linkedTo = this.linkedObject,
xAxis = chart.xAxis[options.xAxis],
yAxis = chart.yAxis[options.yAxis],
width = options.width,
height = options.height,
anchorY = ALIGN_FACTOR[options.anchorY],
anchorX = ALIGN_FACTOR[options.anchorX],
shapeParams,
linkType,
series,
param,
bbox,
x,
y;
if (linkedTo) {
linkType = (linkedTo instanceof H.Point) ? 'point' :
(linkedTo instanceof H.Series) ? 'series' : null;
if (linkType === 'point') {
options.xValue = linkedTo.x;
options.yValue = linkedTo.y;
series = linkedTo.series;
} else if (linkType === 'series') {
series = linkedTo;
}
if (group.visibility !== series.group.visibility) {
group.attr({
visibility: series.group.visibility
});
}
}
// Based on given options find annotation pixel position
x = (defined(options.xValue) ? xAxis.toPixels(options.xValue + xAxis.minPointOffset) - xAxis.minPixelPadding : options.x);
y = defined(options.yValue) ? yAxis.toPixels(options.yValue) : options.y;
if (!isNumber(x) || !isNumber(y)) {
return;
}
if (title) {
title.attr(options.title);
title.css(options.title.style);
}
if (shape) {
shapeParams = extend({}, options.shape.params);
if (options.units === 'values') {
for (param in shapeParams) {
if (inArray(param, ['width', 'x']) > -1) {
shapeParams[param] = xAxis.translate(shapeParams[param]);
} else if (inArray(param, ['height', 'y']) > -1) {
shapeParams[param] = yAxis.translate(shapeParams[param]);
}
}
if (shapeParams.width) {
shapeParams.width -= xAxis.toPixels(0) - xAxis.left;
}
if (shapeParams.x) {
shapeParams.x += xAxis.minPixelPadding;
}
if (options.shape.type === 'path') {
translatePath(shapeParams.d, xAxis, yAxis, x, y);
}
}
// move the center of the circle to shape x/y
if (options.shape.type === 'circle') {
shapeParams.x += shapeParams.r;
shapeParams.y += shapeParams.r;
}
shape.attr(shapeParams);
}
group.bBox = null;
// If annotation width or height is not defined in options use bounding box size
if (!isNumber(width)) {
bbox = group.getBBox();
width = bbox.width;
}
if (!isNumber(height)) {
// get bbox only if it wasn't set before
if (!bbox) {
bbox = group.getBBox();
}
height = bbox.height;
}
// Calculate anchor point
if (!isNumber(anchorX)) {
anchorX = ALIGN_FACTOR.center;
}
if (!isNumber(anchorY)) {
anchorY = ALIGN_FACTOR.center;
}
// Translate group according to its dimension and anchor point
x = x - width * anchorX;
y = y - height * anchorY;
if (defined(group.translateX) && defined(group.translateY)) {
group.animate({
translateX: x,
translateY: y
});
} else {
group.translate(x, y);
}
},
/*
* Destroy the annotation
*/
destroy: function() {
var annotation = this,
chart = this.chart,
allItems = chart.annotations.allItems,
index = allItems.indexOf(annotation);
if (index > -1) {
allItems.splice(index, 1);
}
each(['title', 'shape', 'group'], function(element) {
if (annotation[element]) {
annotation[element].destroy();
annotation[element] = null;
}
});
annotation.group = annotation.title = annotation.shape = annotation.chart = annotation.options = null;
},
/*
* Update the annotation with a given options
*/
update: function(options, redraw) {
extend(this.options, options);
// update link to point or series
this.linkObjects();
this.render(redraw);
},
linkObjects: function() {
var annotation = this,
chart = annotation.chart,
linkedTo = annotation.linkedObject,
linkedId = linkedTo && (linkedTo.id || linkedTo.options.id),
options = annotation.options,
id = options.linkedTo;
if (!defined(id)) {
annotation.linkedObject = null;
} else if (!defined(linkedTo) || id !== linkedId) {
annotation.linkedObject = chart.get(id);
}
}
};
// Add annotations methods to chart prototype
extend(Chart.prototype, {
annotations: {
/*
* Unified method for adding annotations to the chart
*/
add: function(options, redraw) {
var annotations = this.allItems,
chart = this.chart,
item,
len;
if (!isArray(options)) {
options = [options];
}
len = options.length;
while (len--) {
item = new Annotation(chart, options[len]);
annotations.push(item);
item.render(redraw);
}
},
/**
* Redraw all annotations, method used in chart events
*/
redraw: function() {
each(this.allItems, function(annotation) {
annotation.redraw();
});
}
}
});
// Initialize on chart load
Chart.prototype.callbacks.push(function(chart) {
var options = chart.options.annotations,
group;
group = chart.renderer.g('annotations');
group.attr({
zIndex: 7
});
group.add();
// initialize empty array for annotations
chart.annotations.allItems = [];
// link chart object to annotations
chart.annotations.chart = chart;
// link annotations group element to the chart
chart.annotations.group = group;
if (isArray(options) && options.length > 0) {
chart.annotations.add(chart.options.annotations);
}
// update annotations after chart redraw
H.addEvent(chart, 'redraw', function() {
chart.annotations.redraw();
});
});
}(Highcharts));
}));

View File

@ -0,0 +1,22 @@
/*
Highcharts JS v5.0.2 (2016-10-26)
Boost module
(c) 2010-2016 Highsoft AS
Author: Torstein Honsi
License: www.highcharts.com/license
*/
(function(p){"object"===typeof module&&module.exports?module.exports=p:p(Highcharts)})(function(p){(function(f){function p(a,b,c,e,h){h=h||0;e=e||5E4;for(var k=h+e,f=!0;f&&h<k&&h<a.length;)f=b(a[h],h),h+=1;f&&(h<a.length?setTimeout(function(){p(a,b,c,e,h)}):c&&c())}var x=f.win.document,U=function(){},V=f.Color,n=f.Series,d=f.seriesTypes,q=f.each,y=f.extend,W=f.addEvent,X=f.fireEvent,z=f.grep,u=f.isNumber,Y=f.merge,Z=f.pick,l=f.wrap,v=f.getOptions().plotOptions,F;q(["area","arearange","column","line",
"scatter"],function(a){v[a]&&(v[a].boostThreshold=5E3)});q(["translate","generatePoints","drawTracker","drawPoints","render"],function(a){function b(b){var c=this.options.stacking&&("translate"===a||"generatePoints"===a);if((this.processedXData||this.options.data).length<(this.options.boostThreshold||Number.MAX_VALUE)||c)"render"===a&&this.image&&(this.image.attr({href:""}),this.animate=null),b.call(this);else if(this[a+"Canvas"])this[a+"Canvas"]()}l(n.prototype,a,b);"translate"===a&&(d.column&&l(d.column.prototype,
a,b),d.arearange&&l(d.arearange.prototype,a,b))});l(n.prototype,"getExtremes",function(a){this.hasExtremes()||a.apply(this,Array.prototype.slice.call(arguments,1))});l(n.prototype,"setData",function(a){this.hasExtremes(!0)||a.apply(this,Array.prototype.slice.call(arguments,1))});l(n.prototype,"processData",function(a){this.hasExtremes(!0)||a.apply(this,Array.prototype.slice.call(arguments,1))});f.extend(n.prototype,{pointRange:0,allowDG:!1,hasExtremes:function(a){var b=this.options,c=this.xAxis&&
this.xAxis.options,e=this.yAxis&&this.yAxis.options;return b.data.length>(b.boostThreshold||Number.MAX_VALUE)&&u(e.min)&&u(e.max)&&(!a||u(c.min)&&u(c.max))},destroyGraphics:function(){var a=this,b=this.points,c,e;if(b)for(e=0;e<b.length;e+=1)(c=b[e])&&c.graphic&&(c.graphic=c.graphic.destroy());q(["graph","area","tracker"],function(b){a[b]&&(a[b]=a[b].destroy())})},getContext:function(){var a=this.chart,b=a.plotWidth,c=a.plotHeight,e=this.ctx,h=function(a,b,c,e,h,f,d){a.call(this,c,b,e,h,f,d)};this.canvas?
e.clearRect(0,0,b,c):(this.canvas=x.createElement("canvas"),this.image=a.renderer.image("",0,0,b,c).add(this.group),this.ctx=e=this.canvas.getContext("2d"),a.inverted&&q(["moveTo","lineTo","rect","arc"],function(a){l(e,a,h)}));this.canvas.width=b;this.canvas.height=c;this.image.attr({width:b,height:c});return e},canvasToSVG:function(){this.image.attr({href:this.canvas.toDataURL("image/png")})},cvsLineTo:function(a,b,c){a.lineTo(b,c)},renderCanvas:function(){var a=this,b=a.options,c=a.chart,e=this.xAxis,
h=this.yAxis,k,d=0,l=a.processedXData,n=a.processedYData,q=b.data,m=e.getExtremes(),v=m.min,x=m.max,m=h.getExtremes(),z=m.min,aa=m.max,G={},A,ba=!!a.sampling,H,I=b.marker&&b.marker.radius,J=this.cvsDrawPoint,B=b.lineWidth?this.cvsLineTo:!1,K=1>=I?this.cvsMarkerSquare:this.cvsMarkerCircle,ca=!1!==b.enableMouseTracking,L,m=b.threshold,r=h.getThreshold(m),M=u(m),N=r,da=this.fill,O=a.pointArrayMap&&"low,high"===a.pointArrayMap.join(","),P=!!b.stacking,ea=a.cropStart||0,m=c.options.loading,fa=a.requireSorting,
Q,ga=b.connectNulls,R=!l,C,D,t,w,ha=a.fillOpacity?(new V(a.color)).setOpacity(Z(b.fillOpacity,.75)).get():a.color,S=function(){da?(k.fillStyle=ha,k.fill()):(k.strokeStyle=a.color,k.lineWidth=b.lineWidth,k.stroke())},T=function(a,b,c){0===d&&(k.beginPath(),B&&(k.lineJoin="round"));Q?k.moveTo(a,b):J?J(k,a,b,c,L):B?B(k,a,b):K&&K(k,a,b,I);d+=1;1E3===d&&(S(),d=0);L={clientX:a,plotY:b,yBottom:c}},E=function(a,b,f){ca&&!G[a+","+b]&&(G[a+","+b]=!0,c.inverted&&(a=e.len-a,b=h.len-b),H.push({clientX:a,plotX:a,
plotY:b,i:ea+f}))};(this.points||this.graph)&&this.destroyGraphics();a.plotGroup("group","series",a.visible?"visible":"hidden",b.zIndex,c.seriesGroup);a.markerGroup=a.group;W(a,"destroy",function(){a.markerGroup=null});H=this.points=[];k=this.getContext();a.buildKDTree=U;99999<q.length&&(c.options.loading=Y(m,{labelStyle:{backgroundColor:f.color("#ffffff").setOpacity(.75).get(),padding:"1em",borderRadius:"0.5em"},style:{backgroundColor:"none",opacity:1}}),clearTimeout(F),c.showLoading("Drawing..."),
c.options.loading=m);p(P?a.data:l||q,function(b,f){var d,g,k,l="undefined"===typeof c.index,m=!0;if(!l){R?(d=b[0],g=b[1]):(d=b,g=n[f]);O?(R&&(g=b.slice(1,3)),k=g[0],g=g[1]):P&&(d=b.x,g=b.stackY,k=g-b.y);b=null===g;fa||(m=g>=z&&g<=aa);if(!b&&d>=v&&d<=x&&m)if(d=Math.round(e.toPixels(d,!0)),ba){if(void 0===t||d===A){O||(k=g);if(void 0===w||g>D)D=g,w=f;if(void 0===t||k<C)C=k,t=f}d!==A&&(void 0!==t&&(g=h.toPixels(D,!0),r=h.toPixels(C,!0),T(d,M?Math.min(g,N):g,M?Math.max(r,N):r),E(d,g,w),r!==g&&E(d,r,t)),
t=w=void 0,A=d)}else g=Math.round(h.toPixels(g,!0)),T(d,g,r),E(d,g,f);Q=b&&!ga;0===f%5E4&&a.canvasToSVG()}return!l},function(){var b=c.loadingDiv,e=c.loadingShown;S();a.canvasToSVG();X(a,"renderedCanvas");e&&(y(b.style,{transition:"opacity 250ms",opacity:0}),c.loadingShown=!1,F=setTimeout(function(){b.parentNode&&b.parentNode.removeChild(b);c.loadingDiv=c.loadingSpan=null},250));a.directTouch=!1;a.options.stickyTracking=!0;delete a.buildKDTree;a.buildKDTree()},c.renderer.forExport?Number.MAX_VALUE:
void 0)}});d.scatter.prototype.cvsMarkerCircle=function(a,b,c,e){a.moveTo(b,c);a.arc(b,c,e,0,2*Math.PI,!1)};d.scatter.prototype.cvsMarkerSquare=function(a,b,c,e){a.rect(b-e,c-e,2*e,2*e)};d.scatter.prototype.fill=!0;y(d.area.prototype,{cvsDrawPoint:function(a,b,c,e,d){d&&b!==d.clientX&&(a.moveTo(d.clientX,d.yBottom),a.lineTo(d.clientX,d.plotY),a.lineTo(b,c),a.lineTo(b,e))},fill:!0,fillOpacity:!0,sampling:!0});y(d.column.prototype,{cvsDrawPoint:function(a,b,c,d){a.rect(b-1,c,1,d-c)},fill:!0,sampling:!0});
n.prototype.getPoint=function(a){var b=a;!a||a instanceof this.pointClass||(b=(new this.pointClass).init(this,this.options.data[a.i]),b.category=b.x,b.dist=a.dist,b.distX=a.distX,b.plotX=a.plotX,b.plotY=a.plotY);return b};l(n.prototype,"destroy",function(a){var b=this,c=b.chart;c.hoverPoints&&(c.hoverPoints=z(c.hoverPoints,function(a){return a.series===b}));c.hoverPoint&&c.hoverPoint.series===b&&(c.hoverPoint=null);a.call(this)});l(n.prototype,"searchPoint",function(a){return this.getPoint(a.apply(this,
[].slice.call(arguments,1)))})})(p)});

View File

@ -0,0 +1,636 @@
/**
* @license Highcharts JS v5.0.2 (2016-10-26)
* Boost module
*
* (c) 2010-2016 Highsoft AS
* Author: Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* License: www.highcharts.com/license
* Author: Torstein Honsi
*
* This is an experimental Highcharts module that draws long data series on a canvas
* in order to increase performance of the initial load time and tooltip responsiveness.
*
* Compatible with HTML5 canvas compatible browsers (not IE < 9).
*
*
*
* Development plan
* - Column range.
* - Heatmap. Modify the heatmap-canvas demo so that it uses this module.
* - Treemap.
* - Check how it works with Highstock and data grouping. Currently it only works when navigator.adaptToUpdatedData
* is false. It is also recommended to set scrollbar.liveRedraw to false.
* - Check inverted charts.
* - Check reversed axes.
* - Chart callback should be async after last series is drawn. (But not necessarily, we don't do
that with initial series animation).
* - Cache full-size image so we don't have to redraw on hide/show and zoom up. But k-d-tree still
* needs to be built.
* - Test IE9 and IE10.
* - Stacking is not perhaps not correct since it doesn't use the translation given in
* the translate method. If this gets to complicated, a possible way out would be to
* have a simplified renderCanvas method that simply draws the areaPath on a canvas.
*
* If this module is taken in as part of the core
* - All the loading logic should be merged with core. Update styles in the core.
* - Most of the method wraps should probably be added directly in parent methods.
*
* Notes for boost mode
* - Area lines are not drawn
* - Point markers are not drawn on line-type series
* - Lines are not drawn on scatter charts
* - Zones and negativeColor don't work
* - Columns are always one pixel wide. Don't set the threshold too low.
*
* Optimizing tips for users
* - For scatter plots, use a marker.radius of 1 or less. It results in a rectangle being drawn, which is
* considerably faster than a circle.
* - Set extremes (min, max) explicitly on the axes in order for Highcharts to avoid computing extremes.
* - Set enableMouseTracking to false on the series to improve total rendering time.
* - The default threshold is set based on one series. If you have multiple, dense series, the combined
* number of points drawn gets higher, and you may want to set the threshold lower in order to
* use optimizations.
*/
'use strict';
var win = H.win,
doc = win.document,
noop = function() {},
Color = H.Color,
Series = H.Series,
seriesTypes = H.seriesTypes,
each = H.each,
extend = H.extend,
addEvent = H.addEvent,
fireEvent = H.fireEvent,
grep = H.grep,
isNumber = H.isNumber,
merge = H.merge,
pick = H.pick,
wrap = H.wrap,
plotOptions = H.getOptions().plotOptions,
CHUNK_SIZE = 50000,
destroyLoadingDiv;
function eachAsync(arr, fn, finalFunc, chunkSize, i) {
i = i || 0;
chunkSize = chunkSize || CHUNK_SIZE;
var threshold = i + chunkSize,
proceed = true;
while (proceed && i < threshold && i < arr.length) {
proceed = fn(arr[i], i);
i = i + 1;
}
if (proceed) {
if (i < arr.length) {
setTimeout(function() {
eachAsync(arr, fn, finalFunc, chunkSize, i);
});
} else if (finalFunc) {
finalFunc();
}
}
}
// Set default options
each(['area', 'arearange', 'column', 'line', 'scatter'], function(type) {
if (plotOptions[type]) {
plotOptions[type].boostThreshold = 5000;
}
});
/**
* Override a bunch of methods the same way. If the number of points is below the threshold,
* run the original method. If not, check for a canvas version or do nothing.
*/
each(['translate', 'generatePoints', 'drawTracker', 'drawPoints', 'render'], function(method) {
function branch(proceed) {
var letItPass = this.options.stacking && (method === 'translate' || method === 'generatePoints');
if ((this.processedXData || this.options.data).length < (this.options.boostThreshold || Number.MAX_VALUE) ||
letItPass) {
// Clear image
if (method === 'render' && this.image) {
this.image.attr({
href: ''
});
this.animate = null; // We're zooming in, don't run animation
}
proceed.call(this);
// If a canvas version of the method exists, like renderCanvas(), run
} else if (this[method + 'Canvas']) {
this[method + 'Canvas']();
}
}
wrap(Series.prototype, method, branch);
// A special case for some types - its translate method is already wrapped
if (method === 'translate') {
if (seriesTypes.column) {
wrap(seriesTypes.column.prototype, method, branch);
}
if (seriesTypes.arearange) {
wrap(seriesTypes.arearange.prototype, method, branch);
}
}
});
/**
* Do not compute extremes when min and max are set.
* If we use this in the core, we can add the hook to hasExtremes to the methods directly.
*/
wrap(Series.prototype, 'getExtremes', function(proceed) {
if (!this.hasExtremes()) {
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
}
});
wrap(Series.prototype, 'setData', function(proceed) {
if (!this.hasExtremes(true)) {
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
}
});
wrap(Series.prototype, 'processData', function(proceed) {
if (!this.hasExtremes(true)) {
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
}
});
H.extend(Series.prototype, {
pointRange: 0,
allowDG: false, // No data grouping, let boost handle large data
hasExtremes: function(checkX) {
var options = this.options,
data = options.data,
xAxis = this.xAxis && this.xAxis.options,
yAxis = this.yAxis && this.yAxis.options;
return data.length > (options.boostThreshold || Number.MAX_VALUE) && isNumber(yAxis.min) && isNumber(yAxis.max) &&
(!checkX || (isNumber(xAxis.min) && isNumber(xAxis.max)));
},
/**
* If implemented in the core, parts of this can probably be shared with other similar
* methods in Highcharts.
*/
destroyGraphics: function() {
var series = this,
points = this.points,
point,
i;
if (points) {
for (i = 0; i < points.length; i = i + 1) {
point = points[i];
if (point && point.graphic) {
point.graphic = point.graphic.destroy();
}
}
}
each(['graph', 'area', 'tracker'], function(prop) {
if (series[prop]) {
series[prop] = series[prop].destroy();
}
});
},
/**
* Create a hidden canvas to draw the graph on. The contents is later copied over
* to an SVG image element.
*/
getContext: function() {
var chart = this.chart,
width = chart.plotWidth,
height = chart.plotHeight,
ctx = this.ctx,
swapXY = function(proceed, x, y, a, b, c, d) {
proceed.call(this, y, x, a, b, c, d);
};
if (!this.canvas) {
this.canvas = doc.createElement('canvas');
this.image = chart.renderer.image('', 0, 0, width, height).add(this.group);
this.ctx = ctx = this.canvas.getContext('2d');
if (chart.inverted) {
each(['moveTo', 'lineTo', 'rect', 'arc'], function(fn) {
wrap(ctx, fn, swapXY);
});
}
} else {
ctx.clearRect(0, 0, width, height);
}
this.canvas.width = width;
this.canvas.height = height;
this.image.attr({
width: width,
height: height
});
return ctx;
},
/**
* Draw the canvas image inside an SVG image
*/
canvasToSVG: function() {
this.image.attr({
href: this.canvas.toDataURL('image/png')
});
},
cvsLineTo: function(ctx, clientX, plotY) {
ctx.lineTo(clientX, plotY);
},
renderCanvas: function() {
var series = this,
options = series.options,
chart = series.chart,
xAxis = this.xAxis,
yAxis = this.yAxis,
ctx,
c = 0,
xData = series.processedXData,
yData = series.processedYData,
rawData = options.data,
xExtremes = xAxis.getExtremes(),
xMin = xExtremes.min,
xMax = xExtremes.max,
yExtremes = yAxis.getExtremes(),
yMin = yExtremes.min,
yMax = yExtremes.max,
pointTaken = {},
lastClientX,
sampling = !!series.sampling,
points,
r = options.marker && options.marker.radius,
cvsDrawPoint = this.cvsDrawPoint,
cvsLineTo = options.lineWidth ? this.cvsLineTo : false,
cvsMarker = r <= 1 ? this.cvsMarkerSquare : this.cvsMarkerCircle,
enableMouseTracking = options.enableMouseTracking !== false,
lastPoint,
threshold = options.threshold,
yBottom = yAxis.getThreshold(threshold),
hasThreshold = isNumber(threshold),
translatedThreshold = yBottom,
doFill = this.fill,
isRange = series.pointArrayMap && series.pointArrayMap.join(',') === 'low,high',
isStacked = !!options.stacking,
cropStart = series.cropStart || 0,
loadingOptions = chart.options.loading,
requireSorting = series.requireSorting,
wasNull,
connectNulls = options.connectNulls,
useRaw = !xData,
minVal,
maxVal,
minI,
maxI,
fillColor = series.fillOpacity ?
new Color(series.color).setOpacity(pick(options.fillOpacity, 0.75)).get() :
series.color,
stroke = function() {
if (doFill) {
ctx.fillStyle = fillColor;
ctx.fill();
} else {
ctx.strokeStyle = series.color;
ctx.lineWidth = options.lineWidth;
ctx.stroke();
}
},
drawPoint = function(clientX, plotY, yBottom) {
if (c === 0) {
ctx.beginPath();
if (cvsLineTo) {
ctx.lineJoin = 'round';
}
}
if (wasNull) {
ctx.moveTo(clientX, plotY);
} else {
if (cvsDrawPoint) {
cvsDrawPoint(ctx, clientX, plotY, yBottom, lastPoint);
} else if (cvsLineTo) {
cvsLineTo(ctx, clientX, plotY);
} else if (cvsMarker) {
cvsMarker(ctx, clientX, plotY, r);
}
}
// We need to stroke the line for every 1000 pixels. It will crash the browser
// memory use if we stroke too infrequently.
c = c + 1;
if (c === 1000) {
stroke();
c = 0;
}
// Area charts need to keep track of the last point
lastPoint = {
clientX: clientX,
plotY: plotY,
yBottom: yBottom
};
},
addKDPoint = function(clientX, plotY, i) {
// The k-d tree requires series points. Reduce the amount of points, since the time to build the
// tree increases exponentially.
if (enableMouseTracking && !pointTaken[clientX + ',' + plotY]) {
pointTaken[clientX + ',' + plotY] = true;
if (chart.inverted) {
clientX = xAxis.len - clientX;
plotY = yAxis.len - plotY;
}
points.push({
clientX: clientX,
plotX: clientX,
plotY: plotY,
i: cropStart + i
});
}
};
// If we are zooming out from SVG mode, destroy the graphics
if (this.points || this.graph) {
this.destroyGraphics();
}
// The group
series.plotGroup(
'group',
'series',
series.visible ? 'visible' : 'hidden',
options.zIndex,
chart.seriesGroup
);
series.markerGroup = series.group;
addEvent(series, 'destroy', function() {
series.markerGroup = null;
});
points = this.points = [];
ctx = this.getContext();
series.buildKDTree = noop; // Do not start building while drawing
// Display a loading indicator
if (rawData.length > 99999) {
chart.options.loading = merge(loadingOptions, {
labelStyle: {
backgroundColor: H.color('#ffffff').setOpacity(0.75).get(),
padding: '1em',
borderRadius: '0.5em'
},
style: {
backgroundColor: 'none',
opacity: 1
}
});
clearTimeout(destroyLoadingDiv);
chart.showLoading('Drawing...');
chart.options.loading = loadingOptions; // reset
}
// Loop over the points
eachAsync(isStacked ? series.data : (xData || rawData), function(d, i) {
var x,
y,
clientX,
plotY,
isNull,
low,
chartDestroyed = typeof chart.index === 'undefined',
isYInside = true;
if (!chartDestroyed) {
if (useRaw) {
x = d[0];
y = d[1];
} else {
x = d;
y = yData[i];
}
// Resolve low and high for range series
if (isRange) {
if (useRaw) {
y = d.slice(1, 3);
}
low = y[0];
y = y[1];
} else if (isStacked) {
x = d.x;
y = d.stackY;
low = y - d.y;
}
isNull = y === null;
// Optimize for scatter zooming
if (!requireSorting) {
isYInside = y >= yMin && y <= yMax;
}
if (!isNull && x >= xMin && x <= xMax && isYInside) {
clientX = Math.round(xAxis.toPixels(x, true));
if (sampling) {
if (minI === undefined || clientX === lastClientX) {
if (!isRange) {
low = y;
}
if (maxI === undefined || y > maxVal) {
maxVal = y;
maxI = i;
}
if (minI === undefined || low < minVal) {
minVal = low;
minI = i;
}
}
if (clientX !== lastClientX) { // Add points and reset
if (minI !== undefined) { // then maxI is also a number
plotY = yAxis.toPixels(maxVal, true);
yBottom = yAxis.toPixels(minVal, true);
drawPoint(
clientX,
hasThreshold ? Math.min(plotY, translatedThreshold) : plotY,
hasThreshold ? Math.max(yBottom, translatedThreshold) : yBottom
);
addKDPoint(clientX, plotY, maxI);
if (yBottom !== plotY) {
addKDPoint(clientX, yBottom, minI);
}
}
minI = maxI = undefined;
lastClientX = clientX;
}
} else {
plotY = Math.round(yAxis.toPixels(y, true));
drawPoint(clientX, plotY, yBottom);
addKDPoint(clientX, plotY, i);
}
}
wasNull = isNull && !connectNulls;
if (i % CHUNK_SIZE === 0) {
series.canvasToSVG();
}
}
return !chartDestroyed;
}, function() {
var loadingDiv = chart.loadingDiv,
loadingShown = chart.loadingShown;
stroke();
series.canvasToSVG();
fireEvent(series, 'renderedCanvas');
// Do not use chart.hideLoading, as it runs JS animation and will be blocked by buildKDTree.
// CSS animation looks good, but then it must be deleted in timeout. If we add the module to core,
// change hideLoading so we can skip this block.
if (loadingShown) {
extend(loadingDiv.style, {
transition: 'opacity 250ms',
opacity: 0
});
chart.loadingShown = false;
destroyLoadingDiv = setTimeout(function() {
if (loadingDiv.parentNode) { // In exporting it is falsy
loadingDiv.parentNode.removeChild(loadingDiv);
}
chart.loadingDiv = chart.loadingSpan = null;
}, 250);
}
// Pass tests in Pointer.
// Replace this with a single property, and replace when zooming in
// below boostThreshold.
series.directTouch = false;
series.options.stickyTracking = true;
delete series.buildKDTree; // Go back to prototype, ready to build
series.buildKDTree();
// Don't do async on export, the exportChart, getSVGForExport and getSVG methods are not chained for it.
}, chart.renderer.forExport ? Number.MAX_VALUE : undefined);
}
});
seriesTypes.scatter.prototype.cvsMarkerCircle = function(ctx, clientX, plotY, r) {
ctx.moveTo(clientX, plotY);
ctx.arc(clientX, plotY, r, 0, 2 * Math.PI, false);
};
// Rect is twice as fast as arc, should be used for small markers
seriesTypes.scatter.prototype.cvsMarkerSquare = function(ctx, clientX, plotY, r) {
ctx.rect(clientX - r, plotY - r, r * 2, r * 2);
};
seriesTypes.scatter.prototype.fill = true;
extend(seriesTypes.area.prototype, {
cvsDrawPoint: function(ctx, clientX, plotY, yBottom, lastPoint) {
if (lastPoint && clientX !== lastPoint.clientX) {
ctx.moveTo(lastPoint.clientX, lastPoint.yBottom);
ctx.lineTo(lastPoint.clientX, lastPoint.plotY);
ctx.lineTo(clientX, plotY);
ctx.lineTo(clientX, yBottom);
}
},
fill: true,
fillOpacity: true,
sampling: true
});
extend(seriesTypes.column.prototype, {
cvsDrawPoint: function(ctx, clientX, plotY, yBottom) {
ctx.rect(clientX - 1, plotY, 1, yBottom - plotY);
},
fill: true,
sampling: true
});
/**
* Return a full Point object based on the index. The boost module uses stripped point objects
* for performance reasons.
* @param {Number} boostPoint A stripped-down point object
* @returns {Object} A Point object as per http://api.highcharts.com/highcharts#Point
*/
Series.prototype.getPoint = function(boostPoint) {
var point = boostPoint;
if (boostPoint && !(boostPoint instanceof this.pointClass)) {
point = (new this.pointClass()).init(this, this.options.data[boostPoint.i]); // eslint-disable-line new-cap
point.category = point.x;
point.dist = boostPoint.dist;
point.distX = boostPoint.distX;
point.plotX = boostPoint.plotX;
point.plotY = boostPoint.plotY;
}
return point;
};
/**
* Extend series.destroy to also remove the fake k-d-tree points (#5137). Normally
* this is handled by Series.destroy that calls Point.destroy, but the fake
* search points are not registered like that.
*/
wrap(Series.prototype, 'destroy', function(proceed) {
var series = this,
chart = series.chart;
if (chart.hoverPoints) {
chart.hoverPoints = grep(chart.hoverPoints, function(point) {
return point.series === series;
});
}
if (chart.hoverPoint && chart.hoverPoint.series === series) {
chart.hoverPoint = null;
}
proceed.call(this);
});
/**
* Return a point instance from the k-d-tree
*/
wrap(Series.prototype, 'searchPoint', function(proceed) {
return this.getPoint(
proceed.apply(this, [].slice.call(arguments, 1))
);
});
}(Highcharts));
}));

View File

@ -0,0 +1,14 @@
/*
Highcharts JS v5.0.2 (2016-10-26)
(c) 2009-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(h){"object"===typeof module&&module.exports?module.exports=h:h(Highcharts)})(function(h){(function(f){function h(){return Array.prototype.slice.call(arguments,1)}function u(g){g.apply(this);this.drawBreaks(this.xAxis,["x"]);this.drawBreaks(this.yAxis,r(this.pointArrayMap,["y"]))}var r=f.pick,p=f.wrap,t=f.each,x=f.extend,v=f.fireEvent,q=f.Axis,y=f.Series;x(q.prototype,{isInBreak:function(g,c){var d=g.repeat||Infinity,b=g.from,a=g.to-g.from;c=c>=b?(c-b)%d:d-(b-c)%d;return g.inclusive?c<=a:
c<a&&0!==c},isInAnyBreak:function(g,c){var d=this.options.breaks,b=d&&d.length,a,e,m;if(b){for(;b--;)this.isInBreak(d[b],g)&&(a=!0,e||(e=r(d[b].showPoints,this.isXAxis?!1:!0)));m=a&&c?a&&!e:a}return m}});p(q.prototype,"setTickPositions",function(g){g.apply(this,Array.prototype.slice.call(arguments,1));if(this.options.breaks){var c=this.tickPositions,d=this.tickPositions.info,b=[],a;for(a=0;a<c.length;a++)this.isInAnyBreak(c[a])||b.push(c[a]);this.tickPositions=b;this.tickPositions.info=d}});p(q.prototype,
"init",function(g,c,d){d.breaks&&d.breaks.length&&(d.ordinal=!1);g.call(this,c,d);if(this.options.breaks){var b=this;b.isBroken=!0;this.val2lin=function(a){var e=a,m,d;for(d=0;d<b.breakArray.length;d++)if(m=b.breakArray[d],m.to<=a)e-=m.len;else if(m.from>=a)break;else if(b.isInBreak(m,a)){e-=a-m.from;break}return e};this.lin2val=function(a){var e,d;for(d=0;d<b.breakArray.length&&!(e=b.breakArray[d],e.from>=a);d++)e.to<a?a+=e.len:b.isInBreak(e,a)&&(a+=e.len);return a};this.setExtremes=function(a,b,
d,g,c){for(;this.isInAnyBreak(a);)a-=this.closestPointRange;for(;this.isInAnyBreak(b);)b-=this.closestPointRange;q.prototype.setExtremes.call(this,a,b,d,g,c)};this.setAxisTranslation=function(a){q.prototype.setAxisTranslation.call(this,a);var e=b.options.breaks;a=[];var d=[],g=0,c,k,n=b.userMin||b.min,f=b.userMax||b.max,l,h;for(h in e)k=e[h],c=k.repeat||Infinity,b.isInBreak(k,n)&&(n+=k.to%c-n%c),b.isInBreak(k,f)&&(f-=f%c-k.from%c);for(h in e){k=e[h];l=k.from;for(c=k.repeat||Infinity;l-c>n;)l-=c;for(;l<
n;)l+=c;for(;l<f;l+=c)a.push({value:l,move:"in"}),a.push({value:l+(k.to-k.from),move:"out",size:k.breakSize})}a.sort(function(a,b){return a.value===b.value?("in"===a.move?0:1)-("in"===b.move?0:1):a.value-b.value});e=0;l=n;for(h in a)k=a[h],e+="in"===k.move?1:-1,1===e&&"in"===k.move&&(l=k.value),0===e&&(d.push({from:l,to:k.value,len:k.value-l-(k.size||0)}),g+=k.value-l-(k.size||0));b.breakArray=d;v(b,"afterBreaks");b.transA*=(f-b.min)/(f-n-g);b.min=n;b.max=f}}});p(y.prototype,"generatePoints",function(g){g.apply(this,
h(arguments));var c=this.xAxis,d=this.yAxis,b=this.points,a,e=b.length,f=this.options.connectNulls,w;if(c&&d&&(c.options.breaks||d.options.breaks))for(;e--;)a=b[e],w=null===a.y&&!1===f,w||!c.isInAnyBreak(a.x,!0)&&!d.isInAnyBreak(a.y,!0)||(b.splice(e,1),this.data[e]&&this.data[e].destroyElements())});f.Series.prototype.drawBreaks=function(g,c){var d=this,b=d.points,a,e,f,h;t(c,function(c){a=g.breakArray||[];e=g.isXAxis?g.min:r(d.options.threshold,g.min);t(b,function(b){h=r(b["stack"+c.toUpperCase()],
b[c]);t(a,function(a){f=!1;if(e<a.from&&h>a.to||e>a.from&&h<a.from)f="pointBreak";else if(e<a.from&&h>a.from&&h<a.to||e>a.from&&h>a.to&&h<a.from)f="pointInBreak";f&&v(g,f,{point:b,brk:a})})})})};p(f.seriesTypes.column.prototype,"drawPoints",u);p(f.Series.prototype,"drawPoints",u)})(h)});

View File

@ -0,0 +1,334 @@
/**
* @license Highcharts JS v5.0.2 (2016-10-26)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
'use strict';
var pick = H.pick,
wrap = H.wrap,
each = H.each,
extend = H.extend,
fireEvent = H.fireEvent,
Axis = H.Axis,
Series = H.Series;
function stripArguments() {
return Array.prototype.slice.call(arguments, 1);
}
extend(Axis.prototype, {
isInBreak: function(brk, val) {
var ret,
repeat = brk.repeat || Infinity,
from = brk.from,
length = brk.to - brk.from,
test = (val >= from ? (val - from) % repeat : repeat - ((from - val) % repeat));
if (!brk.inclusive) {
ret = test < length && test !== 0;
} else {
ret = test <= length;
}
return ret;
},
isInAnyBreak: function(val, testKeep) {
var breaks = this.options.breaks,
i = breaks && breaks.length,
inbrk,
keep,
ret;
if (i) {
while (i--) {
if (this.isInBreak(breaks[i], val)) {
inbrk = true;
if (!keep) {
keep = pick(breaks[i].showPoints, this.isXAxis ? false : true);
}
}
}
if (inbrk && testKeep) {
ret = inbrk && !keep;
} else {
ret = inbrk;
}
}
return ret;
}
});
wrap(Axis.prototype, 'setTickPositions', function(proceed) {
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
if (this.options.breaks) {
var axis = this,
tickPositions = this.tickPositions,
info = this.tickPositions.info,
newPositions = [],
i;
for (i = 0; i < tickPositions.length; i++) {
if (!axis.isInAnyBreak(tickPositions[i])) {
newPositions.push(tickPositions[i]);
}
}
this.tickPositions = newPositions;
this.tickPositions.info = info;
}
});
wrap(Axis.prototype, 'init', function(proceed, chart, userOptions) {
// Force Axis to be not-ordinal when breaks are defined
if (userOptions.breaks && userOptions.breaks.length) {
userOptions.ordinal = false;
}
proceed.call(this, chart, userOptions);
if (this.options.breaks) {
var axis = this;
axis.isBroken = true;
this.val2lin = function(val) {
var nval = val,
brk,
i;
for (i = 0; i < axis.breakArray.length; i++) {
brk = axis.breakArray[i];
if (brk.to <= val) {
nval -= brk.len;
} else if (brk.from >= val) {
break;
} else if (axis.isInBreak(brk, val)) {
nval -= (val - brk.from);
break;
}
}
return nval;
};
this.lin2val = function(val) {
var nval = val,
brk,
i;
for (i = 0; i < axis.breakArray.length; i++) {
brk = axis.breakArray[i];
if (brk.from >= nval) {
break;
} else if (brk.to < nval) {
nval += brk.len;
} else if (axis.isInBreak(brk, nval)) {
nval += brk.len;
}
}
return nval;
};
this.setExtremes = function(newMin, newMax, redraw, animation, eventArguments) {
// If trying to set extremes inside a break, extend it to before and after the break ( #3857 )
while (this.isInAnyBreak(newMin)) {
newMin -= this.closestPointRange;
}
while (this.isInAnyBreak(newMax)) {
newMax -= this.closestPointRange;
}
Axis.prototype.setExtremes.call(this, newMin, newMax, redraw, animation, eventArguments);
};
this.setAxisTranslation = function(saveOld) {
Axis.prototype.setAxisTranslation.call(this, saveOld);
var breaks = axis.options.breaks,
breakArrayT = [], // Temporary one
breakArray = [],
length = 0,
inBrk,
repeat,
brk,
min = axis.userMin || axis.min,
max = axis.userMax || axis.max,
start,
i,
j;
// Min & max check (#4247)
for (i in breaks) {
brk = breaks[i];
repeat = brk.repeat || Infinity;
if (axis.isInBreak(brk, min)) {
min += (brk.to % repeat) - (min % repeat);
}
if (axis.isInBreak(brk, max)) {
max -= (max % repeat) - (brk.from % repeat);
}
}
// Construct an array holding all breaks in the axis
for (i in breaks) {
brk = breaks[i];
start = brk.from;
repeat = brk.repeat || Infinity;
while (start - repeat > min) {
start -= repeat;
}
while (start < min) {
start += repeat;
}
for (j = start; j < max; j += repeat) {
breakArrayT.push({
value: j,
move: 'in'
});
breakArrayT.push({
value: j + (brk.to - brk.from),
move: 'out',
size: brk.breakSize
});
}
}
breakArrayT.sort(function(a, b) {
var ret;
if (a.value === b.value) {
ret = (a.move === 'in' ? 0 : 1) - (b.move === 'in' ? 0 : 1);
} else {
ret = a.value - b.value;
}
return ret;
});
// Simplify the breaks
inBrk = 0;
start = min;
for (i in breakArrayT) {
brk = breakArrayT[i];
inBrk += (brk.move === 'in' ? 1 : -1);
if (inBrk === 1 && brk.move === 'in') {
start = brk.value;
}
if (inBrk === 0) {
breakArray.push({
from: start,
to: brk.value,
len: brk.value - start - (brk.size || 0)
});
length += brk.value - start - (brk.size || 0);
}
}
axis.breakArray = breakArray;
fireEvent(axis, 'afterBreaks');
axis.transA *= ((max - axis.min) / (max - min - length));
axis.min = min;
axis.max = max;
};
}
});
wrap(Series.prototype, 'generatePoints', function(proceed) {
proceed.apply(this, stripArguments(arguments));
var series = this,
xAxis = series.xAxis,
yAxis = series.yAxis,
points = series.points,
point,
i = points.length,
connectNulls = series.options.connectNulls,
nullGap;
if (xAxis && yAxis && (xAxis.options.breaks || yAxis.options.breaks)) {
while (i--) {
point = points[i];
nullGap = point.y === null && connectNulls === false; // respect nulls inside the break (#4275)
if (!nullGap && (xAxis.isInAnyBreak(point.x, true) || yAxis.isInAnyBreak(point.y, true))) {
points.splice(i, 1);
if (this.data[i]) {
this.data[i].destroyElements(); // removes the graphics for this point if they exist
}
}
}
}
});
function drawPointsWrapped(proceed) {
proceed.apply(this);
this.drawBreaks(this.xAxis, ['x']);
this.drawBreaks(this.yAxis, pick(this.pointArrayMap, ['y']));
}
H.Series.prototype.drawBreaks = function(axis, keys) {
var series = this,
points = series.points,
breaks,
threshold,
eventName,
y;
each(keys, function(key) {
breaks = axis.breakArray || [];
threshold = axis.isXAxis ? axis.min : pick(series.options.threshold, axis.min);
each(points, function(point) {
y = pick(point['stack' + key.toUpperCase()], point[key]);
each(breaks, function(brk) {
eventName = false;
if ((threshold < brk.from && y > brk.to) || (threshold > brk.from && y < brk.from)) {
eventName = 'pointBreak';
} else if ((threshold < brk.from && y > brk.from && y < brk.to) || (threshold > brk.from && y > brk.to && y < brk.from)) { // point falls inside the break
eventName = 'pointInBreak';
}
if (eventName) {
fireEvent(axis, eventName, {
point: point,
brk: brk
});
}
});
});
});
};
wrap(H.seriesTypes.column.prototype, 'drawPoints', drawPointsWrapped);
wrap(H.Series.prototype, 'drawPoints', drawPointsWrapped);
}(Highcharts));
}));

View File

@ -0,0 +1,26 @@
/*
Highcharts JS v5.0.2 (2016-10-26)
Data module
(c) 2012-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(p){"object"===typeof module&&module.exports?module.exports=p:p(Highcharts)})(function(p){(function(g){var p=g.win.document,m=g.each,z=g.pick,w=g.inArray,x=g.isNumber,A=g.splat,n,u=function(b,a){this.init(b,a)};g.extend(u.prototype,{init:function(b,a){this.options=b;this.chartOptions=a;this.columns=b.columns||this.rowsToColumns(b.rows)||[];this.firstRowAsNames=z(b.firstRowAsNames,!0);this.decimalRegex=b.decimalPoint&&new RegExp("^(-?[0-9]+)"+b.decimalPoint+"([0-9]+)$");this.rawColumns=[];
this.columns.length?this.dataFound():(this.parseCSV(),this.parseTable(),this.parseGoogleSpreadsheet())},getColumnDistribution:function(){var b=this.chartOptions,a=this.options,d=[],f=function(b){return(g.seriesTypes[b||"line"].prototype.pointArrayMap||[0]).length},e=b&&b.chart&&b.chart.type,c=[],k=[],t=0,h;m(b&&b.series||[],function(b){c.push(f(b.type||e))});m(a&&a.seriesMapping||[],function(b){d.push(b.x||0)});0===d.length&&d.push(0);m(a&&a.seriesMapping||[],function(a){var d=new n,r,v=c[t]||f(e),
q=g.seriesTypes[((b&&b.series||[])[t]||{}).type||e||"line"].prototype.pointArrayMap||["y"];d.addColumnReader(a.x,"x");for(r in a)a.hasOwnProperty(r)&&"x"!==r&&d.addColumnReader(a[r],r);for(h=0;h<v;h++)d.hasReader(q[h])||d.addColumnReader(void 0,q[h]);k.push(d);t++});a=g.seriesTypes[e||"line"].prototype.pointArrayMap;void 0===a&&(a=["y"]);this.valueCount={global:f(e),xColumns:d,individual:c,seriesBuilders:k,globalPointArrayMap:a}},dataFound:function(){this.options.switchRowsAndColumns&&(this.columns=
this.rowsToColumns(this.columns));this.getColumnDistribution();this.parseTypes();!1!==this.parsed()&&this.complete()},parseCSV:function(){var b=this,a=this.options,d=a.csv,f=this.columns,e=a.startRow||0,c=a.endRow||Number.MAX_VALUE,k=a.startColumn||0,t=a.endColumn||Number.MAX_VALUE,h,g,y=0;d&&(g=d.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split(a.lineDelimiter||"\n"),h=a.itemDelimiter||(-1!==d.indexOf("\t")?"\t":","),m(g,function(a,d){var g=b.trim(a),r=0===g.indexOf("#");d>=e&&d<=c&&!r&&""!==g&&(a=
a.split(h),m(a,function(b,a){a>=k&&a<=t&&(f[a-k]||(f[a-k]=[]),f[a-k][y]=b)}),y+=1)}),this.dataFound())},parseTable:function(){var b=this.options,a=b.table,d=this.columns,f=b.startRow||0,e=b.endRow||Number.MAX_VALUE,c=b.startColumn||0,k=b.endColumn||Number.MAX_VALUE;a&&("string"===typeof a&&(a=p.getElementById(a)),m(a.getElementsByTagName("tr"),function(b,a){a>=f&&a<=e&&m(b.children,function(b,e){("TD"===b.tagName||"TH"===b.tagName)&&e>=c&&e<=k&&(d[e-c]||(d[e-c]=[]),d[e-c][a-f]=b.innerHTML)})}),this.dataFound())},
parseGoogleSpreadsheet:function(){var b=this,a=this.options,d=a.googleSpreadsheetKey,f=this.columns,e=a.startRow||0,c=a.endRow||Number.MAX_VALUE,k=a.startColumn||0,g=a.endColumn||Number.MAX_VALUE,h,v;d&&jQuery.ajax({dataType:"json",url:"https://spreadsheets.google.com/feeds/cells/"+d+"/"+(a.googleSpreadsheetWorksheet||"od6")+"/public/values?alt\x3djson-in-script\x26callback\x3d?",error:a.error,success:function(a){a=a.feed.entry;var d,t=a.length,q=0,n=0,l;for(l=0;l<t;l++)d=a[l],q=Math.max(q,d.gs$cell.col),
n=Math.max(n,d.gs$cell.row);for(l=0;l<q;l++)l>=k&&l<=g&&(f[l-k]=[],f[l-k].length=Math.min(n,c-e));for(l=0;l<t;l++)d=a[l],h=d.gs$cell.row-1,v=d.gs$cell.col-1,v>=k&&v<=g&&h>=e&&h<=c&&(f[v-k][h-e]=d.content.$t);m(f,function(a){for(l=0;l<a.length;l++)void 0===a[l]&&(a[l]=null)});b.dataFound()}})},trim:function(b,a){"string"===typeof b&&(b=b.replace(/^\s+|\s+$/g,""),a&&/^[0-9\s]+$/.test(b)&&(b=b.replace(/\s/g,"")),this.decimalRegex&&(b=b.replace(this.decimalRegex,"$1.$2")));return b},parseTypes:function(){for(var b=
this.columns,a=b.length;a--;)this.parseColumn(b[a],a)},parseColumn:function(b,a){var d=this.rawColumns,f=this.columns,e=b.length,c,k,g,h,n=this.firstRowAsNames,m=-1!==w(a,this.valueCount.xColumns),r=[],p=this.chartOptions,q,u=(this.options.columnTypes||[])[a],p=m&&(p&&p.xAxis&&"category"===A(p.xAxis)[0].type||"string"===u);for(d[a]||(d[a]=[]);e--;)c=r[e]||b[e],g=this.trim(c),h=this.trim(c,!0),k=parseFloat(h),void 0===d[a][e]&&(d[a][e]=g),p||0===e&&n?b[e]=g:+h===k?(b[e]=k,31536E6<k&&"float"!==u?b.isDatetime=
!0:b.isNumeric=!0,void 0!==b[e+1]&&(q=k>b[e+1])):(k=this.parseDate(c),m&&x(k)&&"float"!==u?(r[e]=c,b[e]=k,b.isDatetime=!0,void 0!==b[e+1]&&(c=k>b[e+1],c!==q&&void 0!==q&&(this.alternativeFormat?(this.dateFormat=this.alternativeFormat,e=b.length,this.alternativeFormat=this.dateFormats[this.dateFormat].alternative):b.unsorted=!0),q=c)):(b[e]=""===g?null:g,0!==e&&(b.isDatetime||b.isNumeric)&&(b.mixed=!0)));m&&b.mixed&&(f[a]=d[a]);if(m&&q&&this.options.sort)for(a=0;a<f.length;a++)f[a].reverse(),n&&f[a].unshift(f[a].pop())},
dateFormats:{"YYYY-mm-dd":{regex:/^([0-9]{4})[\-\/\.]([0-9]{2})[\-\/\.]([0-9]{2})$/,parser:function(b){return Date.UTC(+b[1],b[2]-1,+b[3])}},"dd/mm/YYYY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/,parser:function(b){return Date.UTC(+b[3],b[2]-1,+b[1])},alternative:"mm/dd/YYYY"},"mm/dd/YYYY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/,parser:function(b){return Date.UTC(+b[3],b[1]-1,+b[2])}},"dd/mm/YY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/,
parser:function(b){return Date.UTC(+b[3]+2E3,b[2]-1,+b[1])},alternative:"mm/dd/YY"},"mm/dd/YY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/,parser:function(b){return Date.UTC(+b[3]+2E3,b[1]-1,+b[2])}}},parseDate:function(b){var a=this.options.parseDate,d,f,e=this.options.dateFormat||this.dateFormat,c;if(a)d=a(b);else if("string"===typeof b){if(e)a=this.dateFormats[e],(c=b.match(a.regex))&&(d=a.parser(c));else for(f in this.dateFormats)if(a=this.dateFormats[f],c=b.match(a.regex)){this.dateFormat=
f;this.alternativeFormat=a.alternative;d=a.parser(c);break}c||(c=Date.parse(b),"object"===typeof c&&null!==c&&c.getTime?d=c.getTime()-6E4*c.getTimezoneOffset():x(c)&&(d=c-6E4*(new Date(c)).getTimezoneOffset()))}return d},rowsToColumns:function(b){var a,d,f,e,c;if(b)for(c=[],d=b.length,a=0;a<d;a++)for(e=b[a].length,f=0;f<e;f++)c[f]||(c[f]=[]),c[f][a]=b[a][f];return c},parsed:function(){if(this.options.parsed)return this.options.parsed.call(this,this.columns)},getFreeIndexes:function(b,a){var d,f=[],
e=[],c;for(d=0;d<b;d+=1)f.push(!0);for(b=0;b<a.length;b+=1)for(c=a[b].getReferencedColumnIndexes(),d=0;d<c.length;d+=1)f[c[d]]=!1;for(d=0;d<f.length;d+=1)f[d]&&e.push(d);return e},complete:function(){var b=this.columns,a,d=this.options,f,e,c,k,g=[],h;if(d.complete||d.afterComplete){for(c=0;c<b.length;c++)this.firstRowAsNames&&(b[c].name=b[c].shift());f=[];e=this.getFreeIndexes(b.length,this.valueCount.seriesBuilders);for(c=0;c<this.valueCount.seriesBuilders.length;c++)h=this.valueCount.seriesBuilders[c],
h.populateColumns(e)&&g.push(h);for(;0<e.length;){h=new n;h.addColumnReader(0,"x");c=w(0,e);-1!==c&&e.splice(c,1);for(c=0;c<this.valueCount.global;c++)h.addColumnReader(void 0,this.valueCount.globalPointArrayMap[c]);h.populateColumns(e)&&g.push(h)}0<g.length&&0<g[0].readers.length&&(h=b[g[0].readers[0].columnIndex],void 0!==h&&(h.isDatetime?a="datetime":h.isNumeric||(a="category")));if("category"===a)for(c=0;c<g.length;c++)for(h=g[c],e=0;e<h.readers.length;e++)"x"===h.readers[e].configName&&(h.readers[e].configName=
"name");for(c=0;c<g.length;c++){h=g[c];e=[];for(k=0;k<b[0].length;k++)e[k]=h.read(b,k);f[c]={data:e};h.name&&(f[c].name=h.name);"category"===a&&(f[c].turboThreshold=0)}b={series:f};a&&(b.xAxis={type:a},"category"===a&&(b.xAxis.uniqueNames=!1));d.complete&&d.complete(b);d.afterComplete&&d.afterComplete(b)}}});g.Data=u;g.data=function(b,a){return new u(b,a)};g.wrap(g.Chart.prototype,"init",function(b,a,d){var f=this;a&&a.data?g.data(g.extend(a.data,{afterComplete:function(e){var c,k;if(a.hasOwnProperty("series"))if("object"===
typeof a.series)for(c=Math.max(a.series.length,e.series.length);c--;)k=a.series[c]||{},a.series[c]=g.merge(k,e.series[c]);else delete a.series;a=g.merge(e,a);b.call(f,a,d)}}),a):b.call(f,a,d)});n=function(){this.readers=[];this.pointIsArray=!0};n.prototype.populateColumns=function(b){var a=!0;m(this.readers,function(a){void 0===a.columnIndex&&(a.columnIndex=b.shift())});m(this.readers,function(b){void 0===b.columnIndex&&(a=!1)});return a};n.prototype.read=function(b,a){var d=this.pointIsArray,f=d?
[]:{},e;m(this.readers,function(c){var e=b[c.columnIndex][a];d?f.push(e):f[c.configName]=e});void 0===this.name&&2<=this.readers.length&&(e=this.getReferencedColumnIndexes(),2<=e.length&&(e.shift(),e.sort(),this.name=b[e.shift()].name));return f};n.prototype.addColumnReader=function(b,a){this.readers.push({columnIndex:b,configName:a});"x"!==a&&"y"!==a&&void 0!==a&&(this.pointIsArray=!1)};n.prototype.getReferencedColumnIndexes=function(){var b,a=[],d;for(b=0;b<this.readers.length;b+=1)d=this.readers[b],
void 0!==d.columnIndex&&a.push(d.columnIndex);return a};n.prototype.hasReader=function(b){var a,d;for(a=0;a<this.readers.length;a+=1)if(d=this.readers[a],d.configName===b)return!0}})(p)});

View File

@ -0,0 +1,981 @@
/**
* @license Highcharts JS v5.0.2 (2016-10-26)
* Data module
*
* (c) 2012-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* Data module
*
* (c) 2012-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
/* global jQuery */
'use strict';
// Utilities
var win = Highcharts.win,
doc = win.document,
each = Highcharts.each,
pick = Highcharts.pick,
inArray = Highcharts.inArray,
isNumber = Highcharts.isNumber,
splat = Highcharts.splat,
SeriesBuilder;
// The Data constructor
var Data = function(dataOptions, chartOptions) {
this.init(dataOptions, chartOptions);
};
// Set the prototype properties
Highcharts.extend(Data.prototype, {
/**
* Initialize the Data object with the given options
*/
init: function(options, chartOptions) {
this.options = options;
this.chartOptions = chartOptions;
this.columns = options.columns || this.rowsToColumns(options.rows) || [];
this.firstRowAsNames = pick(options.firstRowAsNames, true);
this.decimalRegex = options.decimalPoint && new RegExp('^(-?[0-9]+)' + options.decimalPoint + '([0-9]+)$');
// This is a two-dimensional array holding the raw, trimmed string values
// with the same organisation as the columns array. It makes it possible
// for example to revert from interpreted timestamps to string-based
// categories.
this.rawColumns = [];
// No need to parse or interpret anything
if (this.columns.length) {
this.dataFound();
// Parse and interpret
} else {
// Parse a CSV string if options.csv is given
this.parseCSV();
// Parse a HTML table if options.table is given
this.parseTable();
// Parse a Google Spreadsheet
this.parseGoogleSpreadsheet();
}
},
/**
* Get the column distribution. For example, a line series takes a single column for
* Y values. A range series takes two columns for low and high values respectively,
* and an OHLC series takes four columns.
*/
getColumnDistribution: function() {
var chartOptions = this.chartOptions,
options = this.options,
xColumns = [],
getValueCount = function(type) {
return (Highcharts.seriesTypes[type || 'line'].prototype.pointArrayMap || [0]).length;
},
getPointArrayMap = function(type) {
return Highcharts.seriesTypes[type || 'line'].prototype.pointArrayMap;
},
globalType = chartOptions && chartOptions.chart && chartOptions.chart.type,
individualCounts = [],
seriesBuilders = [],
seriesIndex = 0,
i;
each((chartOptions && chartOptions.series) || [], function(series) {
individualCounts.push(getValueCount(series.type || globalType));
});
// Collect the x-column indexes from seriesMapping
each((options && options.seriesMapping) || [], function(mapping) {
xColumns.push(mapping.x || 0);
});
// If there are no defined series with x-columns, use the first column as x column
if (xColumns.length === 0) {
xColumns.push(0);
}
// Loop all seriesMappings and constructs SeriesBuilders from
// the mapping options.
each((options && options.seriesMapping) || [], function(mapping) {
var builder = new SeriesBuilder(),
name,
numberOfValueColumnsNeeded = individualCounts[seriesIndex] || getValueCount(globalType),
seriesArr = (chartOptions && chartOptions.series) || [],
series = seriesArr[seriesIndex] || {},
pointArrayMap = getPointArrayMap(series.type || globalType) || ['y'];
// Add an x reader from the x property or from an undefined column
// if the property is not set. It will then be auto populated later.
builder.addColumnReader(mapping.x, 'x');
// Add all column mappings
for (name in mapping) {
if (mapping.hasOwnProperty(name) && name !== 'x') {
builder.addColumnReader(mapping[name], name);
}
}
// Add missing columns
for (i = 0; i < numberOfValueColumnsNeeded; i++) {
if (!builder.hasReader(pointArrayMap[i])) {
//builder.addNextColumnReader(pointArrayMap[i]);
// Create and add a column reader for the next free column index
builder.addColumnReader(undefined, pointArrayMap[i]);
}
}
seriesBuilders.push(builder);
seriesIndex++;
});
var globalPointArrayMap = getPointArrayMap(globalType);
if (globalPointArrayMap === undefined) {
globalPointArrayMap = ['y'];
}
this.valueCount = {
global: getValueCount(globalType),
xColumns: xColumns,
individual: individualCounts,
seriesBuilders: seriesBuilders,
globalPointArrayMap: globalPointArrayMap
};
},
/**
* When the data is parsed into columns, either by CSV, table, GS or direct input,
* continue with other operations.
*/
dataFound: function() {
if (this.options.switchRowsAndColumns) {
this.columns = this.rowsToColumns(this.columns);
}
// Interpret the info about series and columns
this.getColumnDistribution();
// Interpret the values into right types
this.parseTypes();
// Handle columns if a handleColumns callback is given
if (this.parsed() !== false) {
// Complete if a complete callback is given
this.complete();
}
},
/**
* Parse a CSV input string
*/
parseCSV: function() {
var self = this,
options = this.options,
csv = options.csv,
columns = this.columns,
startRow = options.startRow || 0,
endRow = options.endRow || Number.MAX_VALUE,
startColumn = options.startColumn || 0,
endColumn = options.endColumn || Number.MAX_VALUE,
itemDelimiter,
lines,
activeRowNo = 0;
if (csv) {
lines = csv
.replace(/\r\n/g, '\n') // Unix
.replace(/\r/g, '\n') // Mac
.split(options.lineDelimiter || '\n');
itemDelimiter = options.itemDelimiter || (csv.indexOf('\t') !== -1 ? '\t' : ',');
each(lines, function(line, rowNo) {
var trimmed = self.trim(line),
isComment = trimmed.indexOf('#') === 0,
isBlank = trimmed === '',
items;
if (rowNo >= startRow && rowNo <= endRow && !isComment && !isBlank) {
items = line.split(itemDelimiter);
each(items, function(item, colNo) {
if (colNo >= startColumn && colNo <= endColumn) {
if (!columns[colNo - startColumn]) {
columns[colNo - startColumn] = [];
}
columns[colNo - startColumn][activeRowNo] = item;
}
});
activeRowNo += 1;
}
});
this.dataFound();
}
},
/**
* Parse a HTML table
*/
parseTable: function() {
var options = this.options,
table = options.table,
columns = this.columns,
startRow = options.startRow || 0,
endRow = options.endRow || Number.MAX_VALUE,
startColumn = options.startColumn || 0,
endColumn = options.endColumn || Number.MAX_VALUE;
if (table) {
if (typeof table === 'string') {
table = doc.getElementById(table);
}
each(table.getElementsByTagName('tr'), function(tr, rowNo) {
if (rowNo >= startRow && rowNo <= endRow) {
each(tr.children, function(item, colNo) {
if ((item.tagName === 'TD' || item.tagName === 'TH') && colNo >= startColumn && colNo <= endColumn) {
if (!columns[colNo - startColumn]) {
columns[colNo - startColumn] = [];
}
columns[colNo - startColumn][rowNo - startRow] = item.innerHTML;
}
});
}
});
this.dataFound(); // continue
}
},
/**
*/
parseGoogleSpreadsheet: function() {
var self = this,
options = this.options,
googleSpreadsheetKey = options.googleSpreadsheetKey,
columns = this.columns,
startRow = options.startRow || 0,
endRow = options.endRow || Number.MAX_VALUE,
startColumn = options.startColumn || 0,
endColumn = options.endColumn || Number.MAX_VALUE,
gr, // google row
gc; // google column
if (googleSpreadsheetKey) {
jQuery.ajax({
dataType: 'json',
url: 'https://spreadsheets.google.com/feeds/cells/' +
googleSpreadsheetKey + '/' + (options.googleSpreadsheetWorksheet || 'od6') +
'/public/values?alt=json-in-script&callback=?',
error: options.error,
success: function(json) {
// Prepare the data from the spreadsheat
var cells = json.feed.entry,
cell,
cellCount = cells.length,
colCount = 0,
rowCount = 0,
i;
// First, find the total number of columns and rows that
// are actually filled with data
for (i = 0; i < cellCount; i++) {
cell = cells[i];
colCount = Math.max(colCount, cell.gs$cell.col);
rowCount = Math.max(rowCount, cell.gs$cell.row);
}
// Set up arrays containing the column data
for (i = 0; i < colCount; i++) {
if (i >= startColumn && i <= endColumn) {
// Create new columns with the length of either end-start or rowCount
columns[i - startColumn] = [];
// Setting the length to avoid jslint warning
columns[i - startColumn].length = Math.min(rowCount, endRow - startRow);
}
}
// Loop over the cells and assign the value to the right
// place in the column arrays
for (i = 0; i < cellCount; i++) {
cell = cells[i];
gr = cell.gs$cell.row - 1; // rows start at 1
gc = cell.gs$cell.col - 1; // columns start at 1
// If both row and col falls inside start and end
// set the transposed cell value in the newly created columns
if (gc >= startColumn && gc <= endColumn &&
gr >= startRow && gr <= endRow) {
columns[gc - startColumn][gr - startRow] = cell.content.$t;
}
}
// Insert null for empty spreadsheet cells (#5298)
each(columns, function(column) {
for (i = 0; i < column.length; i++) {
if (column[i] === undefined) {
column[i] = null;
}
}
});
self.dataFound();
}
});
}
},
/**
* Trim a string from whitespace
*/
trim: function(str, inside) {
if (typeof str === 'string') {
str = str.replace(/^\s+|\s+$/g, '');
// Clear white space insdie the string, like thousands separators
if (inside && /^[0-9\s]+$/.test(str)) {
str = str.replace(/\s/g, '');
}
if (this.decimalRegex) {
str = str.replace(this.decimalRegex, '$1.$2');
}
}
return str;
},
/**
* Parse numeric cells in to number types and date types in to true dates.
*/
parseTypes: function() {
var columns = this.columns,
col = columns.length;
while (col--) {
this.parseColumn(columns[col], col);
}
},
/**
* Parse a single column. Set properties like .isDatetime and .isNumeric.
*/
parseColumn: function(column, col) {
var rawColumns = this.rawColumns,
columns = this.columns,
row = column.length,
val,
floatVal,
trimVal,
trimInsideVal,
firstRowAsNames = this.firstRowAsNames,
isXColumn = inArray(col, this.valueCount.xColumns) !== -1,
dateVal,
backup = [],
diff,
chartOptions = this.chartOptions,
descending,
columnTypes = this.options.columnTypes || [],
columnType = columnTypes[col],
forceCategory = isXColumn && ((chartOptions && chartOptions.xAxis && splat(chartOptions.xAxis)[0].type === 'category') || columnType === 'string');
if (!rawColumns[col]) {
rawColumns[col] = [];
}
while (row--) {
val = backup[row] || column[row];
trimVal = this.trim(val);
trimInsideVal = this.trim(val, true);
floatVal = parseFloat(trimInsideVal);
// Set it the first time
if (rawColumns[col][row] === undefined) {
rawColumns[col][row] = trimVal;
}
// Disable number or date parsing by setting the X axis type to category
if (forceCategory || (row === 0 && firstRowAsNames)) {
column[row] = trimVal;
} else if (+trimInsideVal === floatVal) { // is numeric
column[row] = floatVal;
// If the number is greater than milliseconds in a year, assume datetime
if (floatVal > 365 * 24 * 3600 * 1000 && columnType !== 'float') {
column.isDatetime = true;
} else {
column.isNumeric = true;
}
if (column[row + 1] !== undefined) {
descending = floatVal > column[row + 1];
}
// String, continue to determine if it is a date string or really a string
} else {
dateVal = this.parseDate(val);
// Only allow parsing of dates if this column is an x-column
if (isXColumn && isNumber(dateVal) && columnType !== 'float') { // is date
backup[row] = val;
column[row] = dateVal;
column.isDatetime = true;
// Check if the dates are uniformly descending or ascending. If they
// are not, chances are that they are a different time format, so check
// for alternative.
if (column[row + 1] !== undefined) {
diff = dateVal > column[row + 1];
if (diff !== descending && descending !== undefined) {
if (this.alternativeFormat) {
this.dateFormat = this.alternativeFormat;
row = column.length;
this.alternativeFormat = this.dateFormats[this.dateFormat].alternative;
} else {
column.unsorted = true;
}
}
descending = diff;
}
} else { // string
column[row] = trimVal === '' ? null : trimVal;
if (row !== 0 && (column.isDatetime || column.isNumeric)) {
column.mixed = true;
}
}
}
}
// If strings are intermixed with numbers or dates in a parsed column, it is an indication
// that parsing went wrong or the data was not intended to display as numbers or dates and
// parsing is too aggressive. Fall back to categories. Demonstrated in the
// highcharts/demo/column-drilldown sample.
if (isXColumn && column.mixed) {
columns[col] = rawColumns[col];
}
// If the 0 column is date or number and descending, reverse all columns.
if (isXColumn && descending && this.options.sort) {
for (col = 0; col < columns.length; col++) {
columns[col].reverse();
if (firstRowAsNames) {
columns[col].unshift(columns[col].pop());
}
}
}
},
/**
* A collection of available date formats, extendable from the outside to support
* custom date formats.
*/
dateFormats: {
'YYYY-mm-dd': {
regex: /^([0-9]{4})[\-\/\.]([0-9]{2})[\-\/\.]([0-9]{2})$/,
parser: function(match) {
return Date.UTC(+match[1], match[2] - 1, +match[3]);
}
},
'dd/mm/YYYY': {
regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/,
parser: function(match) {
return Date.UTC(+match[3], match[2] - 1, +match[1]);
},
alternative: 'mm/dd/YYYY' // different format with the same regex
},
'mm/dd/YYYY': {
regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/,
parser: function(match) {
return Date.UTC(+match[3], match[1] - 1, +match[2]);
}
},
'dd/mm/YY': {
regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/,
parser: function(match) {
return Date.UTC(+match[3] + 2000, match[2] - 1, +match[1]);
},
alternative: 'mm/dd/YY' // different format with the same regex
},
'mm/dd/YY': {
regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/,
parser: function(match) {
return Date.UTC(+match[3] + 2000, match[1] - 1, +match[2]);
}
}
},
/**
* Parse a date and return it as a number. Overridable through options.parseDate.
*/
parseDate: function(val) {
var parseDate = this.options.parseDate,
ret,
key,
format,
dateFormat = this.options.dateFormat || this.dateFormat,
match;
if (parseDate) {
ret = parseDate(val);
} else if (typeof val === 'string') {
// Auto-detect the date format the first time
if (!dateFormat) {
for (key in this.dateFormats) {
format = this.dateFormats[key];
match = val.match(format.regex);
if (match) {
this.dateFormat = dateFormat = key;
this.alternativeFormat = format.alternative;
ret = format.parser(match);
break;
}
}
// Next time, use the one previously found
} else {
format = this.dateFormats[dateFormat];
match = val.match(format.regex);
if (match) {
ret = format.parser(match);
}
}
// Fall back to Date.parse
if (!match) {
match = Date.parse(val);
// External tools like Date.js and MooTools extend Date object and
// returns a date.
if (typeof match === 'object' && match !== null && match.getTime) {
ret = match.getTime() - match.getTimezoneOffset() * 60000;
// Timestamp
} else if (isNumber(match)) {
ret = match - (new Date(match)).getTimezoneOffset() * 60000;
}
}
}
return ret;
},
/**
* Reorganize rows into columns
*/
rowsToColumns: function(rows) {
var row,
rowsLength,
col,
colsLength,
columns;
if (rows) {
columns = [];
rowsLength = rows.length;
for (row = 0; row < rowsLength; row++) {
colsLength = rows[row].length;
for (col = 0; col < colsLength; col++) {
if (!columns[col]) {
columns[col] = [];
}
columns[col][row] = rows[row][col];
}
}
}
return columns;
},
/**
* A hook for working directly on the parsed columns
*/
parsed: function() {
if (this.options.parsed) {
return this.options.parsed.call(this, this.columns);
}
},
getFreeIndexes: function(numberOfColumns, seriesBuilders) {
var s,
i,
freeIndexes = [],
freeIndexValues = [],
referencedIndexes;
// Add all columns as free
for (i = 0; i < numberOfColumns; i = i + 1) {
freeIndexes.push(true);
}
// Loop all defined builders and remove their referenced columns
for (s = 0; s < seriesBuilders.length; s = s + 1) {
referencedIndexes = seriesBuilders[s].getReferencedColumnIndexes();
for (i = 0; i < referencedIndexes.length; i = i + 1) {
freeIndexes[referencedIndexes[i]] = false;
}
}
// Collect the values for the free indexes
for (i = 0; i < freeIndexes.length; i = i + 1) {
if (freeIndexes[i]) {
freeIndexValues.push(i);
}
}
return freeIndexValues;
},
/**
* If a complete callback function is provided in the options, interpret the
* columns into a Highcharts options object.
*/
complete: function() {
var columns = this.columns,
xColumns = [],
type,
options = this.options,
series,
data,
i,
j,
r,
seriesIndex,
chartOptions,
allSeriesBuilders = [],
builder,
freeIndexes,
typeCol,
index;
xColumns.length = columns.length;
if (options.complete || options.afterComplete) {
// Get the names and shift the top row
for (i = 0; i < columns.length; i++) {
if (this.firstRowAsNames) {
columns[i].name = columns[i].shift();
}
}
// Use the next columns for series
series = [];
freeIndexes = this.getFreeIndexes(columns.length, this.valueCount.seriesBuilders);
// Populate defined series
for (seriesIndex = 0; seriesIndex < this.valueCount.seriesBuilders.length; seriesIndex++) {
builder = this.valueCount.seriesBuilders[seriesIndex];
// If the builder can be populated with remaining columns, then add it to allBuilders
if (builder.populateColumns(freeIndexes)) {
allSeriesBuilders.push(builder);
}
}
// Populate dynamic series
while (freeIndexes.length > 0) {
builder = new SeriesBuilder();
builder.addColumnReader(0, 'x');
// Mark index as used (not free)
index = inArray(0, freeIndexes);
if (index !== -1) {
freeIndexes.splice(index, 1);
}
for (i = 0; i < this.valueCount.global; i++) {
// Create and add a column reader for the next free column index
builder.addColumnReader(undefined, this.valueCount.globalPointArrayMap[i]);
}
// If the builder can be populated with remaining columns, then add it to allBuilders
if (builder.populateColumns(freeIndexes)) {
allSeriesBuilders.push(builder);
}
}
// Get the data-type from the first series x column
if (allSeriesBuilders.length > 0 && allSeriesBuilders[0].readers.length > 0) {
typeCol = columns[allSeriesBuilders[0].readers[0].columnIndex];
if (typeCol !== undefined) {
if (typeCol.isDatetime) {
type = 'datetime';
} else if (!typeCol.isNumeric) {
type = 'category';
}
}
}
// Axis type is category, then the "x" column should be called "name"
if (type === 'category') {
for (seriesIndex = 0; seriesIndex < allSeriesBuilders.length; seriesIndex++) {
builder = allSeriesBuilders[seriesIndex];
for (r = 0; r < builder.readers.length; r++) {
if (builder.readers[r].configName === 'x') {
builder.readers[r].configName = 'name';
}
}
}
}
// Read data for all builders
for (seriesIndex = 0; seriesIndex < allSeriesBuilders.length; seriesIndex++) {
builder = allSeriesBuilders[seriesIndex];
// Iterate down the cells of each column and add data to the series
data = [];
for (j = 0; j < columns[0].length; j++) {
data[j] = builder.read(columns, j);
}
// Add the series
series[seriesIndex] = {
data: data
};
if (builder.name) {
series[seriesIndex].name = builder.name;
}
if (type === 'category') {
series[seriesIndex].turboThreshold = 0;
}
}
// Do the callback
chartOptions = {
series: series
};
if (type) {
chartOptions.xAxis = {
type: type
};
if (type === 'category') {
chartOptions.xAxis.uniqueNames = false;
}
}
if (options.complete) {
options.complete(chartOptions);
}
// The afterComplete hook is used internally to avoid conflict with the externally
// available complete option.
if (options.afterComplete) {
options.afterComplete(chartOptions);
}
}
}
});
// Register the Data prototype and data function on Highcharts
Highcharts.Data = Data;
Highcharts.data = function(options, chartOptions) {
return new Data(options, chartOptions);
};
// Extend Chart.init so that the Chart constructor accepts a new configuration
// option group, data.
Highcharts.wrap(Highcharts.Chart.prototype, 'init', function(proceed, userOptions, callback) {
var chart = this;
if (userOptions && userOptions.data) {
Highcharts.data(Highcharts.extend(userOptions.data, {
afterComplete: function(dataOptions) {
var i, series;
// Merge series configs
if (userOptions.hasOwnProperty('series')) {
if (typeof userOptions.series === 'object') {
i = Math.max(userOptions.series.length, dataOptions.series.length);
while (i--) {
series = userOptions.series[i] || {};
userOptions.series[i] = Highcharts.merge(series, dataOptions.series[i]);
}
} else { // Allow merging in dataOptions.series (#2856)
delete userOptions.series;
}
}
// Do the merge
userOptions = Highcharts.merge(dataOptions, userOptions);
proceed.call(chart, userOptions, callback);
}
}), userOptions);
} else {
proceed.call(chart, userOptions, callback);
}
});
/**
* Creates a new SeriesBuilder. A SeriesBuilder consists of a number
* of ColumnReaders that reads columns and give them a name.
* Ex: A series builder can be constructed to read column 3 as 'x' and
* column 7 and 8 as 'y1' and 'y2'.
* The output would then be points/rows of the form {x: 11, y1: 22, y2: 33}
*
* The name of the builder is taken from the second column. In the above
* example it would be the column with index 7.
* @constructor
*/
SeriesBuilder = function() {
this.readers = [];
this.pointIsArray = true;
};
/**
* Populates readers with column indexes. A reader can be added without
* a specific index and for those readers the index is taken sequentially
* from the free columns (this is handled by the ColumnCursor instance).
* @returns {boolean}
*/
SeriesBuilder.prototype.populateColumns = function(freeIndexes) {
var builder = this,
enoughColumns = true;
// Loop each reader and give it an index if its missing.
// The freeIndexes.shift() will return undefined if there
// are no more columns.
each(builder.readers, function(reader) {
if (reader.columnIndex === undefined) {
reader.columnIndex = freeIndexes.shift();
}
});
// Now, all readers should have columns mapped. If not
// then return false to signal that this series should
// not be added.
each(builder.readers, function(reader) {
if (reader.columnIndex === undefined) {
enoughColumns = false;
}
});
return enoughColumns;
};
/**
* Reads a row from the dataset and returns a point or array depending
* on the names of the readers.
* @param columns
* @param rowIndex
* @returns {Array | Object}
*/
SeriesBuilder.prototype.read = function(columns, rowIndex) {
var builder = this,
pointIsArray = builder.pointIsArray,
point = pointIsArray ? [] : {},
columnIndexes;
// Loop each reader and ask it to read its value.
// Then, build an array or point based on the readers names.
each(builder.readers, function(reader) {
var value = columns[reader.columnIndex][rowIndex];
if (pointIsArray) {
point.push(value);
} else {
point[reader.configName] = value;
}
});
// The name comes from the first column (excluding the x column)
if (this.name === undefined && builder.readers.length >= 2) {
columnIndexes = builder.getReferencedColumnIndexes();
if (columnIndexes.length >= 2) {
// remove the first one (x col)
columnIndexes.shift();
// Sort the remaining
columnIndexes.sort();
// Now use the lowest index as name column
this.name = columns[columnIndexes.shift()].name;
}
}
return point;
};
/**
* Creates and adds ColumnReader from the given columnIndex and configName.
* ColumnIndex can be undefined and in that case the reader will be given
* an index when columns are populated.
* @param columnIndex {Number | undefined}
* @param configName
*/
SeriesBuilder.prototype.addColumnReader = function(columnIndex, configName) {
this.readers.push({
columnIndex: columnIndex,
configName: configName
});
if (!(configName === 'x' || configName === 'y' || configName === undefined)) {
this.pointIsArray = false;
}
};
/**
* Returns an array of column indexes that the builder will use when
* reading data.
* @returns {Array}
*/
SeriesBuilder.prototype.getReferencedColumnIndexes = function() {
var i,
referencedColumnIndexes = [],
columnReader;
for (i = 0; i < this.readers.length; i = i + 1) {
columnReader = this.readers[i];
if (columnReader.columnIndex !== undefined) {
referencedColumnIndexes.push(columnReader.columnIndex);
}
}
return referencedColumnIndexes;
};
/**
* Returns true if the builder has a reader for the given configName.
* @param configName
* @returns {boolean}
*/
SeriesBuilder.prototype.hasReader = function(configName) {
var i, columnReader;
for (i = 0; i < this.readers.length; i = i + 1) {
columnReader = this.readers[i];
if (columnReader.configName === configName) {
return true;
}
}
// Else return undefined
};
}(Highcharts));
}));

View File

@ -0,0 +1,25 @@
/*
Highcharts JS v5.0.2 (2016-10-26)
Highcharts Drilldown module
Author: Torstein Honsi
License: www.highcharts.com/license
*/
(function(n){"object"===typeof module&&module.exports?module.exports=n:n(Highcharts)})(function(n){(function(f){function n(a,b,d){var c;b.rgba.length&&a.rgba.length?(a=a.rgba,b=b.rgba,c=1!==b[3]||1!==a[3],a=(c?"rgba(":"rgb(")+Math.round(b[0]+(a[0]-b[0])*(1-d))+","+Math.round(b[1]+(a[1]-b[1])*(1-d))+","+Math.round(b[2]+(a[2]-b[2])*(1-d))+(c?","+(b[3]+(a[3]-b[3])*(1-d)):"")+")"):a=b.input||"none";return a}var C=f.noop,v=f.color,w=f.defaultOptions,l=f.each,p=f.extend,H=f.format,y=f.pick,x=f.wrap,q=f.Chart,
t=f.seriesTypes,D=t.pie,r=t.column,E=f.Tick,z=f.fireEvent,F=f.inArray,G=1;l(["fill","stroke"],function(a){f.Fx.prototype[a+"Setter"]=function(){this.elem.attr(a,n(v(this.start),v(this.end),this.pos))}});p(w.lang,{drillUpText:"\u25c1 Back to {series.name}"});w.drilldown={animation:{duration:500},drillUpButton:{position:{align:"right",x:-10,y:10}}};f.SVGRenderer.prototype.Element.prototype.fadeIn=function(a){this.attr({opacity:.1,visibility:"inherit"}).animate({opacity:y(this.newOpacity,1)},a||{duration:250})};
q.prototype.addSeriesAsDrilldown=function(a,b){this.addSingleSeriesAsDrilldown(a,b);this.applyDrilldown()};q.prototype.addSingleSeriesAsDrilldown=function(a,b){var d=a.series,c=d.xAxis,e=d.yAxis,h,g=[],k=[],u,m,A;A={colorIndex:y(a.colorIndex,d.colorIndex)};this.drilldownLevels||(this.drilldownLevels=[]);u=d.options._levelNumber||0;(m=this.drilldownLevels[this.drilldownLevels.length-1])&&m.levelNumber!==u&&(m=void 0);b=p(p({_ddSeriesId:G++},A),b);h=F(a,d.points);l(d.chart.series,function(a){a.xAxis!==
c||a.isDrilling||(a.options._ddSeriesId=a.options._ddSeriesId||G++,a.options._colorIndex=a.userOptions._colorIndex,a.options._levelNumber=a.options._levelNumber||u,m?(g=m.levelSeries,k=m.levelSeriesOptions):(g.push(a),k.push(a.options)))});a=p({levelNumber:u,seriesOptions:d.options,levelSeriesOptions:k,levelSeries:g,shapeArgs:a.shapeArgs,bBox:a.graphic?a.graphic.getBBox():{},color:a.isNull?(new f.Color(v)).setOpacity(0).get():v,lowerSeriesOptions:b,pointOptions:d.options.data[h],pointIndex:h,oldExtremes:{xMin:c&&
c.userMin,xMax:c&&c.userMax,yMin:e&&e.userMin,yMax:e&&e.userMax}},A);this.drilldownLevels.push(a);b=a.lowerSeries=this.addSeries(b,!1);b.options._levelNumber=u+1;c&&(c.oldPos=c.pos,c.userMin=c.userMax=null,e.userMin=e.userMax=null);d.type===b.type&&(b.animate=b.animateDrilldown||C,b.options.animation=!0)};q.prototype.applyDrilldown=function(){var a=this.drilldownLevels,b;a&&0<a.length&&(b=a[a.length-1].levelNumber,l(this.drilldownLevels,function(a){a.levelNumber===b&&l(a.levelSeries,function(a){a.options&&
a.options._levelNumber===b&&a.remove(!1)})}));this.redraw();this.showDrillUpButton()};q.prototype.getDrilldownBackText=function(){var a=this.drilldownLevels;if(a&&0<a.length)return a=a[a.length-1],a.series=a.seriesOptions,H(this.options.lang.drillUpText,a)};q.prototype.showDrillUpButton=function(){var a=this,b=this.getDrilldownBackText(),d=a.options.drilldown.drillUpButton,c,e;this.drillUpButton?this.drillUpButton.attr({text:b}).align():(e=(c=d.theme)&&c.states,this.drillUpButton=this.renderer.button(b,
null,null,function(){a.drillUp()},c,e&&e.hover,e&&e.select).addClass("highcharts-drillup-button").attr({align:d.position.align,zIndex:7}).add().align(d.position,!1,d.relativeTo||"plotBox"))};q.prototype.drillUp=function(){for(var a=this,b=a.drilldownLevels,d=b[b.length-1].levelNumber,c=b.length,e=a.series,h,g,k,f,m=function(c){var b;l(e,function(a){a.options._ddSeriesId===c._ddSeriesId&&(b=a)});b=b||a.addSeries(c,!1);b.type===k.type&&b.animateDrillupTo&&(b.animate=b.animateDrillupTo);c===g.seriesOptions&&
(f=b)};c--;)if(g=b[c],g.levelNumber===d){b.pop();k=g.lowerSeries;if(!k.chart)for(h=e.length;h--;)if(e[h].options.id===g.lowerSeriesOptions.id&&e[h].options._levelNumber===d+1){k=e[h];break}k.xData=[];l(g.levelSeriesOptions,m);z(a,"drillup",{seriesOptions:g.seriesOptions});f.type===k.type&&(f.drilldownLevel=g,f.options.animation=a.options.drilldown.animation,k.animateDrillupFrom&&k.chart&&k.animateDrillupFrom(g));f.options._levelNumber=d;k.remove(!1);f.xAxis&&(h=g.oldExtremes,f.xAxis.setExtremes(h.xMin,
h.xMax,!1),f.yAxis.setExtremes(h.yMin,h.yMax,!1))}z(a,"drillupall");this.redraw();0===this.drilldownLevels.length?this.drillUpButton=this.drillUpButton.destroy():this.drillUpButton.attr({text:this.getDrilldownBackText()}).align();this.ddDupes.length=[]};r.prototype.supportsDrilldown=!0;r.prototype.animateDrillupTo=function(a){if(!a){var b=this,d=b.drilldownLevel;l(this.points,function(a){a.graphic&&a.graphic.hide();a.dataLabel&&a.dataLabel.hide();a.connector&&a.connector.hide()});setTimeout(function(){b.points&&
l(b.points,function(a,b){b=b===(d&&d.pointIndex)?"show":"fadeIn";var c="show"===b?!0:void 0;if(a.graphic)a.graphic[b](c);if(a.dataLabel)a.dataLabel[b](c);if(a.connector)a.connector[b](c)})},Math.max(this.chart.options.drilldown.animation.duration-50,0));this.animate=C}};r.prototype.animateDrilldown=function(a){var b=this,d=this.chart.drilldownLevels,c,e=this.chart.options.drilldown.animation,h=this.xAxis;a||(l(d,function(a){b.options._ddSeriesId===a.lowerSeriesOptions._ddSeriesId&&(c=a.shapeArgs)}),
c.x+=y(h.oldPos,h.pos)-h.pos,l(this.points,function(a){a.graphic&&a.graphic.attr(c).animate(p(a.shapeArgs,{fill:a.color||b.color}),e);a.dataLabel&&a.dataLabel.fadeIn(e)}),this.animate=null)};r.prototype.animateDrillupFrom=function(a){var b=this.chart.options.drilldown.animation,d=this.group,c=this;l(c.trackerGroups,function(a){if(c[a])c[a].on("mouseover")});delete this.group;l(this.points,function(c){var e=c.graphic,g=a.shapeArgs,k=function(){e.destroy();d&&(d=d.destroy())};e&&(delete c.graphic,b?
e.animate(g,f.merge(b,{complete:k})):(e.attr(g),k()))})};D&&p(D.prototype,{supportsDrilldown:!0,animateDrillupTo:r.prototype.animateDrillupTo,animateDrillupFrom:r.prototype.animateDrillupFrom,animateDrilldown:function(a){var b=this.chart.options.drilldown.animation,d=this.chart.drilldownLevels[this.chart.drilldownLevels.length-1].shapeArgs,c=d.start,e=(d.end-c)/this.points.length;a||(l(this.points,function(a,g){var h=a.shapeArgs;if(a.graphic)a.graphic.attr(f.merge(d,{start:c+g*e,end:c+(g+1)*e}))[b?
"animate":"attr"](h,b)}),this.animate=null)}});f.Point.prototype.doDrilldown=function(a,b,d){var c=this.series.chart,e=c.options.drilldown,f=(e.series||[]).length,g;c.ddDupes||(c.ddDupes=[]);for(;f--&&!g;)e.series[f].id===this.drilldown&&-1===F(this.drilldown,c.ddDupes)&&(g=e.series[f],c.ddDupes.push(this.drilldown));z(c,"drilldown",{point:this,seriesOptions:g,category:b,originalEvent:d,points:void 0!==b&&this.series.xAxis.getDDPoints(b).slice(0)},function(b){var c=b.point.series&&b.point.series.chart,
d=b.seriesOptions;c&&d&&(a?c.addSingleSeriesAsDrilldown(b.point,d):c.addSeriesAsDrilldown(b.point,d))})};f.Axis.prototype.drilldownCategory=function(a,b){var d,c,e=this.getDDPoints(a);for(d in e)(c=e[d])&&c.series&&c.series.visible&&c.doDrilldown&&c.doDrilldown(!0,a,b);this.chart.applyDrilldown()};f.Axis.prototype.getDDPoints=function(a){var b=[];l(this.series,function(d){var c,e=d.xData,f=d.points;for(c=0;c<e.length;c++)if(e[c]===a&&d.options.data[c]&&d.options.data[c].drilldown){b.push(f?f[c]:!0);
break}});return b};E.prototype.drillable=function(){var a=this.pos,b=this.label,d=this.axis,c="xAxis"===d.coll&&d.getDDPoints,e=c&&d.getDDPoints(a);c&&(b&&e.length?(b.drillable=!0,b.addClass("highcharts-drilldown-axis-label").on("click",function(b){d.drilldownCategory(a,b)})):b&&b.drillable&&(b.on("click",null),b.removeClass("highcharts-drilldown-axis-label")))};x(E.prototype,"addLabel",function(a){a.call(this);this.drillable()});x(f.Point.prototype,"init",function(a,b,d,c){var e=a.call(this,b,d,
c);c=(a=b.xAxis)&&a.ticks[c];e.drilldown&&f.addEvent(e,"click",function(a){b.xAxis&&!1===b.chart.options.drilldown.allowPointDrilldown?b.xAxis.drilldownCategory(e.x,a):e.doDrilldown(void 0,void 0,a)});c&&c.drillable();return e});x(f.Series.prototype,"drawDataLabels",function(a){var b=this.chart.options.drilldown.activeDataLabelStyle,d=this.chart.renderer;a.call(this);l(this.points,function(a){a.drilldown&&a.dataLabel&&("contrast"===b.color&&d.getContrast(a.color||this.color),a.dataLabel.addClass("highcharts-drilldown-data-label"))},
this)});var B,w=function(a){a.call(this);l(this.points,function(a){a.drilldown&&a.graphic&&a.graphic.addClass("highcharts-drilldown-point")})};for(B in t)t[B].prototype.supportsDrilldown&&x(t[B].prototype,"drawTracker",w)})(n)});

View File

@ -0,0 +1,751 @@
/**
* @license Highcharts JS v5.0.2 (2016-10-26)
* Highcharts Drilldown module
*
* Author: Torstein Honsi
* License: www.highcharts.com/license
*
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* Highcharts Drilldown module
*
* Author: Torstein Honsi
* License: www.highcharts.com/license
*
*/
'use strict';
var noop = H.noop,
color = H.color,
defaultOptions = H.defaultOptions,
each = H.each,
extend = H.extend,
format = H.format,
pick = H.pick,
wrap = H.wrap,
Chart = H.Chart,
seriesTypes = H.seriesTypes,
PieSeries = seriesTypes.pie,
ColumnSeries = seriesTypes.column,
Tick = H.Tick,
fireEvent = H.fireEvent,
inArray = H.inArray,
ddSeriesId = 1;
// Utilities
/*
* Return an intermediate color between two colors, according to pos where 0
* is the from color and 1 is the to color. This method is copied from ColorAxis.js
* and should always be kept updated, until we get AMD support.
*/
function tweenColors(from, to, pos) {
// Check for has alpha, because rgba colors perform worse due to lack of
// support in WebKit.
var hasAlpha,
ret;
// Unsupported color, return to-color (#3920)
if (!to.rgba.length || !from.rgba.length) {
ret = to.input || 'none';
// Interpolate
} else {
from = from.rgba;
to = to.rgba;
hasAlpha = (to[3] !== 1 || from[3] !== 1);
ret = (hasAlpha ? 'rgba(' : 'rgb(') +
Math.round(to[0] + (from[0] - to[0]) * (1 - pos)) + ',' +
Math.round(to[1] + (from[1] - to[1]) * (1 - pos)) + ',' +
Math.round(to[2] + (from[2] - to[2]) * (1 - pos)) +
(hasAlpha ? (',' + (to[3] + (from[3] - to[3]) * (1 - pos))) : '') + ')';
}
return ret;
}
/**
* Handle animation of the color attributes directly
*/
each(['fill', 'stroke'], function(prop) {
H.Fx.prototype[prop + 'Setter'] = function() {
this.elem.attr(prop, tweenColors(color(this.start), color(this.end), this.pos));
};
});
// Add language
extend(defaultOptions.lang, {
drillUpText: '◁ Back to {series.name}'
});
defaultOptions.drilldown = {
animation: {
duration: 500
},
drillUpButton: {
position: {
align: 'right',
x: -10,
y: 10
}
// relativeTo: 'plotBox'
// theme
}
};
/**
* A general fadeIn method
*/
H.SVGRenderer.prototype.Element.prototype.fadeIn = function(animation) {
this
.attr({
opacity: 0.1,
visibility: 'inherit'
})
.animate({
opacity: pick(this.newOpacity, 1) // newOpacity used in maps
}, animation || {
duration: 250
});
};
Chart.prototype.addSeriesAsDrilldown = function(point, ddOptions) {
this.addSingleSeriesAsDrilldown(point, ddOptions);
this.applyDrilldown();
};
Chart.prototype.addSingleSeriesAsDrilldown = function(point, ddOptions) {
var oldSeries = point.series,
xAxis = oldSeries.xAxis,
yAxis = oldSeries.yAxis,
newSeries,
pointIndex,
levelSeries = [],
levelSeriesOptions = [],
level,
levelNumber,
last,
colorProp;
colorProp = {
colorIndex: pick(point.colorIndex, oldSeries.colorIndex)
};
if (!this.drilldownLevels) {
this.drilldownLevels = [];
}
levelNumber = oldSeries.options._levelNumber || 0;
// See if we can reuse the registered series from last run
last = this.drilldownLevels[this.drilldownLevels.length - 1];
if (last && last.levelNumber !== levelNumber) {
last = undefined;
}
ddOptions = extend(extend({
_ddSeriesId: ddSeriesId++
}, colorProp), ddOptions);
pointIndex = inArray(point, oldSeries.points);
// Record options for all current series
each(oldSeries.chart.series, function(series) {
if (series.xAxis === xAxis && !series.isDrilling) {
series.options._ddSeriesId = series.options._ddSeriesId || ddSeriesId++;
series.options._colorIndex = series.userOptions._colorIndex;
series.options._levelNumber = series.options._levelNumber || levelNumber; // #3182
if (last) {
levelSeries = last.levelSeries;
levelSeriesOptions = last.levelSeriesOptions;
} else {
levelSeries.push(series);
levelSeriesOptions.push(series.options);
}
}
});
// Add a record of properties for each drilldown level
level = extend({
levelNumber: levelNumber,
seriesOptions: oldSeries.options,
levelSeriesOptions: levelSeriesOptions,
levelSeries: levelSeries,
shapeArgs: point.shapeArgs,
bBox: point.graphic ? point.graphic.getBBox() : {}, // no graphic in line series with markers disabled
color: point.isNull ? new H.Color(color).setOpacity(0).get() : color,
lowerSeriesOptions: ddOptions,
pointOptions: oldSeries.options.data[pointIndex],
pointIndex: pointIndex,
oldExtremes: {
xMin: xAxis && xAxis.userMin,
xMax: xAxis && xAxis.userMax,
yMin: yAxis && yAxis.userMin,
yMax: yAxis && yAxis.userMax
}
}, colorProp);
// Push it to the lookup array
this.drilldownLevels.push(level);
newSeries = level.lowerSeries = this.addSeries(ddOptions, false);
newSeries.options._levelNumber = levelNumber + 1;
if (xAxis) {
xAxis.oldPos = xAxis.pos;
xAxis.userMin = xAxis.userMax = null;
yAxis.userMin = yAxis.userMax = null;
}
// Run fancy cross-animation on supported and equal types
if (oldSeries.type === newSeries.type) {
newSeries.animate = newSeries.animateDrilldown || noop;
newSeries.options.animation = true;
}
};
Chart.prototype.applyDrilldown = function() {
var drilldownLevels = this.drilldownLevels,
levelToRemove;
if (drilldownLevels && drilldownLevels.length > 0) { // #3352, async loading
levelToRemove = drilldownLevels[drilldownLevels.length - 1].levelNumber;
each(this.drilldownLevels, function(level) {
if (level.levelNumber === levelToRemove) {
each(level.levelSeries, function(series) {
if (series.options && series.options._levelNumber === levelToRemove) { // Not removed, not added as part of a multi-series drilldown
series.remove(false);
}
});
}
});
}
this.redraw();
this.showDrillUpButton();
};
Chart.prototype.getDrilldownBackText = function() {
var drilldownLevels = this.drilldownLevels,
lastLevel;
if (drilldownLevels && drilldownLevels.length > 0) { // #3352, async loading
lastLevel = drilldownLevels[drilldownLevels.length - 1];
lastLevel.series = lastLevel.seriesOptions;
return format(this.options.lang.drillUpText, lastLevel);
}
};
Chart.prototype.showDrillUpButton = function() {
var chart = this,
backText = this.getDrilldownBackText(),
buttonOptions = chart.options.drilldown.drillUpButton,
attr,
states;
if (!this.drillUpButton) {
attr = buttonOptions.theme;
states = attr && attr.states;
this.drillUpButton = this.renderer.button(
backText,
null,
null,
function() {
chart.drillUp();
},
attr,
states && states.hover,
states && states.select
)
.addClass('highcharts-drillup-button')
.attr({
align: buttonOptions.position.align,
zIndex: 7
})
.add()
.align(buttonOptions.position, false, buttonOptions.relativeTo || 'plotBox');
} else {
this.drillUpButton.attr({
text: backText
})
.align();
}
};
Chart.prototype.drillUp = function() {
var chart = this,
drilldownLevels = chart.drilldownLevels,
levelNumber = drilldownLevels[drilldownLevels.length - 1].levelNumber,
i = drilldownLevels.length,
chartSeries = chart.series,
seriesI,
level,
oldSeries,
newSeries,
oldExtremes,
addSeries = function(seriesOptions) {
var addedSeries;
each(chartSeries, function(series) {
if (series.options._ddSeriesId === seriesOptions._ddSeriesId) {
addedSeries = series;
}
});
addedSeries = addedSeries || chart.addSeries(seriesOptions, false);
if (addedSeries.type === oldSeries.type && addedSeries.animateDrillupTo) {
addedSeries.animate = addedSeries.animateDrillupTo;
}
if (seriesOptions === level.seriesOptions) {
newSeries = addedSeries;
}
};
while (i--) {
level = drilldownLevels[i];
if (level.levelNumber === levelNumber) {
drilldownLevels.pop();
// Get the lower series by reference or id
oldSeries = level.lowerSeries;
if (!oldSeries.chart) { // #2786
seriesI = chartSeries.length; // #2919
while (seriesI--) {
if (chartSeries[seriesI].options.id === level.lowerSeriesOptions.id &&
chartSeries[seriesI].options._levelNumber === levelNumber + 1) { // #3867
oldSeries = chartSeries[seriesI];
break;
}
}
}
oldSeries.xData = []; // Overcome problems with minRange (#2898)
each(level.levelSeriesOptions, addSeries);
fireEvent(chart, 'drillup', {
seriesOptions: level.seriesOptions
});
if (newSeries.type === oldSeries.type) {
newSeries.drilldownLevel = level;
newSeries.options.animation = chart.options.drilldown.animation;
if (oldSeries.animateDrillupFrom && oldSeries.chart) { // #2919
oldSeries.animateDrillupFrom(level);
}
}
newSeries.options._levelNumber = levelNumber;
oldSeries.remove(false);
// Reset the zoom level of the upper series
if (newSeries.xAxis) {
oldExtremes = level.oldExtremes;
newSeries.xAxis.setExtremes(oldExtremes.xMin, oldExtremes.xMax, false);
newSeries.yAxis.setExtremes(oldExtremes.yMin, oldExtremes.yMax, false);
}
}
}
// Fire a once-off event after all series have been drilled up (#5158)
fireEvent(chart, 'drillupall');
this.redraw();
if (this.drilldownLevels.length === 0) {
this.drillUpButton = this.drillUpButton.destroy();
} else {
this.drillUpButton.attr({
text: this.getDrilldownBackText()
})
.align();
}
this.ddDupes.length = []; // #3315
};
ColumnSeries.prototype.supportsDrilldown = true;
/**
* When drilling up, keep the upper series invisible until the lower series has
* moved into place
*/
ColumnSeries.prototype.animateDrillupTo = function(init) {
if (!init) {
var newSeries = this,
level = newSeries.drilldownLevel;
each(this.points, function(point) {
if (point.graphic) { // #3407
point.graphic.hide();
}
if (point.dataLabel) {
point.dataLabel.hide();
}
if (point.connector) {
point.connector.hide();
}
});
// Do dummy animation on first point to get to complete
setTimeout(function() {
if (newSeries.points) { // May be destroyed in the meantime, #3389
each(newSeries.points, function(point, i) {
// Fade in other points
var verb = i === (level && level.pointIndex) ? 'show' : 'fadeIn',
inherit = verb === 'show' ? true : undefined;
if (point.graphic) { // #3407
point.graphic[verb](inherit);
}
if (point.dataLabel) {
point.dataLabel[verb](inherit);
}
if (point.connector) {
point.connector[verb](inherit);
}
});
}
}, Math.max(this.chart.options.drilldown.animation.duration - 50, 0));
// Reset
this.animate = noop;
}
};
ColumnSeries.prototype.animateDrilldown = function(init) {
var series = this,
drilldownLevels = this.chart.drilldownLevels,
animateFrom,
animationOptions = this.chart.options.drilldown.animation,
xAxis = this.xAxis;
if (!init) {
each(drilldownLevels, function(level) {
if (series.options._ddSeriesId === level.lowerSeriesOptions._ddSeriesId) {
animateFrom = level.shapeArgs;
}
});
animateFrom.x += (pick(xAxis.oldPos, xAxis.pos) - xAxis.pos);
each(this.points, function(point) {
var animateTo = point.shapeArgs;
if (point.graphic) {
point.graphic
.attr(animateFrom)
.animate(
extend(point.shapeArgs, {
fill: point.color || series.color
}),
animationOptions
);
}
if (point.dataLabel) {
point.dataLabel.fadeIn(animationOptions);
}
});
this.animate = null;
}
};
/**
* When drilling up, pull out the individual point graphics from the lower series
* and animate them into the origin point in the upper series.
*/
ColumnSeries.prototype.animateDrillupFrom = function(level) {
var animationOptions = this.chart.options.drilldown.animation,
group = this.group,
series = this;
// Cancel mouse events on the series group (#2787)
each(series.trackerGroups, function(key) {
if (series[key]) { // we don't always have dataLabelsGroup
series[key].on('mouseover');
}
});
delete this.group;
each(this.points, function(point) {
var graphic = point.graphic,
animateTo = level.shapeArgs,
complete = function() {
graphic.destroy();
if (group) {
group = group.destroy();
}
};
if (graphic) {
delete point.graphic;
if (animationOptions) {
graphic.animate(
animateTo,
H.merge(animationOptions, {
complete: complete
})
);
} else {
graphic.attr(animateTo);
complete();
}
}
});
};
if (PieSeries) {
extend(PieSeries.prototype, {
supportsDrilldown: true,
animateDrillupTo: ColumnSeries.prototype.animateDrillupTo,
animateDrillupFrom: ColumnSeries.prototype.animateDrillupFrom,
animateDrilldown: function(init) {
var level = this.chart.drilldownLevels[this.chart.drilldownLevels.length - 1],
animationOptions = this.chart.options.drilldown.animation,
animateFrom = level.shapeArgs,
start = animateFrom.start,
angle = animateFrom.end - start,
startAngle = angle / this.points.length;
if (!init) {
each(this.points, function(point, i) {
var animateTo = point.shapeArgs;
if (point.graphic) {
point.graphic
.attr(H.merge(animateFrom, {
start: start + i * startAngle,
end: start + (i + 1) * startAngle
}))[animationOptions ? 'animate' : 'attr'](
animateTo,
animationOptions
);
}
});
this.animate = null;
}
}
});
}
H.Point.prototype.doDrilldown = function(_holdRedraw, category, originalEvent) {
var series = this.series,
chart = series.chart,
drilldown = chart.options.drilldown,
i = (drilldown.series || []).length,
seriesOptions;
if (!chart.ddDupes) {
chart.ddDupes = [];
}
while (i-- && !seriesOptions) {
if (drilldown.series[i].id === this.drilldown && inArray(this.drilldown, chart.ddDupes) === -1) {
seriesOptions = drilldown.series[i];
chart.ddDupes.push(this.drilldown);
}
}
// Fire the event. If seriesOptions is undefined, the implementer can check for
// seriesOptions, and call addSeriesAsDrilldown async if necessary.
fireEvent(chart, 'drilldown', {
point: this,
seriesOptions: seriesOptions,
category: category,
originalEvent: originalEvent,
points: category !== undefined && this.series.xAxis.getDDPoints(category).slice(0)
}, function(e) {
var chart = e.point.series && e.point.series.chart,
seriesOptions = e.seriesOptions;
if (chart && seriesOptions) {
if (_holdRedraw) {
chart.addSingleSeriesAsDrilldown(e.point, seriesOptions);
} else {
chart.addSeriesAsDrilldown(e.point, seriesOptions);
}
}
});
};
/**
* Drill down to a given category. This is the same as clicking on an axis label.
*/
H.Axis.prototype.drilldownCategory = function(x, e) {
var key,
point,
ddPointsX = this.getDDPoints(x);
for (key in ddPointsX) {
point = ddPointsX[key];
if (point && point.series && point.series.visible && point.doDrilldown) { // #3197
point.doDrilldown(true, x, e);
}
}
this.chart.applyDrilldown();
};
/**
* Return drillable points for this specific X value
*/
H.Axis.prototype.getDDPoints = function(x) {
var ret = [];
each(this.series, function(series) {
var i,
xData = series.xData,
points = series.points;
for (i = 0; i < xData.length; i++) {
if (xData[i] === x && series.options.data[i] && series.options.data[i].drilldown) {
ret.push(points ? points[i] : true);
break;
}
}
});
return ret;
};
/**
* Make a tick label drillable, or remove drilling on update
*/
Tick.prototype.drillable = function() {
var pos = this.pos,
label = this.label,
axis = this.axis,
isDrillable = axis.coll === 'xAxis' && axis.getDDPoints,
ddPointsX = isDrillable && axis.getDDPoints(pos);
if (isDrillable) {
if (label && ddPointsX.length) {
label.drillable = true;
label
.addClass('highcharts-drilldown-axis-label')
.on('click', function(e) {
axis.drilldownCategory(pos, e);
});
} else if (label && label.drillable) {
label.on('click', null); // #3806
label.removeClass('highcharts-drilldown-axis-label');
}
}
};
/**
* Always keep the drillability updated (#3951)
*/
wrap(Tick.prototype, 'addLabel', function(proceed) {
proceed.call(this);
this.drillable();
});
/**
* On initialization of each point, identify its label and make it clickable. Also, provide a
* list of points associated to that label.
*/
wrap(H.Point.prototype, 'init', function(proceed, series, options, x) {
var point = proceed.call(this, series, options, x),
xAxis = series.xAxis,
tick = xAxis && xAxis.ticks[x];
if (point.drilldown) {
// Add the click event to the point
H.addEvent(point, 'click', function(e) {
if (series.xAxis && series.chart.options.drilldown.allowPointDrilldown === false) {
series.xAxis.drilldownCategory(point.x, e); // #5822, x changed
} else {
point.doDrilldown(undefined, undefined, e);
}
});
/*wrap(point, 'importEvents', function (proceed) { // wrapping importEvents makes point.click event work
if (!this.hasImportedEvents) {
proceed.call(this);
H.addEvent(this, 'click', function () {
this.doDrilldown();
});
}
});*/
}
// Add or remove click handler and style on the tick label
if (tick) {
tick.drillable();
}
return point;
});
wrap(H.Series.prototype, 'drawDataLabels', function(proceed) {
var css = this.chart.options.drilldown.activeDataLabelStyle,
renderer = this.chart.renderer;
proceed.call(this);
each(this.points, function(point) {
var pointCSS = {};
if (point.drilldown && point.dataLabel) {
if (css.color === 'contrast') {
pointCSS.color = renderer.getContrast(point.color || this.color);
}
point.dataLabel
.addClass('highcharts-drilldown-data-label');
}
}, this);
});
// Mark the trackers with a pointer
var type,
drawTrackerWrapper = function(proceed) {
proceed.call(this);
each(this.points, function(point) {
if (point.drilldown && point.graphic) {
point.graphic.addClass('highcharts-drilldown-point');
}
});
};
for (type in seriesTypes) {
if (seriesTypes[type].prototype.supportsDrilldown) {
wrap(seriesTypes[type].prototype, 'drawTracker', drawTrackerWrapper);
}
}
}(Highcharts));
}));

View File

@ -0,0 +1,26 @@
/*
Highcharts JS v5.0.2 (2016-10-26)
Exporting module
(c) 2010-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(q){"object"===typeof module&&module.exports?module.exports=q:q(Highcharts)})(function(q){(function(f){var q=f.defaultOptions,v=f.doc,A=f.Chart,x=f.addEvent,F=f.removeEvent,G=f.fireEvent,w=f.createElement,B=f.discardElement,H=f.css,p=f.merge,C=f.pick,u=f.each,y=f.extend,I=f.splat,z=f.win,D=f.SVGRenderer,J=f.Renderer.prototype.symbols;y(q.lang,{printChart:"Print chart",downloadPNG:"Download PNG image",downloadJPEG:"Download JPEG image",downloadPDF:"Download PDF document",downloadSVG:"Download SVG vector image",
contextButtonTitle:"Chart context menu"});q.navigation={buttonOptions:{theme:{},symbolSize:14,symbolX:12.5,symbolY:10.5,align:"right",buttonSpacing:3,height:22,verticalAlign:"top",width:24}};q.exporting={type:"image/png",url:"https://export.highcharts.com/",printMaxWidth:780,scale:2,buttons:{contextButton:{className:"highcharts-contextbutton",menuClassName:"highcharts-contextmenu",symbol:"menu",_titleKey:"contextButtonTitle",menuItems:[{textKey:"printChart",onclick:function(){this.print()}},{separator:!0},
{textKey:"downloadPNG",onclick:function(){this.exportChart()}},{textKey:"downloadJPEG",onclick:function(){this.exportChart({type:"image/jpeg"})}},{textKey:"downloadPDF",onclick:function(){this.exportChart({type:"application/pdf"})}},{textKey:"downloadSVG",onclick:function(){this.exportChart({type:"image/svg+xml"})}}]}}};f.post=function(a,b,d){var e;a=w("form",p({method:"post",action:a,enctype:"multipart/form-data"},d),{display:"none"},v.body);for(e in b)w("input",{type:"hidden",name:e,value:b[e]},
null,a);a.submit();B(a)};y(A.prototype,{sanitizeSVG:function(a){return a=a.replace(/zIndex="[^"]+"/g,"").replace(/isShadow="[^"]+"/g,"").replace(/symbolName="[^"]+"/g,"").replace(/jQuery[0-9]+="[^"]+"/g,"").replace(/url\(("|&quot;)(\S+)("|&quot;)\)/g,"url($2)").replace(/url\([^#]+#/g,"url(#").replace(/<svg /,'\x3csvg xmlns:xlink\x3d"http://www.w3.org/1999/xlink" ').replace(/ (NS[0-9]+\:)?href=/g," xlink:href\x3d").replace(/\n/," ").replace(/<\/svg>.*?$/,"\x3c/svg\x3e").replace(/(fill|stroke)="rgba\(([ 0-9]+,[ 0-9]+,[ 0-9]+),([ 0-9\.]+)\)"/g,
'$1\x3d"rgb($2)" $1-opacity\x3d"$3"').replace(/&nbsp;/g,"\u00a0").replace(/&shy;/g,"\u00ad")},getChartHTML:function(){this.inlineStyles();return this.container.innerHTML},getSVG:function(a){var b=this,d,e,g,E,k,c=p(b.options,a),n=c.exporting.allowHTML;v.createElementNS||(v.createElementNS=function(a,b){return v.createElement(b)});e=w("div",null,{position:"absolute",top:"-9999em",width:b.chartWidth+"px",height:b.chartHeight+"px"},v.body);g=b.renderTo.style.width;k=b.renderTo.style.height;g=c.exporting.sourceWidth||
c.chart.width||/px$/.test(g)&&parseInt(g,10)||600;k=c.exporting.sourceHeight||c.chart.height||/px$/.test(k)&&parseInt(k,10)||400;y(c.chart,{animation:!1,renderTo:e,forExport:!0,renderer:"SVGRenderer",width:g,height:k});c.exporting.enabled=!1;delete c.data;c.series=[];u(b.series,function(a){E=p(a.userOptions,{animation:!1,enableMouseTracking:!1,showCheckbox:!1,visible:a.visible});E.isInternal||c.series.push(E)});a&&u(["xAxis","yAxis"],function(b){u(I(a[b]),function(a,e){c[b][e]=p(c[b][e],a)})});d=
new f.Chart(c,b.callback);u(["xAxis","yAxis"],function(a){u(b[a],function(b,e){e=d[a][e];var c=b.getExtremes();b=c.userMin;c=c.userMax;!e||void 0===b&&void 0===c||e.setExtremes(b,c,!0,!1)})});g=d.getChartHTML();c=null;d.destroy();B(e);n&&(e=g.match(/<\/svg>(.*?$)/))&&(e='\x3cforeignObject x\x3d"0" y\x3d"0" width\x3d"200" height\x3d"200"\x3e\x3cbody xmlns\x3d"http://www.w3.org/1999/xhtml"\x3e'+e[1]+"\x3c/body\x3e\x3c/foreignObject\x3e",g=g.replace("\x3c/svg\x3e",e+"\x3c/svg\x3e"));g=this.sanitizeSVG(g);
return g=g.replace(/(url\(#highcharts-[0-9]+)&quot;/g,"$1").replace(/&quot;/g,"'")},getSVGForExport:function(a,b){var d=this.options.exporting;return this.getSVG(p({chart:{borderRadius:0}},d.chartOptions,b,{exporting:{sourceWidth:a&&a.sourceWidth||d.sourceWidth,sourceHeight:a&&a.sourceHeight||d.sourceHeight}}))},exportChart:function(a,b){b=this.getSVGForExport(a,b);a=p(this.options.exporting,a);f.post(a.url,{filename:a.filename||"chart",type:a.type,width:a.width||0,scale:a.scale,svg:b},a.formAttributes)},
print:function(){var a=this,b=a.container,d=[],e=b.parentNode,g=v.body,f=g.childNodes,k=a.options.exporting.printMaxWidth,c,n;if(!a.isPrinting){a.isPrinting=!0;a.pointer.reset(null,0);G(a,"beforePrint");if(n=k&&a.chartWidth>k)c=[a.options.chart.width,void 0,!1],a.setSize(k,void 0,!1);u(f,function(a,b){1===a.nodeType&&(d[b]=a.style.display,a.style.display="none")});g.appendChild(b);z.focus();z.print();setTimeout(function(){e.appendChild(b);u(f,function(a,b){1===a.nodeType&&(a.style.display=d[b])});
a.isPrinting=!1;n&&a.setSize.apply(a,c);G(a,"afterPrint")},1E3)}},contextMenu:function(a,b,d,e,g,f,k){var c=this,n=c.chartWidth,h=c.chartHeight,l="cache-"+a,m=c[l],r=Math.max(g,f),t,p,q=function(b){c.pointer.inClass(b.target,a)||p()};m||(c[l]=m=w("div",{className:a},{position:"absolute",zIndex:1E3,padding:r+"px"},c.container),t=w("div",{className:"highcharts-menu"},null,m),p=function(){H(m,{display:"none"});k&&k.setState(0);c.openMenu=!1},x(m,"mouseleave",function(){m.hideTimer=setTimeout(p,500)}),
x(m,"mouseenter",function(){clearTimeout(m.hideTimer)}),x(v,"mouseup",q),x(c,"destroy",function(){F(v,"mouseup",q)}),u(b,function(a){if(a){var b;b=a.separator?w("hr",null,null,t):w("div",{className:"highcharts-menu-item",onclick:function(b){b&&b.stopPropagation();p();a.onclick&&a.onclick.apply(c,arguments)},innerHTML:a.text||c.options.lang[a.textKey]},null,t);c.exportDivElements.push(b)}}),c.exportDivElements.push(t,m),c.exportMenuWidth=m.offsetWidth,c.exportMenuHeight=m.offsetHeight);b={display:"block"};
d+c.exportMenuWidth>n?b.right=n-d-g-r+"px":b.left=d-r+"px";e+f+c.exportMenuHeight>h&&"top"!==k.alignOptions.verticalAlign?b.bottom=h-e-r+"px":b.top=e+f-r+"px";H(m,b);c.openMenu=!0},addButton:function(a){var b=this,d=b.renderer,e=p(b.options.navigation.buttonOptions,a),g=e.onclick,f=e.menuItems,k,c,n=e.symbolSize||12;b.btnCount||(b.btnCount=0);b.exportDivElements||(b.exportDivElements=[],b.exportSVGElements=[]);if(!1!==e.enabled){var h=e.theme,l=h.states,m=l&&l.hover,l=l&&l.select,r;delete h.states;
g?r=function(a){a.stopPropagation();g.call(b,a)}:f&&(r=function(){b.contextMenu(c.menuClassName,f,c.translateX,c.translateY,c.width,c.height,c);c.setState(2)});e.text&&e.symbol?h.paddingLeft=C(h.paddingLeft,25):e.text||y(h,{width:e.width,height:e.height,padding:0});c=d.button(e.text,0,0,r,h,m,l).addClass(a.className).attr({title:b.options.lang[e._titleKey],zIndex:3});c.menuClassName=a.menuClassName||"highcharts-menu-"+b.btnCount++;e.symbol&&(k=d.symbol(e.symbol,e.symbolX-n/2,e.symbolY-n/2,n,n).addClass("highcharts-button-symbol").attr({zIndex:1}).add(c));
c.add().align(y(e,{width:c.width,x:C(e.x,b.buttonOffset)}),!0,"spacingBox");b.buttonOffset+=(c.width+e.buttonSpacing)*("right"===e.align?-1:1);b.exportSVGElements.push(c,k)}},destroyExport:function(a){var b=a?a.target:this;a=b.exportSVGElements;var d=b.exportDivElements;a&&(u(a,function(a,d){a&&(a.onclick=a.ontouchstart=null,b.exportSVGElements[d]=a.destroy())}),a.length=0);d&&(u(d,function(a,d){clearTimeout(a.hideTimer);F(a,"mouseleave");b.exportDivElements[d]=a.onmouseout=a.onmouseover=a.ontouchstart=
a.onclick=null;B(a)}),d.length=0)}});D.prototype.inlineToAttributes="fill stroke strokeLinecap strokeLinejoin strokeWidth textAnchor x y".split(" ");D.prototype.inlineBlacklist=[/-/,/^(clipPath|cssText|d|height|width)$/,/^font$/,/[lL]ogical(Width|Height)$/,/perspective/,/TapHighlightColor/,/^transition/];D.prototype.unstyledElements=["clipPath","defs","desc"];A.prototype.inlineStyles=function(){function a(a){return a.replace(/([A-Z])/g,function(a,b){return"-"+b.toLowerCase()})}function b(d){var h,
l,m,r="",t,n;if(1===d.nodeType&&-1===q.indexOf(d.nodeName)){l=z.getComputedStyle(d,null);m="svg"===d.nodeName?{}:z.getComputedStyle(d.parentNode,null);k[d.nodeName]||(c||(c=v.createElementNS(f.SVG_NS,"svg"),c.setAttribute("version","1.1"),v.body.appendChild(c)),t=v.createElementNS(d.namespaceURI,d.nodeName),c.appendChild(t),k[d.nodeName]=p(z.getComputedStyle(t,null)),c.removeChild(t));for(h in l){t=!1;for(n=g.length;n--&&!t;)t=g[n].test(h)||"function"===typeof l[h];t||m[h]!==l[h]&&k[d.nodeName][h]!==
l[h]&&(-1!==e.indexOf(h)?d.setAttribute(a(h),l[h]):r+=a(h)+":"+l[h]+";")}r&&(h=d.getAttribute("style"),d.setAttribute("style",(h?h+";":"")+r));"text"!==d.nodeName&&u(d.children||d.childNodes,b)}}var d=this.renderer,e=d.inlineToAttributes,g=d.inlineBlacklist,q=d.unstyledElements,k={},c;b(this.container.querySelector("svg"));c.parentNode.removeChild(c)};J.menu=function(a,b,d,e){return["M",a,b+2.5,"L",a+d,b+2.5,"M",a,b+e/2+.5,"L",a+d,b+e/2+.5,"M",a,b+e-1.5,"L",a+d,b+e-1.5]};A.prototype.renderExporting=
function(){var a,b=this.options.exporting,d=b.buttons,e=this.isDirtyExporting||!this.exportSVGElements;this.buttonOffset=0;this.isDirtyExporting&&this.destroyExport();if(e&&!1!==b.enabled){for(a in d)this.addButton(d[a]);this.isDirtyExporting=!1}x(this,"destroy",this.destroyExport)};A.prototype.callbacks.push(function(a){a.renderExporting();x(a,"redraw",a.renderExporting);u(["exporting","navigation"],function(b){a[b]={update:function(d,e){a.isDirtyExporting=!0;p(!0,a.options[b],d);C(e,!0)&&a.redraw()}}})})})(q)});

View File

@ -0,0 +1,948 @@
/**
* @license Highcharts JS v5.0.2 (2016-10-26)
* Exporting module
*
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* Exporting module
*
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
/* eslint indent:0 */
'use strict';
// create shortcuts
var defaultOptions = H.defaultOptions,
doc = H.doc,
Chart = H.Chart,
addEvent = H.addEvent,
removeEvent = H.removeEvent,
fireEvent = H.fireEvent,
createElement = H.createElement,
discardElement = H.discardElement,
css = H.css,
merge = H.merge,
pick = H.pick,
each = H.each,
extend = H.extend,
splat = H.splat,
isTouchDevice = H.isTouchDevice,
win = H.win,
SVGRenderer = H.SVGRenderer;
var symbols = H.Renderer.prototype.symbols;
// Add language
extend(defaultOptions.lang, {
printChart: 'Print chart',
downloadPNG: 'Download PNG image',
downloadJPEG: 'Download JPEG image',
downloadPDF: 'Download PDF document',
downloadSVG: 'Download SVG vector image',
contextButtonTitle: 'Chart context menu'
});
// Buttons and menus are collected in a separate config option set called 'navigation'.
// This can be extended later to add control buttons like zoom and pan right click menus.
defaultOptions.navigation = {
buttonOptions: {
theme: {},
symbolSize: 14,
symbolX: 12.5,
symbolY: 10.5,
align: 'right',
buttonSpacing: 3,
height: 22,
// text: null,
verticalAlign: 'top',
width: 24
}
};
// Add the export related options
defaultOptions.exporting = {
//enabled: true,
//filename: 'chart',
type: 'image/png',
url: 'https://export.highcharts.com/',
//width: undefined,
printMaxWidth: 780,
scale: 2,
buttons: {
contextButton: {
className: 'highcharts-contextbutton',
menuClassName: 'highcharts-contextmenu',
//x: -10,
symbol: 'menu',
_titleKey: 'contextButtonTitle',
menuItems: [{
textKey: 'printChart',
onclick: function() {
this.print();
}
}, {
separator: true
}, {
textKey: 'downloadPNG',
onclick: function() {
this.exportChart();
}
}, {
textKey: 'downloadJPEG',
onclick: function() {
this.exportChart({
type: 'image/jpeg'
});
}
}, {
textKey: 'downloadPDF',
onclick: function() {
this.exportChart({
type: 'application/pdf'
});
}
}, {
textKey: 'downloadSVG',
onclick: function() {
this.exportChart({
type: 'image/svg+xml'
});
}
}
// Enable this block to add "View SVG" to the dropdown menu
/*
,{
text: 'View SVG',
onclick: function () {
var svg = this.getSVG()
.replace(/</g, '\n&lt;')
.replace(/>/g, '&gt;');
doc.body.innerHTML = '<pre>' + svg + '</pre>';
}
} // */
]
}
}
};
// Add the H.post utility
H.post = function(url, data, formAttributes) {
var name,
form;
// create the form
form = createElement('form', merge({
method: 'post',
action: url,
enctype: 'multipart/form-data'
}, formAttributes), {
display: 'none'
}, doc.body);
// add the data
for (name in data) {
createElement('input', {
type: 'hidden',
name: name,
value: data[name]
}, null, form);
}
// submit
form.submit();
// clean up
discardElement(form);
};
extend(Chart.prototype, {
/**
* A collection of regex fixes on the produces SVG to account for expando properties,
* browser bugs, VML problems and other. Returns a cleaned SVG.
*/
sanitizeSVG: function(svg) {
svg = svg
.replace(/zIndex="[^"]+"/g, '')
.replace(/isShadow="[^"]+"/g, '')
.replace(/symbolName="[^"]+"/g, '')
.replace(/jQuery[0-9]+="[^"]+"/g, '')
.replace(/url\(("|&quot;)(\S+)("|&quot;)\)/g, 'url($2)')
.replace(/url\([^#]+#/g, 'url(#')
.replace(/<svg /, '<svg xmlns:xlink="http://www.w3.org/1999/xlink" ')
.replace(/ (NS[0-9]+\:)?href=/g, ' xlink:href=') // #3567
.replace(/\n/, ' ')
// Any HTML added to the container after the SVG (#894)
.replace(/<\/svg>.*?$/, '</svg>')
// Batik doesn't support rgba fills and strokes (#3095)
.replace(/(fill|stroke)="rgba\(([ 0-9]+,[ 0-9]+,[ 0-9]+),([ 0-9\.]+)\)"/g, '$1="rgb($2)" $1-opacity="$3"')
/* This fails in IE < 8
.replace(/([0-9]+)\.([0-9]+)/g, function(s1, s2, s3) { // round off to save weight
return s2 +'.'+ s3[0];
})*/
// Replace HTML entities, issue #347
.replace(/&nbsp;/g, '\u00A0') // no-break space
.replace(/&shy;/g, '\u00AD'); // soft hyphen
return svg;
},
/**
* Return innerHTML of chart. Used as hook for plugins.
*/
getChartHTML: function() {
this.inlineStyles();
return this.container.innerHTML;
},
/**
* Return an SVG representation of the chart
*
* @param additionalOptions {Object} Additional chart options for the generated SVG representation
*/
getSVG: function(additionalOptions) {
var chart = this,
chartCopy,
sandbox,
svg,
seriesOptions,
sourceWidth,
sourceHeight,
cssWidth,
cssHeight,
html,
options = merge(chart.options, additionalOptions), // copy the options and add extra options
allowHTML = options.exporting.allowHTML;
// IE compatibility hack for generating SVG content that it doesn't really understand
if (!doc.createElementNS) {
doc.createElementNS = function(ns, tagName) {
return doc.createElement(tagName);
};
}
// create a sandbox where a new chart will be generated
sandbox = createElement('div', null, {
position: 'absolute',
top: '-9999em',
width: chart.chartWidth + 'px',
height: chart.chartHeight + 'px'
}, doc.body);
// get the source size
cssWidth = chart.renderTo.style.width;
cssHeight = chart.renderTo.style.height;
sourceWidth = options.exporting.sourceWidth ||
options.chart.width ||
(/px$/.test(cssWidth) && parseInt(cssWidth, 10)) ||
600;
sourceHeight = options.exporting.sourceHeight ||
options.chart.height ||
(/px$/.test(cssHeight) && parseInt(cssHeight, 10)) ||
400;
// override some options
extend(options.chart, {
animation: false,
renderTo: sandbox,
forExport: true,
renderer: 'SVGRenderer',
width: sourceWidth,
height: sourceHeight
});
options.exporting.enabled = false; // hide buttons in print
delete options.data; // #3004
// prepare for replicating the chart
options.series = [];
each(chart.series, function(serie) {
seriesOptions = merge(serie.userOptions, { // #4912
animation: false, // turn off animation
enableMouseTracking: false,
showCheckbox: false,
visible: serie.visible
});
if (!seriesOptions.isInternal) { // used for the navigator series that has its own option set
options.series.push(seriesOptions);
}
});
// Axis options must be merged in one by one, since it may be an array or an object (#2022, #3900)
if (additionalOptions) {
each(['xAxis', 'yAxis'], function(axisType) {
each(splat(additionalOptions[axisType]), function(axisOptions, i) {
options[axisType][i] = merge(options[axisType][i], axisOptions);
});
});
}
// generate the chart copy
chartCopy = new H.Chart(options, chart.callback);
// reflect axis extremes in the export
each(['xAxis', 'yAxis'], function(axisType) {
each(chart[axisType], function(axis, i) {
var axisCopy = chartCopy[axisType][i],
extremes = axis.getExtremes(),
userMin = extremes.userMin,
userMax = extremes.userMax;
if (axisCopy && (userMin !== undefined || userMax !== undefined)) {
axisCopy.setExtremes(userMin, userMax, true, false);
}
});
});
// get the SVG from the container's innerHTML
svg = chartCopy.getChartHTML();
// free up memory
options = null;
chartCopy.destroy();
discardElement(sandbox);
// Move HTML into a foreignObject
if (allowHTML) {
html = svg.match(/<\/svg>(.*?$)/);
if (html) {
html = '<foreignObject x="0" y="0" width="200" height="200">' +
'<body xmlns="http://www.w3.org/1999/xhtml">' +
html[1] +
'</body>' +
'</foreignObject>';
svg = svg.replace('</svg>', html + '</svg>');
}
}
// sanitize
svg = this.sanitizeSVG(svg);
// IE9 beta bugs with innerHTML. Test again with final IE9.
svg = svg.replace(/(url\(#highcharts-[0-9]+)&quot;/g, '$1')
.replace(/&quot;/g, '\'');
return svg;
},
getSVGForExport: function(options, chartOptions) {
var chartExportingOptions = this.options.exporting;
return this.getSVG(merge({
chart: {
borderRadius: 0
}
},
chartExportingOptions.chartOptions,
chartOptions, {
exporting: {
sourceWidth: (options && options.sourceWidth) || chartExportingOptions.sourceWidth,
sourceHeight: (options && options.sourceHeight) || chartExportingOptions.sourceHeight
}
}
));
},
/**
* Submit the SVG representation of the chart to the server
* @param {Object} options Exporting options. Possible members are url, type, width and formAttributes.
* @param {Object} chartOptions Additional chart options for the SVG representation of the chart
*/
exportChart: function(options, chartOptions) {
var svg = this.getSVGForExport(options, chartOptions);
// merge the options
options = merge(this.options.exporting, options);
// do the post
H.post(options.url, {
filename: options.filename || 'chart',
type: options.type,
width: options.width || 0, // IE8 fails to post undefined correctly, so use 0
scale: options.scale,
svg: svg
}, options.formAttributes);
},
/**
* Print the chart
*/
print: function() {
var chart = this,
container = chart.container,
origDisplay = [],
origParent = container.parentNode,
body = doc.body,
childNodes = body.childNodes,
printMaxWidth = chart.options.exporting.printMaxWidth,
resetParams,
handleMaxWidth;
if (chart.isPrinting) { // block the button while in printing mode
return;
}
chart.isPrinting = true;
chart.pointer.reset(null, 0);
fireEvent(chart, 'beforePrint');
// Handle printMaxWidth
handleMaxWidth = printMaxWidth && chart.chartWidth > printMaxWidth;
if (handleMaxWidth) {
resetParams = [chart.options.chart.width, undefined, false];
chart.setSize(printMaxWidth, undefined, false);
}
// hide all body content
each(childNodes, function(node, i) {
if (node.nodeType === 1) {
origDisplay[i] = node.style.display;
node.style.display = 'none';
}
});
// pull out the chart
body.appendChild(container);
// print
win.focus(); // #1510
win.print();
// allow the browser to prepare before reverting
setTimeout(function() {
// put the chart back in
origParent.appendChild(container);
// restore all body content
each(childNodes, function(node, i) {
if (node.nodeType === 1) {
node.style.display = origDisplay[i];
}
});
chart.isPrinting = false;
// Reset printMaxWidth
if (handleMaxWidth) {
chart.setSize.apply(chart, resetParams);
}
fireEvent(chart, 'afterPrint');
}, 1000);
},
/**
* Display a popup menu for choosing the export type
*
* @param {String} className An identifier for the menu
* @param {Array} items A collection with text and onclicks for the items
* @param {Number} x The x position of the opener button
* @param {Number} y The y position of the opener button
* @param {Number} width The width of the opener button
* @param {Number} height The height of the opener button
*/
contextMenu: function(className, items, x, y, width, height, button) {
var chart = this,
navOptions = chart.options.navigation,
chartWidth = chart.chartWidth,
chartHeight = chart.chartHeight,
cacheName = 'cache-' + className,
menu = chart[cacheName],
menuPadding = Math.max(width, height), // for mouse leave detection
innerMenu,
hide,
menuStyle,
docMouseUpHandler = function(e) {
if (!chart.pointer.inClass(e.target, className)) {
hide();
}
};
// create the menu only the first time
if (!menu) {
// create a HTML element above the SVG
chart[cacheName] = menu = createElement('div', {
className: className
}, {
position: 'absolute',
zIndex: 1000,
padding: menuPadding + 'px'
}, chart.container);
innerMenu = createElement('div', {
className: 'highcharts-menu'
}, null, menu);
// hide on mouse out
hide = function() {
css(menu, {
display: 'none'
});
if (button) {
button.setState(0);
}
chart.openMenu = false;
};
// Hide the menu some time after mouse leave (#1357)
addEvent(menu, 'mouseleave', function() {
menu.hideTimer = setTimeout(hide, 500);
});
addEvent(menu, 'mouseenter', function() {
clearTimeout(menu.hideTimer);
});
// Hide it on clicking or touching outside the menu (#2258, #2335, #2407)
addEvent(doc, 'mouseup', docMouseUpHandler);
addEvent(chart, 'destroy', function() {
removeEvent(doc, 'mouseup', docMouseUpHandler);
});
// create the items
each(items, function(item) {
if (item) {
var element;
if (item.separator) {
element = createElement('hr', null, null, innerMenu);
} else {
element = createElement('div', {
className: 'highcharts-menu-item',
onclick: function(e) {
if (e) { // IE7
e.stopPropagation();
}
hide();
if (item.onclick) {
item.onclick.apply(chart, arguments);
}
},
innerHTML: item.text || chart.options.lang[item.textKey]
}, null, innerMenu);
}
// Keep references to menu divs to be able to destroy them
chart.exportDivElements.push(element);
}
});
// Keep references to menu and innerMenu div to be able to destroy them
chart.exportDivElements.push(innerMenu, menu);
chart.exportMenuWidth = menu.offsetWidth;
chart.exportMenuHeight = menu.offsetHeight;
}
menuStyle = {
display: 'block'
};
// if outside right, right align it
if (x + chart.exportMenuWidth > chartWidth) {
menuStyle.right = (chartWidth - x - width - menuPadding) + 'px';
} else {
menuStyle.left = (x - menuPadding) + 'px';
}
// if outside bottom, bottom align it
if (y + height + chart.exportMenuHeight > chartHeight && button.alignOptions.verticalAlign !== 'top') {
menuStyle.bottom = (chartHeight - y - menuPadding) + 'px';
} else {
menuStyle.top = (y + height - menuPadding) + 'px';
}
css(menu, menuStyle);
chart.openMenu = true;
},
/**
* Add the export button to the chart
*/
addButton: function(options) {
var chart = this,
renderer = chart.renderer,
btnOptions = merge(chart.options.navigation.buttonOptions, options),
onclick = btnOptions.onclick,
menuItems = btnOptions.menuItems,
symbol,
button,
symbolSize = btnOptions.symbolSize || 12;
if (!chart.btnCount) {
chart.btnCount = 0;
}
// Keeps references to the button elements
if (!chart.exportDivElements) {
chart.exportDivElements = [];
chart.exportSVGElements = [];
}
if (btnOptions.enabled === false) {
return;
}
var attr = btnOptions.theme,
states = attr.states,
hover = states && states.hover,
select = states && states.select,
callback;
delete attr.states;
if (onclick) {
callback = function(e) {
e.stopPropagation();
onclick.call(chart, e);
};
} else if (menuItems) {
callback = function() {
chart.contextMenu(
button.menuClassName,
menuItems,
button.translateX,
button.translateY,
button.width,
button.height,
button
);
button.setState(2);
};
}
if (btnOptions.text && btnOptions.symbol) {
attr.paddingLeft = pick(attr.paddingLeft, 25);
} else if (!btnOptions.text) {
extend(attr, {
width: btnOptions.width,
height: btnOptions.height,
padding: 0
});
}
button = renderer.button(btnOptions.text, 0, 0, callback, attr, hover, select)
.addClass(options.className)
.attr({
title: chart.options.lang[btnOptions._titleKey],
zIndex: 3 // #4955
});
button.menuClassName = options.menuClassName || 'highcharts-menu-' + chart.btnCount++;
if (btnOptions.symbol) {
symbol = renderer.symbol(
btnOptions.symbol,
btnOptions.symbolX - (symbolSize / 2),
btnOptions.symbolY - (symbolSize / 2),
symbolSize,
symbolSize
)
.addClass('highcharts-button-symbol')
.attr({
zIndex: 1
}).add(button);
}
button.add()
.align(extend(btnOptions, {
width: button.width,
x: pick(btnOptions.x, chart.buttonOffset) // #1654
}), true, 'spacingBox');
chart.buttonOffset += (button.width + btnOptions.buttonSpacing) * (btnOptions.align === 'right' ? -1 : 1);
chart.exportSVGElements.push(button, symbol);
},
/**
* Destroy the buttons.
*/
destroyExport: function(e) {
var chart = e ? e.target : this,
exportSVGElements = chart.exportSVGElements,
exportDivElements = chart.exportDivElements;
// Destroy the extra buttons added
if (exportSVGElements) {
each(exportSVGElements, function(elem, i) {
// Destroy and null the svg/vml elements
if (elem) { // #1822
elem.onclick = elem.ontouchstart = null;
chart.exportSVGElements[i] = elem.destroy();
}
});
exportSVGElements.length = 0;
}
// Destroy the divs for the menu
if (exportDivElements) {
each(exportDivElements, function(elem, i) {
// Remove the event handler
clearTimeout(elem.hideTimer); // #5427
removeEvent(elem, 'mouseleave');
// Remove inline events
chart.exportDivElements[i] = elem.onmouseout = elem.onmouseover = elem.ontouchstart = elem.onclick = null;
// Destroy the div by moving to garbage bin
discardElement(elem);
});
exportDivElements.length = 0;
}
}
});
// These ones are translated to attributes rather than styles
SVGRenderer.prototype.inlineToAttributes = [
'fill',
'stroke',
'strokeLinecap',
'strokeLinejoin',
'strokeWidth',
'textAnchor',
'x',
'y'
];
// These CSS properties are not inlined. Remember camelCase.
SVGRenderer.prototype.inlineBlacklist = [
/-/, // In Firefox, both hyphened and camelCased names are listed
/^(clipPath|cssText|d|height|width)$/, // Full words
/^font$/, // more specific props are set
/[lL]ogical(Width|Height)$/,
/perspective/,
/TapHighlightColor/,
/^transition/
// /^text (border|color|cursor|height|webkitBorder)/
];
SVGRenderer.prototype.unstyledElements = [
'clipPath',
'defs',
'desc'
];
/**
* Analyze inherited styles from stylesheets and add them inline
*
* @todo: What are the border styles for text about? In general, text has a lot of properties.
* @todo: Make it work with IE9 and IE10.
*/
Chart.prototype.inlineStyles = function() {
var renderer = this.renderer,
inlineToAttributes = renderer.inlineToAttributes,
blacklist = renderer.inlineBlacklist,
unstyledElements = renderer.unstyledElements,
defaultStyles = {},
dummySVG;
/**
* Make hyphenated property names out of camelCase
*/
function hyphenate(prop) {
return prop.replace(
/([A-Z])/g,
function(a, b) {
return '-' + b.toLowerCase();
}
);
}
/**
* Call this on all elements and recurse to children
*/
function recurse(node) {
var prop,
styles,
parentStyles,
cssText = '',
dummy,
styleAttr,
blacklisted,
i;
if (node.nodeType === 1 && unstyledElements.indexOf(node.nodeName) === -1) {
styles = win.getComputedStyle(node, null);
parentStyles = node.nodeName === 'svg' ? {} : win.getComputedStyle(node.parentNode, null);
// Get default styles from the browser so that we don't have to add these
if (!defaultStyles[node.nodeName]) {
if (!dummySVG) {
dummySVG = doc.createElementNS(H.SVG_NS, 'svg');
dummySVG.setAttribute('version', '1.1');
doc.body.appendChild(dummySVG);
}
dummy = doc.createElementNS(node.namespaceURI, node.nodeName);
dummySVG.appendChild(dummy);
defaultStyles[node.nodeName] = merge(win.getComputedStyle(dummy, null)); // Copy, so we can remove the node
dummySVG.removeChild(dummy);
}
// Loop over all the computed styles and check whether they are in the
// white list for styles or atttributes.
for (prop in styles) {
// Check against blacklist
blacklisted = false;
i = blacklist.length;
while (i-- && !blacklisted) {
blacklisted = blacklist[i].test(prop) || typeof styles[prop] === 'function';
}
if (!blacklisted) {
// If parent node has the same style, it gets inherited, no need to inline it
if (parentStyles[prop] !== styles[prop] && defaultStyles[node.nodeName][prop] !== styles[prop]) {
// Attributes
if (inlineToAttributes.indexOf(prop) !== -1) {
node.setAttribute(hyphenate(prop), styles[prop]);
// Styles
} else {
cssText += hyphenate(prop) + ':' + styles[prop] + ';';
}
}
}
}
// Apply styles
if (cssText) {
styleAttr = node.getAttribute('style');
node.setAttribute('style', (styleAttr ? styleAttr + ';' : '') + cssText);
}
if (node.nodeName === 'text') {
return;
}
// Recurse
each(node.children || node.childNodes, recurse);
}
}
/**
* Remove the dummy objects used to get defaults
*/
function tearDown() {
dummySVG.parentNode.removeChild(dummySVG);
}
recurse(this.container.querySelector('svg'));
tearDown();
};
symbols.menu = function(x, y, width, height) {
var arr = [
'M', x, y + 2.5,
'L', x + width, y + 2.5,
'M', x, y + height / 2 + 0.5,
'L', x + width, y + height / 2 + 0.5,
'M', x, y + height - 1.5,
'L', x + width, y + height - 1.5
];
return arr;
};
// Add the buttons on chart load
Chart.prototype.renderExporting = function() {
var n,
exportingOptions = this.options.exporting,
buttons = exportingOptions.buttons,
isDirty = this.isDirtyExporting || !this.exportSVGElements;
this.buttonOffset = 0;
if (this.isDirtyExporting) {
this.destroyExport();
}
if (isDirty && exportingOptions.enabled !== false) {
for (n in buttons) {
this.addButton(buttons[n]);
}
this.isDirtyExporting = false;
}
// Destroy the export elements at chart destroy
addEvent(this, 'destroy', this.destroyExport);
};
Chart.prototype.callbacks.push(function(chart) {
function update(prop, options, redraw) {
chart.isDirtyExporting = true;
merge(true, chart.options[prop], options);
if (pick(redraw, true)) {
chart.redraw();
}
}
chart.renderExporting();
addEvent(chart, 'redraw', chart.renderExporting);
// Add update methods to handle chart.update and chart.exporting.update
// and chart.navigation.update.
each(['exporting', 'navigation'], function(prop) {
chart[prop] = {
update: function(options, redraw) {
update(prop, options, redraw);
}
};
});
});
}(Highcharts));
}));

View File

@ -0,0 +1,12 @@
/*
Highcharts JS v5.0.2 (2016-10-26)
Highcharts funnel module
(c) 2010-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(c){"object"===typeof module&&module.exports?module.exports=c:c(Highcharts)})(function(c){(function(c){var n=c.seriesType,z=c.seriesTypes,F=c.noop,G=c.each;n("funnel","pie",{animation:!1,center:["50%","50%"],width:"90%",neckWidth:"30%",height:"100%",neckHeight:"25%",reversed:!1,size:!0},{animate:F,translate:function(){var b=function(a,b){return/%$/.test(a)?b*parseInt(a,10)/100:parseInt(a,10)},c=0,e=this.chart,d=this.options,r=d.reversed,H=d.ignoreHiddenPoint,t=e.plotWidth,e=e.plotHeight,
p=0,n=d.center,f=b(n[0],t),q=b(n[1],e),z=b(d.width,t),h,v,k=b(d.height,e),w=b(d.neckWidth,t),D=b(d.neckHeight,e),x=q-k/2+k-D,b=this.data,A,B,I="left"===d.dataLabels.position?1:0,C,l,E,u,g,y,m;this.getWidthAt=v=function(a){var b=q-k/2;return a>x||k===D?w:w+(z-w)*(1-(a-b)/(k-D))};this.getX=function(a,b){return f+(b?-1:1)*(v(r?2*q-a:a)/2+d.dataLabels.distance)};this.center=[f,q,k];this.centerX=f;G(b,function(a){H&&!1===a.visible||(c+=a.y)});G(b,function(a){m=null;B=c?a.y/c:0;l=q-k/2+p*k;g=l+B*k;h=v(l);
C=f-h/2;E=C+h;h=v(g);u=f-h/2;y=u+h;l>x?(C=u=f-w/2,E=y=f+w/2):g>x&&(m=g,h=v(x),u=f-h/2,y=u+h,g=x);r&&(l=2*q-l,g=2*q-g,m=m?2*q-m:null);A=["M",C,l,"L",E,l,y,g];m&&A.push(y,m,u,m);A.push(u,g,"Z");a.shapeType="path";a.shapeArgs={d:A};a.percentage=100*B;a.plotX=f;a.plotY=(l+(m||g))/2;a.tooltipPos=[f,a.plotY];a.slice=F;a.half=I;H&&!1===a.visible||(p+=B)})},drawPoints:z.column.prototype.drawPoints,sortByAngle:function(b){b.sort(function(b,c){return b.plotY-c.plotY})},drawDataLabels:function(){var b=this.data,
c=this.options.dataLabels.distance,e,d,r,n=b.length,t,p;for(this.center[2]-=2*c;n--;)r=b[n],d=(e=r.half)?1:-1,p=r.plotY,t=this.getX(p,e),r.labelPos=[0,p,t+(c-5)*d,p,t+c*d,p,e?"right":"left",0];z.pie.prototype.drawDataLabels.call(this)}});n("pyramid","funnel",{neckWidth:"0%",neckHeight:"0%",reversed:!0})})(c)});

View File

@ -0,0 +1,290 @@
/**
* @license Highcharts JS v5.0.2 (2016-10-26)
* Highcharts funnel module
*
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* Highcharts funnel module
*
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
/* eslint indent:0 */
'use strict';
// create shortcuts
var seriesType = Highcharts.seriesType,
seriesTypes = Highcharts.seriesTypes,
noop = Highcharts.noop,
each = Highcharts.each;
seriesType('funnel', 'pie', {
animation: false,
center: ['50%', '50%'],
width: '90%',
neckWidth: '30%',
height: '100%',
neckHeight: '25%',
reversed: false,
size: true, // to avoid adapting to data label size in Pie.drawDataLabels
},
// Properties
{
animate: noop,
/**
* Overrides the pie translate method
*/
translate: function() {
var
// Get positions - either an integer or a percentage string must be given
getLength = function(length, relativeTo) {
return (/%$/).test(length) ?
relativeTo * parseInt(length, 10) / 100 :
parseInt(length, 10);
},
sum = 0,
series = this,
chart = series.chart,
options = series.options,
reversed = options.reversed,
ignoreHiddenPoint = options.ignoreHiddenPoint,
plotWidth = chart.plotWidth,
plotHeight = chart.plotHeight,
cumulative = 0, // start at top
center = options.center,
centerX = getLength(center[0], plotWidth),
centerY = getLength(center[1], plotHeight),
width = getLength(options.width, plotWidth),
tempWidth,
getWidthAt,
height = getLength(options.height, plotHeight),
neckWidth = getLength(options.neckWidth, plotWidth),
neckHeight = getLength(options.neckHeight, plotHeight),
neckY = (centerY - height / 2) + height - neckHeight,
data = series.data,
path,
fraction,
half = options.dataLabels.position === 'left' ? 1 : 0,
x1,
y1,
x2,
x3,
y3,
x4,
y5;
// Return the width at a specific y coordinate
series.getWidthAt = getWidthAt = function(y) {
var top = (centerY - height / 2);
return y > neckY || height === neckHeight ?
neckWidth :
neckWidth + (width - neckWidth) * (1 - (y - top) / (height - neckHeight));
};
series.getX = function(y, half) {
return centerX + (half ? -1 : 1) * ((getWidthAt(reversed ? 2 * centerY - y : y) / 2) + options.dataLabels.distance);
};
// Expose
series.center = [centerX, centerY, height];
series.centerX = centerX;
/*
* Individual point coordinate naming:
*
* x1,y1 _________________ x2,y1
* \ /
* \ /
* \ /
* \ /
* \ /
* x3,y3 _________ x4,y3
*
* Additional for the base of the neck:
*
* | |
* | |
* | |
* x3,y5 _________ x4,y5
*/
// get the total sum
each(data, function(point) {
if (!ignoreHiddenPoint || point.visible !== false) {
sum += point.y;
}
});
each(data, function(point) {
// set start and end positions
y5 = null;
fraction = sum ? point.y / sum : 0;
y1 = centerY - height / 2 + cumulative * height;
y3 = y1 + fraction * height;
//tempWidth = neckWidth + (width - neckWidth) * ((height - neckHeight - y1) / (height - neckHeight));
tempWidth = getWidthAt(y1);
x1 = centerX - tempWidth / 2;
x2 = x1 + tempWidth;
tempWidth = getWidthAt(y3);
x3 = centerX - tempWidth / 2;
x4 = x3 + tempWidth;
// the entire point is within the neck
if (y1 > neckY) {
x1 = x3 = centerX - neckWidth / 2;
x2 = x4 = centerX + neckWidth / 2;
// the base of the neck
} else if (y3 > neckY) {
y5 = y3;
tempWidth = getWidthAt(neckY);
x3 = centerX - tempWidth / 2;
x4 = x3 + tempWidth;
y3 = neckY;
}
if (reversed) {
y1 = 2 * centerY - y1;
y3 = 2 * centerY - y3;
y5 = (y5 ? 2 * centerY - y5 : null);
}
// save the path
path = [
'M',
x1, y1,
'L',
x2, y1,
x4, y3
];
if (y5) {
path.push(x4, y5, x3, y5);
}
path.push(x3, y3, 'Z');
// prepare for using shared dr
point.shapeType = 'path';
point.shapeArgs = {
d: path
};
// for tooltips and data labels
point.percentage = fraction * 100;
point.plotX = centerX;
point.plotY = (y1 + (y5 || y3)) / 2;
// Placement of tooltips and data labels
point.tooltipPos = [
centerX,
point.plotY
];
// Slice is a noop on funnel points
point.slice = noop;
// Mimicking pie data label placement logic
point.half = half;
if (!ignoreHiddenPoint || point.visible !== false) {
cumulative += fraction;
}
});
},
/**
* Draw a single point (wedge)
* @param {Object} point The point object
* @param {Object} color The color of the point
* @param {Number} brightness The brightness relative to the color
*/
drawPoints: seriesTypes.column.prototype.drawPoints,
/**
* Funnel items don't have angles (#2289)
*/
sortByAngle: function(points) {
points.sort(function(a, b) {
return a.plotY - b.plotY;
});
},
/**
* Extend the pie data label method
*/
drawDataLabels: function() {
var data = this.data,
labelDistance = this.options.dataLabels.distance,
leftSide,
sign,
point,
i = data.length,
x,
y;
// In the original pie label anticollision logic, the slots are distributed
// from one labelDistance above to one labelDistance below the pie. In funnels
// we don't want this.
this.center[2] -= 2 * labelDistance;
// Set the label position array for each point.
while (i--) {
point = data[i];
leftSide = point.half;
sign = leftSide ? 1 : -1;
y = point.plotY;
x = this.getX(y, leftSide);
// set the anchor point for data labels
point.labelPos = [
0, // first break of connector
y, // a/a
x + (labelDistance - 5) * sign, // second break, right outside point shape
y, // a/a
x + labelDistance * sign, // landing point for connector
y, // a/a
leftSide ? 'right' : 'left', // alignment
0 // center angle
];
}
seriesTypes.pie.prototype.drawDataLabels.call(this);
}
});
/**
* Pyramid series type.
* A pyramid series is a special type of funnel, without neck and reversed by default.
*/
seriesType('pyramid', 'funnel', {
neckWidth: '0%',
neckHeight: '0%',
reversed: true
});
}(Highcharts));
}));

View File

@ -0,0 +1,24 @@
/*
Highcharts JS v5.0.2 (2016-10-26)
Gantt series
(c) 2016 Lars A. V. Cabrera
--- WORK IN PROGRESS ---
License: www.highcharts.com/license
*/
(function(m){"object"===typeof module&&module.exports?module.exports=m:m(Highcharts)})(function(m){(function(c){var m=c.dateFormat,p=c.each,q=c.isObject,u=c.pick,l=c.wrap,n=c.Axis,v=c.Chart,r=c.Tick;n.prototype.isOuterAxis=function(){var a=this,f=-1,b=!0;p(this.chart.axes,function(d,g){d.side===a.side&&(d===a?f=g:0<=f&&g>f&&(b=!1))});return b};r.prototype.getLabelWidth=function(){return this.label.getBBox().width};n.prototype.getMaxLabelLength=function(a){var f=this.tickPositions,b=this.ticks,d=0;
if(!this.maxLabelLength||a)p(f,function(a){(a=b[a])&&a.labelLength>d&&(d=a.labelLength)}),this.maxLabelLength=d;return this.maxLabelLength};n.prototype.addTitle=function(){var a=this.chart.renderer,f=this.axisParent,b=this.horiz,d=this.opposite,g=this.options,e=g.title,h;this.showAxis=h=this.hasData()||u(g.showEmpty,!0);g.title="";this.axisTitle||((g=e.textAlign)||(g=(b?{low:"left",middle:"center",high:"right"}:{low:d?"right":"left",middle:"center",high:d?"left":"right"})[e.align]),this.axisTitle=
a.text(e.text,0,0,e.useHTML).attr({zIndex:7,rotation:e.rotation||0,align:g}).addClass("highcharts-axis-title").add(f),this.axisTitle.isNew=!0);this.axisTitle[h?"show":"hide"](!0)};c.dateFormats={W:function(a){a=new Date(a);var f=0===a.getUTCDay()?7:a.getUTCDay(),b=a.getTime(),d=new Date(a.getUTCFullYear(),0,1,-6);a.setDate(a.getUTCDate()+4-f);return 1+Math.floor(Math.floor((b-d)/864E5)/7)},E:function(a){return m("%a",a,!0).charAt(0)}};l(r.prototype,"addLabel",function(a){var f=this.axis,b=void 0!==
f.options.categories,d=f.tickPositions,d=this.pos!==d[d.length-1];(!f.options.grid||b||d)&&a.apply(this)});l(r.prototype,"getLabelPosition",function(a,f,b,d){var g=a.apply(this,Array.prototype.slice.call(arguments,1)),e=this.axis,h=e.options,k=h.tickInterval||1,c,t;h.grid&&(c=h.labels.style.fontSize,t=e.chart.renderer.fontMetrics(c,d),c=t.b,t=t.h,e.horiz&&void 0===h.categories?(h=e.axisGroup.getBBox().height,k=this.pos+k/2,g.x=e.translate(k)+e.left,k=h/2+t/2-Math.abs(t-c),g.y=0===e.side?b-k:b+k):
(void 0===h.categories&&(k=this.pos+k/2,g.y=e.translate(k)+e.top+c/2),k=this.getLabelWidth()/2-e.maxLabelLength/2,g.x=3===e.side?g.x+k:g.x-k));return g});l(n.prototype,"tickSize",function(a){var f=a.apply(this,Array.prototype.slice.call(arguments,1)),b;this.options.grid&&!this.horiz&&(b=2*Math.abs(this.defaultLeftAxisOptions.labels.x),this.maxLabelLength||(this.maxLabelLength=this.getMaxLabelLength()),b=this.maxLabelLength+b,f[0]=b);return f});l(n.prototype,"getOffset",function(a){var f=this.chart.axisOffset,
b=this.side,d,g,e=this.options,h=e.title,k=h&&h.text&&!1!==h.enabled;this.options.grid&&q(this.options.title)?(g=this.tickSize("tick")[0],f[b]&&g&&(d=f[b]+g),k&&this.addTitle(),a.apply(this,Array.prototype.slice.call(arguments,1)),f[b]=u(d,f[b]),e.title=h):a.apply(this,Array.prototype.slice.call(arguments,1))});l(n.prototype,"renderUnsquish",function(a){this.options.grid&&(this.labelRotation=0,this.options.labels.rotation=0);a.apply(this)});l(n.prototype,"setOptions",function(a,f){f.grid&&this.horiz&&
(f.startOnTick=!0,f.minPadding=0,f.endOnTick=!0);a.apply(this,Array.prototype.slice.call(arguments,1))});l(n.prototype,"render",function(a){var f=this.options,b,d,g,e,h,k,c=this.chart.renderer;if(f.grid){if(b=2*Math.abs(this.defaultLeftAxisOptions.labels.x),b=this.maxLabelLength+b,d=f.lineWidth,this.rightWall&&this.rightWall.destroy(),a.apply(this),a=this.axisGroup.getBBox(),this.horiz&&(this.rightWall=c.path(["M",a.x+this.width+1,a.y,"L",a.x+this.width+1,a.y+a.height]).attr({stroke:f.tickColor||
"#ccd6eb","stroke-width":f.tickWidth||1,zIndex:7,class:"grid-wall"}).add(this.axisGroup)),this.isOuterAxis()&&this.axisLine&&(this.horiz&&(b=a.height-1),d)){a=this.getLinePath(d);h=a.indexOf("M")+1;k=a.indexOf("L")+1;g=a.indexOf("M")+2;e=a.indexOf("L")+2;if(0===this.side||3===this.side)b=-b;this.horiz?(a[g]+=b,a[e]+=b):(a[h]+=b,a[k]+=b);this.axisLineExtra?this.axisLineExtra.animate({d:a}):this.axisLineExtra=c.path(a).attr({stroke:f.lineColor,"stroke-width":d,zIndex:7}).add(this.axisGroup);this.axisLine[this.showAxis?
"show":"hide"](!0)}}else a.apply(this)});l(v.prototype,"render",function(a){var f=25/11,b,c;p(this.axes,function(a){var e=a.options;e.grid&&(c=e.labels.style.fontSize,b=a.chart.renderer.fontMetrics(c),"datetime"===e.type&&(e.units=[["millisecond",[1]],["second",[1]],["minute",[1]],["hour",[1]],["day",[1]],["week",[1]],["month",[1]],["year",null]]),a.horiz?e.tickLength=e.cellHeight||b.h*f:(e.tickWidth=1,e.lineWidth||(e.lineWidth=1)))});a.apply(this)})})(m);(function(c){var m=c.getOptions().plotOptions,
p=c.seriesTypes.column,q=c.each,u=c.extendClass,l=c.isNumber,n=c.isObject,v=c.merge,r=c.pick,a=c.seriesTypes,f=c.stop,b=c.wrap,d=c.Axis,g=c.Point,e=c.Series;m.xrange=v(m.column,{tooltip:{pointFormat:'\x3cspan style\x3d"color:{point.color}"\x3e\u25cf\x3c/span\x3e {series.name}: \x3cb\x3e{point.yCategory}\x3c/b\x3e\x3cbr/\x3e'}});a.xrange=u(p,{pointClass:u(g,{getLabelConfig:function(){var a=g.prototype.getLabelConfig.call(this);a.x2=this.x2;a.yCategory=this.yCategory=this.series.yAxis.categories&&this.series.yAxis.categories[this.y];
return a}}),type:"xrange",forceDL:!0,parallelArrays:["x","x2","y"],requireSorting:!1,animate:a.line.prototype.animate,getColumnMetrics:function(){function a(){q(f.series,function(a){var b=a.xAxis;a.xAxis=a.yAxis;a.yAxis=b})}var b,f=this.chart;a();this.yAxis.closestPointRange=1;b=p.prototype.getColumnMetrics.call(this);a();return b},cropData:function(a,b,f,c){b=e.prototype.cropData.call(this,this.x2Data,b,f,c);b.xData=a.slice(b.start,b.end);return b},translate:function(){p.prototype.translate.apply(this,
arguments);var a=this.xAxis,b=this.columnMetrics,f=this.options.minPointLength||0;q(this.points,function(c){var e=c.plotX,d=r(c.x2,c.x+(c.len||0)),d=a.toPixels(d,!0),g=d-e,h;f&&(h=f-g,0>h&&(h=0),e-=h/2,d+=h/2);e=Math.max(e,-10);d=Math.min(Math.max(d,-10),a.len+10);c.shapeArgs={x:e,y:c.plotY+b.offset,width:d-e,height:b.width};c.tooltipPos[0]+=g/2;c.tooltipPos[1]-=b.width/2;if(d=c.partialFill)n(d)&&(d=d.amount),l(d)||(d=0),e=c.shapeArgs,c.partShapeArgs={x:e.x,y:e.y+1,width:e.width*d,height:e.height-
2}})},drawPoints:function(){var a=this,b=this.chart,c=b.renderer,e=b.pointCount<(a.options.animationLimit||250)?"animate":"attr";q(a.points,function(b){var d=b.graphic,g=b.shapeType,h=b.shapeArgs,k=b.partShapeArgs;if(l(b.plotY)&&null!==b.y)if(d){if(f(d),b.graphicOriginal[e](v(h)),k)b.graphicOverlay[e](v(k))}else b.graphic=d=c.g("point").attr({"class":b.getClassName()}).add(b.group||a.group),b.graphicOriginal=c[g](h).addClass("highcharts-partfill-original").add(d),k&&(b.graphicOverlay=c[g](k).addClass("highcharts-partfill-overlay").add(d));
else d&&(b.graphic=d.destroy())})}});b(d.prototype,"getSeriesExtremes",function(a){var b=this.series,c,d;a.call(this);this.isXAxis&&"xrange"===b.type&&(c=r(this.dataMax,Number.MIN_VALUE),q(this.series,function(a){q(a.x2Data||[],function(a){a>c&&(c=a,d=!0)})}),d&&(this.dataMax=c))})})(m)});

View File

@ -0,0 +1,793 @@
/**
* @license Highcharts JS v5.0.2 (2016-10-26)
* Gantt series
*
* (c) 2016 Lars A. V. Cabrera
*
* --- WORK IN PROGRESS ---
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* (c) 2016 Highsoft AS
* Authors: Lars A. V. Cabrera
*
* License: www.highcharts.com/license
*/
'use strict';
var dateFormat = H.dateFormat,
each = H.each,
isObject = H.isObject,
pick = H.pick,
wrap = H.wrap,
Axis = H.Axis,
Chart = H.Chart,
Tick = H.Tick;
// Enum for which side the axis is on.
// Maps to axis.side
var axisSide = {
top: 0,
right: 1,
bottom: 2,
left: 3,
0: 'top',
1: 'right',
2: 'bottom',
3: 'left'
};
/**
* Checks if an axis is the outer axis in its dimension. Since
* axes are placed outwards in order, the axis with the highest
* index is the outermost axis.
*
* Example: If there are multiple x-axes at the top of the chart,
* this function returns true if the axis supplied is the last
* of the x-axes.
*
* @return true if the axis is the outermost axis in its dimension;
* false if not
*/
Axis.prototype.isOuterAxis = function() {
var axis = this,
thisIndex = -1,
isOuter = true;
each(this.chart.axes, function(otherAxis, index) {
if (otherAxis.side === axis.side) {
if (otherAxis === axis) {
// Get the index of the axis in question
thisIndex = index;
// Check thisIndex >= 0 in case thisIndex has
// not been found yet
} else if (thisIndex >= 0 && index > thisIndex) {
// There was an axis on the same side with a
// higher index. Exit the loop.
isOuter = false;
return;
}
}
});
// There were either no other axes on the same side,
// or the other axes were not farther from the chart
return isOuter;
};
/**
* Shortcut function to Tick.label.getBBox().width.
*
* @return {number} width - the width of the tick label
*/
Tick.prototype.getLabelWidth = function() {
return this.label.getBBox().width;
};
/**
* Get the maximum label length.
* This function can be used in states where the axis.maxLabelLength has not
* been set.
*
* @param {boolean} force - Optional parameter to force a new calculation, even
* if a value has already been set
* @return {number} maxLabelLength - the maximum label length of the axis
*/
Axis.prototype.getMaxLabelLength = function(force) {
var tickPositions = this.tickPositions,
ticks = this.ticks,
maxLabelLength = 0;
if (!this.maxLabelLength || force) {
each(tickPositions, function(tick) {
tick = ticks[tick];
if (tick && tick.labelLength > maxLabelLength) {
maxLabelLength = tick.labelLength;
}
});
this.maxLabelLength = maxLabelLength;
}
return this.maxLabelLength;
};
/**
* Adds the axis defined in axis.options.title
*/
Axis.prototype.addTitle = function() {
var axis = this,
renderer = axis.chart.renderer,
axisParent = axis.axisParent,
horiz = axis.horiz,
opposite = axis.opposite,
options = axis.options,
axisTitleOptions = options.title,
hasData,
showAxis,
textAlign;
// For reuse in Axis.render
hasData = axis.hasData();
axis.showAxis = showAxis = hasData || pick(options.showEmpty, true);
// Disregard title generation in original Axis.getOffset()
options.title = '';
if (!axis.axisTitle) {
textAlign = axisTitleOptions.textAlign;
if (!textAlign) {
textAlign = (horiz ? {
low: 'left',
middle: 'center',
high: 'right'
} : {
low: opposite ? 'right' : 'left',
middle: 'center',
high: opposite ? 'left' : 'right'
})[axisTitleOptions.align];
}
axis.axisTitle = renderer.text(
axisTitleOptions.text,
0,
0,
axisTitleOptions.useHTML
)
.attr({
zIndex: 7,
rotation: axisTitleOptions.rotation || 0,
align: textAlign
})
.addClass('highcharts-axis-title')
// Add to axisParent instead of axisGroup, to ignore the space
// it takes
.add(axisParent);
axis.axisTitle.isNew = true;
}
// hide or show the title depending on whether showEmpty is set
axis.axisTitle[showAxis ? 'show' : 'hide'](true);
};
/**
* Add custom date formats
*/
H.dateFormats = {
// Week number
W: function(timestamp) {
var date = new Date(timestamp),
day = date.getUTCDay() === 0 ? 7 : date.getUTCDay(),
time = date.getTime(),
startOfYear = new Date(date.getUTCFullYear(), 0, 1, -6),
dayNumber;
date.setDate(date.getUTCDate() + 4 - day);
dayNumber = Math.floor((time - startOfYear) / 86400000);
return 1 + Math.floor(dayNumber / 7);
},
// First letter of the day of the week, e.g. 'M' for 'Monday'.
E: function(timestamp) {
return dateFormat('%a', timestamp, true).charAt(0);
}
};
/**
* Prevents adding the last tick label if the axis is not a category axis.
*
* Since numeric labels are normally placed at starts and ends of a range of
* value, and this module makes the label point at the value, an "extra" label
* would appear.
*
* @param {function} proceed - the original function
*/
wrap(Tick.prototype, 'addLabel', function(proceed) {
var axis = this.axis,
isCategoryAxis = axis.options.categories !== undefined,
tickPositions = axis.tickPositions,
lastTick = tickPositions[tickPositions.length - 1],
isLastTick = this.pos !== lastTick;
if (!axis.options.grid || isCategoryAxis || isLastTick) {
proceed.apply(this);
}
});
/**
* Center tick labels vertically and horizontally between ticks
*
* @param {function} proceed - the original function
*
* @return {object} object - an object containing x and y positions
* for the tick
*/
wrap(Tick.prototype, 'getLabelPosition', function(proceed, x, y, label) {
var retVal = proceed.apply(this, Array.prototype.slice.call(arguments, 1)),
axis = this.axis,
options = axis.options,
tickInterval = options.tickInterval || 1,
newX,
newPos,
axisHeight,
fontSize,
labelMetrics,
lblB,
lblH,
labelCenter;
// Only center tick labels if axis has option grid: true
if (options.grid) {
fontSize = options.labels.style.fontSize;
labelMetrics = axis.chart.renderer.fontMetrics(fontSize, label);
lblB = labelMetrics.b;
lblH = labelMetrics.h;
if (axis.horiz && options.categories === undefined) {
// Center x position
axisHeight = axis.axisGroup.getBBox().height;
newPos = this.pos + tickInterval / 2;
retVal.x = axis.translate(newPos) + axis.left;
labelCenter = (axisHeight / 2) + (lblH / 2) - Math.abs(lblH - lblB);
// Center y position
if (axis.side === axisSide.top) {
retVal.y = y - labelCenter;
} else {
retVal.y = y + labelCenter;
}
} else {
// Center y position
if (options.categories === undefined) {
newPos = this.pos + (tickInterval / 2);
retVal.y = axis.translate(newPos) + axis.top + (lblB / 2);
}
// Center x position
newX = (this.getLabelWidth() / 2) - (axis.maxLabelLength / 2);
if (axis.side === axisSide.left) {
retVal.x += newX;
} else {
retVal.x -= newX;
}
}
}
return retVal;
});
/**
* Draw vertical ticks extra long to create cell floors and roofs.
* Overrides the tickLength for vertical axes.
*
* @param {function} proceed - the original function
* @returns {array} retVal -
*/
wrap(Axis.prototype, 'tickSize', function(proceed) {
var axis = this,
retVal = proceed.apply(axis, Array.prototype.slice.call(arguments, 1)),
labelPadding,
distance;
if (axis.options.grid && !axis.horiz) {
labelPadding = (Math.abs(axis.defaultLeftAxisOptions.labels.x) * 2);
if (!axis.maxLabelLength) {
axis.maxLabelLength = axis.getMaxLabelLength();
}
distance = axis.maxLabelLength + labelPadding;
retVal[0] = distance;
}
return retVal;
});
/**
* Disregards space required by axisTitle, by adding axisTitle to axisParent
* instead of axisGroup, and disregarding margins and offsets related to
* axisTitle.
*
* @param {function} proceed - the original function
*/
wrap(Axis.prototype, 'getOffset', function(proceed) {
var axis = this,
axisOffset = axis.chart.axisOffset,
side = axis.side,
axisHeight,
tickSize,
options = axis.options,
axisTitleOptions = options.title,
addTitle = axisTitleOptions &&
axisTitleOptions.text &&
axisTitleOptions.enabled !== false;
if (axis.options.grid && isObject(axis.options.title)) {
tickSize = axis.tickSize('tick')[0];
if (axisOffset[side] && tickSize) {
axisHeight = axisOffset[side] + tickSize;
}
if (addTitle) {
// Use the custom addTitle() to add it, while preventing making room
// for it
axis.addTitle();
}
proceed.apply(axis, Array.prototype.slice.call(arguments, 1));
axisOffset[side] = pick(axisHeight, axisOffset[side]);
// Put axis options back after original Axis.getOffset() has been called
options.title = axisTitleOptions;
} else {
proceed.apply(axis, Array.prototype.slice.call(arguments, 1));
}
});
/**
* Prevents rotation of labels when squished, as rotating them would not
* help.
*
* @param {function} proceed - the original function
*/
wrap(Axis.prototype, 'renderUnsquish', function(proceed) {
if (this.options.grid) {
this.labelRotation = 0;
this.options.labels.rotation = 0;
}
proceed.apply(this);
});
/**
* Places leftmost tick at the start of the axis, to create a left wall.
*
* @param {function} proceed - the original function
*/
wrap(Axis.prototype, 'setOptions', function(proceed, userOptions) {
var axis = this;
if (userOptions.grid && axis.horiz) {
userOptions.startOnTick = true;
userOptions.minPadding = 0;
userOptions.endOnTick = true;
}
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
});
/**
* Draw an extra line on the far side of the the axisLine,
* creating cell roofs of a grid.
*
* @param {function} proceed - the original function
*/
wrap(Axis.prototype, 'render', function(proceed) {
var axis = this,
options = axis.options,
labelPadding,
distance,
lineWidth,
linePath,
yStartIndex,
yEndIndex,
xStartIndex,
xEndIndex,
renderer = axis.chart.renderer,
axisGroupBox;
if (options.grid) {
labelPadding = (Math.abs(axis.defaultLeftAxisOptions.labels.x) * 2);
distance = axis.maxLabelLength + labelPadding;
lineWidth = options.lineWidth;
// Remove right wall before rendering
if (axis.rightWall) {
axis.rightWall.destroy();
}
// Call original Axis.render() to obtain axis.axisLine and
// axis.axisGroup
proceed.apply(axis);
axisGroupBox = axis.axisGroup.getBBox();
// Add right wall on horizontal axes
if (axis.horiz) {
axis.rightWall = renderer.path([
'M',
axisGroupBox.x + axis.width + 1, // account for left wall
axisGroupBox.y,
'L',
axisGroupBox.x + axis.width + 1, // account for left wall
axisGroupBox.y + axisGroupBox.height
])
.attr({
stroke: options.tickColor || '#ccd6eb',
'stroke-width': options.tickWidth || 1,
zIndex: 7,
class: 'grid-wall'
})
.add(axis.axisGroup);
}
if (axis.isOuterAxis() && axis.axisLine) {
if (axis.horiz) {
// -1 to avoid adding distance each time the chart updates
distance = axisGroupBox.height - 1;
}
if (lineWidth) {
linePath = axis.getLinePath(lineWidth);
xStartIndex = linePath.indexOf('M') + 1;
xEndIndex = linePath.indexOf('L') + 1;
yStartIndex = linePath.indexOf('M') + 2;
yEndIndex = linePath.indexOf('L') + 2;
// Negate distance if top or left axis
if (axis.side === axisSide.top || axis.side === axisSide.left) {
distance = -distance;
}
// If axis is horizontal, reposition line path vertically
if (axis.horiz) {
linePath[yStartIndex] = linePath[yStartIndex] + distance;
linePath[yEndIndex] = linePath[yEndIndex] + distance;
} else {
// If axis is vertical, reposition line path horizontally
linePath[xStartIndex] = linePath[xStartIndex] + distance;
linePath[xEndIndex] = linePath[xEndIndex] + distance;
}
if (!axis.axisLineExtra) {
axis.axisLineExtra = renderer.path(linePath)
.attr({
stroke: options.lineColor,
'stroke-width': lineWidth,
zIndex: 7
})
.add(axis.axisGroup);
} else {
axis.axisLineExtra.animate({
d: linePath
});
}
// show or hide the line depending on options.showEmpty
axis.axisLine[axis.showAxis ? 'show' : 'hide'](true);
}
}
} else {
proceed.apply(axis);
}
});
/**
* Wraps chart rendering with the following customizations:
* 1. Prohibit timespans of multitudes of a time unit
* 2. Draw cell walls on vertical axes
*
* @param {function} proceed - the original function
*/
wrap(Chart.prototype, 'render', function(proceed) {
// 25 is optimal height for default fontSize (11px)
// 25 / 11 ≈ 2.28
var fontSizeToCellHeightRatio = 25 / 11,
fontMetrics,
fontSize;
each(this.axes, function(axis) {
var options = axis.options;
if (options.grid) {
fontSize = options.labels.style.fontSize;
fontMetrics = axis.chart.renderer.fontMetrics(fontSize);
// Prohibit timespans of multitudes of a time unit,
// e.g. two days, three weeks, etc.
if (options.type === 'datetime') {
options.units = [
['millisecond', [1]],
['second', [1]],
['minute', [1]],
['hour', [1]],
['day', [1]],
['week', [1]],
['month', [1]],
['year', null]
];
}
// Make tick marks taller, creating cell walls of a grid.
// Use cellHeight axis option if set
if (axis.horiz) {
options.tickLength = options.cellHeight ||
fontMetrics.h * fontSizeToCellHeightRatio;
} else {
options.tickWidth = 1;
if (!options.lineWidth) {
options.lineWidth = 1;
}
}
}
});
// Call original Chart.render()
proceed.apply(this);
});
}(Highcharts));
(function(H) {
/**
* (c) 2014-2016 Highsoft AS
* Authors: Torstein Honsi, Lars A. V. Cabrera
*
* License: www.highcharts.com/license
*/
'use strict';
var defaultPlotOptions = H.getOptions().plotOptions,
color = H.Color,
columnType = H.seriesTypes.column,
each = H.each,
extendClass = H.extendClass,
isNumber = H.isNumber,
isObject = H.isObject,
merge = H.merge,
pick = H.pick,
seriesTypes = H.seriesTypes,
stop = H.stop,
wrap = H.wrap,
Axis = H.Axis,
Point = H.Point,
Series = H.Series,
pointFormat = '<span style="color:{point.color}">' +
'\u25CF' +
'</span> {series.name}: <b>{point.yCategory}</b><br/>',
xrange = 'xrange';
defaultPlotOptions.xrange = merge(defaultPlotOptions.column, {
tooltip: {
pointFormat: pointFormat
}
});
seriesTypes.xrange = extendClass(columnType, {
pointClass: extendClass(Point, {
// Add x2 and yCategory to the available properties for tooltip formats
getLabelConfig: function() {
var cfg = Point.prototype.getLabelConfig.call(this);
cfg.x2 = this.x2;
cfg.yCategory = this.yCategory = this.series.yAxis.categories && this.series.yAxis.categories[this.y];
return cfg;
}
}),
type: xrange,
forceDL: true,
parallelArrays: ['x', 'x2', 'y'],
requireSorting: false,
animate: seriesTypes.line.prototype.animate,
/**
* Borrow the column series metrics, but with swapped axes. This gives free access
* to features like groupPadding, grouping, pointWidth etc.
*/
getColumnMetrics: function() {
var metrics,
chart = this.chart;
function swapAxes() {
each(chart.series, function(s) {
var xAxis = s.xAxis;
s.xAxis = s.yAxis;
s.yAxis = xAxis;
});
}
swapAxes();
this.yAxis.closestPointRange = 1;
metrics = columnType.prototype.getColumnMetrics.call(this);
swapAxes();
return metrics;
},
/**
* Override cropData to show a point where x is outside visible range
* but x2 is outside.
*/
cropData: function(xData, yData, min, max) {
// Replace xData with x2Data to find the appropriate cropStart
var cropData = Series.prototype.cropData,
crop = cropData.call(this, this.x2Data, yData, min, max);
// Re-insert the cropped xData
crop.xData = xData.slice(crop.start, crop.end);
return crop;
},
translate: function() {
columnType.prototype.translate.apply(this, arguments);
var series = this,
xAxis = series.xAxis,
metrics = series.columnMetrics,
minPointLength = series.options.minPointLength || 0;
each(series.points, function(point) {
var plotX = point.plotX,
posX = pick(point.x2, point.x + (point.len || 0)),
plotX2 = xAxis.toPixels(posX, true),
width = plotX2 - plotX,
widthDifference,
shapeArgs,
partialFill;
if (minPointLength) {
widthDifference = minPointLength - width;
if (widthDifference < 0) {
widthDifference = 0;
}
plotX -= widthDifference / 2;
plotX2 += widthDifference / 2;
}
plotX = Math.max(plotX, -10);
plotX2 = Math.min(Math.max(plotX2, -10), xAxis.len + 10);
point.shapeArgs = {
x: plotX,
y: point.plotY + metrics.offset,
width: plotX2 - plotX,
height: metrics.width
};
point.tooltipPos[0] += width / 2;
point.tooltipPos[1] -= metrics.width / 2;
// Add a partShapeArgs to the point, based on the shapeArgs property
partialFill = point.partialFill;
if (partialFill) {
// Get the partial fill amount
if (isObject(partialFill)) {
partialFill = partialFill.amount;
}
// If it was not a number, assume 0
if (!isNumber(partialFill)) {
partialFill = 0;
}
shapeArgs = point.shapeArgs;
point.partShapeArgs = {
x: shapeArgs.x,
y: shapeArgs.y + 1,
width: shapeArgs.width * partialFill,
height: shapeArgs.height - 2
};
}
});
},
drawPoints: function() {
var series = this,
chart = this.chart,
options = series.options,
renderer = chart.renderer,
animationLimit = options.animationLimit || 250,
verb = chart.pointCount < animationLimit ? 'animate' : 'attr';
// draw the columns
each(series.points, function(point) {
var plotY = point.plotY,
graphic = point.graphic,
type = point.shapeType,
shapeArgs = point.shapeArgs,
partShapeArgs = point.partShapeArgs,
seriesOpts = series.options,
pfOptions = point.partialFill,
fill,
state = point.selected && 'select',
cutOff = options.stacking && !options.borderRadius;
if (isNumber(plotY) && point.y !== null) {
if (graphic) { // update
stop(graphic);
point.graphicOriginal[verb](
merge(shapeArgs)
);
if (partShapeArgs) {
point.graphicOverlay[verb](
merge(partShapeArgs)
);
}
} else {
point.graphic = graphic = renderer.g('point')
.attr({
'class': point.getClassName()
})
.add(point.group || series.group);
point.graphicOriginal = renderer[type](shapeArgs)
.addClass('highcharts-partfill-original')
.add(graphic);
if (partShapeArgs) {
point.graphicOverlay = renderer[type](partShapeArgs)
.addClass('highcharts-partfill-overlay')
.add(graphic);
}
}
} else if (graphic) {
point.graphic = graphic.destroy(); // #1269
}
});
}
});
/**
* Max x2 should be considered in xAxis extremes
*/
wrap(Axis.prototype, 'getSeriesExtremes', function(proceed) {
var axis = this,
series = axis.series,
dataMax,
modMax;
proceed.call(this);
if (axis.isXAxis && series.type === xrange) {
dataMax = pick(axis.dataMax, Number.MIN_VALUE);
each(this.series, function(series) {
each(series.x2Data || [], function(val) {
if (val > dataMax) {
dataMax = val;
modMax = true;
}
});
});
if (modMax) {
axis.dataMax = dataMax;
}
}
});
}(Highcharts));
(function(H) {
/**
* (c) 2016 Highsoft AS
* Authors: Lars A. V. Cabrera
*
* License: www.highcharts.com/license
*/
'use strict';
//
}(Highcharts));
}));

View File

@ -0,0 +1,19 @@
/*
Highcharts JS v5.0.2 (2016-10-26)
GridAxis
(c) 2016 Lars A. V. Cabrera
--- WORK IN PROGRESS ---
License: www.highcharts.com/license
*/
(function(n){"object"===typeof module&&module.exports?module.exports=n:n(Highcharts)})(function(n){(function(h){var n=h.dateFormat,p=h.each,t=h.isObject,r=h.pick,l=h.wrap,m=h.Axis,u=h.Chart,q=h.Tick;m.prototype.isOuterAxis=function(){var a=this,c=-1,b=!0;p(this.chart.axes,function(e,f){e.side===a.side&&(e===a?c=f:0<=c&&f>c&&(b=!1))});return b};q.prototype.getLabelWidth=function(){return this.label.getBBox().width};m.prototype.getMaxLabelLength=function(a){var c=this.tickPositions,b=this.ticks,e=0;
if(!this.maxLabelLength||a)p(c,function(a){(a=b[a])&&a.labelLength>e&&(e=a.labelLength)}),this.maxLabelLength=e;return this.maxLabelLength};m.prototype.addTitle=function(){var a=this.chart.renderer,c=this.axisParent,b=this.horiz,e=this.opposite,f=this.options,d=f.title,g;this.showAxis=g=this.hasData()||r(f.showEmpty,!0);f.title="";this.axisTitle||((f=d.textAlign)||(f=(b?{low:"left",middle:"center",high:"right"}:{low:e?"right":"left",middle:"center",high:e?"left":"right"})[d.align]),this.axisTitle=
a.text(d.text,0,0,d.useHTML).attr({zIndex:7,rotation:d.rotation||0,align:f}).addClass("highcharts-axis-title").add(c),this.axisTitle.isNew=!0);this.axisTitle[g?"show":"hide"](!0)};h.dateFormats={W:function(a){a=new Date(a);var c=0===a.getUTCDay()?7:a.getUTCDay(),b=a.getTime(),e=new Date(a.getUTCFullYear(),0,1,-6);a.setDate(a.getUTCDate()+4-c);return 1+Math.floor(Math.floor((b-e)/864E5)/7)},E:function(a){return n("%a",a,!0).charAt(0)}};l(q.prototype,"addLabel",function(a){var c=this.axis,b=void 0!==
c.options.categories,e=c.tickPositions,e=this.pos!==e[e.length-1];(!c.options.grid||b||e)&&a.apply(this)});l(q.prototype,"getLabelPosition",function(a,c,b,e){var f=a.apply(this,Array.prototype.slice.call(arguments,1)),d=this.axis,g=d.options,k=g.tickInterval||1,h,l;g.grid&&(h=g.labels.style.fontSize,l=d.chart.renderer.fontMetrics(h,e),h=l.b,l=l.h,d.horiz&&void 0===g.categories?(g=d.axisGroup.getBBox().height,k=this.pos+k/2,f.x=d.translate(k)+d.left,k=g/2+l/2-Math.abs(l-h),f.y=0===d.side?b-k:b+k):
(void 0===g.categories&&(k=this.pos+k/2,f.y=d.translate(k)+d.top+h/2),k=this.getLabelWidth()/2-d.maxLabelLength/2,f.x=3===d.side?f.x+k:f.x-k));return f});l(m.prototype,"tickSize",function(a){var c=a.apply(this,Array.prototype.slice.call(arguments,1)),b;this.options.grid&&!this.horiz&&(b=2*Math.abs(this.defaultLeftAxisOptions.labels.x),this.maxLabelLength||(this.maxLabelLength=this.getMaxLabelLength()),b=this.maxLabelLength+b,c[0]=b);return c});l(m.prototype,"getOffset",function(a){var c=this.chart.axisOffset,
b=this.side,e,f,d=this.options,g=d.title,k=g&&g.text&&!1!==g.enabled;this.options.grid&&t(this.options.title)?(f=this.tickSize("tick")[0],c[b]&&f&&(e=c[b]+f),k&&this.addTitle(),a.apply(this,Array.prototype.slice.call(arguments,1)),c[b]=r(e,c[b]),d.title=g):a.apply(this,Array.prototype.slice.call(arguments,1))});l(m.prototype,"renderUnsquish",function(a){this.options.grid&&(this.labelRotation=0,this.options.labels.rotation=0);a.apply(this)});l(m.prototype,"setOptions",function(a,c){c.grid&&this.horiz&&
(c.startOnTick=!0,c.minPadding=0,c.endOnTick=!0);a.apply(this,Array.prototype.slice.call(arguments,1))});l(m.prototype,"render",function(a){var c=this.options,b,e,f,d,g,k,h=this.chart.renderer;if(c.grid){if(b=2*Math.abs(this.defaultLeftAxisOptions.labels.x),b=this.maxLabelLength+b,e=c.lineWidth,this.rightWall&&this.rightWall.destroy(),a.apply(this),a=this.axisGroup.getBBox(),this.horiz&&(this.rightWall=h.path(["M",a.x+this.width+1,a.y,"L",a.x+this.width+1,a.y+a.height]).attr({stroke:c.tickColor||
"#ccd6eb","stroke-width":c.tickWidth||1,zIndex:7,class:"grid-wall"}).add(this.axisGroup)),this.isOuterAxis()&&this.axisLine&&(this.horiz&&(b=a.height-1),e)){a=this.getLinePath(e);g=a.indexOf("M")+1;k=a.indexOf("L")+1;f=a.indexOf("M")+2;d=a.indexOf("L")+2;if(0===this.side||3===this.side)b=-b;this.horiz?(a[f]+=b,a[d]+=b):(a[g]+=b,a[k]+=b);this.axisLineExtra?this.axisLineExtra.animate({d:a}):this.axisLineExtra=h.path(a).attr({stroke:c.lineColor,"stroke-width":e,zIndex:7}).add(this.axisGroup);this.axisLine[this.showAxis?
"show":"hide"](!0)}}else a.apply(this)});l(u.prototype,"render",function(a){var c=25/11,b,e;p(this.axes,function(a){var d=a.options;d.grid&&(e=d.labels.style.fontSize,b=a.chart.renderer.fontMetrics(e),"datetime"===d.type&&(d.units=[["millisecond",[1]],["second",[1]],["minute",[1]],["hour",[1]],["day",[1]],["week",[1]],["month",[1]],["year",null]]),a.horiz?d.tickLength=d.cellHeight||b.h*c:(d.tickWidth=1,d.lineWidth||(d.lineWidth=1)))});a.apply(this)})})(n)});

View File

@ -0,0 +1,545 @@
/**
* @license Highcharts JS v5.0.2 (2016-10-26)
* GridAxis
*
* (c) 2016 Lars A. V. Cabrera
*
* --- WORK IN PROGRESS ---
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* (c) 2016 Highsoft AS
* Authors: Lars A. V. Cabrera
*
* License: www.highcharts.com/license
*/
'use strict';
var dateFormat = H.dateFormat,
each = H.each,
isObject = H.isObject,
pick = H.pick,
wrap = H.wrap,
Axis = H.Axis,
Chart = H.Chart,
Tick = H.Tick;
// Enum for which side the axis is on.
// Maps to axis.side
var axisSide = {
top: 0,
right: 1,
bottom: 2,
left: 3,
0: 'top',
1: 'right',
2: 'bottom',
3: 'left'
};
/**
* Checks if an axis is the outer axis in its dimension. Since
* axes are placed outwards in order, the axis with the highest
* index is the outermost axis.
*
* Example: If there are multiple x-axes at the top of the chart,
* this function returns true if the axis supplied is the last
* of the x-axes.
*
* @return true if the axis is the outermost axis in its dimension;
* false if not
*/
Axis.prototype.isOuterAxis = function() {
var axis = this,
thisIndex = -1,
isOuter = true;
each(this.chart.axes, function(otherAxis, index) {
if (otherAxis.side === axis.side) {
if (otherAxis === axis) {
// Get the index of the axis in question
thisIndex = index;
// Check thisIndex >= 0 in case thisIndex has
// not been found yet
} else if (thisIndex >= 0 && index > thisIndex) {
// There was an axis on the same side with a
// higher index. Exit the loop.
isOuter = false;
return;
}
}
});
// There were either no other axes on the same side,
// or the other axes were not farther from the chart
return isOuter;
};
/**
* Shortcut function to Tick.label.getBBox().width.
*
* @return {number} width - the width of the tick label
*/
Tick.prototype.getLabelWidth = function() {
return this.label.getBBox().width;
};
/**
* Get the maximum label length.
* This function can be used in states where the axis.maxLabelLength has not
* been set.
*
* @param {boolean} force - Optional parameter to force a new calculation, even
* if a value has already been set
* @return {number} maxLabelLength - the maximum label length of the axis
*/
Axis.prototype.getMaxLabelLength = function(force) {
var tickPositions = this.tickPositions,
ticks = this.ticks,
maxLabelLength = 0;
if (!this.maxLabelLength || force) {
each(tickPositions, function(tick) {
tick = ticks[tick];
if (tick && tick.labelLength > maxLabelLength) {
maxLabelLength = tick.labelLength;
}
});
this.maxLabelLength = maxLabelLength;
}
return this.maxLabelLength;
};
/**
* Adds the axis defined in axis.options.title
*/
Axis.prototype.addTitle = function() {
var axis = this,
renderer = axis.chart.renderer,
axisParent = axis.axisParent,
horiz = axis.horiz,
opposite = axis.opposite,
options = axis.options,
axisTitleOptions = options.title,
hasData,
showAxis,
textAlign;
// For reuse in Axis.render
hasData = axis.hasData();
axis.showAxis = showAxis = hasData || pick(options.showEmpty, true);
// Disregard title generation in original Axis.getOffset()
options.title = '';
if (!axis.axisTitle) {
textAlign = axisTitleOptions.textAlign;
if (!textAlign) {
textAlign = (horiz ? {
low: 'left',
middle: 'center',
high: 'right'
} : {
low: opposite ? 'right' : 'left',
middle: 'center',
high: opposite ? 'left' : 'right'
})[axisTitleOptions.align];
}
axis.axisTitle = renderer.text(
axisTitleOptions.text,
0,
0,
axisTitleOptions.useHTML
)
.attr({
zIndex: 7,
rotation: axisTitleOptions.rotation || 0,
align: textAlign
})
.addClass('highcharts-axis-title')
// Add to axisParent instead of axisGroup, to ignore the space
// it takes
.add(axisParent);
axis.axisTitle.isNew = true;
}
// hide or show the title depending on whether showEmpty is set
axis.axisTitle[showAxis ? 'show' : 'hide'](true);
};
/**
* Add custom date formats
*/
H.dateFormats = {
// Week number
W: function(timestamp) {
var date = new Date(timestamp),
day = date.getUTCDay() === 0 ? 7 : date.getUTCDay(),
time = date.getTime(),
startOfYear = new Date(date.getUTCFullYear(), 0, 1, -6),
dayNumber;
date.setDate(date.getUTCDate() + 4 - day);
dayNumber = Math.floor((time - startOfYear) / 86400000);
return 1 + Math.floor(dayNumber / 7);
},
// First letter of the day of the week, e.g. 'M' for 'Monday'.
E: function(timestamp) {
return dateFormat('%a', timestamp, true).charAt(0);
}
};
/**
* Prevents adding the last tick label if the axis is not a category axis.
*
* Since numeric labels are normally placed at starts and ends of a range of
* value, and this module makes the label point at the value, an "extra" label
* would appear.
*
* @param {function} proceed - the original function
*/
wrap(Tick.prototype, 'addLabel', function(proceed) {
var axis = this.axis,
isCategoryAxis = axis.options.categories !== undefined,
tickPositions = axis.tickPositions,
lastTick = tickPositions[tickPositions.length - 1],
isLastTick = this.pos !== lastTick;
if (!axis.options.grid || isCategoryAxis || isLastTick) {
proceed.apply(this);
}
});
/**
* Center tick labels vertically and horizontally between ticks
*
* @param {function} proceed - the original function
*
* @return {object} object - an object containing x and y positions
* for the tick
*/
wrap(Tick.prototype, 'getLabelPosition', function(proceed, x, y, label) {
var retVal = proceed.apply(this, Array.prototype.slice.call(arguments, 1)),
axis = this.axis,
options = axis.options,
tickInterval = options.tickInterval || 1,
newX,
newPos,
axisHeight,
fontSize,
labelMetrics,
lblB,
lblH,
labelCenter;
// Only center tick labels if axis has option grid: true
if (options.grid) {
fontSize = options.labels.style.fontSize;
labelMetrics = axis.chart.renderer.fontMetrics(fontSize, label);
lblB = labelMetrics.b;
lblH = labelMetrics.h;
if (axis.horiz && options.categories === undefined) {
// Center x position
axisHeight = axis.axisGroup.getBBox().height;
newPos = this.pos + tickInterval / 2;
retVal.x = axis.translate(newPos) + axis.left;
labelCenter = (axisHeight / 2) + (lblH / 2) - Math.abs(lblH - lblB);
// Center y position
if (axis.side === axisSide.top) {
retVal.y = y - labelCenter;
} else {
retVal.y = y + labelCenter;
}
} else {
// Center y position
if (options.categories === undefined) {
newPos = this.pos + (tickInterval / 2);
retVal.y = axis.translate(newPos) + axis.top + (lblB / 2);
}
// Center x position
newX = (this.getLabelWidth() / 2) - (axis.maxLabelLength / 2);
if (axis.side === axisSide.left) {
retVal.x += newX;
} else {
retVal.x -= newX;
}
}
}
return retVal;
});
/**
* Draw vertical ticks extra long to create cell floors and roofs.
* Overrides the tickLength for vertical axes.
*
* @param {function} proceed - the original function
* @returns {array} retVal -
*/
wrap(Axis.prototype, 'tickSize', function(proceed) {
var axis = this,
retVal = proceed.apply(axis, Array.prototype.slice.call(arguments, 1)),
labelPadding,
distance;
if (axis.options.grid && !axis.horiz) {
labelPadding = (Math.abs(axis.defaultLeftAxisOptions.labels.x) * 2);
if (!axis.maxLabelLength) {
axis.maxLabelLength = axis.getMaxLabelLength();
}
distance = axis.maxLabelLength + labelPadding;
retVal[0] = distance;
}
return retVal;
});
/**
* Disregards space required by axisTitle, by adding axisTitle to axisParent
* instead of axisGroup, and disregarding margins and offsets related to
* axisTitle.
*
* @param {function} proceed - the original function
*/
wrap(Axis.prototype, 'getOffset', function(proceed) {
var axis = this,
axisOffset = axis.chart.axisOffset,
side = axis.side,
axisHeight,
tickSize,
options = axis.options,
axisTitleOptions = options.title,
addTitle = axisTitleOptions &&
axisTitleOptions.text &&
axisTitleOptions.enabled !== false;
if (axis.options.grid && isObject(axis.options.title)) {
tickSize = axis.tickSize('tick')[0];
if (axisOffset[side] && tickSize) {
axisHeight = axisOffset[side] + tickSize;
}
if (addTitle) {
// Use the custom addTitle() to add it, while preventing making room
// for it
axis.addTitle();
}
proceed.apply(axis, Array.prototype.slice.call(arguments, 1));
axisOffset[side] = pick(axisHeight, axisOffset[side]);
// Put axis options back after original Axis.getOffset() has been called
options.title = axisTitleOptions;
} else {
proceed.apply(axis, Array.prototype.slice.call(arguments, 1));
}
});
/**
* Prevents rotation of labels when squished, as rotating them would not
* help.
*
* @param {function} proceed - the original function
*/
wrap(Axis.prototype, 'renderUnsquish', function(proceed) {
if (this.options.grid) {
this.labelRotation = 0;
this.options.labels.rotation = 0;
}
proceed.apply(this);
});
/**
* Places leftmost tick at the start of the axis, to create a left wall.
*
* @param {function} proceed - the original function
*/
wrap(Axis.prototype, 'setOptions', function(proceed, userOptions) {
var axis = this;
if (userOptions.grid && axis.horiz) {
userOptions.startOnTick = true;
userOptions.minPadding = 0;
userOptions.endOnTick = true;
}
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
});
/**
* Draw an extra line on the far side of the the axisLine,
* creating cell roofs of a grid.
*
* @param {function} proceed - the original function
*/
wrap(Axis.prototype, 'render', function(proceed) {
var axis = this,
options = axis.options,
labelPadding,
distance,
lineWidth,
linePath,
yStartIndex,
yEndIndex,
xStartIndex,
xEndIndex,
renderer = axis.chart.renderer,
axisGroupBox;
if (options.grid) {
labelPadding = (Math.abs(axis.defaultLeftAxisOptions.labels.x) * 2);
distance = axis.maxLabelLength + labelPadding;
lineWidth = options.lineWidth;
// Remove right wall before rendering
if (axis.rightWall) {
axis.rightWall.destroy();
}
// Call original Axis.render() to obtain axis.axisLine and
// axis.axisGroup
proceed.apply(axis);
axisGroupBox = axis.axisGroup.getBBox();
// Add right wall on horizontal axes
if (axis.horiz) {
axis.rightWall = renderer.path([
'M',
axisGroupBox.x + axis.width + 1, // account for left wall
axisGroupBox.y,
'L',
axisGroupBox.x + axis.width + 1, // account for left wall
axisGroupBox.y + axisGroupBox.height
])
.attr({
stroke: options.tickColor || '#ccd6eb',
'stroke-width': options.tickWidth || 1,
zIndex: 7,
class: 'grid-wall'
})
.add(axis.axisGroup);
}
if (axis.isOuterAxis() && axis.axisLine) {
if (axis.horiz) {
// -1 to avoid adding distance each time the chart updates
distance = axisGroupBox.height - 1;
}
if (lineWidth) {
linePath = axis.getLinePath(lineWidth);
xStartIndex = linePath.indexOf('M') + 1;
xEndIndex = linePath.indexOf('L') + 1;
yStartIndex = linePath.indexOf('M') + 2;
yEndIndex = linePath.indexOf('L') + 2;
// Negate distance if top or left axis
if (axis.side === axisSide.top || axis.side === axisSide.left) {
distance = -distance;
}
// If axis is horizontal, reposition line path vertically
if (axis.horiz) {
linePath[yStartIndex] = linePath[yStartIndex] + distance;
linePath[yEndIndex] = linePath[yEndIndex] + distance;
} else {
// If axis is vertical, reposition line path horizontally
linePath[xStartIndex] = linePath[xStartIndex] + distance;
linePath[xEndIndex] = linePath[xEndIndex] + distance;
}
if (!axis.axisLineExtra) {
axis.axisLineExtra = renderer.path(linePath)
.attr({
stroke: options.lineColor,
'stroke-width': lineWidth,
zIndex: 7
})
.add(axis.axisGroup);
} else {
axis.axisLineExtra.animate({
d: linePath
});
}
// show or hide the line depending on options.showEmpty
axis.axisLine[axis.showAxis ? 'show' : 'hide'](true);
}
}
} else {
proceed.apply(axis);
}
});
/**
* Wraps chart rendering with the following customizations:
* 1. Prohibit timespans of multitudes of a time unit
* 2. Draw cell walls on vertical axes
*
* @param {function} proceed - the original function
*/
wrap(Chart.prototype, 'render', function(proceed) {
// 25 is optimal height for default fontSize (11px)
// 25 / 11 ≈ 2.28
var fontSizeToCellHeightRatio = 25 / 11,
fontMetrics,
fontSize;
each(this.axes, function(axis) {
var options = axis.options;
if (options.grid) {
fontSize = options.labels.style.fontSize;
fontMetrics = axis.chart.renderer.fontMetrics(fontSize);
// Prohibit timespans of multitudes of a time unit,
// e.g. two days, three weeks, etc.
if (options.type === 'datetime') {
options.units = [
['millisecond', [1]],
['second', [1]],
['minute', [1]],
['hour', [1]],
['day', [1]],
['week', [1]],
['month', [1]],
['year', null]
];
}
// Make tick marks taller, creating cell walls of a grid.
// Use cellHeight axis option if set
if (axis.horiz) {
options.tickLength = options.cellHeight ||
fontMetrics.h * fontSizeToCellHeightRatio;
} else {
options.tickWidth = 1;
if (!options.lineWidth) {
options.lineWidth = 1;
}
}
}
});
// Call original Chart.render()
proceed.apply(this);
});
}(Highcharts));
}));

View File

@ -0,0 +1,24 @@
/*
Highcharts JS v5.0.2 (2016-10-26)
(c) 2009-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(p){"object"===typeof module&&module.exports?module.exports=p:p(Highcharts)})(function(p){(function(b){var g=b.Axis,t=b.Chart,l=b.color,n,e=b.each,w=b.extend,x=b.isNumber,m=b.Legend,h=b.LegendSymbolMixin,y=b.noop,r=b.merge,v=b.pick,u=b.wrap;n=b.ColorAxis=function(){this.init.apply(this,arguments)};w(n.prototype,g.prototype);w(n.prototype,{defaultColorAxisOptions:{lineWidth:0,minPadding:0,maxPadding:0,gridLineWidth:1,tickPixelInterval:72,startOnTick:!0,endOnTick:!0,offset:0,marker:{animation:{duration:50},
width:.01},labels:{overflow:"justify"},minColor:"#e6ebf5",maxColor:"#003399",tickLength:5,showInLegend:!0},init:function(a,c){var d="vertical"!==a.options.legend.layout,f;this.coll="colorAxis";f=r(this.defaultColorAxisOptions,{side:d?2:1,reversed:!d},c,{opposite:!d,showEmpty:!1,title:null});g.prototype.init.call(this,a,f);c.dataClasses&&this.initDataClasses(c);this.initStops(c);this.horiz=d;this.zoomEnabled=!1;this.defaultLegendLength=200},tweenColors:function(a,c,d){var f;c.rgba.length&&a.rgba.length?
(a=a.rgba,c=c.rgba,f=1!==c[3]||1!==a[3],a=(f?"rgba(":"rgb(")+Math.round(c[0]+(a[0]-c[0])*(1-d))+","+Math.round(c[1]+(a[1]-c[1])*(1-d))+","+Math.round(c[2]+(a[2]-c[2])*(1-d))+(f?","+(c[3]+(a[3]-c[3])*(1-d)):"")+")"):a=c.input||"none";return a},initDataClasses:function(a){var c=this,d,f=0,q=this.chart.options.chart.colorCount,b=this.options,k=a.dataClasses.length;this.dataClasses=d=[];this.legendItems=[];e(a.dataClasses,function(a,e){a=r(a);d.push(a);a.color||("category"===b.dataClassColor?(a.colorIndex=
f,f++,f===q&&(f=0)):a.color=c.tweenColors(l(b.minColor),l(b.maxColor),2>k?.5:e/(k-1)))})},initStops:function(a){this.stops=a.stops||[[0,this.options.minColor],[1,this.options.maxColor]];e(this.stops,function(a){a.color=l(a[1])})},setOptions:function(a){g.prototype.setOptions.call(this,a);this.options.crosshair=this.options.marker},setAxisSize:function(){var a=this.legendSymbol,c=this.chart,d=c.options.legend||{},f,q;a?(this.left=d=a.attr("x"),this.top=f=a.attr("y"),this.width=q=a.attr("width"),this.height=
a=a.attr("height"),this.right=c.chartWidth-d-q,this.bottom=c.chartHeight-f-a,this.len=this.horiz?q:a,this.pos=this.horiz?d:f):this.len=(this.horiz?d.symbolWidth:d.symbolHeight)||this.defaultLegendLength},toColor:function(a,c){var d=this.stops,f,q,b=this.dataClasses,k,e;if(b)for(e=b.length;e--;){if(k=b[e],f=k.from,d=k.to,(void 0===f||a>=f)&&(void 0===d||a<=d)){q=k.color;c&&(c.dataClass=e,c.colorIndex=k.colorIndex);break}}else{this.isLog&&(a=this.val2lin(a));a=1-(this.max-a)/(this.max-this.min||1);
for(e=d.length;e--&&!(a>d[e][0]););f=d[e]||d[e+1];d=d[e+1]||f;a=1-(d[0]-a)/(d[0]-f[0]||1);q=this.tweenColors(f.color,d.color,a)}return q},getOffset:function(){var a=this.legendGroup,c=this.chart.axisOffset[this.side];a&&(this.axisParent=a,g.prototype.getOffset.call(this),this.added||(this.added=!0,this.labelLeft=0,this.labelRight=this.width),this.chart.axisOffset[this.side]=c)},setLegendColor:function(){var a,c=this.options,d=this.reversed;a=d?1:0;d=d?0:1;a=this.horiz?[a,0,d,0]:[0,d,0,a];this.legendColor=
{linearGradient:{x1:a[0],y1:a[1],x2:a[2],y2:a[3]},stops:c.stops||[[0,c.minColor],[1,c.maxColor]]}},drawLegendSymbol:function(a,c){var d=a.padding,f=a.options,b=this.horiz,e=v(f.symbolWidth,b?this.defaultLegendLength:12),k=v(f.symbolHeight,b?12:this.defaultLegendLength),h=v(f.labelPadding,b?16:30),f=v(f.itemDistance,10);this.setLegendColor();c.legendSymbol=this.chart.renderer.rect(0,a.baseline-11,e,k).attr({zIndex:1}).add(c.legendGroup);this.legendItemWidth=e+d+(b?f:h);this.legendItemHeight=k+d+(b?
h:0)},setState:y,visible:!0,setVisible:y,getSeriesExtremes:function(){var a;this.series.length&&(a=this.series[0],this.dataMin=a.valueMin,this.dataMax=a.valueMax)},drawCrosshair:function(a,c){var d=c&&c.plotX,b=c&&c.plotY,e,h=this.pos,k=this.len;c&&(e=this.toPixels(c[c.series.colorKey]),e<h?e=h-2:e>h+k&&(e=h+k+2),c.plotX=e,c.plotY=this.len-e,g.prototype.drawCrosshair.call(this,a,c),c.plotX=d,c.plotY=b,this.cross&&this.cross.addClass("highcharts-coloraxis-marker").add(this.legendGroup))},getPlotLinePath:function(a,
c,d,b,e){return x(e)?this.horiz?["M",e-4,this.top-6,"L",e+4,this.top-6,e,this.top,"Z"]:["M",this.left,e,"L",this.left-6,e+6,this.left-6,e-6,"Z"]:g.prototype.getPlotLinePath.call(this,a,c,d,b)},update:function(a,c){var d=this.chart,b=d.legend;e(this.series,function(a){a.isDirtyData=!0});a.dataClasses&&b.allItems&&(e(b.allItems,function(a){a.isDataClass&&a.legendGroup.destroy()}),d.isDirtyLegend=!0);d.options[this.coll]=r(this.userOptions,a);g.prototype.update.call(this,a,c);this.legendItem&&(this.setLegendColor(),
b.colorizeItem(this,!0))},getDataClassLegendSymbols:function(){var a=this,c=this.chart,d=this.legendItems,f=c.options.legend,n=f.valueDecimals,u=f.valueSuffix||"",k;d.length||e(this.dataClasses,function(f,m){var g=!0,r=f.from,l=f.to;k="";void 0===r?k="\x3c ":void 0===l&&(k="\x3e ");void 0!==r&&(k+=b.numberFormat(r,n)+u);void 0!==r&&void 0!==l&&(k+=" - ");void 0!==l&&(k+=b.numberFormat(l,n)+u);d.push(w({chart:c,name:k,options:{},drawLegendSymbol:h.drawRectangle,visible:!0,setState:y,isDataClass:!0,
setVisible:function(){g=this.visible=!g;e(a.series,function(a){e(a.points,function(a){a.dataClass===m&&a.setVisible(g)})});c.legend.colorizeItem(this,g)}},f))});return d},name:""});e(["fill","stroke"],function(a){b.Fx.prototype[a+"Setter"]=function(){this.elem.attr(a,n.prototype.tweenColors(l(this.start),l(this.end),this.pos))}});u(t.prototype,"getAxes",function(a){var c=this.options.colorAxis;a.call(this);this.colorAxis=[];c&&new n(this,c)});u(m.prototype,"getAllItems",function(a){var c=[],d=this.chart.colorAxis[0];
d&&d.options&&(d.options.showInLegend&&(d.options.dataClasses?c=c.concat(d.getDataClassLegendSymbols()):c.push(d)),e(d.series,function(a){a.options.showInLegend=!1}));return c.concat(a.call(this))});u(m.prototype,"colorizeItem",function(a,c,d){a.call(this,c,d);d&&c.legendColor&&c.legendSymbol.attr({fill:c.legendColor})})})(p);(function(b){var g=b.defined,t=b.each,l=b.noop;b.colorPointMixin={isValid:function(){return null!==this.value},setVisible:function(b){var e=this,g=b?"show":"hide";t(["graphic",
"dataLabel"],function(b){if(e[b])e[b][g]()})}};b.colorSeriesMixin={pointArrayMap:["value"],axisTypes:["xAxis","yAxis","colorAxis"],optionalAxis:"colorAxis",trackerGroups:["group","markerGroup","dataLabelsGroup"],getSymbol:l,parallelArrays:["x","y","value"],colorKey:"value",translateColors:function(){var b=this,e=this.options.nullColor,g=this.colorAxis,l=this.colorKey;t(this.data,function(m){var h=m[l];if(h=m.options.color||(m.isNull?e:g&&void 0!==h?g.toColor(h,m):m.color||b.color))m.color=h})},colorAttribs:function(b){var e=
{};g(b.color)&&(e[this.colorProp||"fill"]=b.color);return e}}})(p);(function(b){var g=b.colorPointMixin,t=b.each,l=b.merge,n=b.noop,e=b.pick,p=b.Series,x=b.seriesType,m=b.seriesTypes;x("heatmap","scatter",{animation:!1,borderWidth:0,dataLabels:{formatter:function(){return this.point.value},inside:!0,verticalAlign:"middle",crop:!1,overflow:!1,padding:0},marker:null,pointRange:null,tooltip:{pointFormat:"{point.x}, {point.y}: {point.value}\x3cbr/\x3e"},states:{normal:{animation:!0},hover:{halo:!1,brightness:.2}}},
l(b.colorSeriesMixin,{pointArrayMap:["y","value"],hasPointSpecificOptions:!0,supportsDrilldown:!0,getExtremesFromAll:!0,directTouch:!0,init:function(){var b;m.scatter.prototype.init.apply(this,arguments);b=this.options;b.pointRange=e(b.pointRange,b.colsize||1);this.yAxis.axisPointRange=b.rowsize||1},translate:function(){var b=this.options,e=this.xAxis,g=this.yAxis,l=function(b,a,c){return Math.min(Math.max(a,b),c)};this.generatePoints();t(this.points,function(h){var a=(b.colsize||1)/2,c=(b.rowsize||
1)/2,d=l(Math.round(e.len-e.translate(h.x-a,0,1,0,1)),-e.len,2*e.len),a=l(Math.round(e.len-e.translate(h.x+a,0,1,0,1)),-e.len,2*e.len),f=l(Math.round(g.translate(h.y-c,0,1,0,1)),-g.len,2*g.len),c=l(Math.round(g.translate(h.y+c,0,1,0,1)),-g.len,2*g.len);h.plotX=h.clientX=(d+a)/2;h.plotY=(f+c)/2;h.shapeType="rect";h.shapeArgs={x:Math.min(d,a),y:Math.min(f,c),width:Math.abs(a-d),height:Math.abs(c-f)}});this.translateColors()},drawPoints:function(){m.column.prototype.drawPoints.call(this);t(this.points,
function(b){b.graphic.attr(this.colorAttribs(b,b.state))},this)},animate:n,getBox:n,drawLegendSymbol:b.LegendSymbolMixin.drawRectangle,alignDataLabel:m.column.prototype.alignDataLabel,getExtremes:function(){p.prototype.getExtremes.call(this,this.valueData);this.valueMin=this.dataMin;this.valueMax=this.dataMax;p.prototype.getExtremes.call(this)}}),g)})(p)});

View File

@ -0,0 +1,769 @@
/**
* @license Highcharts JS v5.0.2 (2016-10-26)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
'use strict';
var Axis = H.Axis,
Chart = H.Chart,
color = H.color,
ColorAxis,
each = H.each,
extend = H.extend,
isNumber = H.isNumber,
Legend = H.Legend,
LegendSymbolMixin = H.LegendSymbolMixin,
noop = H.noop,
merge = H.merge,
pick = H.pick,
wrap = H.wrap;
/**
* The ColorAxis object for inclusion in gradient legends
*/
ColorAxis = H.ColorAxis = function() {
this.init.apply(this, arguments);
};
extend(ColorAxis.prototype, Axis.prototype);
extend(ColorAxis.prototype, {
defaultColorAxisOptions: {
lineWidth: 0,
minPadding: 0,
maxPadding: 0,
gridLineWidth: 1,
tickPixelInterval: 72,
startOnTick: true,
endOnTick: true,
offset: 0,
marker: {
animation: {
duration: 50
},
width: 0.01
},
labels: {
overflow: 'justify'
},
minColor: '#e6ebf5',
maxColor: '#003399',
tickLength: 5,
showInLegend: true
},
init: function(chart, userOptions) {
var horiz = chart.options.legend.layout !== 'vertical',
options;
this.coll = 'colorAxis';
// Build the options
options = merge(this.defaultColorAxisOptions, {
side: horiz ? 2 : 1,
reversed: !horiz
}, userOptions, {
opposite: !horiz,
showEmpty: false,
title: null
});
Axis.prototype.init.call(this, chart, options);
// Base init() pushes it to the xAxis array, now pop it again
//chart[this.isXAxis ? 'xAxis' : 'yAxis'].pop();
// Prepare data classes
if (userOptions.dataClasses) {
this.initDataClasses(userOptions);
}
this.initStops(userOptions);
// Override original axis properties
this.horiz = horiz;
this.zoomEnabled = false;
// Add default values
this.defaultLegendLength = 200;
},
/*
* Return an intermediate color between two colors, according to pos where 0
* is the from color and 1 is the to color.
* NOTE: Changes here should be copied
* to the same function in drilldown.src.js and solid-gauge-src.js.
*/
tweenColors: function(from, to, pos) {
// Check for has alpha, because rgba colors perform worse due to lack of
// support in WebKit.
var hasAlpha,
ret;
// Unsupported color, return to-color (#3920)
if (!to.rgba.length || !from.rgba.length) {
ret = to.input || 'none';
// Interpolate
} else {
from = from.rgba;
to = to.rgba;
hasAlpha = (to[3] !== 1 || from[3] !== 1);
ret = (hasAlpha ? 'rgba(' : 'rgb(') +
Math.round(to[0] + (from[0] - to[0]) * (1 - pos)) + ',' +
Math.round(to[1] + (from[1] - to[1]) * (1 - pos)) + ',' +
Math.round(to[2] + (from[2] - to[2]) * (1 - pos)) +
(hasAlpha ? (',' + (to[3] + (from[3] - to[3]) * (1 - pos))) : '') + ')';
}
return ret;
},
initDataClasses: function(userOptions) {
var axis = this,
chart = this.chart,
dataClasses,
colorCounter = 0,
colorCount = chart.options.chart.colorCount,
options = this.options,
len = userOptions.dataClasses.length;
this.dataClasses = dataClasses = [];
this.legendItems = [];
each(userOptions.dataClasses, function(dataClass, i) {
var colors;
dataClass = merge(dataClass);
dataClasses.push(dataClass);
if (!dataClass.color) {
if (options.dataClassColor === 'category') {
dataClass.colorIndex = colorCounter;
// increase and loop back to zero
colorCounter++;
if (colorCounter === colorCount) {
colorCounter = 0;
}
} else {
dataClass.color = axis.tweenColors(
color(options.minColor),
color(options.maxColor),
len < 2 ? 0.5 : i / (len - 1) // #3219
);
}
}
});
},
initStops: function(userOptions) {
this.stops = userOptions.stops || [
[0, this.options.minColor],
[1, this.options.maxColor]
];
each(this.stops, function(stop) {
stop.color = color(stop[1]);
});
},
/**
* Extend the setOptions method to process extreme colors and color
* stops.
*/
setOptions: function(userOptions) {
Axis.prototype.setOptions.call(this, userOptions);
this.options.crosshair = this.options.marker;
},
setAxisSize: function() {
var symbol = this.legendSymbol,
chart = this.chart,
legendOptions = chart.options.legend || {},
x,
y,
width,
height;
if (symbol) {
this.left = x = symbol.attr('x');
this.top = y = symbol.attr('y');
this.width = width = symbol.attr('width');
this.height = height = symbol.attr('height');
this.right = chart.chartWidth - x - width;
this.bottom = chart.chartHeight - y - height;
this.len = this.horiz ? width : height;
this.pos = this.horiz ? x : y;
} else {
// Fake length for disabled legend to avoid tick issues and such (#5205)
this.len = (this.horiz ? legendOptions.symbolWidth : legendOptions.symbolHeight) || this.defaultLegendLength;
}
},
/**
* Translate from a value to a color
*/
toColor: function(value, point) {
var pos,
stops = this.stops,
from,
to,
color,
dataClasses = this.dataClasses,
dataClass,
i;
if (dataClasses) {
i = dataClasses.length;
while (i--) {
dataClass = dataClasses[i];
from = dataClass.from;
to = dataClass.to;
if ((from === undefined || value >= from) && (to === undefined || value <= to)) {
color = dataClass.color;
if (point) {
point.dataClass = i;
point.colorIndex = dataClass.colorIndex;
}
break;
}
}
} else {
if (this.isLog) {
value = this.val2lin(value);
}
pos = 1 - ((this.max - value) / ((this.max - this.min) || 1));
i = stops.length;
while (i--) {
if (pos > stops[i][0]) {
break;
}
}
from = stops[i] || stops[i + 1];
to = stops[i + 1] || from;
// The position within the gradient
pos = 1 - (to[0] - pos) / ((to[0] - from[0]) || 1);
color = this.tweenColors(
from.color,
to.color,
pos
);
}
return color;
},
/**
* Override the getOffset method to add the whole axis groups inside the legend.
*/
getOffset: function() {
var group = this.legendGroup,
sideOffset = this.chart.axisOffset[this.side];
if (group) {
// Hook for the getOffset method to add groups to this parent group
this.axisParent = group;
// Call the base
Axis.prototype.getOffset.call(this);
// First time only
if (!this.added) {
this.added = true;
this.labelLeft = 0;
this.labelRight = this.width;
}
// Reset it to avoid color axis reserving space
this.chart.axisOffset[this.side] = sideOffset;
}
},
/**
* Create the color gradient
*/
setLegendColor: function() {
var grad,
horiz = this.horiz,
options = this.options,
reversed = this.reversed,
one = reversed ? 1 : 0,
zero = reversed ? 0 : 1;
grad = horiz ? [one, 0, zero, 0] : [0, zero, 0, one]; // #3190
this.legendColor = {
linearGradient: {
x1: grad[0],
y1: grad[1],
x2: grad[2],
y2: grad[3]
},
stops: options.stops || [
[0, options.minColor],
[1, options.maxColor]
]
};
},
/**
* The color axis appears inside the legend and has its own legend symbol
*/
drawLegendSymbol: function(legend, item) {
var padding = legend.padding,
legendOptions = legend.options,
horiz = this.horiz,
width = pick(legendOptions.symbolWidth, horiz ? this.defaultLegendLength : 12),
height = pick(legendOptions.symbolHeight, horiz ? 12 : this.defaultLegendLength),
labelPadding = pick(legendOptions.labelPadding, horiz ? 16 : 30),
itemDistance = pick(legendOptions.itemDistance, 10);
this.setLegendColor();
// Create the gradient
item.legendSymbol = this.chart.renderer.rect(
0,
legend.baseline - 11,
width,
height
).attr({
zIndex: 1
}).add(item.legendGroup);
// Set how much space this legend item takes up
this.legendItemWidth = width + padding + (horiz ? itemDistance : labelPadding);
this.legendItemHeight = height + padding + (horiz ? labelPadding : 0);
},
/**
* Fool the legend
*/
setState: noop,
visible: true,
setVisible: noop,
getSeriesExtremes: function() {
var series;
if (this.series.length) {
series = this.series[0];
this.dataMin = series.valueMin;
this.dataMax = series.valueMax;
}
},
drawCrosshair: function(e, point) {
var plotX = point && point.plotX,
plotY = point && point.plotY,
crossPos,
axisPos = this.pos,
axisLen = this.len;
if (point) {
crossPos = this.toPixels(point[point.series.colorKey]);
if (crossPos < axisPos) {
crossPos = axisPos - 2;
} else if (crossPos > axisPos + axisLen) {
crossPos = axisPos + axisLen + 2;
}
point.plotX = crossPos;
point.plotY = this.len - crossPos;
Axis.prototype.drawCrosshair.call(this, e, point);
point.plotX = plotX;
point.plotY = plotY;
if (this.cross) {
this.cross
.addClass('highcharts-coloraxis-marker')
.add(this.legendGroup);
}
}
},
getPlotLinePath: function(a, b, c, d, pos) {
return isNumber(pos) ? // crosshairs only // #3969 pos can be 0 !!
(this.horiz ? ['M', pos - 4, this.top - 6, 'L', pos + 4, this.top - 6, pos, this.top, 'Z'] : ['M', this.left, pos, 'L', this.left - 6, pos + 6, this.left - 6, pos - 6, 'Z']) :
Axis.prototype.getPlotLinePath.call(this, a, b, c, d);
},
update: function(newOptions, redraw) {
var chart = this.chart,
legend = chart.legend;
each(this.series, function(series) {
series.isDirtyData = true; // Needed for Axis.update when choropleth colors change
});
// When updating data classes, destroy old items and make sure new ones are created (#3207)
if (newOptions.dataClasses && legend.allItems) {
each(legend.allItems, function(item) {
if (item.isDataClass) {
item.legendGroup.destroy();
}
});
chart.isDirtyLegend = true;
}
// Keep the options structure updated for export. Unlike xAxis and yAxis, the colorAxis is
// not an array. (#3207)
chart.options[this.coll] = merge(this.userOptions, newOptions);
Axis.prototype.update.call(this, newOptions, redraw);
if (this.legendItem) {
this.setLegendColor();
legend.colorizeItem(this, true);
}
},
/**
* Get the legend item symbols for data classes
*/
getDataClassLegendSymbols: function() {
var axis = this,
chart = this.chart,
legendItems = this.legendItems,
legendOptions = chart.options.legend,
valueDecimals = legendOptions.valueDecimals,
valueSuffix = legendOptions.valueSuffix || '',
name;
if (!legendItems.length) {
each(this.dataClasses, function(dataClass, i) {
var vis = true,
from = dataClass.from,
to = dataClass.to;
// Assemble the default name. This can be overridden by legend.options.labelFormatter
name = '';
if (from === undefined) {
name = '< ';
} else if (to === undefined) {
name = '> ';
}
if (from !== undefined) {
name += H.numberFormat(from, valueDecimals) + valueSuffix;
}
if (from !== undefined && to !== undefined) {
name += ' - ';
}
if (to !== undefined) {
name += H.numberFormat(to, valueDecimals) + valueSuffix;
}
// Add a mock object to the legend items
legendItems.push(extend({
chart: chart,
name: name,
options: {},
drawLegendSymbol: LegendSymbolMixin.drawRectangle,
visible: true,
setState: noop,
isDataClass: true,
setVisible: function() {
vis = this.visible = !vis;
each(axis.series, function(series) {
each(series.points, function(point) {
if (point.dataClass === i) {
point.setVisible(vis);
}
});
});
chart.legend.colorizeItem(this, vis);
}
}, dataClass));
});
}
return legendItems;
},
name: '' // Prevents 'undefined' in legend in IE8
});
/**
* Handle animation of the color attributes directly
*/
each(['fill', 'stroke'], function(prop) {
H.Fx.prototype[prop + 'Setter'] = function() {
this.elem.attr(prop, ColorAxis.prototype.tweenColors(color(this.start), color(this.end), this.pos));
};
});
/**
* Extend the chart getAxes method to also get the color axis
*/
wrap(Chart.prototype, 'getAxes', function(proceed) {
var options = this.options,
colorAxisOptions = options.colorAxis;
proceed.call(this);
this.colorAxis = [];
if (colorAxisOptions) {
new ColorAxis(this, colorAxisOptions); // eslint-disable-line no-new
}
});
/**
* Wrap the legend getAllItems method to add the color axis. This also removes the
* axis' own series to prevent them from showing up individually.
*/
wrap(Legend.prototype, 'getAllItems', function(proceed) {
var allItems = [],
colorAxis = this.chart.colorAxis[0];
if (colorAxis && colorAxis.options) {
if (colorAxis.options.showInLegend) {
// Data classes
if (colorAxis.options.dataClasses) {
allItems = allItems.concat(colorAxis.getDataClassLegendSymbols());
// Gradient legend
} else {
// Add this axis on top
allItems.push(colorAxis);
}
}
// Don't add the color axis' series
each(colorAxis.series, function(series) {
series.options.showInLegend = false;
});
}
return allItems.concat(proceed.call(this));
});
wrap(Legend.prototype, 'colorizeItem', function(proceed, item, visible) {
proceed.call(this, item, visible);
if (visible && item.legendColor) {
item.legendSymbol.attr({
fill: item.legendColor
});
}
});
}(Highcharts));
(function(H) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
'use strict';
var defined = H.defined,
each = H.each,
noop = H.noop,
seriesTypes = H.seriesTypes;
/**
* Mixin for maps and heatmaps
*/
H.colorPointMixin = {
/**
* Color points have a value option that determines whether or not it is a null point
*/
isValid: function() {
return this.value !== null;
},
/**
* Set the visibility of a single point
*/
setVisible: function(vis) {
var point = this,
method = vis ? 'show' : 'hide';
// Show and hide associated elements
each(['graphic', 'dataLabel'], function(key) {
if (point[key]) {
point[key][method]();
}
});
}
};
H.colorSeriesMixin = {
pointArrayMap: ['value'],
axisTypes: ['xAxis', 'yAxis', 'colorAxis'],
optionalAxis: 'colorAxis',
trackerGroups: ['group', 'markerGroup', 'dataLabelsGroup'],
getSymbol: noop,
parallelArrays: ['x', 'y', 'value'],
colorKey: 'value',
/**
* In choropleth maps, the color is a result of the value, so this needs translation too
*/
translateColors: function() {
var series = this,
nullColor = this.options.nullColor,
colorAxis = this.colorAxis,
colorKey = this.colorKey;
each(this.data, function(point) {
var value = point[colorKey],
color;
color = point.options.color ||
(point.isNull ? nullColor : (colorAxis && value !== undefined) ? colorAxis.toColor(value, point) : point.color || series.color);
if (color) {
point.color = color;
}
});
},
/**
* Get the color attibutes to apply on the graphic
*/
colorAttribs: function(point) {
var ret = {};
if (defined(point.color)) {
ret[this.colorProp || 'fill'] = point.color;
}
return ret;
}
};
}(Highcharts));
(function(H) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
'use strict';
var colorPointMixin = H.colorPointMixin,
colorSeriesMixin = H.colorSeriesMixin,
each = H.each,
LegendSymbolMixin = H.LegendSymbolMixin,
merge = H.merge,
noop = H.noop,
pick = H.pick,
Series = H.Series,
seriesType = H.seriesType,
seriesTypes = H.seriesTypes;
// The Heatmap series type
seriesType('heatmap', 'scatter', {
animation: false,
borderWidth: 0,
dataLabels: {
formatter: function() { // #2945
return this.point.value;
},
inside: true,
verticalAlign: 'middle',
crop: false,
overflow: false,
padding: 0 // #3837
},
marker: null,
pointRange: null, // dynamically set to colsize by default
tooltip: {
pointFormat: '{point.x}, {point.y}: {point.value}<br/>'
},
states: {
normal: {
animation: true
},
hover: {
halo: false, // #3406, halo is not required on heatmaps
brightness: 0.2
}
}
}, merge(colorSeriesMixin, {
pointArrayMap: ['y', 'value'],
hasPointSpecificOptions: true,
supportsDrilldown: true,
getExtremesFromAll: true,
directTouch: true,
/**
* Override the init method to add point ranges on both axes.
*/
init: function() {
var options;
seriesTypes.scatter.prototype.init.apply(this, arguments);
options = this.options;
options.pointRange = pick(options.pointRange, options.colsize || 1); // #3758, prevent resetting in setData
this.yAxis.axisPointRange = options.rowsize || 1; // general point range
},
translate: function() {
var series = this,
options = series.options,
xAxis = series.xAxis,
yAxis = series.yAxis,
between = function(x, a, b) {
return Math.min(Math.max(a, x), b);
};
series.generatePoints();
each(series.points, function(point) {
var xPad = (options.colsize || 1) / 2,
yPad = (options.rowsize || 1) / 2,
x1 = between(Math.round(xAxis.len - xAxis.translate(point.x - xPad, 0, 1, 0, 1)), -xAxis.len, 2 * xAxis.len),
x2 = between(Math.round(xAxis.len - xAxis.translate(point.x + xPad, 0, 1, 0, 1)), -xAxis.len, 2 * xAxis.len),
y1 = between(Math.round(yAxis.translate(point.y - yPad, 0, 1, 0, 1)), -yAxis.len, 2 * yAxis.len),
y2 = between(Math.round(yAxis.translate(point.y + yPad, 0, 1, 0, 1)), -yAxis.len, 2 * yAxis.len);
// Set plotX and plotY for use in K-D-Tree and more
point.plotX = point.clientX = (x1 + x2) / 2;
point.plotY = (y1 + y2) / 2;
point.shapeType = 'rect';
point.shapeArgs = {
x: Math.min(x1, x2),
y: Math.min(y1, y2),
width: Math.abs(x2 - x1),
height: Math.abs(y2 - y1)
};
});
series.translateColors();
},
drawPoints: function() {
seriesTypes.column.prototype.drawPoints.call(this);
each(this.points, function(point) {
point.graphic.attr(this.colorAttribs(point, point.state));
}, this);
},
animate: noop,
getBox: noop,
drawLegendSymbol: LegendSymbolMixin.drawRectangle,
alignDataLabel: seriesTypes.column.prototype.alignDataLabel,
getExtremes: function() {
// Get the extremes from the value data
Series.prototype.getExtremes.call(this, this.valueData);
this.valueMin = this.dataMin;
this.valueMax = this.dataMax;
// Get the extremes from the y data
Series.prototype.getExtremes.call(this);
}
}), colorPointMixin);
}(Highcharts));
}));

View File

@ -0,0 +1,12 @@
/*
Highcharts JS v5.0.2 (2016-10-26)
Plugin for displaying a message when there is no data visible in chart.
(c) 2010-2016 Highsoft AS
Author: Oystein Moseng
License: www.highcharts.com/license
*/
(function(d){"object"===typeof module&&module.exports?module.exports=d:d(Highcharts)})(function(d){(function(c){function d(){return!!this.points.length}function f(){this.hasData()?this.hideNoData():this.showNoData()}var g=c.seriesTypes,e=c.Chart.prototype,h=c.getOptions(),k=c.extend,l=c.each;k(h.lang,{noData:"No data to display"});h.noData={position:{x:0,y:0,align:"center",verticalAlign:"middle"}};l(["pie","gauge","waterfall","bubble","treemap"],function(a){g[a]&&(g[a].prototype.hasData=d)});c.Series.prototype.hasData=
function(){return this.visible&&void 0!==this.dataMax&&void 0!==this.dataMin};e.showNoData=function(a){var b=this.options;a=a||b.lang.noData;b=b.noData;this.noDataLabel||(this.noDataLabel=this.renderer.label(a,0,0,null,null,null,b.useHTML,null,"no-data"),this.noDataLabel.add(),this.noDataLabel.align(k(this.noDataLabel.getBBox(),b.position),!1,"plotBox"))};e.hideNoData=function(){this.noDataLabel&&(this.noDataLabel=this.noDataLabel.destroy())};e.hasData=function(){for(var a=this.series,b=a.length;b--;)if(a[b].hasData()&&
!a[b].options.isInternal)return!0;return!1};e.callbacks.push(function(a){c.addEvent(a,"load",f);c.addEvent(a,"redraw",f)})})(d)});

View File

@ -0,0 +1,150 @@
/**
* @license Highcharts JS v5.0.2 (2016-10-26)
* Plugin for displaying a message when there is no data visible in chart.
*
* (c) 2010-2016 Highsoft AS
* Author: Oystein Moseng
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* Plugin for displaying a message when there is no data visible in chart.
*
* (c) 2010-2016 Highsoft AS
* Author: Oystein Moseng
*
* License: www.highcharts.com/license
*/
'use strict';
var seriesTypes = H.seriesTypes,
chartPrototype = H.Chart.prototype,
defaultOptions = H.getOptions(),
extend = H.extend,
each = H.each;
// Add language option
extend(defaultOptions.lang, {
noData: 'No data to display'
});
// Add default display options for message
defaultOptions.noData = {
position: {
x: 0,
y: 0,
align: 'center',
verticalAlign: 'middle'
}
// useHTML: false
};
/**
* Define hasData functions for series. These return true if there are data points on this series within the plot area
*/
function hasDataPie() {
return !!this.points.length; /* != 0 */
}
each(['pie', 'gauge', 'waterfall', 'bubble', 'treemap'], function(type) {
if (seriesTypes[type]) {
seriesTypes[type].prototype.hasData = hasDataPie;
}
});
H.Series.prototype.hasData = function() {
return this.visible && this.dataMax !== undefined && this.dataMin !== undefined; // #3703
};
/**
* Display a no-data message.
*
* @param {String} str An optional message to show in place of the default one
*/
chartPrototype.showNoData = function(str) {
var chart = this,
options = chart.options,
text = str || options.lang.noData,
noDataOptions = options.noData;
if (!chart.noDataLabel) {
chart.noDataLabel = chart.renderer
.label(
text,
0,
0,
null,
null,
null,
noDataOptions.useHTML,
null,
'no-data'
);
chart.noDataLabel.add();
chart.noDataLabel.align(extend(chart.noDataLabel.getBBox(), noDataOptions.position), false, 'plotBox');
}
};
/**
* Hide no-data message
*/
chartPrototype.hideNoData = function() {
var chart = this;
if (chart.noDataLabel) {
chart.noDataLabel = chart.noDataLabel.destroy();
}
};
/**
* Returns true if there are data points within the plot area now
*/
chartPrototype.hasData = function() {
var chart = this,
series = chart.series,
i = series.length;
while (i--) {
if (series[i].hasData() && !series[i].options.isInternal) {
return true;
}
}
return false;
};
/**
* Show no-data message if there is no data in sight. Otherwise, hide it.
*/
function handleNoData() {
var chart = this;
if (chart.hasData()) {
chart.hideNoData();
} else {
chart.showNoData();
}
}
/**
* Add event listener to handle automatic display of no-data message
*/
chartPrototype.callbacks.push(function(chart) {
H.addEvent(chart, 'load', handleNoData);
H.addEvent(chart, 'redraw', handleNoData);
});
}(Highcharts));
}));

View File

@ -0,0 +1,18 @@
/*
Highcharts JS v5.0.2 (2016-10-26)
Client side exporting module
(c) 2015 Torstein Honsi / Oystein Moseng
License: www.highcharts.com/license
*/
(function(g){"object"===typeof module&&module.exports?module.exports=g:g(Highcharts)})(function(g){(function(b){function v(d,b){var c=r.getElementsByTagName("head")[0],a=r.createElement("script");a.type="text/javascript";a.src=d;a.onload=b;a.onerror=function(){console.error("Error loading script",d)};c.appendChild(a)}var g=b.merge,e=b.win,t=e.navigator,r=e.document,z=b.each,A=e.URL||e.webkitURL||e,B=/Edge\/|Trident\/|MSIE /.test(t.userAgent),C=B?150:0;b.CanVGRenderer={};b.downloadURL=function(d,b){var c=
r.createElement("a"),a;if(t.msSaveOrOpenBlob)t.msSaveOrOpenBlob(d,b);else if(void 0!==c.download)c.href=d,c.download=b,c.target="_blank",r.body.appendChild(c),c.click(),r.body.removeChild(c);else try{if(a=e.open(d,"chart"),void 0===a||null===a)throw"Failed to open window";}catch(u){e.location.href=d}};b.svgToDataUrl=function(d){var b=-1<t.userAgent.indexOf("WebKit")&&0>t.userAgent.indexOf("Chrome");try{if(!b&&0>t.userAgent.toLowerCase().indexOf("firefox"))return A.createObjectURL(new e.Blob([d],{type:"image/svg+xml;charset-utf-16"}))}catch(c){}return"data:image/svg+xml;charset\x3dUTF-8,"+
encodeURIComponent(d)};b.imageToDataUrl=function(b,f,c,a,u,l,k,m,p){var d=new e.Image,h,q=function(){setTimeout(function(){var e=r.createElement("canvas"),n=e.getContext&&e.getContext("2d"),w;try{if(n){e.height=d.height*a;e.width=d.width*a;n.drawImage(d,0,0,e.width,e.height);try{w=e.toDataURL(f),u(w,f,c,a)}catch(D){h(b,f,c,a)}}else k(b,f,c,a)}finally{p&&p(b,f,c,a)}},C)},n=function(){m(b,f,c,a);p&&p(b,f,c,a)};h=function(){d=new e.Image;h=l;d.crossOrigin="Anonymous";d.onload=q;d.onerror=n;d.src=b};
d.onload=q;d.onerror=n;d.src=b};b.downloadSVGLocal=function(d,f,c,a){function u(b,a){a=new e.jsPDF("l","pt",[b.width.baseVal.value+2*a,b.height.baseVal.value+2*a]);e.svgElementToPdf(b,a,{removeInvalid:!0});return a.output("datauristring")}function l(){q.innerHTML=d;var c=q.getElementsByTagName("text"),e=q.getElementsByTagName("svg")[0].style;z(c,function(a){z(["font-family","font-size"],function(b){!a.style[b]&&e[b]&&(a.style[b]=e[b])});a.style["font-family"]=a.style["font-family"]&&a.style["font-family"].split(" ").splice(-1)});
c=u(q.firstChild,0);b.downloadURL(c,g);a&&a()}var k,m,p=!0,x,h=f.libURL||b.getOptions().exporting.libURL,q=r.createElement("div"),n=f.type||"image/png",g=(f.filename||"chart")+"."+("image/svg+xml"===n?"svg":n.split("/")[1]),y=f.scale||1,h="/"!==h.slice(-1)?h+"/":h;if("image/svg+xml"===n)try{t.msSaveOrOpenBlob?(m=new MSBlobBuilder,m.append(d),k=m.getBlob("image/svg+xml")):k=b.svgToDataUrl(d),b.downloadURL(k,g),a&&a()}catch(w){c()}else"application/pdf"===n?e.jsPDF&&e.svgElementToPdf?l():(p=!0,v(h+"jspdf.js",
function(){v(h+"rgbcolor.js",function(){v(h+"svg2pdf.js",function(){l()})})})):(k=b.svgToDataUrl(d),x=function(){try{A.revokeObjectURL(k)}catch(w){}},b.imageToDataUrl(k,n,{},y,function(d){try{b.downloadURL(d,g),a&&a()}catch(D){c()}},function(){var f=r.createElement("canvas"),u=f.getContext("2d"),l=d.match(/^<svg[^>]*width\s*=\s*\"?(\d+)\"?[^>]*>/)[1]*y,k=d.match(/^<svg[^>]*height\s*=\s*\"?(\d+)\"?[^>]*>/)[1]*y,m=function(){u.drawSvg(d,0,0,l,k);try{b.downloadURL(t.msSaveOrOpenBlob?f.msToBlob():f.toDataURL(n),
g),a&&a()}catch(E){c()}finally{x()}};f.width=l;f.height=k;e.canvg?m():(p=!0,v(h+"rgbcolor.js",function(){v(h+"canvg.js",function(){m()})}))},c,c,function(){p&&x()}))};b.Chart.prototype.getSVGForLocalExport=function(d,e,c,a){var f=this,l,k=0,m,p,g,h,q=function(b,d,c){++k;c.imageElement.setAttributeNS("http://www.w3.org/1999/xlink","href",b);k===l.length&&a(f.sanitizeSVG(m.innerHTML))};b.wrap(b.Chart.prototype,"getChartHTML",function(a){m=this.container.cloneNode(!0);return a.apply(this,Array.prototype.slice.call(arguments,
1))});f.getSVGForExport(d,e);l=m.getElementsByTagName("image");try{if(l.length)for(g=0,h=l.length;g<h;++g)p=l[g],b.imageToDataUrl(p.getAttributeNS("http://www.w3.org/1999/xlink","href"),"image/png",{imageElement:p},d.scale,q,c,c,c);else a(f.sanitizeSVG(m.innerHTML))}catch(n){c()}};b.Chart.prototype.exportChartLocal=function(d,e){var c=this,a=b.merge(c.options.exporting,d),f=function(){if(!1===a.fallbackToExportServer)if(a.error)a.error();else throw"Fallback to export server disabled";else c.exportChart(a)};
(B&&"image/svg+xml"!==a.imageType||"application/pdf"!==a.imageType)&&c.container.getElementsByTagName("image").length?f():c.getSVGForLocalExport(a,e,f,function(c){b.downloadSVGLocal(c,a,f)})};g(!0,b.getOptions().exporting,{libURL:"http://code.highcharts.com/5.0.2/lib/",buttons:{contextButton:{menuItems:[{textKey:"printChart",onclick:function(){this.print()}},{separator:!0},{textKey:"downloadPNG",onclick:function(){this.exportChartLocal()}},{textKey:"downloadJPEG",onclick:function(){this.exportChartLocal({type:"image/jpeg"})}},
{textKey:"downloadSVG",onclick:function(){this.exportChartLocal({type:"image/svg+xml"})}},{textKey:"downloadPDF",onclick:function(){this.exportChartLocal({type:"application/pdf"})}}]}}})})(g)});

View File

@ -0,0 +1,457 @@
/**
* @license Highcharts JS v5.0.2 (2016-10-26)
* Client side exporting module
*
* (c) 2015 Torstein Honsi / Oystein Moseng
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* Client side exporting module
*
* (c) 2015 Torstein Honsi / Oystein Moseng
*
* License: www.highcharts.com/license
*/
'use strict';
/*global MSBlobBuilder */
var merge = Highcharts.merge,
win = Highcharts.win,
nav = win.navigator,
doc = win.document,
each = Highcharts.each,
domurl = win.URL || win.webkitURL || win,
isMSBrowser = /Edge\/|Trident\/|MSIE /.test(nav.userAgent),
loadEventDeferDelay = isMSBrowser ? 150 : 0; // Milliseconds to defer image load event handlers to offset IE bug
// Dummy object so we can reuse our canvas-tools.js without errors
Highcharts.CanVGRenderer = {};
/**
* Downloads a script and executes a callback when done.
* @param {String} scriptLocation
* @param {Function} callback
*/
function getScript(scriptLocation, callback) {
var head = doc.getElementsByTagName('head')[0],
script = doc.createElement('script');
script.type = 'text/javascript';
script.src = scriptLocation;
script.onload = callback;
script.onerror = function() {
console.error('Error loading script', scriptLocation); // eslint-disable-line no-console
};
head.appendChild(script);
}
// Download contents by dataURL/blob
Highcharts.downloadURL = function(dataURL, filename) {
var a = doc.createElement('a'),
windowRef;
// IE specific blob implementation
if (nav.msSaveOrOpenBlob) {
nav.msSaveOrOpenBlob(dataURL, filename);
return;
}
// Try HTML5 download attr if supported
if (a.download !== undefined) {
a.href = dataURL;
a.download = filename; // HTML5 download attribute
a.target = '_blank';
doc.body.appendChild(a);
a.click();
doc.body.removeChild(a);
} else {
// No download attr, just opening data URI
try {
windowRef = win.open(dataURL, 'chart');
if (windowRef === undefined || windowRef === null) {
throw 'Failed to open window';
}
} catch (e) {
// window.open failed, trying location.href
win.location.href = dataURL;
}
}
};
// Get blob URL from SVG code. Falls back to normal data URI.
Highcharts.svgToDataUrl = function(svg) {
var webKit = nav.userAgent.indexOf('WebKit') > -1 && nav.userAgent.indexOf('Chrome') < 0; // Webkit and not chrome
try {
// Safari requires data URI since it doesn't allow navigation to blob URLs
// Firefox has an issue with Blobs and internal references, leading to gradients not working using Blobs (#4550)
if (!webKit && nav.userAgent.toLowerCase().indexOf('firefox') < 0) {
return domurl.createObjectURL(new win.Blob([svg], {
type: 'image/svg+xml;charset-utf-16'
}));
}
} catch (e) {
// Ignore
}
return 'data:image/svg+xml;charset=UTF-8,' + encodeURIComponent(svg);
};
// Get data:URL from image URL
// Pass in callbacks to handle results. finallyCallback is always called at the end of the process. Supplying this callback is optional.
// All callbacks receive four arguments: imageURL, imageType, callbackArgs and scale. callbackArgs is used only by callbacks and can contain whatever.
Highcharts.imageToDataUrl = function(imageURL, imageType, callbackArgs, scale, successCallback, taintedCallback, noCanvasSupportCallback, failedLoadCallback, finallyCallback) {
var img = new win.Image(),
taintedHandler,
loadHandler = function() {
setTimeout(function() {
var canvas = doc.createElement('canvas'),
ctx = canvas.getContext && canvas.getContext('2d'),
dataURL;
try {
if (!ctx) {
noCanvasSupportCallback(imageURL, imageType, callbackArgs, scale);
} else {
canvas.height = img.height * scale;
canvas.width = img.width * scale;
ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
// Now we try to get the contents of the canvas.
try {
dataURL = canvas.toDataURL(imageType);
successCallback(dataURL, imageType, callbackArgs, scale);
} catch (e) {
taintedHandler(imageURL, imageType, callbackArgs, scale);
}
}
} finally {
if (finallyCallback) {
finallyCallback(imageURL, imageType, callbackArgs, scale);
}
}
}, loadEventDeferDelay); // IE bug where image is not always ready despite calling load event.
},
// Image load failed (e.g. invalid URL)
errorHandler = function() {
failedLoadCallback(imageURL, imageType, callbackArgs, scale);
if (finallyCallback) {
finallyCallback(imageURL, imageType, callbackArgs, scale);
}
};
// This is called on load if the image drawing to canvas failed with a security error.
// We retry the drawing with crossOrigin set to Anonymous.
taintedHandler = function() {
img = new win.Image();
taintedHandler = taintedCallback;
img.crossOrigin = 'Anonymous'; // Must be set prior to loading image source
img.onload = loadHandler;
img.onerror = errorHandler;
img.src = imageURL;
};
img.onload = loadHandler;
img.onerror = errorHandler;
img.src = imageURL;
};
/**
* Get data URL to an image of an SVG and call download on it
*
* options object:
* filename: Name of resulting downloaded file without extension
* type: File type of resulting download
* scale: Scaling factor of downloaded image compared to source
* libURL: URL pointing to location of dependency scripts to download on demand
*/
Highcharts.downloadSVGLocal = function(svg, options, failCallback, successCallback) {
var svgurl,
blob,
objectURLRevoke = true,
finallyHandler,
libURL = options.libURL || Highcharts.getOptions().exporting.libURL,
dummySVGContainer = doc.createElement('div'),
imageType = options.type || 'image/png',
filename = (options.filename || 'chart') + '.' + (imageType === 'image/svg+xml' ? 'svg' : imageType.split('/')[1]),
scale = options.scale || 1;
libURL = libURL.slice(-1) !== '/' ? libURL + '/' : libURL; // Allow libURL to end with or without fordward slash
function svgToPdf(svgElement, margin) {
var width = svgElement.width.baseVal.value + 2 * margin,
height = svgElement.height.baseVal.value + 2 * margin,
pdf = new win.jsPDF('l', 'pt', [width, height]); // eslint-disable-line new-cap
win.svgElementToPdf(svgElement, pdf, {
removeInvalid: true
});
return pdf.output('datauristring');
}
function downloadPDF() {
dummySVGContainer.innerHTML = svg;
var textElements = dummySVGContainer.getElementsByTagName('text'),
svgElementStyle = dummySVGContainer.getElementsByTagName('svg')[0].style;
// Workaround for the text styling. Making sure it does pick up the root element
each(textElements, function(el) {
each(['font-family', 'font-size'], function(property) {
if (!el.style[property] && svgElementStyle[property]) {
el.style[property] = svgElementStyle[property];
}
});
el.style['font-family'] = el.style['font-family'] && el.style['font-family'].split(' ').splice(-1);
});
var svgData = svgToPdf(dummySVGContainer.firstChild, 0);
Highcharts.downloadURL(svgData, filename);
if (successCallback) {
successCallback();
}
}
// Initiate download depending on file type
if (imageType === 'image/svg+xml') {
// SVG download. In this case, we want to use Microsoft specific Blob if available
try {
if (nav.msSaveOrOpenBlob) {
blob = new MSBlobBuilder();
blob.append(svg);
svgurl = blob.getBlob('image/svg+xml');
} else {
svgurl = Highcharts.svgToDataUrl(svg);
}
Highcharts.downloadURL(svgurl, filename);
if (successCallback) {
successCallback();
}
} catch (e) {
failCallback();
}
} else if (imageType === 'application/pdf') {
if (win.jsPDF && win.svgElementToPdf) {
downloadPDF();
} else {
// Must load pdf libraries first
objectURLRevoke = true; // Don't destroy the object URL yet since we are doing things asynchronously. A cleaner solution would be nice, but this will do for now.
getScript(libURL + 'jspdf.js', function() {
getScript(libURL + 'rgbcolor.js', function() {
getScript(libURL + 'svg2pdf.js', function() {
downloadPDF();
});
});
});
}
} else {
// PNG/JPEG download - create bitmap from SVG
svgurl = Highcharts.svgToDataUrl(svg);
finallyHandler = function() {
try {
domurl.revokeObjectURL(svgurl);
} catch (e) {
// Ignore
}
};
// First, try to get PNG by rendering on canvas
Highcharts.imageToDataUrl(svgurl, imageType, { /* args */ }, scale, function(imageURL) {
// Success
try {
Highcharts.downloadURL(imageURL, filename);
if (successCallback) {
successCallback();
}
} catch (e) {
failCallback();
}
}, function() {
// Failed due to tainted canvas
// Create new and untainted canvas
var canvas = doc.createElement('canvas'),
ctx = canvas.getContext('2d'),
imageWidth = svg.match(/^<svg[^>]*width\s*=\s*\"?(\d+)\"?[^>]*>/)[1] * scale,
imageHeight = svg.match(/^<svg[^>]*height\s*=\s*\"?(\d+)\"?[^>]*>/)[1] * scale,
downloadWithCanVG = function() {
ctx.drawSvg(svg, 0, 0, imageWidth, imageHeight);
try {
Highcharts.downloadURL(nav.msSaveOrOpenBlob ? canvas.msToBlob() : canvas.toDataURL(imageType), filename);
if (successCallback) {
successCallback();
}
} catch (e) {
failCallback();
} finally {
finallyHandler();
}
};
canvas.width = imageWidth;
canvas.height = imageHeight;
if (win.canvg) {
// Use preloaded canvg
downloadWithCanVG();
} else {
// Must load canVG first
objectURLRevoke = true; // Don't destroy the object URL yet since we are doing things asynchronously. A cleaner solution would be nice, but this will do for now.
getScript(libURL + 'rgbcolor.js', function() { // Get RGBColor.js first
getScript(libURL + 'canvg.js', function() {
downloadWithCanVG();
});
});
}
},
// No canvas support
failCallback,
// Failed to load image
failCallback,
// Finally
function() {
if (objectURLRevoke) {
finallyHandler();
}
});
}
};
// Get SVG of chart prepared for client side export. This converts embedded images in the SVG to data URIs.
// The options and chartOptions arguments are passed to the getSVGForExport function.
Highcharts.Chart.prototype.getSVGForLocalExport = function(options, chartOptions, failCallback, successCallback) {
var chart = this,
images,
imagesEmbedded = 0,
chartCopyContainer,
el,
i,
l,
// Success handler, we converted image to base64!
embeddedSuccess = function(imageURL, imageType, callbackArgs) {
++imagesEmbedded;
// Change image href in chart copy
callbackArgs.imageElement.setAttributeNS('http://www.w3.org/1999/xlink', 'href', imageURL);
// When done with last image we have our SVG
if (imagesEmbedded === images.length) {
successCallback(chart.sanitizeSVG(chartCopyContainer.innerHTML));
}
};
// Hook into getSVG to get a copy of the chart copy's container
Highcharts.wrap(Highcharts.Chart.prototype, 'getChartHTML', function(proceed) {
chartCopyContainer = this.container.cloneNode(true);
return proceed.apply(this, Array.prototype.slice.call(arguments, 1));
});
// Trigger hook to get chart copy
chart.getSVGForExport(options, chartOptions);
images = chartCopyContainer.getElementsByTagName('image');
try {
// If there are no images to embed, the SVG is okay now.
if (!images.length) {
successCallback(chart.sanitizeSVG(chartCopyContainer.innerHTML)); // Use SVG of chart copy
return;
}
// Go through the images we want to embed
for (i = 0, l = images.length; i < l; ++i) {
el = images[i];
Highcharts.imageToDataUrl(el.getAttributeNS('http://www.w3.org/1999/xlink', 'href'), 'image/png', {
imageElement: el
}, options.scale,
embeddedSuccess,
// Tainted canvas
failCallback,
// No canvas support
failCallback,
// Failed to load source
failCallback
);
}
} catch (e) {
failCallback();
}
};
/**
* Add a new method to the Chart object to perform a local download
*/
Highcharts.Chart.prototype.exportChartLocal = function(exportingOptions, chartOptions) {
var chart = this,
options = Highcharts.merge(chart.options.exporting, exportingOptions),
fallbackToExportServer = function() {
if (options.fallbackToExportServer === false) {
if (options.error) {
options.error();
} else {
throw 'Fallback to export server disabled';
}
} else {
chart.exportChart(options);
}
},
svgSuccess = function(svg) {
Highcharts.downloadSVGLocal(svg, options, fallbackToExportServer);
};
// If we have embedded images and are exporting to JPEG/PNG, Microsoft browsers won't handle it, so fall back
if ((isMSBrowser && options.imageType !== 'image/svg+xml' || options.imageType !== 'application/pdf') && chart.container.getElementsByTagName('image').length) {
fallbackToExportServer();
return;
}
chart.getSVGForLocalExport(options, chartOptions, fallbackToExportServer, svgSuccess);
};
// Extend the default options to use the local exporter logic
merge(true, Highcharts.getOptions().exporting, {
libURL: 'http://code.highcharts.com/5.0.2/lib/',
buttons: {
contextButton: {
menuItems: [{
textKey: 'printChart',
onclick: function() {
this.print();
}
}, {
separator: true
}, {
textKey: 'downloadPNG',
onclick: function() {
this.exportChartLocal();
}
}, {
textKey: 'downloadJPEG',
onclick: function() {
this.exportChartLocal({
type: 'image/jpeg'
});
}
}, {
textKey: 'downloadSVG',
onclick: function() {
this.exportChartLocal({
type: 'image/svg+xml'
});
}
}, {
textKey: 'downloadPDF',
onclick: function() {
this.exportChartLocal({
type: 'application/pdf'
});
}
}]
}
}
});
}(Highcharts));
}));

View File

@ -0,0 +1,10 @@
/*
Highcharts JS v5.0.2 (2016-10-26)
(c) 2009-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(a){"object"===typeof module&&module.exports?module.exports=a:a(Highcharts)})(function(a){(function(a){var h=a.Chart,k=a.each,q=a.pick,r=a.addEvent;h.prototype.callbacks.push(function(f){function a(){var a=[];k(f.series,function(b){var c=b.options.dataLabels,d=b.dataLabelCollections||["dataLabel"];(c.enabled||b._hasPointLabels)&&!c.allowOverlap&&b.visible&&k(d,function(c){k(b.points,function(b){b[c]&&(b[c].labelrank=q(b.labelrank,b.shapeArgs&&b.shapeArgs.height),a.push(b[c]))})})});f.hideOverlappingLabels(a)}
a();r(f,"redraw",a)});h.prototype.hideOverlappingLabels=function(a){var f=a.length,e,b,c,d,l,m,n,p,g,h=function(a,b,c,d,e,f,g,h){return!(e>a+c||e+g<a||f>b+d||f+h<b)};for(b=0;b<f;b++)if(e=a[b])e.oldOpacity=e.opacity,e.newOpacity=1;a.sort(function(a,b){return(b.labelrank||0)-(a.labelrank||0)});for(b=0;b<f;b++)for(c=a[b],e=b+1;e<f;++e)if(d=a[e],c&&d&&c.placed&&d.placed&&0!==c.newOpacity&&0!==d.newOpacity&&(l=c.alignAttr,m=d.alignAttr,n=c.parentGroup,p=d.parentGroup,g=2*(c.box?0:c.padding),l=h(l.x+n.translateX,
l.y+n.translateY,c.width-g,c.height-g,m.x+p.translateX,m.y+p.translateY,d.width-g,d.height-g)))(c.labelrank<d.labelrank?c:d).newOpacity=0;k(a,function(a){var b,c;a&&(c=a.newOpacity,a.oldOpacity!==c&&a.placed&&(c?a.show(!0):b=function(){a.hide()},a.alignAttr.opacity=c,a[a.isOld?"animate":"attr"](a.alignAttr,null,b)),a.isOld=!0)})}})(a)});

View File

@ -0,0 +1,164 @@
/**
* @license Highcharts JS v5.0.2 (2016-10-26)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
'use strict';
/**
* Highcharts module to hide overlapping data labels. This module is included in Highcharts.
*/
var Chart = H.Chart,
each = H.each,
pick = H.pick,
addEvent = H.addEvent;
// Collect potensial overlapping data labels. Stack labels probably don't need to be
// considered because they are usually accompanied by data labels that lie inside the columns.
Chart.prototype.callbacks.push(function(chart) {
function collectAndHide() {
var labels = [];
each(chart.series, function(series) {
var dlOptions = series.options.dataLabels,
collections = series.dataLabelCollections || ['dataLabel']; // Range series have two collections
if ((dlOptions.enabled || series._hasPointLabels) && !dlOptions.allowOverlap && series.visible) { // #3866
each(collections, function(coll) {
each(series.points, function(point) {
if (point[coll]) {
point[coll].labelrank = pick(point.labelrank, point.shapeArgs && point.shapeArgs.height); // #4118
labels.push(point[coll]);
}
});
});
}
});
chart.hideOverlappingLabels(labels);
}
// Do it now ...
collectAndHide();
// ... and after each chart redraw
addEvent(chart, 'redraw', collectAndHide);
});
/**
* Hide overlapping labels. Labels are moved and faded in and out on zoom to provide a smooth
* visual imression.
*/
Chart.prototype.hideOverlappingLabels = function(labels) {
var len = labels.length,
label,
i,
j,
label1,
label2,
isIntersecting,
pos1,
pos2,
parent1,
parent2,
padding,
intersectRect = function(x1, y1, w1, h1, x2, y2, w2, h2) {
return !(
x2 > x1 + w1 ||
x2 + w2 < x1 ||
y2 > y1 + h1 ||
y2 + h2 < y1
);
};
// Mark with initial opacity
for (i = 0; i < len; i++) {
label = labels[i];
if (label) {
label.oldOpacity = label.opacity;
label.newOpacity = 1;
}
}
// Prevent a situation in a gradually rising slope, that each label
// will hide the previous one because the previous one always has
// lower rank.
labels.sort(function(a, b) {
return (b.labelrank || 0) - (a.labelrank || 0);
});
// Detect overlapping labels
for (i = 0; i < len; i++) {
label1 = labels[i];
for (j = i + 1; j < len; ++j) {
label2 = labels[j];
if (label1 && label2 && label1.placed && label2.placed && label1.newOpacity !== 0 && label2.newOpacity !== 0) {
pos1 = label1.alignAttr;
pos2 = label2.alignAttr;
parent1 = label1.parentGroup; // Different panes have different positions
parent2 = label2.parentGroup;
padding = 2 * (label1.box ? 0 : label1.padding); // Substract the padding if no background or border (#4333)
isIntersecting = intersectRect(
pos1.x + parent1.translateX,
pos1.y + parent1.translateY,
label1.width - padding,
label1.height - padding,
pos2.x + parent2.translateX,
pos2.y + parent2.translateY,
label2.width - padding,
label2.height - padding
);
if (isIntersecting) {
(label1.labelrank < label2.labelrank ? label1 : label2).newOpacity = 0;
}
}
}
}
// Hide or show
each(labels, function(label) {
var complete,
newOpacity;
if (label) {
newOpacity = label.newOpacity;
if (label.oldOpacity !== newOpacity && label.placed) {
// Make sure the label is completely hidden to avoid catching clicks (#4362)
if (newOpacity) {
label.show(true);
} else {
complete = function() {
label.hide();
};
}
// Animate or set the opacity
label.alignAttr.opacity = newOpacity;
label[label.isOld ? 'animate' : 'attr'](label.alignAttr, null, complete);
}
label.isOld = true;
}
});
};
}(Highcharts));
}));

View File

@ -0,0 +1,18 @@
/*
Highcharts JS v5.0.2 (2016-10-26)
(c) 2009-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(t){"object"===typeof module&&module.exports?module.exports=t:t(Highcharts)})(function(t){(function(u){function t(d,b,a,m,c,e){d=(e-b)*(a-d)-(m-b)*(c-d);return 0<d?!0:0>d?!1:!0}function v(d,b,a,m,c,e,f,l){return t(d,b,c,e,f,l)!==t(a,m,c,e,f,l)&&t(d,b,a,m,c,e)!==t(d,b,a,m,f,l)}function y(d,b,a,m,c,e,f,l){return v(d,b,d+a,b,c,e,f,l)||v(d+a,b,d+a,b+m,c,e,f,l)||v(d,b+m,d+a,b+m,c,e,f,l)||v(d,b,d,b+m,c,e,f,l)}function z(d){var b=this;d.call(b);clearTimeout(b.seriesLabelTimer);b.seriesLabelTimer=
setTimeout(function(){b.boxesToAvoid=[];w(b.series,function(a){var d=a.options.label;d.enabled&&a.visible&&(a.graph||a.area)&&(a.interpolatedPoints=a.getPointsOnGraph(),w(d.boxesToAvoid||[],function(a){b.boxesToAvoid.push(a)}))});w(b.series,function(a){function d(a,b,c){return a>p&&a<=p+r-c.width&&b>=g&&b<=g+h-c.height}var c,e,f,l=[],k,n,p=(c=b.inverted)?a.yAxis.pos:a.xAxis.pos,g=c?a.xAxis.pos:a.yAxis.pos,r=b.inverted?a.yAxis.len:a.xAxis.len,h=b.inverted?a.xAxis.len:a.yAxis.len,q=a.interpolatedPoints;
if(a.visible&&q){a.labelBySeries||(a.labelBySeries=b.renderer.label(a.name,0,-9999,"connector").css(D({color:a.color},a.options.label.styles)).attr({padding:0,opacity:0,stroke:a.color,"stroke-width":1}).add(a.group).animate({opacity:1},{duration:200}));c=a.labelBySeries.getBBox();c.width=Math.round(c.width);for(n=q.length-1;0<n;--n)e=q[n].chartX+3,f=q[n].chartY-c.height-3,d(e,f,c)&&(k=a.checkClearPoint(e,f,c)),k&&l.push(k),e=q[n].chartX+3,f=q[n].chartY+3,d(e,f,c)&&(k=a.checkClearPoint(e,f,c)),k&&
l.push(k),e=q[n].chartX-c.width-3,f=q[n].chartY+3,d(e,f,c)&&(k=a.checkClearPoint(e,f,c)),k&&l.push(k),e=q[n].chartX-c.width-3,f=q[n].chartY-c.height-3,d(e,f,c)&&(k=a.checkClearPoint(e,f,c)),k&&l.push(k);if(!l.length)for(e=p+r-c.width;e>=p;e-=16)for(f=g;f<g+h-c.height;f+=16)(k=a.checkClearPoint(e,f,c,!0))&&l.push(k);l.length?(l.sort(function(a,b){return b.weight-a.weight}),k=l[0],b.boxesToAvoid.push({left:k.x,right:k.x+c.width,top:k.y,bottom:k.y+c.height}),Math.round(k.x)===Math.round(a.labelBySeries.x)&&
Math.round(k.y)===Math.round(a.labelBySeries.y)||a.labelBySeries.attr({x:k.x-p,y:k.y-g,anchorX:k.connectorPoint&&k.connectorPoint.plotX,anchorY:k.connectorPoint&&k.connectorPoint.plotY,opacity:0}).animate({opacity:1})):a.labelBySeries&&(a.labelBySeries=a.labelBySeries.destroy())}})},350)}var A=u.wrap,w=u.each,D=u.extend,x=u.isNumber,B=u.Series,E=u.SVGRenderer,C=u.Chart;u.setOptions({plotOptions:{series:{label:{enabled:!0,connectorAllowed:!0,connectorNeighbourDistance:24,styles:{fontWeight:"bold"}}}}});
E.prototype.symbols.connector=function(d,b,a,m,c){var e=c&&c.anchorX;c=c&&c.anchorY;var f,l,k=a/2;x(e)&&x(c)&&(f=["M",e,c],l=b-c,0>l&&(l=-m-l),l<a&&(k=e<d+a/2?l:a-l),c>b+m?f.push("L",d+k,b+m):c<b?f.push("L",d+k,b):e<d?f.push("L",d,b+m/2):e>d+a&&f.push("L",d+a,b+m/2));return f||[]};B.prototype.getPointsOnGraph=function(){var d=this.points,b,a,m=[],c,e,f,l;e=this.graph||this.area;f=e.element;var k=(b=this.chart.inverted)?this.yAxis.pos:this.xAxis.pos,n=b?this.xAxis.pos:this.yAxis.pos;if(this.getPointSpline&&
f.getPointAtLength){e.toD&&(a=e.attr("d"),e.attr({d:e.toD}));l=f.getTotalLength();for(c=0;c<l;c+=16)b=f.getPointAtLength(c),m.push({chartX:k+b.x,chartY:n+b.y,plotX:b.x,plotY:b.y});a&&e.attr({d:a});b=d[d.length-1];b.chartX=k+b.plotX;b.chartY=n+b.plotY;m.push(b)}else for(l=d.length,c=0;c<l;c+=1){b=d[c];a=d[c-1];b.chartX=k+b.plotX;b.chartY=n+b.plotY;if(0<c&&(e=Math.abs(b.chartX-a.chartX),f=Math.abs(b.chartY-a.chartY),e=Math.max(e,f),16<e))for(e=Math.ceil(e/16),f=1;f<e;f+=1)m.push({chartX:a.chartX+f/
e*(b.chartX-a.chartX),chartY:a.chartY+f/e*(b.chartY-a.chartY),plotX:a.plotX+f/e*(b.plotX-a.plotX),plotY:a.plotY+f/e*(b.plotY-a.plotY)});x(b.plotY)&&m.push(b)}return m};B.prototype.checkClearPoint=function(d,b,a,m){var c=Number.MAX_VALUE,e=Number.MAX_VALUE,f,l,k=this.options.label.connectorAllowed,n=this.chart,p,g,r,h;for(r=0;r<n.boxesToAvoid.length;r+=1){g=n.boxesToAvoid[r];h=d+a.width;p=b;var q=b+a.height;if(!(d>g.right||h<g.left||p>g.bottom||q<g.top))return!1}for(r=0;r<n.series.length;r+=1)if(p=
n.series[r],g=p.interpolatedPoints,p.visible&&g){for(h=1;h<g.length;h+=1){if(y(d,b,a.width,a.height,g[h-1].chartX,g[h-1].chartY,g[h].chartX,g[h].chartY))return!1;this===p&&!f&&m&&(f=y(d-16,b-16,a.width+32,a.height+32,g[h-1].chartX,g[h-1].chartY,g[h].chartX,g[h].chartY));this!==p&&(c=Math.min(c,Math.pow(d+a.width/2-g[h].chartX,2)+Math.pow(b+a.height/2-g[h].chartY,2),Math.pow(d-g[h].chartX,2)+Math.pow(b-g[h].chartY,2),Math.pow(d+a.width-g[h].chartX,2)+Math.pow(b-g[h].chartY,2),Math.pow(d+a.width-g[h].chartX,
2)+Math.pow(b+a.height-g[h].chartY,2),Math.pow(d-g[h].chartX,2)+Math.pow(b+a.height-g[h].chartY,2)))}if(k&&this===p&&(m&&!f||c<Math.pow(this.options.label.connectorNeighbourDistance,2))){for(h=1;h<g.length;h+=1)f=Math.min(Math.pow(d+a.width/2-g[h].chartX,2)+Math.pow(b+a.height/2-g[h].chartY,2),Math.pow(d-g[h].chartX,2)+Math.pow(b-g[h].chartY,2),Math.pow(d+a.width-g[h].chartX,2)+Math.pow(b-g[h].chartY,2),Math.pow(d+a.width-g[h].chartX,2)+Math.pow(b+a.height-g[h].chartY,2),Math.pow(d-g[h].chartX,2)+
Math.pow(b+a.height-g[h].chartY,2)),f<e&&(e=f,l=g[h]);f=!0}}return!m||f?{x:d,y:b,weight:c-(l?e:0),connectorPoint:l}:!1};A(C.prototype,"render",z);A(C.prototype,"redraw",z)})(t)});

View File

@ -0,0 +1,544 @@
/**
* @license Highcharts JS v5.0.2 (2016-10-26)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
/**
* EXPERIMENTAL Highcharts module to place labels next to a series in a natural position.
*
* TODO:
* - add column support (box collision detection, boxesToAvoid logic)
* - other series types, area etc.
* - avoid data labels, when data labels above, show series label below.
* - add more options (connector, format, formatter)
*
* http://jsfiddle.net/highcharts/L2u9rpwr/
* http://jsfiddle.net/highcharts/y5A37/
* http://jsfiddle.net/highcharts/264Nm/
* http://jsfiddle.net/highcharts/y5A37/
*/
'use strict';
var labelDistance = 3,
wrap = H.wrap,
each = H.each,
extend = H.extend,
isNumber = H.isNumber,
Series = H.Series,
SVGRenderer = H.SVGRenderer,
Chart = H.Chart;
H.setOptions({
plotOptions: {
series: {
label: {
enabled: true,
// Allow labels to be placed distant to the graph if necessary, and
// draw a connector line to the graph
connectorAllowed: true,
connectorNeighbourDistance: 24, // If the label is closer than this to a neighbour graph, draw a connector
styles: {
fontWeight: 'bold'
}
// boxesToAvoid: []
}
}
}
});
/**
* Counter-clockwise, part of the fast line intersection logic
*/
function ccw(x1, y1, x2, y2, x3, y3) {
var cw = ((y3 - y1) * (x2 - x1)) - ((y2 - y1) * (x3 - x1));
return cw > 0 ? true : cw < 0 ? false : true;
}
/**
* Detect if two lines intersect
*/
function intersectLine(x1, y1, x2, y2, x3, y3, x4, y4) {
return ccw(x1, y1, x3, y3, x4, y4) !== ccw(x2, y2, x3, y3, x4, y4) &&
ccw(x1, y1, x2, y2, x3, y3) !== ccw(x1, y1, x2, y2, x4, y4);
}
/**
* Detect if a box intersects with a line
*/
function boxIntersectLine(x, y, w, h, x1, y1, x2, y2) {
return (
intersectLine(x, y, x + w, y, x1, y1, x2, y2) || // top of label
intersectLine(x + w, y, x + w, y + h, x1, y1, x2, y2) || // right of label
intersectLine(x, y + h, x + w, y + h, x1, y1, x2, y2) || // bottom of label
intersectLine(x, y, x, y + h, x1, y1, x2, y2) // left of label
);
}
/**
* General symbol definition for labels with connector
*/
SVGRenderer.prototype.symbols.connector = function(x, y, w, h, options) {
var anchorX = options && options.anchorX,
anchorY = options && options.anchorY,
path,
yOffset,
lateral = w / 2;
if (isNumber(anchorX) && isNumber(anchorY)) {
path = ['M', anchorX, anchorY];
// Prefer 45 deg connectors
yOffset = y - anchorY;
if (yOffset < 0) {
yOffset = -h - yOffset;
}
if (yOffset < w) {
lateral = anchorX < x + (w / 2) ? yOffset : w - yOffset;
}
// Anchor below label
if (anchorY > y + h) {
path.push('L', x + lateral, y + h);
// Anchor above label
} else if (anchorY < y) {
path.push('L', x + lateral, y);
// Anchor left of label
} else if (anchorX < x) {
path.push('L', x, y + h / 2);
// Anchor right of label
} else if (anchorX > x + w) {
path.push('L', x + w, y + h / 2);
}
}
return path || [];
};
/**
* Points to avoid. In addition to actual data points, the label should avoid
* interpolated positions.
*/
Series.prototype.getPointsOnGraph = function() {
var distance = 16,
points = this.points,
point,
last,
interpolated = [],
i,
deltaX,
deltaY,
delta,
len,
n,
j,
d,
graph = this.graph || this.area,
node = graph.element,
inverted = this.chart.inverted,
paneLeft = inverted ? this.yAxis.pos : this.xAxis.pos,
paneTop = inverted ? this.xAxis.pos : this.yAxis.pos;
// For splines, get the point at length (possible caveat: peaks are not correctly detected)
if (this.getPointSpline && node.getPointAtLength) {
// If it is animating towards a path definition, use that briefly, and reset
if (graph.toD) {
d = graph.attr('d');
graph.attr({
d: graph.toD
});
}
len = node.getTotalLength();
for (i = 0; i < len; i += distance) {
point = node.getPointAtLength(i);
interpolated.push({
chartX: paneLeft + point.x,
chartY: paneTop + point.y,
plotX: point.x,
plotY: point.y
});
}
if (d) {
graph.attr({
d: d
});
}
// Last point
point = points[points.length - 1];
point.chartX = paneLeft + point.plotX;
point.chartY = paneTop + point.plotY;
interpolated.push(point);
// Interpolate
} else {
len = points.length;
for (i = 0; i < len; i += 1) {
point = points[i];
last = points[i - 1];
// Absolute coordinates so we can compare different panes
point.chartX = paneLeft + point.plotX;
point.chartY = paneTop + point.plotY;
// Add interpolated points
if (i > 0) {
deltaX = Math.abs(point.chartX - last.chartX);
deltaY = Math.abs(point.chartY - last.chartY);
delta = Math.max(deltaX, deltaY);
if (delta > distance) {
n = Math.ceil(delta / distance);
for (j = 1; j < n; j += 1) {
interpolated.push({
chartX: last.chartX + (point.chartX - last.chartX) * (j / n),
chartY: last.chartY + (point.chartY - last.chartY) * (j / n),
plotX: last.plotX + (point.plotX - last.plotX) * (j / n),
plotY: last.plotY + (point.plotY - last.plotY) * (j / n)
});
}
}
}
// Add the real point in order to find positive and negative peaks
if (isNumber(point.plotY)) {
interpolated.push(point);
}
}
}
return interpolated;
};
/**
* Check whether a proposed label position is clear of other elements
*/
Series.prototype.checkClearPoint = function(x, y, bBox, checkDistance) {
var distToOthersSquared = Number.MAX_VALUE, // distance to other graphs
distToPointSquared = Number.MAX_VALUE,
dist,
connectorPoint,
connectorEnabled = this.options.label.connectorAllowed,
chart = this.chart,
series,
points,
leastDistance = 16,
withinRange,
i,
j;
function intersectRect(r1, r2) {
return !(r2.left > r1.right ||
r2.right < r1.left ||
r2.top > r1.bottom ||
r2.bottom < r1.top);
}
/**
* Get the weight in order to determine the ideal position. Larger distance to
* other series gives more weight. Smaller distance to the actual point (connector points only)
* gives more weight.
*/
function getWeight(distToOthersSquared, distToPointSquared) {
return distToOthersSquared - distToPointSquared;
}
// First check for collision with existing labels
for (i = 0; i < chart.boxesToAvoid.length; i += 1) {
if (intersectRect(chart.boxesToAvoid[i], {
left: x,
right: x + bBox.width,
top: y,
bottom: y + bBox.height
})) {
return false;
}
}
// For each position, check if the lines around the label intersect with any of the
// graphs
for (i = 0; i < chart.series.length; i += 1) {
series = chart.series[i];
points = series.interpolatedPoints;
if (series.visible && points) {
for (j = 1; j < points.length; j += 1) {
// If any of the box sides intersect with the line, return
if (boxIntersectLine(
x,
y,
bBox.width,
bBox.height,
points[j - 1].chartX,
points[j - 1].chartY,
points[j].chartX,
points[j].chartY
)) {
return false;
}
// But if it is too far away (a padded box doesn't intersect), also return
if (this === series && !withinRange && checkDistance) {
withinRange = boxIntersectLine(
x - leastDistance,
y - leastDistance,
bBox.width + 2 * leastDistance,
bBox.height + 2 * leastDistance,
points[j - 1].chartX,
points[j - 1].chartY,
points[j].chartX,
points[j].chartY
);
}
// Find the squared distance from the center of the label
if (this !== series) {
distToOthersSquared = Math.min(
distToOthersSquared,
Math.pow(x + bBox.width / 2 - points[j].chartX, 2) + Math.pow(y + bBox.height / 2 - points[j].chartY, 2),
Math.pow(x - points[j].chartX, 2) + Math.pow(y - points[j].chartY, 2),
Math.pow(x + bBox.width - points[j].chartX, 2) + Math.pow(y - points[j].chartY, 2),
Math.pow(x + bBox.width - points[j].chartX, 2) + Math.pow(y + bBox.height - points[j].chartY, 2),
Math.pow(x - points[j].chartX, 2) + Math.pow(y + bBox.height - points[j].chartY, 2)
);
}
}
// Do we need a connector?
if (connectorEnabled && this === series && ((checkDistance && !withinRange) ||
distToOthersSquared < Math.pow(this.options.label.connectorNeighbourDistance, 2))) {
for (j = 1; j < points.length; j += 1) {
dist = Math.min(
Math.pow(x + bBox.width / 2 - points[j].chartX, 2) + Math.pow(y + bBox.height / 2 - points[j].chartY, 2),
Math.pow(x - points[j].chartX, 2) + Math.pow(y - points[j].chartY, 2),
Math.pow(x + bBox.width - points[j].chartX, 2) + Math.pow(y - points[j].chartY, 2),
Math.pow(x + bBox.width - points[j].chartX, 2) + Math.pow(y + bBox.height - points[j].chartY, 2),
Math.pow(x - points[j].chartX, 2) + Math.pow(y + bBox.height - points[j].chartY, 2)
);
if (dist < distToPointSquared) {
distToPointSquared = dist;
connectorPoint = points[j];
}
}
withinRange = true;
}
}
}
return !checkDistance || withinRange ? {
x: x,
y: y,
weight: getWeight(distToOthersSquared, connectorPoint ? distToPointSquared : 0),
connectorPoint: connectorPoint
} : false;
};
/**
* The main initiator method that runs on chart level after initiation and redraw. It runs in
* a timeout to prevent locking, and loops over all series, taking all series and labels into
* account when placing the labels.
*/
function drawLabels(proceed) {
var chart = this;
proceed.call(chart);
clearTimeout(chart.seriesLabelTimer);
chart.seriesLabelTimer = setTimeout(function() {
chart.boxesToAvoid = [];
// Build the interpolated points
each(chart.series, function(series) {
var options = series.options.label;
if (options.enabled && series.visible && (series.graph || series.area)) {
series.interpolatedPoints = series.getPointsOnGraph();
each(options.boxesToAvoid || [], function(box) {
chart.boxesToAvoid.push(box);
});
}
});
each(chart.series, function(series) {
var bBox,
x,
y,
results = [],
clearPoint,
i,
best,
inverted = chart.inverted,
paneLeft = inverted ? series.yAxis.pos : series.xAxis.pos,
paneTop = inverted ? series.xAxis.pos : series.yAxis.pos,
paneWidth = chart.inverted ? series.yAxis.len : series.xAxis.len,
paneHeight = chart.inverted ? series.xAxis.len : series.yAxis.len,
points = series.interpolatedPoints;
function insidePane(x, y, bBox) {
return x > paneLeft && x <= paneLeft + paneWidth - bBox.width &&
y >= paneTop && y <= paneTop + paneHeight - bBox.height;
}
if (series.visible && points) {
if (!series.labelBySeries) {
series.labelBySeries = chart.renderer.label(series.name, 0, -9999, 'connector')
.css(extend({
color: series.color
}, series.options.label.styles))
.attr({
padding: 0,
opacity: 0,
stroke: series.color,
'stroke-width': 1
})
.add(series.group)
.animate({
opacity: 1
}, {
duration: 200
});
}
bBox = series.labelBySeries.getBBox();
bBox.width = Math.round(bBox.width);
// Ideal positions are centered above or below a point on right side of chart
for (i = points.length - 1; i > 0; i -= 1) {
// Right - up
x = points[i].chartX + labelDistance;
y = points[i].chartY - bBox.height - labelDistance;
if (insidePane(x, y, bBox)) {
best = series.checkClearPoint(
x,
y,
bBox
);
}
if (best) {
results.push(best);
}
// Right - down
x = points[i].chartX + labelDistance;
y = points[i].chartY + labelDistance;
if (insidePane(x, y, bBox)) {
best = series.checkClearPoint(
x,
y,
bBox
);
}
if (best) {
results.push(best);
}
// Left - down
x = points[i].chartX - bBox.width - labelDistance;
y = points[i].chartY + labelDistance;
if (insidePane(x, y, bBox)) {
best = series.checkClearPoint(
x,
y,
bBox
);
}
if (best) {
results.push(best);
}
// Left - up
x = points[i].chartX - bBox.width - labelDistance;
y = points[i].chartY - bBox.height - labelDistance;
if (insidePane(x, y, bBox)) {
best = series.checkClearPoint(
x,
y,
bBox
);
}
if (best) {
results.push(best);
}
}
// Brute force, try all positions on the chart in a 16x16 grid
if (!results.length) {
for (x = paneLeft + paneWidth - bBox.width; x >= paneLeft; x -= 16) {
for (y = paneTop; y < paneTop + paneHeight - bBox.height; y += 16) {
clearPoint = series.checkClearPoint(x, y, bBox, true);
if (clearPoint) {
results.push(clearPoint);
}
}
}
}
if (results.length) {
results.sort(function(a, b) {
return b.weight - a.weight;
});
best = results[0];
chart.boxesToAvoid.push({
left: best.x,
right: best.x + bBox.width,
top: best.y,
bottom: best.y + bBox.height
});
// Move it if needed
if (Math.round(best.x) !== Math.round(series.labelBySeries.x) || Math.round(best.y) !== Math.round(series.labelBySeries.y)) {
series.labelBySeries
.attr({
x: best.x - paneLeft,
y: best.y - paneTop,
anchorX: best.connectorPoint && best.connectorPoint.plotX,
anchorY: best.connectorPoint && best.connectorPoint.plotY,
opacity: 0
})
.animate({
opacity: 1
});
}
} else if (series.labelBySeries) {
series.labelBySeries = series.labelBySeries.destroy();
}
}
});
}, 350);
}
wrap(Chart.prototype, 'render', drawLabels);
wrap(Chart.prototype, 'redraw', drawLabels);
}(Highcharts));
}));

View File

@ -0,0 +1,14 @@
/*
Highcharts JS v5.0.2 (2016-10-26)
Solid angular gauge module
(c) 2010-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(k){"object"===typeof module&&module.exports?module.exports=k:k(Highcharts)})(function(k){(function(d){var k=d.pInt,t=d.pick,l=d.each,u=d.isNumber,m;m={initDataClasses:function(a){var c=this,e=this.chart,h,r=0,f=this.options;this.dataClasses=h=[];l(a.dataClasses,function(g,b){g=d.merge(g);h.push(g);g.color||("category"===f.dataClassColor?(b=e.options.colors,g.color=b[r++],r===b.length&&(r=0)):g.color=c.tweenColors(d.color(f.minColor),d.color(f.maxColor),b/(a.dataClasses.length-1)))})},initStops:function(a){this.stops=
a.stops||[[0,this.options.minColor],[1,this.options.maxColor]];l(this.stops,function(a){a.color=d.color(a[1])})},toColor:function(a,c){var e=this.stops,h,d,f=this.dataClasses,g,b;if(f)for(b=f.length;b--;){if(g=f[b],h=g.from,e=g.to,(void 0===h||a>=h)&&(void 0===e||a<=e)){d=g.color;c&&(c.dataClass=b);break}}else{this.isLog&&(a=this.val2lin(a));a=1-(this.max-a)/(this.max-this.min);for(b=e.length;b--&&!(a>e[b][0]););h=e[b]||e[b+1];e=e[b+1]||h;a=1-(e[0]-a)/(e[0]-h[0]||1);d=this.tweenColors(h.color,e.color,
a)}return d},tweenColors:function(a,c,e){var d;c.rgba.length&&a.rgba.length?(a=a.rgba,c=c.rgba,d=1!==c[3]||1!==a[3],a=(d?"rgba(":"rgb(")+Math.round(c[0]+(a[0]-c[0])*(1-e))+","+Math.round(c[1]+(a[1]-c[1])*(1-e))+","+Math.round(c[2]+(a[2]-c[2])*(1-e))+(d?","+(c[3]+(a[3]-c[3])*(1-e)):"")+")"):a=c.input||"none";return a}};l(["fill","stroke"],function(a){d.Fx.prototype[a+"Setter"]=function(){this.elem.attr(a,m.tweenColors(d.color(this.start),d.color(this.end),this.pos))}});d.seriesType("solidgauge","gauge",
{colorByPoint:!0},{bindAxes:function(){var a;d.seriesTypes.gauge.prototype.bindAxes.call(this);a=this.yAxis;d.extend(a,m);a.options.dataClasses&&a.initDataClasses(a.options);a.initStops(a.options)},drawPoints:function(){var a=this,c=a.yAxis,e=c.center,d=a.options,r=a.chart.renderer,f=d.overshoot,g=u(f)?f/180*Math.PI:0;l(a.points,function(b){var h=b.graphic,f=c.startAngleRad+c.translate(b.y,null,null,null,!0),l=k(t(b.options.radius,d.radius,100))*e[2]/200,n=k(t(b.options.innerRadius,d.innerRadius,
60))*e[2]/200,p=c.toColor(b.y,b),q=Math.min(c.startAngleRad,c.endAngleRad),m=Math.max(c.startAngleRad,c.endAngleRad);"none"===p&&(p=b.color||a.color||"none");"none"!==p&&(b.color=p);f=Math.max(q-g,Math.min(m+g,f));!1===d.wrap&&(f=Math.max(q,Math.min(m,f)));q=Math.min(f,c.startAngleRad);f=Math.max(f,c.startAngleRad);f-q>2*Math.PI&&(f=q+2*Math.PI);b.shapeArgs=n={x:e[0],y:e[1],r:l,innerR:n,start:q,end:f,fill:p};b.startR=l;h?(b=n.d,h.animate(n),b&&(n.d=b)):b.graphic=r.arc(n).addClass("highcharts-point").attr({fill:p,
"sweep-flag":0}).add(a.group)})},animate:function(a){a||(this.startAngleRad=this.yAxis.startAngleRad,d.seriesTypes.pie.prototype.animate.call(this,a))}})})(k)});

View File

@ -0,0 +1,277 @@
/**
* @license Highcharts JS v5.0.2 (2016-10-26)
* Solid angular gauge module
*
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* Solid angular gauge module
*
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
'use strict';
var pInt = H.pInt,
pick = H.pick,
each = H.each,
isNumber = H.isNumber,
colorAxisMethods;
// These methods are defined in the ColorAxis object, and copied here.
// If we implement an AMD system we should make ColorAxis a dependency.
colorAxisMethods = {
initDataClasses: function(userOptions) {
var axis = this,
chart = this.chart,
dataClasses,
colorCounter = 0,
options = this.options;
this.dataClasses = dataClasses = [];
each(userOptions.dataClasses, function(dataClass, i) {
var colors;
dataClass = H.merge(dataClass);
dataClasses.push(dataClass);
if (!dataClass.color) {
if (options.dataClassColor === 'category') {
colors = chart.options.colors;
dataClass.color = colors[colorCounter++];
// loop back to zero
if (colorCounter === colors.length) {
colorCounter = 0;
}
} else {
dataClass.color = axis.tweenColors(H.color(options.minColor), H.color(options.maxColor), i / (userOptions.dataClasses.length - 1));
}
}
});
},
initStops: function(userOptions) {
this.stops = userOptions.stops || [
[0, this.options.minColor],
[1, this.options.maxColor]
];
each(this.stops, function(stop) {
stop.color = H.color(stop[1]);
});
},
/**
* Translate from a value to a color
*/
toColor: function(value, point) {
var pos,
stops = this.stops,
from,
to,
color,
dataClasses = this.dataClasses,
dataClass,
i;
if (dataClasses) {
i = dataClasses.length;
while (i--) {
dataClass = dataClasses[i];
from = dataClass.from;
to = dataClass.to;
if ((from === undefined || value >= from) && (to === undefined || value <= to)) {
color = dataClass.color;
if (point) {
point.dataClass = i;
}
break;
}
}
} else {
if (this.isLog) {
value = this.val2lin(value);
}
pos = 1 - ((this.max - value) / (this.max - this.min));
i = stops.length;
while (i--) {
if (pos > stops[i][0]) {
break;
}
}
from = stops[i] || stops[i + 1];
to = stops[i + 1] || from;
// The position within the gradient
pos = 1 - (to[0] - pos) / ((to[0] - from[0]) || 1);
color = this.tweenColors(
from.color,
to.color,
pos
);
}
return color;
},
/*
* Return an intermediate color between two colors, according to pos where 0
* is the from color and 1 is the to color.
*/
tweenColors: function(from, to, pos) {
// Check for has alpha, because rgba colors perform worse due to lack of
// support in WebKit.
var hasAlpha,
ret;
// Unsupported color, return to-color (#3920)
if (!to.rgba.length || !from.rgba.length) {
ret = to.input || 'none';
// Interpolate
} else {
from = from.rgba;
to = to.rgba;
hasAlpha = (to[3] !== 1 || from[3] !== 1);
ret = (hasAlpha ? 'rgba(' : 'rgb(') +
Math.round(to[0] + (from[0] - to[0]) * (1 - pos)) + ',' +
Math.round(to[1] + (from[1] - to[1]) * (1 - pos)) + ',' +
Math.round(to[2] + (from[2] - to[2]) * (1 - pos)) +
(hasAlpha ? (',' + (to[3] + (from[3] - to[3]) * (1 - pos))) : '') + ')';
}
return ret;
}
};
/**
* Handle animation of the color attributes directly
*/
each(['fill', 'stroke'], function(prop) {
H.Fx.prototype[prop + 'Setter'] = function() {
this.elem.attr(prop, colorAxisMethods.tweenColors(H.color(this.start), H.color(this.end), this.pos));
};
});
// The solidgauge series type
H.seriesType('solidgauge', 'gauge', {
colorByPoint: true
}, {
bindAxes: function() {
var axis;
H.seriesTypes.gauge.prototype.bindAxes.call(this);
axis = this.yAxis;
H.extend(axis, colorAxisMethods);
// Prepare data classes
if (axis.options.dataClasses) {
axis.initDataClasses(axis.options);
}
axis.initStops(axis.options);
},
/**
* Draw the points where each point is one needle
*/
drawPoints: function() {
var series = this,
yAxis = series.yAxis,
center = yAxis.center,
options = series.options,
renderer = series.chart.renderer,
overshoot = options.overshoot,
overshootVal = isNumber(overshoot) ? overshoot / 180 * Math.PI : 0;
each(series.points, function(point) {
var graphic = point.graphic,
rotation = yAxis.startAngleRad + yAxis.translate(point.y, null, null, null, true),
radius = (pInt(pick(point.options.radius, options.radius, 100)) * center[2]) / 200,
innerRadius = (pInt(pick(point.options.innerRadius, options.innerRadius, 60)) * center[2]) / 200,
shapeArgs,
d,
toColor = yAxis.toColor(point.y, point),
axisMinAngle = Math.min(yAxis.startAngleRad, yAxis.endAngleRad),
axisMaxAngle = Math.max(yAxis.startAngleRad, yAxis.endAngleRad),
minAngle,
maxAngle;
if (toColor === 'none') { // #3708
toColor = point.color || series.color || 'none';
}
if (toColor !== 'none') {
point.color = toColor;
}
// Handle overshoot and clipping to axis max/min
rotation = Math.max(axisMinAngle - overshootVal, Math.min(axisMaxAngle + overshootVal, rotation));
// Handle the wrap option
if (options.wrap === false) {
rotation = Math.max(axisMinAngle, Math.min(axisMaxAngle, rotation));
}
minAngle = Math.min(rotation, yAxis.startAngleRad);
maxAngle = Math.max(rotation, yAxis.startAngleRad);
if (maxAngle - minAngle > 2 * Math.PI) {
maxAngle = minAngle + 2 * Math.PI;
}
point.shapeArgs = shapeArgs = {
x: center[0],
y: center[1],
r: radius,
innerR: innerRadius,
start: minAngle,
end: maxAngle,
fill: toColor
};
point.startR = radius; // For PieSeries.animate
if (graphic) {
d = shapeArgs.d;
graphic.animate(shapeArgs);
if (d) {
shapeArgs.d = d; // animate alters it
}
} else {
point.graphic = renderer.arc(shapeArgs)
.addClass('highcharts-point')
.attr({
fill: toColor,
'sweep-flag': 0
})
.add(series.group);
}
});
},
/**
* Extend the pie slice animation by animating from start angle and up
*/
animate: function(init) {
if (!init) {
this.startAngleRad = this.yAxis.startAngleRad;
H.seriesTypes.pie.prototype.animate.call(this, init);
}
}
});
}(Highcharts));
}));

View File

@ -0,0 +1,29 @@
/*
Highcharts JS v5.0.2 (2016-10-26)
(c) 2014 Highsoft AS
Authors: Jon Arild Nygard / Oystein Moseng
License: www.highcharts.com/license
*/
(function(p){"object"===typeof module&&module.exports?module.exports=p:p(Highcharts)})(function(p){(function(g){var p=g.seriesType,t=g.seriesTypes,D=g.map,w=g.merge,z=g.extend,A=g.noop,m=g.each,y=g.grep,E=g.isNumber,k=g.pick,u=g.Series,F=g.stableSort,G=function(a,b,c){var e;c=c||this;for(e in a)a.hasOwnProperty(e)&&b.call(c,a[e],e,a)},B=function(a,b,c,e){e=e||this;a=a||[];m(a,function(d,f){c=b.call(e,c,d,f,a)});return c},x=function(a,b,c){c=c||this;a=b.call(c,a);!1!==a&&x(a,b,c)};p("treemap","scatter",
{showInLegend:!1,marker:!1,dataLabels:{enabled:!0,defer:!1,verticalAlign:"middle",formatter:function(){return this.point.name||this.point.id},inside:!0},tooltip:{headerFormat:"",pointFormat:"\x3cb\x3e{point.name}\x3c/b\x3e: {point.value}\x3c/b\x3e\x3cbr/\x3e"},layoutAlgorithm:"sliceAndDice",layoutStartingDirection:"vertical",alternateStartingDirection:!1,levelIsConstant:!0,drillUpButton:{position:{align:"right",x:-10,y:10}}},{pointArrayMap:["value"],axisTypes:t.heatmap?["xAxis","yAxis","colorAxis"]:
["xAxis","yAxis"],optionalAxis:"colorAxis",getSymbol:A,parallelArrays:["x","y","value","colorValue"],colorKey:"colorValue",translateColors:t.heatmap&&t.heatmap.prototype.translateColors,trackerGroups:["group","dataLabelsGroup"],getListOfParents:function(a,b){a=B(a,function(a,b,d){b=k(b.parent,"");void 0===a[b]&&(a[b]=[]);a[b].push(d);return a},{});G(a,function(a,e,d){""!==e&&-1===g.inArray(e,b)&&(m(a,function(a){d[""].push(a)}),delete d[e])});return a},getTree:function(){var a,b=this;a=D(this.data,
function(a){return a.id});a=b.getListOfParents(this.data,a);b.nodeMap=[];a=b.buildNode("",-1,0,a,null);x(this.nodeMap[this.rootNode],function(a){var c=!1,d=a.parent;a.visible=!0;if(d||""===d)c=b.nodeMap[d];return c});x(this.nodeMap[this.rootNode].children,function(a){var b=!1;m(a,function(a){a.visible=!0;a.children.length&&(b=(b||[]).concat(a.children))});return b});this.setTreeValues(a);return a},init:function(a,b){u.prototype.init.call(this,a,b);this.options.allowDrillToNode&&this.drillTo()},buildNode:function(a,
b,c,e,d){var f=this,h=[],C=f.points[b],v;m(e[a]||[],function(b){v=f.buildNode(f.points[b].id,b,c+1,e,a);h.push(v)});b={id:a,i:b,children:h,level:c,parent:d,visible:!1};f.nodeMap[b.id]=b;C&&(C.node=b);return b},setTreeValues:function(a){var b=this,c=b.options,e=0,d=[],f,h=b.points[a.i];m(a.children,function(a){a=b.setTreeValues(a);d.push(a);a.ignore?x(a.children,function(a){var b=!1;m(a,function(a){z(a,{ignore:!0,isLeaf:!1,visible:!1});a.children.length&&(b=(b||[]).concat(a.children))});return b}):
e+=a.val});F(d,function(a,b){return a.sortIndex-b.sortIndex});f=k(h&&h.options.value,e);h&&(h.value=f);z(a,{children:d,childrenTotal:e,ignore:!(k(h&&h.visible,!0)&&0<f),isLeaf:a.visible&&!e,levelDynamic:c.levelIsConstant?a.level:a.level-b.nodeMap[b.rootNode].level,name:k(h&&h.name,""),sortIndex:k(h&&h.sortIndex,-f),val:f});return a},calculateChildrenAreas:function(a,b){var c=this,e=c.options,d=this.levelMap[a.levelDynamic+1],f=k(c[d&&d.layoutAlgorithm]&&d.layoutAlgorithm,e.layoutAlgorithm),h=e.alternateStartingDirection,
g=[];a=y(a.children,function(a){return!a.ignore});d&&d.layoutStartingDirection&&(b.direction="vertical"===d.layoutStartingDirection?0:1);g=c[f](b,a);m(a,function(a,d){d=g[d];a.values=w(d,{val:a.childrenTotal,direction:h?1-b.direction:b.direction});a.pointValues=w(d,{x:d.x/c.axisRatio,width:d.width/c.axisRatio});a.children.length&&c.calculateChildrenAreas(a,a.values)})},setPointValues:function(){var a=this.xAxis,b=this.yAxis;m(this.points,function(c){var e=c.node,d=e.pointValues,f,h;d&&e.visible?(e=
Math.round(a.translate(d.x,0,0,0,1))-.5,f=Math.round(a.translate(d.x+d.width,0,0,0,1))-.5,h=Math.round(b.translate(d.y,0,0,0,1))-.5,d=Math.round(b.translate(d.y+d.height,0,0,0,1))-.5,c.shapeType="rect",c.shapeArgs={x:Math.min(e,f),y:Math.min(h,d),width:Math.abs(f-e),height:Math.abs(d-h)},c.plotX=c.shapeArgs.x+c.shapeArgs.width/2,c.plotY=c.shapeArgs.y+c.shapeArgs.height/2):(delete c.plotX,delete c.plotY)})},setColorRecursive:function(a,b,c){var e=this,d,f;a&&(d=e.points[a.i],f=e.levelMap[a.levelDynamic],
b=k(d&&d.options.color,f&&f.color,b),c=k(d&&d.options.colorIndex,f&&f.colorIndex,c),d&&(d.color=b,d.colorIndex=c),a.children.length&&m(a.children,function(a){e.setColorRecursive(a,b,c)}))},algorithmGroup:function(a,b,c,e){this.height=a;this.width=b;this.plot=e;this.startDirection=this.direction=c;this.lH=this.nH=this.lW=this.nW=this.total=0;this.elArr=[];this.lP={total:0,lH:0,nH:0,lW:0,nW:0,nR:0,lR:0,aspectRatio:function(a,b){return Math.max(a/b,b/a)}};this.addElement=function(a){this.lP.total=this.elArr[this.elArr.length-
1];this.total+=a;0===this.direction?(this.lW=this.nW,this.lP.lH=this.lP.total/this.lW,this.lP.lR=this.lP.aspectRatio(this.lW,this.lP.lH),this.nW=this.total/this.height,this.lP.nH=this.lP.total/this.nW,this.lP.nR=this.lP.aspectRatio(this.nW,this.lP.nH)):(this.lH=this.nH,this.lP.lW=this.lP.total/this.lH,this.lP.lR=this.lP.aspectRatio(this.lP.lW,this.lH),this.nH=this.total/this.width,this.lP.nW=this.lP.total/this.nH,this.lP.nR=this.lP.aspectRatio(this.lP.nW,this.nH));this.elArr.push(a)};this.reset=function(){this.lW=
this.nW=0;this.elArr=[];this.total=0}},algorithmCalcPoints:function(a,b,c,e){var d,f,h,g,v=c.lW,n=c.lH,l=c.plot,k,q=0,r=c.elArr.length-1;b?(v=c.nW,n=c.nH):k=c.elArr[c.elArr.length-1];m(c.elArr,function(a){if(b||q<r)0===c.direction?(d=l.x,f=l.y,h=v,g=a/h):(d=l.x,f=l.y,g=n,h=a/g),e.push({x:d,y:f,width:h,height:g}),0===c.direction?l.y+=g:l.x+=h;q+=1});c.reset();0===c.direction?c.width-=v:c.height-=n;l.y=l.parent.y+(l.parent.height-c.height);l.x=l.parent.x+(l.parent.width-c.width);a&&(c.direction=1-c.direction);
b||c.addElement(k)},algorithmLowAspectRatio:function(a,b,c){var e=[],d=this,f,h={x:b.x,y:b.y,parent:b},g=0,k=c.length-1,n=new this.algorithmGroup(b.height,b.width,b.direction,h);m(c,function(c){f=c.val/b.val*b.height*b.width;n.addElement(f);n.lP.nR>n.lP.lR&&d.algorithmCalcPoints(a,!1,n,e,h);g===k&&d.algorithmCalcPoints(a,!0,n,e,h);g+=1});return e},algorithmFill:function(a,b,c){var e=[],d,f=b.direction,h=b.x,g=b.y,k=b.width,n=b.height,l,p,q,r;m(c,function(c){d=c.val/b.val*b.height*b.width;l=h;p=g;
0===f?(r=n,q=d/r,k-=q,h+=q):(q=k,r=d/q,n-=r,g+=r);e.push({x:l,y:p,width:q,height:r});a&&(f=1-f)});return e},strip:function(a,b){return this.algorithmLowAspectRatio(!1,a,b)},squarified:function(a,b){return this.algorithmLowAspectRatio(!0,a,b)},sliceAndDice:function(a,b){return this.algorithmFill(!0,a,b)},stripes:function(a,b){return this.algorithmFill(!1,a,b)},translate:function(){var a,b;u.prototype.translate.call(this);this.rootNode=k(this.options.rootId,"");this.levelMap=B(this.options.levels,function(a,
b){a[b.level]=b;return a},{});b=this.tree=this.getTree();this.axisRatio=this.xAxis.len/this.yAxis.len;this.nodeMap[""].pointValues=a={x:0,y:0,width:100,height:100};this.nodeMap[""].values=a=w(a,{width:a.width*this.axisRatio,direction:"vertical"===this.options.layoutStartingDirection?0:1,val:b.val});this.calculateChildrenAreas(b,a);this.colorAxis?this.translateColors():this.options.colorByPoint||this.setColorRecursive(this.tree);this.options.allowDrillToNode&&(b=this.nodeMap[this.rootNode].pointValues,
this.xAxis.setExtremes(b.x,b.x+b.width,!1),this.yAxis.setExtremes(b.y,b.y+b.height,!1),this.xAxis.setScale(),this.yAxis.setScale());this.setPointValues()},drawDataLabels:function(){var a=this,b=y(a.points,function(a){return a.node.visible}),c,e;m(b,function(b){e=a.levelMap[b.node.levelDynamic];c={style:{}};b.node.isLeaf||(c.enabled=!1);e&&e.dataLabels&&(c=w(c,e.dataLabels),a._hasPointLabels=!0);b.shapeArgs&&(c.style.width=b.shapeArgs.width,b.dataLabel&&b.dataLabel.css({width:b.shapeArgs.width+"px"}));
b.dlOptions=w(c,b.options.dataLabels)});u.prototype.drawDataLabels.call(this)},alignDataLabel:function(a){t.column.prototype.alignDataLabel.apply(this,arguments);a.dataLabel&&a.dataLabel.attr({zIndex:a.node.zIndex+1})},drawPoints:function(){var a=this,b=y(a.points,function(a){return a.node.visible});m(b,function(b){var c="levelGroup-"+b.node.levelDynamic;a[c]||(a[c]=a.chart.renderer.g(c).attr({zIndex:1E3-b.node.levelDynamic}).add(a.group));b.group=a[c]});t.column.prototype.drawPoints.call(this);a.options.allowDrillToNode&&
m(b,function(b){b.graphic&&(b.drillId=a.options.interactByLeaf?a.drillToByLeaf(b):a.drillToByGroup(b))})},drillTo:function(){var a=this;g.addEvent(a,"click",function(b){b=b.point;var c=b.drillId,e;c&&(e=a.nodeMap[a.rootNode].name||a.rootNode,b.setState(""),a.drillToNode(c),a.showDrillUpButton(e))})},drillToByGroup:function(a){var b=!1;1!==a.node.level-this.nodeMap[this.rootNode].level||a.node.isLeaf||(b=a.id);return b},drillToByLeaf:function(a){var b=!1;if(a.node.parent!==this.rootNode&&a.node.isLeaf)for(a=
a.node;!b;)a=this.nodeMap[a.parent],a.parent===this.rootNode&&(b=a.id);return b},drillUp:function(){var a=null;this.rootNode&&(a=this.nodeMap[this.rootNode],a=null!==a.parent?this.nodeMap[a.parent]:this.nodeMap[""]);null!==a&&(this.drillToNode(a.id),""===a.id?this.drillUpButton=this.drillUpButton.destroy():(a=this.nodeMap[a.parent],this.showDrillUpButton(a.name||a.id)))},drillToNode:function(a){this.options.rootId=a;this.isDirty=!0;this.chart.redraw()},showDrillUpButton:function(a){var b=this;a=a||
"\x3c Back";var c=b.options.drillUpButton,e,d;c.text&&(a=c.text);this.drillUpButton?this.drillUpButton.attr({text:a}).align():(d=(e=c.theme)&&e.states,this.drillUpButton=this.chart.renderer.button(a,null,null,function(){b.drillUp()},e,d&&d.hover,d&&d.select).attr({align:c.position.align,zIndex:7}).add().align(c.position,!1,c.relativeTo||"plotBox"))},buildKDTree:A,drawLegendSymbol:g.LegendSymbolMixin.drawRectangle,getExtremes:function(){u.prototype.getExtremes.call(this,this.colorValueData);this.valueMin=
this.dataMin;this.valueMax=this.dataMax;u.prototype.getExtremes.call(this)},getExtremesFromAll:!0,bindAxes:function(){var a={endOnTick:!1,gridLineWidth:0,lineWidth:0,min:0,dataMin:0,minPadding:0,max:100,dataMax:100,maxPadding:0,startOnTick:!1,title:null,tickPositions:[]};u.prototype.bindAxes.call(this);g.extend(this.yAxis.options,a);g.extend(this.xAxis.options,a)}},{getClassName:function(){var a=g.Point.prototype.getClassName.call(this),b=this.series,c=b.options;this.node.level<=b.nodeMap[b.rootNode].level?
a+=" highcharts-above-level":this.node.isLeaf||k(c.interactByLeaf,!c.allowDrillToNode)?this.node.isLeaf||(a+=" highcharts-internal-node"):a+=" highcharts-internal-node-interactive";return a},isValid:function(){return E(this.value)},setState:function(a){g.Point.prototype.setState.call(this,a);this.graphic.attr({zIndex:"hover"===a?1:0})},setVisible:t.pie.prototype.pointClass.prototype.setVisible})})(p)});

View File

@ -0,0 +1,881 @@
/**
* @license Highcharts JS v5.0.2 (2016-10-26)
*
* (c) 2014 Highsoft AS
* Authors: Jon Arild Nygard / Oystein Moseng
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* (c) 2014 Highsoft AS
* Authors: Jon Arild Nygard / Oystein Moseng
*
* License: www.highcharts.com/license
*/
'use strict';
var seriesType = H.seriesType,
seriesTypes = H.seriesTypes,
map = H.map,
merge = H.merge,
extend = H.extend,
noop = H.noop,
each = H.each,
grep = H.grep,
isNumber = H.isNumber,
pick = H.pick,
Series = H.Series,
stableSort = H.stableSort,
color = H.Color,
eachObject = function(list, func, context) {
var key;
context = context || this;
for (key in list) {
if (list.hasOwnProperty(key)) {
func.call(context, list[key], key, list);
}
}
},
reduce = function(arr, func, previous, context) {
context = context || this;
arr = arr || []; // @note should each be able to handle empty values automatically?
each(arr, function(current, i) {
previous = func.call(context, previous, current, i, arr);
});
return previous;
},
// @todo find correct name for this function.
// @todo Similar to reduce, this function is likely redundant
recursive = function(item, func, context) {
var next;
context = context || this;
next = func.call(context, item);
if (next !== false) {
recursive(next, func, context);
}
};
// The Treemap series type
seriesType('treemap', 'scatter', {
showInLegend: false,
marker: false,
dataLabels: {
enabled: true,
defer: false,
verticalAlign: 'middle',
formatter: function() { // #2945
return this.point.name || this.point.id;
},
inside: true
},
tooltip: {
headerFormat: '',
pointFormat: '<b>{point.name}</b>: {point.value}</b><br/>'
},
layoutAlgorithm: 'sliceAndDice',
layoutStartingDirection: 'vertical',
alternateStartingDirection: false,
levelIsConstant: true,
drillUpButton: {
position: {
align: 'right',
x: -10,
y: 10
}
},
// Prototype members
}, {
pointArrayMap: ['value'],
axisTypes: seriesTypes.heatmap ? ['xAxis', 'yAxis', 'colorAxis'] : ['xAxis', 'yAxis'],
optionalAxis: 'colorAxis',
getSymbol: noop,
parallelArrays: ['x', 'y', 'value', 'colorValue'],
colorKey: 'colorValue', // Point color option key
translateColors: seriesTypes.heatmap && seriesTypes.heatmap.prototype.translateColors,
trackerGroups: ['group', 'dataLabelsGroup'],
/**
* Creates an object map from parent id to childrens index.
* @param {Array} data List of points set in options.
* @param {string} data[].parent Parent id of point.
* @param {Array} ids List of all point ids.
* @return {Object} Map from parent id to children index in data.
*/
getListOfParents: function(data, ids) {
var listOfParents = reduce(data, function(prev, curr, i) {
var parent = pick(curr.parent, '');
if (prev[parent] === undefined) {
prev[parent] = [];
}
prev[parent].push(i);
return prev;
}, {});
// If parent does not exist, hoist parent to root of tree.
eachObject(listOfParents, function(children, parent, list) {
if ((parent !== '') && (H.inArray(parent, ids) === -1)) {
each(children, function(child) {
list[''].push(child);
});
delete list[parent];
}
});
return listOfParents;
},
/**
* Creates a tree structured object from the series points
*/
getTree: function() {
var tree,
series = this,
allIds = map(this.data, function(d) {
return d.id;
}),
parentList = series.getListOfParents(this.data, allIds);
series.nodeMap = [];
tree = series.buildNode('', -1, 0, parentList, null);
// Parents of the root node is by default visible
recursive(this.nodeMap[this.rootNode], function(node) {
var next = false,
p = node.parent;
node.visible = true;
if (p || p === '') {
next = series.nodeMap[p];
}
return next;
});
// Children of the root node is by default visible
recursive(this.nodeMap[this.rootNode].children, function(children) {
var next = false;
each(children, function(child) {
child.visible = true;
if (child.children.length) {
next = (next || []).concat(child.children);
}
});
return next;
});
this.setTreeValues(tree);
return tree;
},
init: function(chart, options) {
var series = this;
Series.prototype.init.call(series, chart, options);
if (series.options.allowDrillToNode) {
series.drillTo();
}
},
buildNode: function(id, i, level, list, parent) {
var series = this,
children = [],
point = series.points[i],
node,
child;
// Actions
each((list[id] || []), function(i) {
child = series.buildNode(series.points[i].id, i, (level + 1), list, id);
children.push(child);
});
node = {
id: id,
i: i,
children: children,
level: level,
parent: parent,
visible: false // @todo move this to better location
};
series.nodeMap[node.id] = node;
if (point) {
point.node = node;
}
return node;
},
setTreeValues: function(tree) {
var series = this,
options = series.options,
childrenTotal = 0,
children = [],
val,
point = series.points[tree.i];
// First give the children some values
each(tree.children, function(child) {
child = series.setTreeValues(child);
children.push(child);
if (!child.ignore) {
childrenTotal += child.val;
} else {
// @todo Add predicate to avoid looping already ignored children
recursive(child.children, function(children) {
var next = false;
each(children, function(node) {
extend(node, {
ignore: true,
isLeaf: false,
visible: false
});
if (node.children.length) {
next = (next || []).concat(node.children);
}
});
return next;
});
}
});
// Sort the children
stableSort(children, function(a, b) {
return a.sortIndex - b.sortIndex;
});
// Set the values
val = pick(point && point.options.value, childrenTotal);
if (point) {
point.value = val;
}
extend(tree, {
children: children,
childrenTotal: childrenTotal,
// Ignore this node if point is not visible
ignore: !(pick(point && point.visible, true) && (val > 0)),
isLeaf: tree.visible && !childrenTotal,
levelDynamic: (options.levelIsConstant ? tree.level : (tree.level - series.nodeMap[series.rootNode].level)),
name: pick(point && point.name, ''),
sortIndex: pick(point && point.sortIndex, -val),
val: val
});
return tree;
},
/**
* Recursive function which calculates the area for all children of a node.
* @param {Object} node The node which is parent to the children.
* @param {Object} area The rectangular area of the parent.
*/
calculateChildrenAreas: function(parent, area) {
var series = this,
options = series.options,
level = this.levelMap[parent.levelDynamic + 1],
algorithm = pick((series[level && level.layoutAlgorithm] && level.layoutAlgorithm), options.layoutAlgorithm),
alternate = options.alternateStartingDirection,
childrenValues = [],
children;
// Collect all children which should be included
children = grep(parent.children, function(n) {
return !n.ignore;
});
if (level && level.layoutStartingDirection) {
area.direction = level.layoutStartingDirection === 'vertical' ? 0 : 1;
}
childrenValues = series[algorithm](area, children);
each(children, function(child, index) {
var values = childrenValues[index];
child.values = merge(values, {
val: child.childrenTotal,
direction: (alternate ? 1 - area.direction : area.direction)
});
child.pointValues = merge(values, {
x: (values.x / series.axisRatio),
width: (values.width / series.axisRatio)
});
// If node has children, then call method recursively
if (child.children.length) {
series.calculateChildrenAreas(child, child.values);
}
});
},
setPointValues: function() {
var series = this,
xAxis = series.xAxis,
yAxis = series.yAxis;
each(series.points, function(point) {
var node = point.node,
values = node.pointValues,
x1,
x2,
y1,
y2,
crispCorr = 0.5; // Assume 1px borderWidth for simplicity
// Points which is ignored, have no values.
if (values && node.visible) {
x1 = Math.round(xAxis.translate(values.x, 0, 0, 0, 1)) - crispCorr;
x2 = Math.round(xAxis.translate(values.x + values.width, 0, 0, 0, 1)) - crispCorr;
y1 = Math.round(yAxis.translate(values.y, 0, 0, 0, 1)) - crispCorr;
y2 = Math.round(yAxis.translate(values.y + values.height, 0, 0, 0, 1)) - crispCorr;
// Set point values
point.shapeType = 'rect';
point.shapeArgs = {
x: Math.min(x1, x2),
y: Math.min(y1, y2),
width: Math.abs(x2 - x1),
height: Math.abs(y2 - y1)
};
point.plotX = point.shapeArgs.x + (point.shapeArgs.width / 2);
point.plotY = point.shapeArgs.y + (point.shapeArgs.height / 2);
} else {
// Reset visibility
delete point.plotX;
delete point.plotY;
}
});
},
setColorRecursive: function(node, color, colorIndex) {
var series = this,
point,
level;
if (node) {
point = series.points[node.i];
level = series.levelMap[node.levelDynamic];
// Select either point color, level color or inherited color.
color = pick(point && point.options.color, level && level.color, color);
colorIndex = pick(point && point.options.colorIndex, level && level.colorIndex, colorIndex);
if (point) {
point.color = color;
point.colorIndex = colorIndex;
}
// Do it all again with the children
if (node.children.length) {
each(node.children, function(child) {
series.setColorRecursive(child, color, colorIndex);
});
}
}
},
algorithmGroup: function(h, w, d, p) {
this.height = h;
this.width = w;
this.plot = p;
this.direction = d;
this.startDirection = d;
this.total = 0;
this.nW = 0;
this.lW = 0;
this.nH = 0;
this.lH = 0;
this.elArr = [];
this.lP = {
total: 0,
lH: 0,
nH: 0,
lW: 0,
nW: 0,
nR: 0,
lR: 0,
aspectRatio: function(w, h) {
return Math.max((w / h), (h / w));
}
};
this.addElement = function(el) {
this.lP.total = this.elArr[this.elArr.length - 1];
this.total = this.total + el;
if (this.direction === 0) {
// Calculate last point old aspect ratio
this.lW = this.nW;
this.lP.lH = this.lP.total / this.lW;
this.lP.lR = this.lP.aspectRatio(this.lW, this.lP.lH);
// Calculate last point new aspect ratio
this.nW = this.total / this.height;
this.lP.nH = this.lP.total / this.nW;
this.lP.nR = this.lP.aspectRatio(this.nW, this.lP.nH);
} else {
// Calculate last point old aspect ratio
this.lH = this.nH;
this.lP.lW = this.lP.total / this.lH;
this.lP.lR = this.lP.aspectRatio(this.lP.lW, this.lH);
// Calculate last point new aspect ratio
this.nH = this.total / this.width;
this.lP.nW = this.lP.total / this.nH;
this.lP.nR = this.lP.aspectRatio(this.lP.nW, this.nH);
}
this.elArr.push(el);
};
this.reset = function() {
this.nW = 0;
this.lW = 0;
this.elArr = [];
this.total = 0;
};
},
algorithmCalcPoints: function(directionChange, last, group, childrenArea) {
var pX,
pY,
pW,
pH,
gW = group.lW,
gH = group.lH,
plot = group.plot,
keep,
i = 0,
end = group.elArr.length - 1;
if (last) {
gW = group.nW;
gH = group.nH;
} else {
keep = group.elArr[group.elArr.length - 1];
}
each(group.elArr, function(p) {
if (last || (i < end)) {
if (group.direction === 0) {
pX = plot.x;
pY = plot.y;
pW = gW;
pH = p / pW;
} else {
pX = plot.x;
pY = plot.y;
pH = gH;
pW = p / pH;
}
childrenArea.push({
x: pX,
y: pY,
width: pW,
height: pH
});
if (group.direction === 0) {
plot.y = plot.y + pH;
} else {
plot.x = plot.x + pW;
}
}
i = i + 1;
});
// Reset variables
group.reset();
if (group.direction === 0) {
group.width = group.width - gW;
} else {
group.height = group.height - gH;
}
plot.y = plot.parent.y + (plot.parent.height - group.height);
plot.x = plot.parent.x + (plot.parent.width - group.width);
if (directionChange) {
group.direction = 1 - group.direction;
}
// If not last, then add uncalculated element
if (!last) {
group.addElement(keep);
}
},
algorithmLowAspectRatio: function(directionChange, parent, children) {
var childrenArea = [],
series = this,
pTot,
plot = {
x: parent.x,
y: parent.y,
parent: parent
},
direction = parent.direction,
i = 0,
end = children.length - 1,
group = new this.algorithmGroup(parent.height, parent.width, direction, plot); // eslint-disable-line new-cap
// Loop through and calculate all areas
each(children, function(child) {
pTot = (parent.width * parent.height) * (child.val / parent.val);
group.addElement(pTot);
if (group.lP.nR > group.lP.lR) {
series.algorithmCalcPoints(directionChange, false, group, childrenArea, plot);
}
// If last child, then calculate all remaining areas
if (i === end) {
series.algorithmCalcPoints(directionChange, true, group, childrenArea, plot);
}
i = i + 1;
});
return childrenArea;
},
algorithmFill: function(directionChange, parent, children) {
var childrenArea = [],
pTot,
direction = parent.direction,
x = parent.x,
y = parent.y,
width = parent.width,
height = parent.height,
pX,
pY,
pW,
pH;
each(children, function(child) {
pTot = (parent.width * parent.height) * (child.val / parent.val);
pX = x;
pY = y;
if (direction === 0) {
pH = height;
pW = pTot / pH;
width = width - pW;
x = x + pW;
} else {
pW = width;
pH = pTot / pW;
height = height - pH;
y = y + pH;
}
childrenArea.push({
x: pX,
y: pY,
width: pW,
height: pH
});
if (directionChange) {
direction = 1 - direction;
}
});
return childrenArea;
},
strip: function(parent, children) {
return this.algorithmLowAspectRatio(false, parent, children);
},
squarified: function(parent, children) {
return this.algorithmLowAspectRatio(true, parent, children);
},
sliceAndDice: function(parent, children) {
return this.algorithmFill(true, parent, children);
},
stripes: function(parent, children) {
return this.algorithmFill(false, parent, children);
},
translate: function() {
var pointValues,
seriesArea,
tree,
val;
// Call prototype function
Series.prototype.translate.call(this);
// Assign variables
this.rootNode = pick(this.options.rootId, '');
// Create a object map from level to options
this.levelMap = reduce(this.options.levels, function(arr, item) {
arr[item.level] = item;
return arr;
}, {});
tree = this.tree = this.getTree(); // @todo Only if series.isDirtyData is true
// Calculate plotting values.
this.axisRatio = (this.xAxis.len / this.yAxis.len);
this.nodeMap[''].pointValues = pointValues = {
x: 0,
y: 0,
width: 100,
height: 100
};
this.nodeMap[''].values = seriesArea = merge(pointValues, {
width: (pointValues.width * this.axisRatio),
direction: (this.options.layoutStartingDirection === 'vertical' ? 0 : 1),
val: tree.val
});
this.calculateChildrenAreas(tree, seriesArea);
// Logic for point colors
if (this.colorAxis) {
this.translateColors();
} else if (!this.options.colorByPoint) {
this.setColorRecursive(this.tree);
}
// Update axis extremes according to the root node.
if (this.options.allowDrillToNode) {
val = this.nodeMap[this.rootNode].pointValues;
this.xAxis.setExtremes(val.x, val.x + val.width, false);
this.yAxis.setExtremes(val.y, val.y + val.height, false);
this.xAxis.setScale();
this.yAxis.setScale();
}
// Assign values to points.
this.setPointValues();
},
/**
* Extend drawDataLabels with logic to handle custom options related to the treemap series:
* - Points which is not a leaf node, has dataLabels disabled by default.
* - Options set on series.levels is merged in.
* - Width of the dataLabel is set to match the width of the point shape.
*/
drawDataLabels: function() {
var series = this,
points = grep(series.points, function(n) {
return n.node.visible;
}),
options,
level;
each(points, function(point) {
level = series.levelMap[point.node.levelDynamic];
// Set options to new object to avoid problems with scope
options = {
style: {}
};
// If not a leaf, then label should be disabled as default
if (!point.node.isLeaf) {
options.enabled = false;
}
// If options for level exists, include them as well
if (level && level.dataLabels) {
options = merge(options, level.dataLabels);
series._hasPointLabels = true;
}
// Set dataLabel width to the width of the point shape.
if (point.shapeArgs) {
options.style.width = point.shapeArgs.width;
if (point.dataLabel) {
point.dataLabel.css({
width: point.shapeArgs.width + 'px'
});
}
}
// Merge custom options with point options
point.dlOptions = merge(options, point.options.dataLabels);
});
Series.prototype.drawDataLabels.call(this);
},
/**
* Over the alignment method by setting z index
*/
alignDataLabel: function(point) {
seriesTypes.column.prototype.alignDataLabel.apply(this, arguments);
if (point.dataLabel) {
point.dataLabel.attr({
zIndex: point.node.zIndex + 1
});
}
},
/**
* Extending ColumnSeries drawPoints
*/
drawPoints: function() {
var series = this,
points = grep(series.points, function(n) {
return n.node.visible;
});
each(points, function(point) {
var groupKey = 'levelGroup-' + point.node.levelDynamic;
if (!series[groupKey]) {
series[groupKey] = series.chart.renderer.g(groupKey)
.attr({
zIndex: 1000 - point.node.levelDynamic // @todo Set the zIndex based upon the number of levels, instead of using 1000
})
.add(series.group);
}
point.group = series[groupKey];
});
// Call standard drawPoints
seriesTypes.column.prototype.drawPoints.call(this);
// If drillToNode is allowed, set a point cursor on clickables & add drillId to point
if (series.options.allowDrillToNode) {
each(points, function(point) {
if (point.graphic) {
point.drillId = series.options.interactByLeaf ? series.drillToByLeaf(point) : series.drillToByGroup(point);
}
});
}
},
/**
* Add drilling on the suitable points
*/
drillTo: function() {
var series = this;
H.addEvent(series, 'click', function(event) {
var point = event.point,
drillId = point.drillId,
drillName;
// If a drill id is returned, add click event and cursor.
if (drillId) {
drillName = series.nodeMap[series.rootNode].name || series.rootNode;
point.setState(''); // Remove hover
series.drillToNode(drillId);
series.showDrillUpButton(drillName);
}
});
},
/**
* Finds the drill id for a parent node.
* Returns false if point should not have a click event
* @param {Object} point
* @return {string || boolean} Drill to id or false when point should not have a click event
*/
drillToByGroup: function(point) {
var series = this,
drillId = false;
if ((point.node.level - series.nodeMap[series.rootNode].level) === 1 && !point.node.isLeaf) {
drillId = point.id;
}
return drillId;
},
/**
* Finds the drill id for a leaf node.
* Returns false if point should not have a click event
* @param {Object} point
* @return {string || boolean} Drill to id or false when point should not have a click event
*/
drillToByLeaf: function(point) {
var series = this,
drillId = false,
nodeParent;
if ((point.node.parent !== series.rootNode) && (point.node.isLeaf)) {
nodeParent = point.node;
while (!drillId) {
nodeParent = series.nodeMap[nodeParent.parent];
if (nodeParent.parent === series.rootNode) {
drillId = nodeParent.id;
}
}
}
return drillId;
},
drillUp: function() {
var drillPoint = null,
node,
parent;
if (this.rootNode) {
node = this.nodeMap[this.rootNode];
if (node.parent !== null) {
drillPoint = this.nodeMap[node.parent];
} else {
drillPoint = this.nodeMap[''];
}
}
if (drillPoint !== null) {
this.drillToNode(drillPoint.id);
if (drillPoint.id === '') {
this.drillUpButton = this.drillUpButton.destroy();
} else {
parent = this.nodeMap[drillPoint.parent];
this.showDrillUpButton((parent.name || parent.id));
}
}
},
drillToNode: function(id) {
this.options.rootId = id;
this.isDirty = true; // Force redraw
this.chart.redraw();
},
showDrillUpButton: function(name) {
var series = this,
backText = (name || '< Back'),
buttonOptions = series.options.drillUpButton,
attr,
states;
if (buttonOptions.text) {
backText = buttonOptions.text;
}
if (!this.drillUpButton) {
attr = buttonOptions.theme;
states = attr && attr.states;
this.drillUpButton = this.chart.renderer.button(
backText,
null,
null,
function() {
series.drillUp();
},
attr,
states && states.hover,
states && states.select
)
.attr({
align: buttonOptions.position.align,
zIndex: 7
})
.add()
.align(buttonOptions.position, false, buttonOptions.relativeTo || 'plotBox');
} else {
this.drillUpButton.attr({
text: backText
})
.align();
}
},
buildKDTree: noop,
drawLegendSymbol: H.LegendSymbolMixin.drawRectangle,
getExtremes: function() {
// Get the extremes from the value data
Series.prototype.getExtremes.call(this, this.colorValueData);
this.valueMin = this.dataMin;
this.valueMax = this.dataMax;
// Get the extremes from the y data
Series.prototype.getExtremes.call(this);
},
getExtremesFromAll: true,
bindAxes: function() {
var treeAxis = {
endOnTick: false,
gridLineWidth: 0,
lineWidth: 0,
min: 0,
dataMin: 0,
minPadding: 0,
max: 100,
dataMax: 100,
maxPadding: 0,
startOnTick: false,
title: null,
tickPositions: []
};
Series.prototype.bindAxes.call(this);
H.extend(this.yAxis.options, treeAxis);
H.extend(this.xAxis.options, treeAxis);
}
// Point class
}, {
getClassName: function() {
var className = H.Point.prototype.getClassName.call(this),
series = this.series,
options = series.options;
// Above the current level
if (this.node.level <= series.nodeMap[series.rootNode].level) {
className += ' highcharts-above-level';
} else if (!this.node.isLeaf && !pick(options.interactByLeaf, !options.allowDrillToNode)) {
className += ' highcharts-internal-node-interactive';
} else if (!this.node.isLeaf) {
className += ' highcharts-internal-node';
}
return className;
},
isValid: function() {
return isNumber(this.value);
},
setState: function(state) {
H.Point.prototype.setState.call(this, state);
this.graphic.attr({
zIndex: state === 'hover' ? 1 : 0
});
},
setVisible: seriesTypes.pie.prototype.pointClass.prototype.setVisible
});
}(Highcharts));
}));

View File

@ -0,0 +1,15 @@
/*
Highcharts JS v5.0.2 (2016-10-26)
X-range series
(c) 2010-2016 Torstein Honsi, Lars A. V. Cabrera
--- WORK IN PROGRESS ---
License: www.highcharts.com/license
*/
(function(h){"object"===typeof module&&module.exports?module.exports=h:h(Highcharts)})(function(h){(function(c){var h=c.getOptions().plotOptions,m=c.seriesTypes.column,k=c.each,p=c.extendClass,q=c.isNumber,v=c.isObject,n=c.merge,r=c.pick,t=c.seriesTypes,w=c.stop,x=c.wrap,y=c.Axis,u=c.Point,z=c.Series;h.xrange=n(h.column,{tooltip:{pointFormat:'\x3cspan style\x3d"color:{point.color}"\x3e\u25cf\x3c/span\x3e {series.name}: \x3cb\x3e{point.yCategory}\x3c/b\x3e\x3cbr/\x3e'}});t.xrange=p(m,{pointClass:p(u,
{getLabelConfig:function(){var g=u.prototype.getLabelConfig.call(this);g.x2=this.x2;g.yCategory=this.yCategory=this.series.yAxis.categories&&this.series.yAxis.categories[this.y];return g}}),type:"xrange",forceDL:!0,parallelArrays:["x","x2","y"],requireSorting:!1,animate:t.line.prototype.animate,getColumnMetrics:function(){function g(){k(f.series,function(b){var a=b.xAxis;b.xAxis=b.yAxis;b.yAxis=a})}var e,f=this.chart;g();this.yAxis.closestPointRange=1;e=m.prototype.getColumnMetrics.call(this);g();
return e},cropData:function(g,e,f,b){e=z.prototype.cropData.call(this,this.x2Data,e,f,b);e.xData=g.slice(e.start,e.end);return e},translate:function(){m.prototype.translate.apply(this,arguments);var g=this.xAxis,e=this.columnMetrics,f=this.options.minPointLength||0;k(this.points,function(b){var a=b.plotX,d=r(b.x2,b.x+(b.len||0)),d=g.toPixels(d,!0),c=d-a,l;f&&(l=f-c,0>l&&(l=0),a-=l/2,d+=l/2);a=Math.max(a,-10);d=Math.min(Math.max(d,-10),g.len+10);b.shapeArgs={x:a,y:b.plotY+e.offset,width:d-a,height:e.width};
b.tooltipPos[0]+=c/2;b.tooltipPos[1]-=e.width/2;if(d=b.partialFill)v(d)&&(d=d.amount),q(d)||(d=0),a=b.shapeArgs,b.partShapeArgs={x:a.x,y:a.y+1,width:a.width*d,height:a.height-2}})},drawPoints:function(){var c=this,e=this.chart,f=e.renderer,b=e.pointCount<(c.options.animationLimit||250)?"animate":"attr";k(c.points,function(a){var d=a.graphic,e=a.shapeType,g=a.shapeArgs,h=a.partShapeArgs;if(q(a.plotY)&&null!==a.y)if(d){if(w(d),a.graphicOriginal[b](n(g)),h)a.graphicOverlay[b](n(h))}else a.graphic=d=
f.g("point").attr({"class":a.getClassName()}).add(a.group||c.group),a.graphicOriginal=f[e](g).addClass("highcharts-partfill-original").add(d),h&&(a.graphicOverlay=f[e](h).addClass("highcharts-partfill-overlay").add(d));else d&&(a.graphic=d.destroy())})}});x(y.prototype,"getSeriesExtremes",function(c){var e=this.series,f,b;c.call(this);this.isXAxis&&"xrange"===e.type&&(f=r(this.dataMax,Number.MIN_VALUE),k(this.series,function(a){k(a.x2Data||[],function(a){a>f&&(f=a,b=!0)})}),b&&(this.dataMax=f))})})(h)});

View File

@ -0,0 +1,256 @@
/**
* @license Highcharts JS v5.0.2 (2016-10-26)
* X-range series
*
* (c) 2010-2016 Torstein Honsi, Lars A. V. Cabrera
*
* --- WORK IN PROGRESS ---
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* (c) 2014-2016 Highsoft AS
* Authors: Torstein Honsi, Lars A. V. Cabrera
*
* License: www.highcharts.com/license
*/
'use strict';
var defaultPlotOptions = H.getOptions().plotOptions,
color = H.Color,
columnType = H.seriesTypes.column,
each = H.each,
extendClass = H.extendClass,
isNumber = H.isNumber,
isObject = H.isObject,
merge = H.merge,
pick = H.pick,
seriesTypes = H.seriesTypes,
stop = H.stop,
wrap = H.wrap,
Axis = H.Axis,
Point = H.Point,
Series = H.Series,
pointFormat = '<span style="color:{point.color}">' +
'\u25CF' +
'</span> {series.name}: <b>{point.yCategory}</b><br/>',
xrange = 'xrange';
defaultPlotOptions.xrange = merge(defaultPlotOptions.column, {
tooltip: {
pointFormat: pointFormat
}
});
seriesTypes.xrange = extendClass(columnType, {
pointClass: extendClass(Point, {
// Add x2 and yCategory to the available properties for tooltip formats
getLabelConfig: function() {
var cfg = Point.prototype.getLabelConfig.call(this);
cfg.x2 = this.x2;
cfg.yCategory = this.yCategory = this.series.yAxis.categories && this.series.yAxis.categories[this.y];
return cfg;
}
}),
type: xrange,
forceDL: true,
parallelArrays: ['x', 'x2', 'y'],
requireSorting: false,
animate: seriesTypes.line.prototype.animate,
/**
* Borrow the column series metrics, but with swapped axes. This gives free access
* to features like groupPadding, grouping, pointWidth etc.
*/
getColumnMetrics: function() {
var metrics,
chart = this.chart;
function swapAxes() {
each(chart.series, function(s) {
var xAxis = s.xAxis;
s.xAxis = s.yAxis;
s.yAxis = xAxis;
});
}
swapAxes();
this.yAxis.closestPointRange = 1;
metrics = columnType.prototype.getColumnMetrics.call(this);
swapAxes();
return metrics;
},
/**
* Override cropData to show a point where x is outside visible range
* but x2 is outside.
*/
cropData: function(xData, yData, min, max) {
// Replace xData with x2Data to find the appropriate cropStart
var cropData = Series.prototype.cropData,
crop = cropData.call(this, this.x2Data, yData, min, max);
// Re-insert the cropped xData
crop.xData = xData.slice(crop.start, crop.end);
return crop;
},
translate: function() {
columnType.prototype.translate.apply(this, arguments);
var series = this,
xAxis = series.xAxis,
metrics = series.columnMetrics,
minPointLength = series.options.minPointLength || 0;
each(series.points, function(point) {
var plotX = point.plotX,
posX = pick(point.x2, point.x + (point.len || 0)),
plotX2 = xAxis.toPixels(posX, true),
width = plotX2 - plotX,
widthDifference,
shapeArgs,
partialFill;
if (minPointLength) {
widthDifference = minPointLength - width;
if (widthDifference < 0) {
widthDifference = 0;
}
plotX -= widthDifference / 2;
plotX2 += widthDifference / 2;
}
plotX = Math.max(plotX, -10);
plotX2 = Math.min(Math.max(plotX2, -10), xAxis.len + 10);
point.shapeArgs = {
x: plotX,
y: point.plotY + metrics.offset,
width: plotX2 - plotX,
height: metrics.width
};
point.tooltipPos[0] += width / 2;
point.tooltipPos[1] -= metrics.width / 2;
// Add a partShapeArgs to the point, based on the shapeArgs property
partialFill = point.partialFill;
if (partialFill) {
// Get the partial fill amount
if (isObject(partialFill)) {
partialFill = partialFill.amount;
}
// If it was not a number, assume 0
if (!isNumber(partialFill)) {
partialFill = 0;
}
shapeArgs = point.shapeArgs;
point.partShapeArgs = {
x: shapeArgs.x,
y: shapeArgs.y + 1,
width: shapeArgs.width * partialFill,
height: shapeArgs.height - 2
};
}
});
},
drawPoints: function() {
var series = this,
chart = this.chart,
options = series.options,
renderer = chart.renderer,
animationLimit = options.animationLimit || 250,
verb = chart.pointCount < animationLimit ? 'animate' : 'attr';
// draw the columns
each(series.points, function(point) {
var plotY = point.plotY,
graphic = point.graphic,
type = point.shapeType,
shapeArgs = point.shapeArgs,
partShapeArgs = point.partShapeArgs,
seriesOpts = series.options,
pfOptions = point.partialFill,
fill,
state = point.selected && 'select',
cutOff = options.stacking && !options.borderRadius;
if (isNumber(plotY) && point.y !== null) {
if (graphic) { // update
stop(graphic);
point.graphicOriginal[verb](
merge(shapeArgs)
);
if (partShapeArgs) {
point.graphicOverlay[verb](
merge(partShapeArgs)
);
}
} else {
point.graphic = graphic = renderer.g('point')
.attr({
'class': point.getClassName()
})
.add(point.group || series.group);
point.graphicOriginal = renderer[type](shapeArgs)
.addClass('highcharts-partfill-original')
.add(graphic);
if (partShapeArgs) {
point.graphicOverlay = renderer[type](partShapeArgs)
.addClass('highcharts-partfill-overlay')
.add(graphic);
}
}
} else if (graphic) {
point.graphic = graphic.destroy(); // #1269
}
});
}
});
/**
* Max x2 should be considered in xAxis extremes
*/
wrap(Axis.prototype, 'getSeriesExtremes', function(proceed) {
var axis = this,
series = axis.series,
dataMax,
modMax;
proceed.call(this);
if (axis.isXAxis && series.type === xrange) {
dataMax = pick(axis.dataMax, Number.MIN_VALUE);
each(this.series, function(series) {
each(series.x2Data || [], function(val) {
if (val > dataMax) {
dataMax = val;
modMax = true;
}
});
});
if (modMax) {
axis.dataMax = dataMax;
}
}
});
}(Highcharts));
}));

View File

@ -0,0 +1,317 @@
/**
* @license Highcharts JS v5.0.2 (2016-10-26)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*
* Dark blue theme for Highcharts JS
* @author Torstein Honsi
*/
'use strict';
Highcharts.theme = {
colors: ['#DDDF0D', '#55BF3B', '#DF5353', '#7798BF', '#aaeeee', '#ff0066', '#eeaaee',
'#55BF3B', '#DF5353', '#7798BF', '#aaeeee'
],
chart: {
backgroundColor: {
linearGradient: {
x1: 0,
y1: 0,
x2: 1,
y2: 1
},
stops: [
[0, 'rgb(48, 48, 96)'],
[1, 'rgb(0, 0, 0)']
]
},
borderColor: '#000000',
borderWidth: 2,
className: 'dark-container',
plotBackgroundColor: 'rgba(255, 255, 255, .1)',
plotBorderColor: '#CCCCCC',
plotBorderWidth: 1
},
title: {
style: {
color: '#C0C0C0',
font: 'bold 16px "Trebuchet MS", Verdana, sans-serif'
}
},
subtitle: {
style: {
color: '#666666',
font: 'bold 12px "Trebuchet MS", Verdana, sans-serif'
}
},
xAxis: {
gridLineColor: '#333333',
gridLineWidth: 1,
labels: {
style: {
color: '#A0A0A0'
}
},
lineColor: '#A0A0A0',
tickColor: '#A0A0A0',
title: {
style: {
color: '#CCC',
fontWeight: 'bold',
fontSize: '12px',
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
}
}
},
yAxis: {
gridLineColor: '#333333',
labels: {
style: {
color: '#A0A0A0'
}
},
lineColor: '#A0A0A0',
minorTickInterval: null,
tickColor: '#A0A0A0',
tickWidth: 1,
title: {
style: {
color: '#CCC',
fontWeight: 'bold',
fontSize: '12px',
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
}
}
},
tooltip: {
backgroundColor: 'rgba(0, 0, 0, 0.75)',
style: {
color: '#F0F0F0'
}
},
toolbar: {
itemStyle: {
color: 'silver'
}
},
plotOptions: {
line: {
dataLabels: {
color: '#CCC'
},
marker: {
lineColor: '#333'
}
},
spline: {
marker: {
lineColor: '#333'
}
},
scatter: {
marker: {
lineColor: '#333'
}
},
candlestick: {
lineColor: 'white'
}
},
legend: {
itemStyle: {
font: '9pt Trebuchet MS, Verdana, sans-serif',
color: '#A0A0A0'
},
itemHoverStyle: {
color: '#FFF'
},
itemHiddenStyle: {
color: '#444'
}
},
credits: {
style: {
color: '#666'
}
},
labels: {
style: {
color: '#CCC'
}
},
navigation: {
buttonOptions: {
symbolStroke: '#DDDDDD',
hoverSymbolStroke: '#FFFFFF',
theme: {
fill: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0.4, '#606060'],
[0.6, '#333333']
]
},
stroke: '#000000'
}
}
},
// scroll charts
rangeSelector: {
buttonTheme: {
fill: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0.4, '#888'],
[0.6, '#555']
]
},
stroke: '#000000',
style: {
color: '#CCC',
fontWeight: 'bold'
},
states: {
hover: {
fill: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0.4, '#BBB'],
[0.6, '#888']
]
},
stroke: '#000000',
style: {
color: 'white'
}
},
select: {
fill: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0.1, '#000'],
[0.3, '#333']
]
},
stroke: '#000000',
style: {
color: 'yellow'
}
}
}
},
inputStyle: {
backgroundColor: '#333',
color: 'silver'
},
labelStyle: {
color: 'silver'
}
},
navigator: {
handles: {
backgroundColor: '#666',
borderColor: '#AAA'
},
outlineColor: '#CCC',
maskFill: 'rgba(16, 16, 16, 0.5)',
series: {
color: '#7798BF',
lineColor: '#A6C7ED'
}
},
scrollbar: {
barBackgroundColor: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0.4, '#888'],
[0.6, '#555']
]
},
barBorderColor: '#CCC',
buttonArrowColor: '#CCC',
buttonBackgroundColor: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0.4, '#888'],
[0.6, '#555']
]
},
buttonBorderColor: '#CCC',
rifleColor: '#FFF',
trackBackgroundColor: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0, '#000'],
[1, '#333']
]
},
trackBorderColor: '#666'
},
// special colors for some of the
legendBackgroundColor: 'rgba(0, 0, 0, 0.5)',
background2: 'rgb(35, 35, 70)',
dataLabelsColor: '#444',
textColor: '#C0C0C0',
maskColor: 'rgba(255,255,255,0.3)'
};
// Apply the theme
Highcharts.setOptions(Highcharts.theme);
}(Highcharts));
}));

View File

@ -0,0 +1,314 @@
/**
* @license Highcharts JS v5.0.2 (2016-10-26)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*
* Dark blue theme for Highcharts JS
* @author Torstein Honsi
*/
'use strict';
Highcharts.theme = {
colors: ['#DDDF0D', '#55BF3B', '#DF5353', '#7798BF', '#aaeeee', '#ff0066', '#eeaaee',
'#55BF3B', '#DF5353', '#7798BF', '#aaeeee'
],
chart: {
backgroundColor: {
linearGradient: [0, 0, 250, 500],
stops: [
[0, 'rgb(48, 96, 48)'],
[1, 'rgb(0, 0, 0)']
]
},
borderColor: '#000000',
borderWidth: 2,
className: 'dark-container',
plotBackgroundColor: 'rgba(255, 255, 255, .1)',
plotBorderColor: '#CCCCCC',
plotBorderWidth: 1
},
title: {
style: {
color: '#C0C0C0',
font: 'bold 16px "Trebuchet MS", Verdana, sans-serif'
}
},
subtitle: {
style: {
color: '#666666',
font: 'bold 12px "Trebuchet MS", Verdana, sans-serif'
}
},
xAxis: {
gridLineColor: '#333333',
gridLineWidth: 1,
labels: {
style: {
color: '#A0A0A0'
}
},
lineColor: '#A0A0A0',
tickColor: '#A0A0A0',
title: {
style: {
color: '#CCC',
fontWeight: 'bold',
fontSize: '12px',
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
}
}
},
yAxis: {
gridLineColor: '#333333',
labels: {
style: {
color: '#A0A0A0'
}
},
lineColor: '#A0A0A0',
minorTickInterval: null,
tickColor: '#A0A0A0',
tickWidth: 1,
title: {
style: {
color: '#CCC',
fontWeight: 'bold',
fontSize: '12px',
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
}
}
},
tooltip: {
backgroundColor: 'rgba(0, 0, 0, 0.75)',
style: {
color: '#F0F0F0'
}
},
toolbar: {
itemStyle: {
color: 'silver'
}
},
plotOptions: {
line: {
dataLabels: {
color: '#CCC'
},
marker: {
lineColor: '#333'
}
},
spline: {
marker: {
lineColor: '#333'
}
},
scatter: {
marker: {
lineColor: '#333'
}
},
candlestick: {
lineColor: 'white'
}
},
legend: {
itemStyle: {
font: '9pt Trebuchet MS, Verdana, sans-serif',
color: '#A0A0A0'
},
itemHoverStyle: {
color: '#FFF'
},
itemHiddenStyle: {
color: '#444'
}
},
credits: {
style: {
color: '#666'
}
},
labels: {
style: {
color: '#CCC'
}
},
navigation: {
buttonOptions: {
symbolStroke: '#DDDDDD',
hoverSymbolStroke: '#FFFFFF',
theme: {
fill: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0.4, '#606060'],
[0.6, '#333333']
]
},
stroke: '#000000'
}
}
},
// scroll charts
rangeSelector: {
buttonTheme: {
fill: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0.4, '#888'],
[0.6, '#555']
]
},
stroke: '#000000',
style: {
color: '#CCC',
fontWeight: 'bold'
},
states: {
hover: {
fill: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0.4, '#BBB'],
[0.6, '#888']
]
},
stroke: '#000000',
style: {
color: 'white'
}
},
select: {
fill: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0.1, '#000'],
[0.3, '#333']
]
},
stroke: '#000000',
style: {
color: 'yellow'
}
}
}
},
inputStyle: {
backgroundColor: '#333',
color: 'silver'
},
labelStyle: {
color: 'silver'
}
},
navigator: {
handles: {
backgroundColor: '#666',
borderColor: '#AAA'
},
outlineColor: '#CCC',
maskFill: 'rgba(16, 16, 16, 0.5)',
series: {
color: '#7798BF',
lineColor: '#A6C7ED'
}
},
scrollbar: {
barBackgroundColor: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0.4, '#888'],
[0.6, '#555']
]
},
barBorderColor: '#CCC',
buttonArrowColor: '#CCC',
buttonBackgroundColor: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0.4, '#888'],
[0.6, '#555']
]
},
buttonBorderColor: '#CCC',
rifleColor: '#FFF',
trackBackgroundColor: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0, '#000'],
[1, '#333']
]
},
trackBorderColor: '#666'
},
// special colors for some of the
legendBackgroundColor: 'rgba(0, 0, 0, 0.5)',
background2: 'rgb(35, 35, 70)',
dataLabelsColor: '#444',
textColor: '#C0C0C0',
maskColor: 'rgba(255,255,255,0.3)'
};
// Apply the theme
Highcharts.setOptions(Highcharts.theme);
}(Highcharts));
}));

View File

@ -0,0 +1,243 @@
/**
* @license Highcharts JS v5.0.2 (2016-10-26)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*
* Dark theme for Highcharts JS
* @author Torstein Honsi
*/
'use strict';
/* global document */
// Load the fonts
Highcharts.createElement('link', {
href: 'https://fonts.googleapis.com/css?family=Unica+One',
rel: 'stylesheet',
type: 'text/css'
}, null, document.getElementsByTagName('head')[0]);
Highcharts.theme = {
colors: ['#2b908f', '#90ee7e', '#f45b5b', '#7798BF', '#aaeeee', '#ff0066', '#eeaaee',
'#55BF3B', '#DF5353', '#7798BF', '#aaeeee'
],
chart: {
backgroundColor: {
linearGradient: {
x1: 0,
y1: 0,
x2: 1,
y2: 1
},
stops: [
[0, '#2a2a2b'],
[1, '#3e3e40']
]
},
style: {
fontFamily: '\'Unica One\', sans-serif'
},
plotBorderColor: '#606063'
},
title: {
style: {
color: '#E0E0E3',
textTransform: 'uppercase',
fontSize: '20px'
}
},
subtitle: {
style: {
color: '#E0E0E3',
textTransform: 'uppercase'
}
},
xAxis: {
gridLineColor: '#707073',
labels: {
style: {
color: '#E0E0E3'
}
},
lineColor: '#707073',
minorGridLineColor: '#505053',
tickColor: '#707073',
title: {
style: {
color: '#A0A0A3'
}
}
},
yAxis: {
gridLineColor: '#707073',
labels: {
style: {
color: '#E0E0E3'
}
},
lineColor: '#707073',
minorGridLineColor: '#505053',
tickColor: '#707073',
tickWidth: 1,
title: {
style: {
color: '#A0A0A3'
}
}
},
tooltip: {
backgroundColor: 'rgba(0, 0, 0, 0.85)',
style: {
color: '#F0F0F0'
}
},
plotOptions: {
series: {
dataLabels: {
color: '#B0B0B3'
},
marker: {
lineColor: '#333'
}
},
boxplot: {
fillColor: '#505053'
},
candlestick: {
lineColor: 'white'
},
errorbar: {
color: 'white'
}
},
legend: {
itemStyle: {
color: '#E0E0E3'
},
itemHoverStyle: {
color: '#FFF'
},
itemHiddenStyle: {
color: '#606063'
}
},
credits: {
style: {
color: '#666'
}
},
labels: {
style: {
color: '#707073'
}
},
drilldown: {
activeAxisLabelStyle: {
color: '#F0F0F3'
},
activeDataLabelStyle: {
color: '#F0F0F3'
}
},
navigation: {
buttonOptions: {
symbolStroke: '#DDDDDD',
theme: {
fill: '#505053'
}
}
},
// scroll charts
rangeSelector: {
buttonTheme: {
fill: '#505053',
stroke: '#000000',
style: {
color: '#CCC'
},
states: {
hover: {
fill: '#707073',
stroke: '#000000',
style: {
color: 'white'
}
},
select: {
fill: '#000003',
stroke: '#000000',
style: {
color: 'white'
}
}
}
},
inputBoxBorderColor: '#505053',
inputStyle: {
backgroundColor: '#333',
color: 'silver'
},
labelStyle: {
color: 'silver'
}
},
navigator: {
handles: {
backgroundColor: '#666',
borderColor: '#AAA'
},
outlineColor: '#CCC',
maskFill: 'rgba(255,255,255,0.1)',
series: {
color: '#7798BF',
lineColor: '#A6C7ED'
},
xAxis: {
gridLineColor: '#505053'
}
},
scrollbar: {
barBackgroundColor: '#808083',
barBorderColor: '#808083',
buttonArrowColor: '#CCC',
buttonBackgroundColor: '#606063',
buttonBorderColor: '#606063',
rifleColor: '#FFF',
trackBackgroundColor: '#404043',
trackBorderColor: '#404043'
},
// special colors for some of the
legendBackgroundColor: 'rgba(0, 0, 0, 0.5)',
background2: '#505053',
dataLabelsColor: '#B0B0B3',
textColor: '#C0C0C0',
contrastTextColor: '#F0F0F3',
maskColor: 'rgba(255,255,255,0.3)'
};
// Apply the theme
Highcharts.setOptions(Highcharts.theme);
}(Highcharts));
}));

View File

@ -0,0 +1,326 @@
/**
* @license Highcharts JS v5.0.2 (2016-10-26)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*
* Gray theme for Highcharts JS
* @author Torstein Honsi
*/
'use strict';
Highcharts.theme = {
colors: ['#DDDF0D', '#7798BF', '#55BF3B', '#DF5353', '#aaeeee', '#ff0066', '#eeaaee',
'#55BF3B', '#DF5353', '#7798BF', '#aaeeee'
],
chart: {
backgroundColor: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0, 'rgb(96, 96, 96)'],
[1, 'rgb(16, 16, 16)']
]
},
borderWidth: 0,
borderRadius: 0,
plotBackgroundColor: null,
plotShadow: false,
plotBorderWidth: 0
},
title: {
style: {
color: '#FFF',
font: '16px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
}
},
subtitle: {
style: {
color: '#DDD',
font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
}
},
xAxis: {
gridLineWidth: 0,
lineColor: '#999',
tickColor: '#999',
labels: {
style: {
color: '#999',
fontWeight: 'bold'
}
},
title: {
style: {
color: '#AAA',
font: 'bold 12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
}
}
},
yAxis: {
alternateGridColor: null,
minorTickInterval: null,
gridLineColor: 'rgba(255, 255, 255, .1)',
minorGridLineColor: 'rgba(255,255,255,0.07)',
lineWidth: 0,
tickWidth: 0,
labels: {
style: {
color: '#999',
fontWeight: 'bold'
}
},
title: {
style: {
color: '#AAA',
font: 'bold 12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
}
}
},
legend: {
itemStyle: {
color: '#CCC'
},
itemHoverStyle: {
color: '#FFF'
},
itemHiddenStyle: {
color: '#333'
}
},
labels: {
style: {
color: '#CCC'
}
},
tooltip: {
backgroundColor: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0, 'rgba(96, 96, 96, .8)'],
[1, 'rgba(16, 16, 16, .8)']
]
},
borderWidth: 0,
style: {
color: '#FFF'
}
},
plotOptions: {
series: {
nullColor: '#444444'
},
line: {
dataLabels: {
color: '#CCC'
},
marker: {
lineColor: '#333'
}
},
spline: {
marker: {
lineColor: '#333'
}
},
scatter: {
marker: {
lineColor: '#333'
}
},
candlestick: {
lineColor: 'white'
}
},
toolbar: {
itemStyle: {
color: '#CCC'
}
},
navigation: {
buttonOptions: {
symbolStroke: '#DDDDDD',
hoverSymbolStroke: '#FFFFFF',
theme: {
fill: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0.4, '#606060'],
[0.6, '#333333']
]
},
stroke: '#000000'
}
}
},
// scroll charts
rangeSelector: {
buttonTheme: {
fill: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0.4, '#888'],
[0.6, '#555']
]
},
stroke: '#000000',
style: {
color: '#CCC',
fontWeight: 'bold'
},
states: {
hover: {
fill: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0.4, '#BBB'],
[0.6, '#888']
]
},
stroke: '#000000',
style: {
color: 'white'
}
},
select: {
fill: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0.1, '#000'],
[0.3, '#333']
]
},
stroke: '#000000',
style: {
color: 'yellow'
}
}
}
},
inputStyle: {
backgroundColor: '#333',
color: 'silver'
},
labelStyle: {
color: 'silver'
}
},
navigator: {
handles: {
backgroundColor: '#666',
borderColor: '#AAA'
},
outlineColor: '#CCC',
maskFill: 'rgba(16, 16, 16, 0.5)',
series: {
color: '#7798BF',
lineColor: '#A6C7ED'
}
},
scrollbar: {
barBackgroundColor: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0.4, '#888'],
[0.6, '#555']
]
},
barBorderColor: '#CCC',
buttonArrowColor: '#CCC',
buttonBackgroundColor: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0.4, '#888'],
[0.6, '#555']
]
},
buttonBorderColor: '#CCC',
rifleColor: '#FFF',
trackBackgroundColor: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0, '#000'],
[1, '#333']
]
},
trackBorderColor: '#666'
},
// special colors for some of the demo examples
legendBackgroundColor: 'rgba(48, 48, 48, 0.8)',
background2: 'rgb(70, 70, 70)',
dataLabelsColor: '#444',
textColor: '#E0E0E0',
maskColor: 'rgba(255,255,255,0.3)'
};
// Apply the theme
Highcharts.setOptions(Highcharts.theme);
}(Highcharts));
}));

View File

@ -0,0 +1,99 @@
/**
* @license Highcharts JS v5.0.2 (2016-10-26)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*
* Grid-light theme for Highcharts JS
* @author Torstein Honsi
*/
'use strict';
/* global document */
// Load the fonts
Highcharts.createElement('link', {
href: 'https://fonts.googleapis.com/css?family=Dosis:400,600',
rel: 'stylesheet',
type: 'text/css'
}, null, document.getElementsByTagName('head')[0]);
Highcharts.theme = {
colors: ['#7cb5ec', '#f7a35c', '#90ee7e', '#7798BF', '#aaeeee', '#ff0066', '#eeaaee',
'#55BF3B', '#DF5353', '#7798BF', '#aaeeee'
],
chart: {
backgroundColor: null,
style: {
fontFamily: 'Dosis, sans-serif'
}
},
title: {
style: {
fontSize: '16px',
fontWeight: 'bold',
textTransform: 'uppercase'
}
},
tooltip: {
borderWidth: 0,
backgroundColor: 'rgba(219,219,216,0.8)',
shadow: false
},
legend: {
itemStyle: {
fontWeight: 'bold',
fontSize: '13px'
}
},
xAxis: {
gridLineWidth: 1,
labels: {
style: {
fontSize: '12px'
}
}
},
yAxis: {
minorTickInterval: 'auto',
title: {
style: {
textTransform: 'uppercase'
}
},
labels: {
style: {
fontSize: '12px'
}
}
},
plotOptions: {
candlestick: {
lineColor: '#404048'
}
},
// General
background2: '#F0F0EA'
};
// Apply the theme
Highcharts.setOptions(Highcharts.theme);
}(Highcharts));
}));

View File

@ -0,0 +1,131 @@
/**
* @license Highcharts JS v5.0.2 (2016-10-26)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*
* Grid theme for Highcharts JS
* @author Torstein Honsi
*/
'use strict';
Highcharts.theme = {
colors: ['#058DC7', '#50B432', '#ED561B', '#DDDF00', '#24CBE5', '#64E572', '#FF9655', '#FFF263', '#6AF9C4'],
chart: {
backgroundColor: {
linearGradient: {
x1: 0,
y1: 0,
x2: 1,
y2: 1
},
stops: [
[0, 'rgb(255, 255, 255)'],
[1, 'rgb(240, 240, 255)']
]
},
borderWidth: 2,
plotBackgroundColor: 'rgba(255, 255, 255, .9)',
plotShadow: true,
plotBorderWidth: 1
},
title: {
style: {
color: '#000',
font: 'bold 16px "Trebuchet MS", Verdana, sans-serif'
}
},
subtitle: {
style: {
color: '#666666',
font: 'bold 12px "Trebuchet MS", Verdana, sans-serif'
}
},
xAxis: {
gridLineWidth: 1,
lineColor: '#000',
tickColor: '#000',
labels: {
style: {
color: '#000',
font: '11px Trebuchet MS, Verdana, sans-serif'
}
},
title: {
style: {
color: '#333',
fontWeight: 'bold',
fontSize: '12px',
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
}
}
},
yAxis: {
minorTickInterval: 'auto',
lineColor: '#000',
lineWidth: 1,
tickWidth: 1,
tickColor: '#000',
labels: {
style: {
color: '#000',
font: '11px Trebuchet MS, Verdana, sans-serif'
}
},
title: {
style: {
color: '#333',
fontWeight: 'bold',
fontSize: '12px',
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
}
}
},
legend: {
itemStyle: {
font: '9pt Trebuchet MS, Verdana, sans-serif',
color: 'black'
},
itemHoverStyle: {
color: '#039'
},
itemHiddenStyle: {
color: 'gray'
}
},
labels: {
style: {
color: '#99b'
}
},
navigation: {
buttonOptions: {
theme: {
stroke: '#CCCCCC'
}
}
}
};
// Apply the theme
Highcharts.setOptions(Highcharts.theme);
}(Highcharts));
}));

View File

@ -0,0 +1,129 @@
/**
* @license Highcharts JS v5.0.2 (2016-10-26)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*
* Sand-Signika theme for Highcharts JS
* @author Torstein Honsi
*/
'use strict';
/* global document */
// Load the fonts
Highcharts.createElement('link', {
href: 'https://fonts.googleapis.com/css?family=Signika:400,700',
rel: 'stylesheet',
type: 'text/css'
}, null, document.getElementsByTagName('head')[0]);
// Add the background image to the container
Highcharts.wrap(Highcharts.Chart.prototype, 'getContainer', function(proceed) {
proceed.call(this);
this.container.style.background = 'url(http://www.highcharts.com/samples/graphics/sand.png)';
});
Highcharts.theme = {
colors: ['#f45b5b', '#8085e9', '#8d4654', '#7798BF', '#aaeeee', '#ff0066', '#eeaaee',
'#55BF3B', '#DF5353', '#7798BF', '#aaeeee'
],
chart: {
backgroundColor: null,
style: {
fontFamily: 'Signika, serif'
}
},
title: {
style: {
color: 'black',
fontSize: '16px',
fontWeight: 'bold'
}
},
subtitle: {
style: {
color: 'black'
}
},
tooltip: {
borderWidth: 0
},
legend: {
itemStyle: {
fontWeight: 'bold',
fontSize: '13px'
}
},
xAxis: {
labels: {
style: {
color: '#6e6e70'
}
}
},
yAxis: {
labels: {
style: {
color: '#6e6e70'
}
}
},
plotOptions: {
series: {
shadow: true
},
candlestick: {
lineColor: '#404048'
},
map: {
shadow: false
}
},
// Highstock specific
navigator: {
xAxis: {
gridLineColor: '#D0D0D8'
}
},
rangeSelector: {
buttonTheme: {
fill: 'white',
stroke: '#C0C0C8',
'stroke-width': 1,
states: {
select: {
fill: '#D0D0D8'
}
}
}
},
scrollbar: {
trackBorderColor: '#C0C0C8'
},
// General
background2: '#E0E0E8'
};
// Apply the theme
Highcharts.setOptions(Highcharts.theme);
}(Highcharts));
}));

View File

@ -0,0 +1,112 @@
/**
* @license Highcharts JS v5.0.2 (2016-10-26)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*
* Skies theme for Highcharts JS
* @author Torstein Honsi
*/
'use strict';
Highcharts.theme = {
colors: ['#514F78', '#42A07B', '#9B5E4A', '#72727F', '#1F949A', '#82914E', '#86777F', '#42A07B'],
chart: {
className: 'skies',
borderWidth: 0,
plotShadow: true,
plotBackgroundImage: 'http://www.highcharts.com/demo/gfx/skies.jpg',
plotBackgroundColor: {
linearGradient: [0, 0, 250, 500],
stops: [
[0, 'rgba(255, 255, 255, 1)'],
[1, 'rgba(255, 255, 255, 0)']
]
},
plotBorderWidth: 1
},
title: {
style: {
color: '#3E576F',
font: '16px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
}
},
subtitle: {
style: {
color: '#6D869F',
font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
}
},
xAxis: {
gridLineWidth: 0,
lineColor: '#C0D0E0',
tickColor: '#C0D0E0',
labels: {
style: {
color: '#666',
fontWeight: 'bold'
}
},
title: {
style: {
color: '#666',
font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
}
}
},
yAxis: {
alternateGridColor: 'rgba(255, 255, 255, .5)',
lineColor: '#C0D0E0',
tickColor: '#C0D0E0',
tickWidth: 1,
labels: {
style: {
color: '#666',
fontWeight: 'bold'
}
},
title: {
style: {
color: '#666',
font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
}
}
},
legend: {
itemStyle: {
font: '9pt Trebuchet MS, Verdana, sans-serif',
color: '#3E576F'
},
itemHoverStyle: {
color: 'black'
},
itemHiddenStyle: {
color: 'silver'
}
},
labels: {
style: {
color: '#3E576F'
}
}
};
// Apply the theme
Highcharts.setOptions(Highcharts.theme);
}(Highcharts));
}));