!function(g){var h,x,t=g.Chart,v=g.addEvent,i=g.removeEvent,w=g.createElement,u=g.discardElement,S=g.css,y=g.merge,k=g.each,E=g.extend,C=Math.max,d=document,a=window,e=g.isTouchDevice,M="div",F="none",f="highcharts-",G="absolute",D="px",n=g.Renderer.prototype.symbols,o=g.getOptions();E(o.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"}),o.navigation={menuStyle:{border:"1px solid #A0A0A0",background:"#FFFFFF",padding:"5px 0"},menuItemStyle:{padding:"0 10px",background:F,color:"#303030",fontSize:e?"14px":"11px"},menuItemHoverStyle:{background:"#4572A5",color:"#FFFFFF"},buttonOptions:{symbolFill:"#E0E0E0",symbolSize:14,symbolStroke:"#666",symbolStrokeWidth:3,symbolX:12.5,symbolY:10.5,align:"right",buttonSpacing:3,height:22,theme:{fill:"white",stroke:"none"},verticalAlign:"top",width:24}},o.exporting={type:"image/png",url:"http://export.highcharts.com/",buttons:{contextButton:{menuClassName:f+"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"})}}]}}},g.post=function(t,e){var n,o;for(n in o=w("form",{method:"post",action:t,enctype:"multipart/form-data"},{display:F},d.body),e)w("input",{type:"hidden",name:n,value:e[n]},null,o);o.submit(),u(o)},E(t.prototype,{getSVG:function(t){var s,e,n,o,i,r,a,l,p=this,c=y(p.options,t);return d.createElementNS||(d.createElementNS=function(t,e){return d.createElement(e)}),e=w(M,null,{position:G,top:"-9999em",width:p.chartWidth+D,height:p.chartHeight+D},d.body),a=p.renderTo.style.width,l=p.renderTo.style.height,i=c.exporting.sourceWidth||c.chart.width||/px$/.test(a)&&parseInt(a,10)||600,r=c.exporting.sourceHeight||c.chart.height||/px$/.test(l)&&parseInt(l,10)||400,E(c.chart,{animation:!1,renderTo:e,forExport:!0,width:i,height:r}),c.exporting.enabled=!1,c.series=[],k(p.series,function(t){(o=y(t.options,{animation:!1,showCheckbox:!1,visible:t.visible})).isInternal||c.series.push(o)}),s=new g.Chart(c,p.callback),k(["xAxis","yAxis"],function(a){k(p[a],function(t,e){var n=s[a][e],o=t.getExtremes(),i=o.userMin,r=o.userMax;!n||i===h&&r===h||n.setExtremes(i,r,!0,!1)})}),n=s.container.innerHTML,c=null,s.destroy(),u(e),n=(n=n.replace(/zIndex="[^"]+"/g,"").replace(/isShadow="[^"]+"/g,"").replace(/symbolName="[^"]+"/g,"").replace(/jQuery[0-9]+="[^"]+"/g,"").replace(/url\([^#]+#/g,"url(#").replace(/<svg /,'<svg xmlns:xlink="http://www.w3.org/1999/xlink" ').replace(/ href=/g," xlink:href=").replace(/\n/," ").replace(/<\/svg>.*?$/,"</svg>").replace(/ /g," ").replace(/­/g,"").replace(/<IMG /g,"<image ").replace(/height=([^" ]+)/g,'height="$1"').replace(/width=([^" ]+)/g,'width="$1"').replace(/hc-svg-href="([^"]+)">/g,'xlink:href="$1"/>').replace(/id=([^" >]+)/g,'id="$1"').replace(/class=([^" >]+)/g,'class="$1"').replace(/ transform /g," ").replace(/:(path|rect)/g,"$1").replace(/style="([^"]+)"/g,function(t){return t.toLowerCase()})).replace(/(url\(#highcharts-[0-9]+)"/g,"$1").replace(/"/g,"'")},exportChart:function(t,e){t=t||{};var n=this.options.exporting,o=this.getSVG(y({chart:{borderRadius:0}},n.chartOptions,e,{exporting:{sourceWidth:t.sourceWidth||n.sourceWidth,sourceHeight:t.sourceHeight||n.sourceHeight}}));t=y(this.options.exporting,t),g.post(t.url,{filename:t.filename||"chart",type:t.type,width:t.width||0,scale:t.scale||2,svg:o})},print:function(){var t=this,e=t.container,n=[],o=e.parentNode,i=d.body,r=i.childNodes;t.isPrinting||(t.isPrinting=!0,k(r,function(t,e){1===t.nodeType&&(n[e]=t.style.display,t.style.display=F)}),i.appendChild(e),a.focus(),a.print(),setTimeout(function(){o.appendChild(e),k(r,function(t,e){1===t.nodeType&&(t.style.display=n[e])}),t.isPrinting=!1},1e3))},contextMenu:function(e,t,n,o,i,r,a){var s,l,p,c,h=this,u=h.options.navigation,d=u.menuItemStyle,m=h.chartWidth,g=h.chartHeight,x="cache-"+e,y=h[x],f=C(i,r),b="3px 3px 10px #888";y||(h[x]=y=w(M,{className:e},{position:G,zIndex:1e3,padding:f+D},h.container),s=w(M,null,E({MozBoxShadow:b,WebkitBoxShadow:b,boxShadow:b},u.menuStyle),y),l=function(){S(y,{display:F}),a&&a.setState(0),h.openMenu=!1},v(y,"mouseleave",function(){p=setTimeout(l,500)}),v(y,"mouseenter",function(){clearTimeout(p)}),v(document,"mousedown",function(t){h.pointer.inClass(t.target,e)||l()}),k(t,function(t){if(t){var e=t.separator?w("hr",null,null,s):w(M,{onmouseover:function(){S(this,u.menuItemHoverStyle)},onmouseout:function(){S(this,d)},onclick:function(){l(),t.onclick.apply(h,arguments)},innerHTML:t.text||h.options.lang[t.textKey]},E({cursor:"pointer"},d),s);h.exportDivElements.push(e)}}),h.exportDivElements.push(s,y),h.exportMenuWidth=y.offsetWidth,h.exportMenuHeight=y.offsetHeight),c={display:"block"},n+h.exportMenuWidth>m?c.right=m-n-i-f+D:c.left=n-f+D,o+r+h.exportMenuHeight>g&&"top"!==a.alignOptions.verticalAlign?c.bottom=g-o-f+D:c.top=o+r-f+D,S(y,c),h.openMenu=!0},addButton:function(t){var e,n,o=this,i=o.renderer,r=y(o.options.navigation.buttonOptions,t),a=r.onclick,s=r.menuItems,l={stroke:r.symbolStroke,fill:r.symbolFill},p=r.symbolSize||12;if(o.btnCount||(o.btnCount=0),o.exportDivElements||(o.exportDivElements=[],o.exportSVGElements=[]),!1!==r.enabled){var c,h=r.theme,u=h.states,d=u&&u.hover,m=u&&u.select;delete h.states,a?c=function(){a.apply(o,arguments)}:s&&(c=function(){o.contextMenu(n.menuClassName,s,n.translateX,n.translateY,n.width,n.height,n),n.setState(2)}),r.text&&r.symbol?h.paddingLeft=g.pick(h.paddingLeft,25):r.text||E(h,{width:r.width,height:r.height,padding:0}),(n=i.button(r.text,0,0,c,h,d,m).attr({title:o.options.lang[r._titleKey],"stroke-linecap":"round"})).menuClassName=t.menuClassName||f+"menu-"+o.btnCount++,r.symbol&&(e=i.symbol(r.symbol,r.symbolX-p/2,r.symbolY-p/2,p,p).attr(E(l,{"stroke-width":r.symbolStrokeWidth||1,zIndex:1})).add(n)),n.add().align(E(r,{width:n.width,x:g.pick(r.x,x)}),!0,"spacingBox"),x+=(n.width+r.buttonSpacing)*("right"===r.align?-1:1),o.exportSVGElements.push(n,e)}},destroyExport:function(t){var e,n,o=t.target;for(e=0;e<o.exportSVGElements.length;e++)(n=o.exportSVGElements[e])&&(n.onclick=n.ontouchstart=null,o.exportSVGElements[e]=n.destroy());for(e=0;e<o.exportDivElements.length;e++)n=o.exportDivElements[e],i(n,"mouseleave"),o.exportDivElements[e]=n.onmouseout=n.onmouseover=n.ontouchstart=n.onclick=null,u(n)}}),n.menu=function(t,e,n,o){return["M",t,e+2.5,"L",t+n,e+2.5,"M",t,e+o/2+.5,"L",t+n,e+o/2+.5,"M",t,e+o-1.5,"L",t+n,e+o-1.5]},t.prototype.callbacks.push(function(t){var e,n=t.options.exporting,o=n.buttons;if(x=0,!1!==n.enabled){for(e in o)t.addButton(o[e]);v(t,"destroy",t.destroyExport)}})}(Highcharts);
|