highstock-rails 1.3.10 → 2.1.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/assets/images/highstock/meteogram-symbols-30px.png +0 -0
  4. data/app/assets/javascripts/highstock.js +418 -369
  5. data/app/assets/javascripts/highstock/adapters/standalone-framework.js +12 -12
  6. data/app/assets/javascripts/highstock/adapters/standalone-framework.src.js +635 -0
  7. data/app/assets/javascripts/highstock/highcharts-3d.js +48 -0
  8. data/app/assets/javascripts/highstock/highcharts-3d.src.js +1711 -0
  9. data/app/assets/javascripts/highstock/highcharts-more.js +49 -45
  10. data/app/assets/javascripts/highstock/highstock-all.js +637 -0
  11. data/app/assets/javascripts/highstock/modules/boost.js +12 -0
  12. data/app/assets/javascripts/highstock/modules/boost.src.js +591 -0
  13. data/app/assets/javascripts/highstock/modules/canvas-tools.js +9 -9
  14. data/app/assets/javascripts/highstock/modules/canvas-tools.src.js +3114 -0
  15. data/app/assets/javascripts/highstock/modules/data.js +20 -10
  16. data/app/assets/javascripts/highstock/modules/data.src.js +957 -0
  17. data/app/assets/javascripts/highstock/modules/drilldown.js +17 -14
  18. data/app/assets/javascripts/highstock/modules/drilldown.src.js +717 -0
  19. data/app/assets/javascripts/highstock/modules/exporting.js +17 -15
  20. data/app/assets/javascripts/highstock/modules/exporting.src.js +780 -0
  21. data/app/assets/javascripts/highstock/modules/funnel.js +5 -5
  22. data/app/assets/javascripts/highstock/modules/funnel.src.js +322 -0
  23. data/app/assets/javascripts/highstock/modules/heatmap.js +23 -2
  24. data/app/assets/javascripts/highstock/modules/heatmap.src.js +711 -0
  25. data/app/assets/javascripts/highstock/modules/no-data-to-display.js +4 -4
  26. data/app/assets/javascripts/highstock/modules/no-data-to-display.src.js +143 -0
  27. data/app/assets/javascripts/highstock/modules/offline-exporting.js +14 -0
  28. data/app/assets/javascripts/highstock/modules/offline-exporting.src.js +280 -0
  29. data/app/assets/javascripts/highstock/modules/solid-gauge.js +14 -0
  30. data/app/assets/javascripts/highstock/modules/solid-gauge.src.js +273 -0
  31. data/app/assets/javascripts/highstock/modules/treemap.js +30 -0
  32. data/app/assets/javascripts/highstock/modules/treemap.src.js +868 -0
  33. data/app/assets/javascripts/highstock/themes/dark-blue.js +1 -1
  34. data/app/assets/javascripts/highstock/themes/dark-green.js +1 -1
  35. data/app/assets/javascripts/highstock/themes/dark-unica.js +213 -0
  36. data/app/assets/javascripts/highstock/themes/gray.js +1 -1
  37. data/app/assets/javascripts/highstock/themes/grid-light.js +74 -0
  38. data/app/assets/javascripts/highstock/themes/sand-signika.js +104 -0
  39. data/lib/highstock/rails/version.rb +1 -1
  40. metadata +26 -7
  41. data/app/assets/javascripts/highstock/adapters/mootools-adapter.js +0 -13
  42. data/app/assets/javascripts/highstock/adapters/prototype-adapter.js +0 -15
  43. data/app/assets/javascripts/highstock/modules/annotations.js +0 -7
  44. data/app/assets/javascripts/highstock/modules/map.js +0 -41
@@ -1,22 +1,24 @@
1
1
  /*
2
- Highstock JS v1.3.10 (2014-03-10)
2
+ Highstock JS v2.1.10 (2015-12-07)
3
3
  Exporting module
4
4
 
5
5
  (c) 2010-2014 Torstein Honsi
6
6
 
7
7
  License: www.highcharts.com/license
8
8
  */
9
- (function(f){var A=f.Chart,t=f.addEvent,B=f.removeEvent,l=f.createElement,o=f.discardElement,v=f.css,k=f.merge,r=f.each,p=f.extend,D=Math.max,j=document,C=window,E=f.isTouchDevice,F=f.Renderer.prototype.symbols,s=f.getOptions(),y;p(s.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"});s.navigation={menuStyle:{border:"1px solid #A0A0A0",
10
- background:"#FFFFFF",padding:"5px 0"},menuItemStyle:{padding:"0 10px",background:"none",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}};s.exporting={type:"image/png",url:"http://export.highcharts.com/",buttons:{contextButton:{menuClassName:"highcharts-contextmenu",
11
- 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(b,a,d){var c,b=l("form",k({method:"post",
12
- action:b,enctype:"multipart/form-data"},d),{display:"none"},j.body);for(c in a)l("input",{type:"hidden",name:c,value:a[c]},null,b);b.submit();o(b)};p(A.prototype,{getSVG:function(b){var a=this,d,c,z,h,g=k(a.options,b);if(!j.createElementNS)j.createElementNS=function(a,b){return j.createElement(b)};b=l("div",null,{position:"absolute",top:"-9999em",width:a.chartWidth+"px",height:a.chartHeight+"px"},j.body);c=a.renderTo.style.width;h=a.renderTo.style.height;c=g.exporting.sourceWidth||g.chart.width||
13
- /px$/.test(c)&&parseInt(c,10)||600;h=g.exporting.sourceHeight||g.chart.height||/px$/.test(h)&&parseInt(h,10)||400;p(g.chart,{animation:!1,renderTo:b,forExport:!0,width:c,height:h});g.exporting.enabled=!1;g.series=[];r(a.series,function(a){z=k(a.options,{animation:!1,showCheckbox:!1,visible:a.visible});z.isInternal||g.series.push(z)});d=new f.Chart(g,a.callback);r(["xAxis","yAxis"],function(b){r(a[b],function(a,c){var g=d[b][c],f=a.getExtremes(),h=f.userMin,f=f.userMax;g&&(h!==void 0||f!==void 0)&&
14
- g.setExtremes(h,f,!0,!1)})});c=d.container.innerHTML;g=null;d.destroy();o(b);c=c.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(/&nbsp;/g," ").replace(/&shy;/g,"­").replace(/<IMG /g,"<image ").replace(/height=([^" ]+)/g,'height="$1"').replace(/width=([^" ]+)/g,
15
- 'width="$1"').replace(/hc-svg-href="([^"]+)">/g,'xlink:href="$1"/>').replace(/id=([^" >]+)/g,'id="$1"').replace(/class=([^" >]+)/g,'class="$1"').replace(/ transform /g," ").replace(/:(path|rect)/g,"$1").replace(/style="([^"]+)"/g,function(a){return a.toLowerCase()});return c=c.replace(/(url\(#highcharts-[0-9]+)&quot;/g,"$1").replace(/&quot;/g,"'")},exportChart:function(b,a){var b=b||{},d=this.options.exporting,d=this.getSVG(k({chart:{borderRadius:0}},d.chartOptions,a,{exporting:{sourceWidth:b.sourceWidth||
16
- d.sourceWidth,sourceHeight:b.sourceHeight||d.sourceHeight}})),b=k(this.options.exporting,b);f.post(b.url,{filename:b.filename||"chart",type:b.type,width:b.width||0,scale:b.scale||2,svg:d},b.formAttributes)},print:function(){var b=this,a=b.container,d=[],c=a.parentNode,f=j.body,h=f.childNodes;if(!b.isPrinting)b.isPrinting=!0,r(h,function(a,b){if(a.nodeType===1)d[b]=a.style.display,a.style.display="none"}),f.appendChild(a),C.focus(),C.print(),setTimeout(function(){c.appendChild(a);r(h,function(a,b){if(a.nodeType===
17
- 1)a.style.display=d[b]});b.isPrinting=!1},1E3)},contextMenu:function(b,a,d,c,f,h,g){var e=this,k=e.options.navigation,q=k.menuItemStyle,m=e.chartWidth,n=e.chartHeight,j="cache-"+b,i=e[j],u=D(f,h),w,x,o,s=function(a){e.pointer.inClass(a.target,b)||x()};if(!i)e[j]=i=l("div",{className:b},{position:"absolute",zIndex:1E3,padding:u+"px"},e.container),w=l("div",null,p({MozBoxShadow:"3px 3px 10px #888",WebkitBoxShadow:"3px 3px 10px #888",boxShadow:"3px 3px 10px #888"},k.menuStyle),i),x=function(){v(i,{display:"none"});
18
- g&&g.setState(0);e.openMenu=!1},t(i,"mouseleave",function(){o=setTimeout(x,500)}),t(i,"mouseenter",function(){clearTimeout(o)}),t(document,"mouseup",s),t(e,"destroy",function(){B(document,"mouseup",s)}),r(a,function(a){if(a){var b=a.separator?l("hr",null,null,w):l("div",{onmouseover:function(){v(this,k.menuItemHoverStyle)},onmouseout:function(){v(this,q)},onclick:function(){x();a.onclick.apply(e,arguments)},innerHTML:a.text||e.options.lang[a.textKey]},p({cursor:"pointer"},q),w);e.exportDivElements.push(b)}}),
19
- e.exportDivElements.push(w,i),e.exportMenuWidth=i.offsetWidth,e.exportMenuHeight=i.offsetHeight;a={display:"block"};d+e.exportMenuWidth>m?a.right=m-d-f-u+"px":a.left=d-u+"px";c+h+e.exportMenuHeight>n&&g.alignOptions.verticalAlign!=="top"?a.bottom=n-c-u+"px":a.top=c+h-u+"px";v(i,a);e.openMenu=!0},addButton:function(b){var a=this,d=a.renderer,c=k(a.options.navigation.buttonOptions,b),j=c.onclick,h=c.menuItems,g,e,l={stroke:c.symbolStroke,fill:c.symbolFill},q=c.symbolSize||12;if(!a.btnCount)a.btnCount=
20
- 0;if(!a.exportDivElements)a.exportDivElements=[],a.exportSVGElements=[];if(c.enabled!==!1){var m=c.theme,n=m.states,o=n&&n.hover,n=n&&n.select,i;delete m.states;j?i=function(){j.apply(a,arguments)}:h&&(i=function(){a.contextMenu(e.menuClassName,h,e.translateX,e.translateY,e.width,e.height,e);e.setState(2)});c.text&&c.symbol?m.paddingLeft=f.pick(m.paddingLeft,25):c.text||p(m,{width:c.width,height:c.height,padding:0});e=d.button(c.text,0,0,i,m,o,n).attr({title:a.options.lang[c._titleKey],"stroke-linecap":"round"});
21
- e.menuClassName=b.menuClassName||"highcharts-menu-"+a.btnCount++;c.symbol&&(g=d.symbol(c.symbol,c.symbolX-q/2,c.symbolY-q/2,q,q).attr(p(l,{"stroke-width":c.symbolStrokeWidth||1,zIndex:1})).add(e));e.add().align(p(c,{width:e.width,x:f.pick(c.x,y)}),!0,"spacingBox");y+=(e.width+c.buttonSpacing)*(c.align==="right"?-1:1);a.exportSVGElements.push(e,g)}},destroyExport:function(b){var b=b.target,a,d;for(a=0;a<b.exportSVGElements.length;a++)if(d=b.exportSVGElements[a])d.onclick=d.ontouchstart=null,b.exportSVGElements[a]=
22
- d.destroy();for(a=0;a<b.exportDivElements.length;a++)d=b.exportDivElements[a],B(d,"mouseleave"),b.exportDivElements[a]=d.onmouseout=d.onmouseover=d.ontouchstart=d.onclick=null,o(d)}});F.menu=function(b,a,d,c){return["M",b,a+2.5,"L",b+d,a+2.5,"M",b,a+c/2+0.5,"L",b+d,a+c/2+0.5,"M",b,a+c-1.5,"L",b+d,a+c-1.5]};A.prototype.callbacks.push(function(b){var a,d=b.options.exporting,c=d.buttons;y=0;if(d.enabled!==!1){for(a in c)b.addButton(c[a]);t(b,"destroy",b.destroyExport)}})})(Highcharts);
9
+ (function(f){typeof module==="object"&&module.exports?module.exports=f:f(Highcharts)})(function(f){var z=f.Chart,t=f.addEvent,A=f.removeEvent,B=f.fireEvent,n=f.createElement,r=f.discardElement,v=f.css,l=f.merge,i=f.each,q=f.extend,E=f.splat,F=Math.max,m=document,C=window,G=f.isTouchDevice,H=f.Renderer.prototype.symbols,s=f.getOptions(),y;q(s.lang,{printChart:"Print chart",downloadPNG:"Download PNG image",downloadJPEG:"Download JPEG image",downloadPDF:"Download PDF document",downloadSVG:"Download SVG vector image",
10
+ contextButtonTitle:"Chart context menu"});s.navigation={menuStyle:{border:"1px solid #A0A0A0",background:"#FFFFFF",padding:"5px 0"},menuItemStyle:{padding:"0 10px",background:"none",color:"#303030",fontSize:G?"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}};
11
+ s.exporting={type:"image/png",url:"http://export.highcharts.com/",buttons:{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",
12
+ onclick:function(){this.exportChart({type:"image/svg+xml"})}}]}}};f.post=function(a,b,e){var c,a=n("form",l({method:"post",action:a,enctype:"multipart/form-data"},e),{display:"none"},m.body);for(c in b)n("input",{type:"hidden",name:c,value:b[c]},null,a);a.submit();r(a)};q(z.prototype,{sanitizeSVG:function(a){return a.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(/ (NS[0-9]+\:)?href=/g,
13
+ " xlink:href=").replace(/\n/," ").replace(/<\/svg>.*?$/,"</svg>").replace(/(fill|stroke)="rgba\(([ 0-9]+,[ 0-9]+,[ 0-9]+),([ 0-9\.]+)\)"/g,'$1="rgb($2)" $1-opacity="$3"').replace(/&nbsp;/g,"\u00a0").replace(/&shy;/g,"\u00ad").replace(/<IMG /g,"<image ").replace(/<(\/?)TITLE>/g,"<$1title>").replace(/height=([^" ]+)/g,'height="$1"').replace(/width=([^" ]+)/g,'width="$1"').replace(/hc-svg-href="([^"]+)">/g,'xlink:href="$1"/>').replace(/ id=([^" >]+)/g,' id="$1"').replace(/class=([^" >]+)/g,'class="$1"').replace(/ transform /g,
14
+ " ").replace(/:(path|rect)/g,"$1").replace(/style="([^"]+)"/g,function(b){return b.toLowerCase()})},getChartHTML:function(){return this.container.innerHTML},getSVG:function(a){var b=this,e,c,g,j,k,d=l(b.options,a),I=d.exporting.allowHTML;if(!m.createElementNS)m.createElementNS=function(b,a){return m.createElement(a)};c=n("div",null,{position:"absolute",top:"-9999em",width:b.chartWidth+"px",height:b.chartHeight+"px"},m.body);g=b.renderTo.style.width;k=b.renderTo.style.height;g=d.exporting.sourceWidth||
15
+ d.chart.width||/px$/.test(g)&&parseInt(g,10)||600;k=d.exporting.sourceHeight||d.chart.height||/px$/.test(k)&&parseInt(k,10)||400;q(d.chart,{animation:!1,renderTo:c,forExport:!0,renderer:"SVGRenderer",width:g,height:k});d.exporting.enabled=!1;delete d.data;d.series=[];i(b.series,function(a){j=l(a.options,{animation:!1,enableMouseTracking:!1,showCheckbox:!1,visible:a.visible});j.isInternal||d.series.push(j)});a&&i(["xAxis","yAxis"],function(b){i(E(a[b]),function(a,c){d[b][c]=l(d[b][c],a)})});e=new f.Chart(d,
16
+ b.callback);i(["xAxis","yAxis"],function(a){i(b[a],function(b,c){var d=e[a][c],f=b.getExtremes(),g=f.userMin,f=f.userMax;d&&(g!==void 0||f!==void 0)&&d.setExtremes(g,f,!0,!1)})});g=e.getChartHTML();d=null;e.destroy();r(c);if(I&&(c=g.match(/<\/svg>(.*?$)/)))c='<foreignObject x="0" y="0" width="200" height="200"><body xmlns="http://www.w3.org/1999/xhtml">'+c[1]+"</body></foreignObject>",g=g.replace("</svg>",c+"</svg>");g=this.sanitizeSVG(g);return g=g.replace(/(url\(#highcharts-[0-9]+)&quot;/g,"$1").replace(/&quot;/g,
17
+ "'")},getSVGForExport:function(a,b){var e=this.options.exporting;return this.getSVG(l({chart:{borderRadius:0}},e.chartOptions,b,{exporting:{sourceWidth:a&&a.sourceWidth||e.sourceWidth,sourceHeight:a&&a.sourceHeight||e.sourceHeight}}))},exportChart:function(a,b){var e=this.getSVGForExport(a,b),a=l(this.options.exporting,a);f.post(a.url,{filename:a.filename||"chart",type:a.type,width:a.width||0,scale:a.scale||2,svg:e},a.formAttributes)},print:function(){var a=this,b=a.container,e=[],c=b.parentNode,
18
+ f=m.body,j=f.childNodes;if(!a.isPrinting)a.isPrinting=!0,a.pointer.reset(null,0),B(a,"beforePrint"),i(j,function(a,b){if(a.nodeType===1)e[b]=a.style.display,a.style.display="none"}),f.appendChild(b),C.focus(),C.print(),setTimeout(function(){c.appendChild(b);i(j,function(a,b){if(a.nodeType===1)a.style.display=e[b]});a.isPrinting=!1;B(a,"afterPrint")},1E3)},contextMenu:function(a,b,e,c,f,j,k){var d=this,l=d.options.navigation,D=l.menuItemStyle,o=d.chartWidth,p=d.chartHeight,m="cache-"+a,h=d[m],u=F(f,
19
+ j),w,x,r,s=function(b){d.pointer.inClass(b.target,a)||x()};if(!h)d[m]=h=n("div",{className:a},{position:"absolute",zIndex:1E3,padding:u+"px"},d.container),w=n("div",null,q({MozBoxShadow:"3px 3px 10px #888",WebkitBoxShadow:"3px 3px 10px #888",boxShadow:"3px 3px 10px #888"},l.menuStyle),h),x=function(){v(h,{display:"none"});k&&k.setState(0);d.openMenu=!1},t(h,"mouseleave",function(){r=setTimeout(x,500)}),t(h,"mouseenter",function(){clearTimeout(r)}),t(document,"mouseup",s),t(d,"destroy",function(){A(document,
20
+ "mouseup",s)}),i(b,function(a){if(a){var b=a.separator?n("hr",null,null,w):n("div",{onmouseover:function(){v(this,l.menuItemHoverStyle)},onmouseout:function(){v(this,D)},onclick:function(b){b&&b.stopPropagation();x();a.onclick&&a.onclick.apply(d,arguments)},innerHTML:a.text||d.options.lang[a.textKey]},q({cursor:"pointer"},D),w);d.exportDivElements.push(b)}}),d.exportDivElements.push(w,h),d.exportMenuWidth=h.offsetWidth,d.exportMenuHeight=h.offsetHeight;b={display:"block"};e+d.exportMenuWidth>o?b.right=
21
+ o-e-f-u+"px":b.left=e-u+"px";c+j+d.exportMenuHeight>p&&k.alignOptions.verticalAlign!=="top"?b.bottom=p-c-u+"px":b.top=c+j-u+"px";v(h,b);d.openMenu=!0},addButton:function(a){var b=this,e=b.renderer,c=l(b.options.navigation.buttonOptions,a),g=c.onclick,j=c.menuItems,k,d,m={stroke:c.symbolStroke,fill:c.symbolFill},i=c.symbolSize||12;if(!b.btnCount)b.btnCount=0;if(!b.exportDivElements)b.exportDivElements=[],b.exportSVGElements=[];if(c.enabled!==!1){var o=c.theme,p=o.states,n=p&&p.hover,p=p&&p.select,
22
+ h;delete o.states;g?h=function(a){a.stopPropagation();g.call(b,a)}:j&&(h=function(){b.contextMenu(d.menuClassName,j,d.translateX,d.translateY,d.width,d.height,d);d.setState(2)});c.text&&c.symbol?o.paddingLeft=f.pick(o.paddingLeft,25):c.text||q(o,{width:c.width,height:c.height,padding:0});d=e.button(c.text,0,0,h,o,n,p).attr({title:b.options.lang[c._titleKey],"stroke-linecap":"round"});d.menuClassName=a.menuClassName||"highcharts-menu-"+b.btnCount++;c.symbol&&(k=e.symbol(c.symbol,c.symbolX-i/2,c.symbolY-
23
+ i/2,i,i).attr(q(m,{"stroke-width":c.symbolStrokeWidth||1,zIndex:1})).add(d));d.add().align(q(c,{width:d.width,x:f.pick(c.x,y)}),!0,"spacingBox");y+=(d.width+c.buttonSpacing)*(c.align==="right"?-1:1);b.exportSVGElements.push(d,k)}},destroyExport:function(a){var a=a.target,b,e;for(b=0;b<a.exportSVGElements.length;b++)if(e=a.exportSVGElements[b])e.onclick=e.ontouchstart=null,a.exportSVGElements[b]=e.destroy();for(b=0;b<a.exportDivElements.length;b++)e=a.exportDivElements[b],A(e,"mouseleave"),a.exportDivElements[b]=
24
+ e.onmouseout=e.onmouseover=e.ontouchstart=e.onclick=null,r(e)}});H.menu=function(a,b,e,c){return["M",a,b+2.5,"L",a+e,b+2.5,"M",a,b+c/2+0.5,"L",a+e,b+c/2+0.5,"M",a,b+c-1.5,"L",a+e,b+c-1.5]};z.prototype.callbacks.push(function(a){var b,e=a.options.exporting,c=e.buttons;y=0;if(e.enabled!==!1){for(b in c)a.addButton(c[b]);t(a,"destroy",a.destroyExport)}})});
@@ -0,0 +1,780 @@
1
+ /**
2
+ * @license Highstock JS v2.1.10 (2015-12-07)
3
+ * Exporting module
4
+ *
5
+ * (c) 2010-2014 Torstein Honsi
6
+ *
7
+ * License: www.highcharts.com/license
8
+ */
9
+
10
+ /* eslint indent:0 */
11
+ (function (factory) {
12
+ if (typeof module === 'object' && module.exports) {
13
+ module.exports = factory;
14
+ } else {
15
+ factory(Highcharts);
16
+ }
17
+ }(function (Highcharts) {
18
+
19
+ // create shortcuts
20
+ var Chart = Highcharts.Chart,
21
+ addEvent = Highcharts.addEvent,
22
+ removeEvent = Highcharts.removeEvent,
23
+ fireEvent = Highcharts.fireEvent,
24
+ createElement = Highcharts.createElement,
25
+ discardElement = Highcharts.discardElement,
26
+ css = Highcharts.css,
27
+ merge = Highcharts.merge,
28
+ each = Highcharts.each,
29
+ extend = Highcharts.extend,
30
+ splat = Highcharts.splat,
31
+ math = Math,
32
+ mathMax = math.max,
33
+ doc = document,
34
+ win = window,
35
+ isTouchDevice = Highcharts.isTouchDevice,
36
+ M = 'M',
37
+ L = 'L',
38
+ DIV = 'div',
39
+ HIDDEN = 'hidden',
40
+ NONE = 'none',
41
+ PREFIX = 'highcharts-',
42
+ ABSOLUTE = 'absolute',
43
+ PX = 'px',
44
+ UNDEFINED,
45
+ symbols = Highcharts.Renderer.prototype.symbols,
46
+ defaultOptions = Highcharts.getOptions(),
47
+ buttonOffset;
48
+
49
+ // Add language
50
+ extend(defaultOptions.lang, {
51
+ printChart: 'Print chart',
52
+ downloadPNG: 'Download PNG image',
53
+ downloadJPEG: 'Download JPEG image',
54
+ downloadPDF: 'Download PDF document',
55
+ downloadSVG: 'Download SVG vector image',
56
+ contextButtonTitle: 'Chart context menu'
57
+ });
58
+
59
+ // Buttons and menus are collected in a separate config option set called 'navigation'.
60
+ // This can be extended later to add control buttons like zoom and pan right click menus.
61
+ defaultOptions.navigation = {
62
+ menuStyle: {
63
+ border: '1px solid #A0A0A0',
64
+ background: '#FFFFFF',
65
+ padding: '5px 0'
66
+ },
67
+ menuItemStyle: {
68
+ padding: '0 10px',
69
+ background: NONE,
70
+ color: '#303030',
71
+ fontSize: isTouchDevice ? '14px' : '11px'
72
+ },
73
+ menuItemHoverStyle: {
74
+ background: '#4572A5',
75
+ color: '#FFFFFF'
76
+ },
77
+
78
+ buttonOptions: {
79
+ symbolFill: '#E0E0E0',
80
+ symbolSize: 14,
81
+ symbolStroke: '#666',
82
+ symbolStrokeWidth: 3,
83
+ symbolX: 12.5,
84
+ symbolY: 10.5,
85
+ align: 'right',
86
+ buttonSpacing: 3,
87
+ height: 22,
88
+ // text: null,
89
+ theme: {
90
+ fill: 'white', // capture hover
91
+ stroke: 'none'
92
+ },
93
+ verticalAlign: 'top',
94
+ width: 24
95
+ }
96
+ };
97
+
98
+
99
+
100
+ // Add the export related options
101
+ defaultOptions.exporting = {
102
+ //enabled: true,
103
+ //filename: 'chart',
104
+ type: 'image/png',
105
+ url: 'http://export.highcharts.com/',
106
+ //width: undefined,
107
+ //scale: 2
108
+ buttons: {
109
+ contextButton: {
110
+ menuClassName: PREFIX + 'contextmenu',
111
+ //x: -10,
112
+ symbol: 'menu',
113
+ _titleKey: 'contextButtonTitle',
114
+ menuItems: [{
115
+ textKey: 'printChart',
116
+ onclick: function () {
117
+ this.print();
118
+ }
119
+ }, {
120
+ separator: true
121
+ }, {
122
+ textKey: 'downloadPNG',
123
+ onclick: function () {
124
+ this.exportChart();
125
+ }
126
+ }, {
127
+ textKey: 'downloadJPEG',
128
+ onclick: function () {
129
+ this.exportChart({
130
+ type: 'image/jpeg'
131
+ });
132
+ }
133
+ }, {
134
+ textKey: 'downloadPDF',
135
+ onclick: function () {
136
+ this.exportChart({
137
+ type: 'application/pdf'
138
+ });
139
+ }
140
+ }, {
141
+ textKey: 'downloadSVG',
142
+ onclick: function () {
143
+ this.exportChart({
144
+ type: 'image/svg+xml'
145
+ });
146
+ }
147
+ }
148
+ // Enable this block to add "View SVG" to the dropdown menu
149
+ /*
150
+ ,{
151
+
152
+ text: 'View SVG',
153
+ onclick: function () {
154
+ var svg = this.getSVG()
155
+ .replace(/</g, '\n&lt;')
156
+ .replace(/>/g, '&gt;');
157
+
158
+ doc.body.innerHTML = '<pre>' + svg + '</pre>';
159
+ }
160
+ } // */
161
+ ]
162
+ }
163
+ }
164
+ };
165
+
166
+ // Add the Highcharts.post utility
167
+ Highcharts.post = function (url, data, formAttributes) {
168
+ var name,
169
+ form;
170
+
171
+ // create the form
172
+ form = createElement('form', merge({
173
+ method: 'post',
174
+ action: url,
175
+ enctype: 'multipart/form-data'
176
+ }, formAttributes), {
177
+ display: NONE
178
+ }, doc.body);
179
+
180
+ // add the data
181
+ for (name in data) {
182
+ createElement('input', {
183
+ type: HIDDEN,
184
+ name: name,
185
+ value: data[name]
186
+ }, null, form);
187
+ }
188
+
189
+ // submit
190
+ form.submit();
191
+
192
+ // clean up
193
+ discardElement(form);
194
+ };
195
+
196
+ extend(Chart.prototype, {
197
+
198
+ /**
199
+ * A collection of regex fixes on the produces SVG to account for expando properties,
200
+ * browser bugs, VML problems and other. Returns a cleaned SVG.
201
+ */
202
+ sanitizeSVG: function (svg) {
203
+ return svg
204
+ .replace(/zIndex="[^"]+"/g, '')
205
+ .replace(/isShadow="[^"]+"/g, '')
206
+ .replace(/symbolName="[^"]+"/g, '')
207
+ .replace(/jQuery[0-9]+="[^"]+"/g, '')
208
+ .replace(/url\([^#]+#/g, 'url(#')
209
+ .replace(/<svg /, '<svg xmlns:xlink="http://www.w3.org/1999/xlink" ')
210
+ .replace(/ (NS[0-9]+\:)?href=/g, ' xlink:href=') // #3567
211
+ .replace(/\n/, ' ')
212
+ // Any HTML added to the container after the SVG (#894)
213
+ .replace(/<\/svg>.*?$/, '</svg>')
214
+ // Batik doesn't support rgba fills and strokes (#3095)
215
+ .replace(/(fill|stroke)="rgba\(([ 0-9]+,[ 0-9]+,[ 0-9]+),([ 0-9\.]+)\)"/g, '$1="rgb($2)" $1-opacity="$3"')
216
+ /* This fails in IE < 8
217
+ .replace(/([0-9]+)\.([0-9]+)/g, function(s1, s2, s3) { // round off to save weight
218
+ return s2 +'.'+ s3[0];
219
+ })*/
220
+
221
+ // Replace HTML entities, issue #347
222
+ .replace(/&nbsp;/g, '\u00A0') // no-break space
223
+ .replace(/&shy;/g, '\u00AD') // soft hyphen
224
+
225
+ // IE specific
226
+ .replace(/<IMG /g, '<image ')
227
+ .replace(/<(\/?)TITLE>/g, '<$1title>')
228
+ .replace(/height=([^" ]+)/g, 'height="$1"')
229
+ .replace(/width=([^" ]+)/g, 'width="$1"')
230
+ .replace(/hc-svg-href="([^"]+)">/g, 'xlink:href="$1"/>')
231
+ .replace(/ id=([^" >]+)/g, ' id="$1"') // #4003
232
+ .replace(/class=([^" >]+)/g, 'class="$1"')
233
+ .replace(/ transform /g, ' ')
234
+ .replace(/:(path|rect)/g, '$1')
235
+ .replace(/style="([^"]+)"/g, function (s) {
236
+ return s.toLowerCase();
237
+ });
238
+ },
239
+
240
+ /**
241
+ * Return innerHTML of chart. Used as hook for plugins.
242
+ */
243
+ getChartHTML: function () {
244
+ return this.container.innerHTML;
245
+ },
246
+
247
+ /**
248
+ * Return an SVG representation of the chart
249
+ *
250
+ * @param additionalOptions {Object} Additional chart options for the generated SVG representation
251
+ */
252
+ getSVG: function (additionalOptions) {
253
+ var chart = this,
254
+ chartCopy,
255
+ sandbox,
256
+ svg,
257
+ seriesOptions,
258
+ sourceWidth,
259
+ sourceHeight,
260
+ cssWidth,
261
+ cssHeight,
262
+ html,
263
+ options = merge(chart.options, additionalOptions), // copy the options and add extra options
264
+ allowHTML = options.exporting.allowHTML;
265
+
266
+
267
+ // IE compatibility hack for generating SVG content that it doesn't really understand
268
+ if (!doc.createElementNS) {
269
+ doc.createElementNS = function (ns, tagName) {
270
+ return doc.createElement(tagName);
271
+ };
272
+ }
273
+
274
+ // create a sandbox where a new chart will be generated
275
+ sandbox = createElement(DIV, null, {
276
+ position: ABSOLUTE,
277
+ top: '-9999em',
278
+ width: chart.chartWidth + PX,
279
+ height: chart.chartHeight + PX
280
+ }, doc.body);
281
+
282
+ // get the source size
283
+ cssWidth = chart.renderTo.style.width;
284
+ cssHeight = chart.renderTo.style.height;
285
+ sourceWidth = options.exporting.sourceWidth ||
286
+ options.chart.width ||
287
+ (/px$/.test(cssWidth) && parseInt(cssWidth, 10)) ||
288
+ 600;
289
+ sourceHeight = options.exporting.sourceHeight ||
290
+ options.chart.height ||
291
+ (/px$/.test(cssHeight) && parseInt(cssHeight, 10)) ||
292
+ 400;
293
+
294
+ // override some options
295
+ extend(options.chart, {
296
+ animation: false,
297
+ renderTo: sandbox,
298
+ forExport: true,
299
+ renderer: 'SVGRenderer',
300
+ width: sourceWidth,
301
+ height: sourceHeight
302
+ });
303
+ options.exporting.enabled = false; // hide buttons in print
304
+ delete options.data; // #3004
305
+
306
+ // prepare for replicating the chart
307
+ options.series = [];
308
+ each(chart.series, function (serie) {
309
+ seriesOptions = merge(serie.options, {
310
+ animation: false, // turn off animation
311
+ enableMouseTracking: false,
312
+ showCheckbox: false,
313
+ visible: serie.visible
314
+ });
315
+
316
+ if (!seriesOptions.isInternal) { // used for the navigator series that has its own option set
317
+ options.series.push(seriesOptions);
318
+ }
319
+ });
320
+
321
+ // Axis options must be merged in one by one, since it may be an array or an object (#2022, #3900)
322
+ if (additionalOptions) {
323
+ each(['xAxis', 'yAxis'], function (axisType) {
324
+ each(splat(additionalOptions[axisType]), function (axisOptions, i) {
325
+ options[axisType][i] = merge(options[axisType][i], axisOptions);
326
+ });
327
+ });
328
+ }
329
+
330
+ // generate the chart copy
331
+ chartCopy = new Highcharts.Chart(options, chart.callback);
332
+
333
+ // reflect axis extremes in the export
334
+ each(['xAxis', 'yAxis'], function (axisType) {
335
+ each(chart[axisType], function (axis, i) {
336
+ var axisCopy = chartCopy[axisType][i],
337
+ extremes = axis.getExtremes(),
338
+ userMin = extremes.userMin,
339
+ userMax = extremes.userMax;
340
+
341
+ if (axisCopy && (userMin !== UNDEFINED || userMax !== UNDEFINED)) {
342
+ axisCopy.setExtremes(userMin, userMax, true, false);
343
+ }
344
+ });
345
+ });
346
+
347
+ // get the SVG from the container's innerHTML
348
+ svg = chartCopy.getChartHTML();
349
+
350
+ // free up memory
351
+ options = null;
352
+ chartCopy.destroy();
353
+ discardElement(sandbox);
354
+
355
+ // Move HTML into a foreignObject
356
+ if (allowHTML) {
357
+ html = svg.match(/<\/svg>(.*?$)/);
358
+ if (html) {
359
+ html = '<foreignObject x="0" y="0" width="200" height="200">' +
360
+ '<body xmlns="http://www.w3.org/1999/xhtml">' +
361
+ html[1] +
362
+ '</body>' +
363
+ '</foreignObject>';
364
+ svg = svg.replace('</svg>', html + '</svg>');
365
+ }
366
+ }
367
+
368
+ // sanitize
369
+ svg = this.sanitizeSVG(svg);
370
+
371
+ // IE9 beta bugs with innerHTML. Test again with final IE9.
372
+ svg = svg.replace(/(url\(#highcharts-[0-9]+)&quot;/g, '$1')
373
+ .replace(/&quot;/g, '\'');
374
+
375
+ return svg;
376
+ },
377
+
378
+ getSVGForExport: function (options, chartOptions) {
379
+ var chartExportingOptions = this.options.exporting;
380
+
381
+ return this.getSVG(merge(
382
+ { chart: { borderRadius: 0 } },
383
+ chartExportingOptions.chartOptions,
384
+ chartOptions,
385
+ {
386
+ exporting: {
387
+ sourceWidth: (options && options.sourceWidth) || chartExportingOptions.sourceWidth,
388
+ sourceHeight: (options && options.sourceHeight) || chartExportingOptions.sourceHeight
389
+ }
390
+ }
391
+ ));
392
+ },
393
+
394
+ /**
395
+ * Submit the SVG representation of the chart to the server
396
+ * @param {Object} options Exporting options. Possible members are url, type, width and formAttributes.
397
+ * @param {Object} chartOptions Additional chart options for the SVG representation of the chart
398
+ */
399
+ exportChart: function (options, chartOptions) {
400
+
401
+ var svg = this.getSVGForExport(options, chartOptions);
402
+
403
+ // merge the options
404
+ options = merge(this.options.exporting, options);
405
+
406
+ // do the post
407
+ Highcharts.post(options.url, {
408
+ filename: options.filename || 'chart',
409
+ type: options.type,
410
+ width: options.width || 0, // IE8 fails to post undefined correctly, so use 0
411
+ scale: options.scale || 2,
412
+ svg: svg
413
+ }, options.formAttributes);
414
+
415
+ },
416
+
417
+ /**
418
+ * Print the chart
419
+ */
420
+ print: function () {
421
+
422
+ var chart = this,
423
+ container = chart.container,
424
+ origDisplay = [],
425
+ origParent = container.parentNode,
426
+ body = doc.body,
427
+ childNodes = body.childNodes;
428
+
429
+ if (chart.isPrinting) { // block the button while in printing mode
430
+ return;
431
+ }
432
+
433
+ chart.isPrinting = true;
434
+ chart.pointer.reset(null, 0);
435
+
436
+ fireEvent(chart, 'beforePrint');
437
+
438
+ // hide all body content
439
+ each(childNodes, function (node, i) {
440
+ if (node.nodeType === 1) {
441
+ origDisplay[i] = node.style.display;
442
+ node.style.display = NONE;
443
+ }
444
+ });
445
+
446
+ // pull out the chart
447
+ body.appendChild(container);
448
+
449
+ // print
450
+ win.focus(); // #1510
451
+ win.print();
452
+
453
+ // allow the browser to prepare before reverting
454
+ setTimeout(function () {
455
+
456
+ // put the chart back in
457
+ origParent.appendChild(container);
458
+
459
+ // restore all body content
460
+ each(childNodes, function (node, i) {
461
+ if (node.nodeType === 1) {
462
+ node.style.display = origDisplay[i];
463
+ }
464
+ });
465
+
466
+ chart.isPrinting = false;
467
+
468
+ fireEvent(chart, 'afterPrint');
469
+
470
+ }, 1000);
471
+
472
+ },
473
+
474
+ /**
475
+ * Display a popup menu for choosing the export type
476
+ *
477
+ * @param {String} className An identifier for the menu
478
+ * @param {Array} items A collection with text and onclicks for the items
479
+ * @param {Number} x The x position of the opener button
480
+ * @param {Number} y The y position of the opener button
481
+ * @param {Number} width The width of the opener button
482
+ * @param {Number} height The height of the opener button
483
+ */
484
+ contextMenu: function (className, items, x, y, width, height, button) {
485
+ var chart = this,
486
+ navOptions = chart.options.navigation,
487
+ menuItemStyle = navOptions.menuItemStyle,
488
+ chartWidth = chart.chartWidth,
489
+ chartHeight = chart.chartHeight,
490
+ cacheName = 'cache-' + className,
491
+ menu = chart[cacheName],
492
+ menuPadding = mathMax(width, height), // for mouse leave detection
493
+ boxShadow = '3px 3px 10px #888',
494
+ innerMenu,
495
+ hide,
496
+ hideTimer,
497
+ menuStyle,
498
+ docMouseUpHandler = function (e) {
499
+ if (!chart.pointer.inClass(e.target, className)) {
500
+ hide();
501
+ }
502
+ };
503
+
504
+ // create the menu only the first time
505
+ if (!menu) {
506
+
507
+ // create a HTML element above the SVG
508
+ chart[cacheName] = menu = createElement(DIV, {
509
+ className: className
510
+ }, {
511
+ position: ABSOLUTE,
512
+ zIndex: 1000,
513
+ padding: menuPadding + PX
514
+ }, chart.container);
515
+
516
+ innerMenu = createElement(DIV, null,
517
+ extend({
518
+ MozBoxShadow: boxShadow,
519
+ WebkitBoxShadow: boxShadow,
520
+ boxShadow: boxShadow
521
+ }, navOptions.menuStyle), menu);
522
+
523
+ // hide on mouse out
524
+ hide = function () {
525
+ css(menu, { display: NONE });
526
+ if (button) {
527
+ button.setState(0);
528
+ }
529
+ chart.openMenu = false;
530
+ };
531
+
532
+ // Hide the menu some time after mouse leave (#1357)
533
+ addEvent(menu, 'mouseleave', function () {
534
+ hideTimer = setTimeout(hide, 500);
535
+ });
536
+ addEvent(menu, 'mouseenter', function () {
537
+ clearTimeout(hideTimer);
538
+ });
539
+
540
+
541
+ // Hide it on clicking or touching outside the menu (#2258, #2335, #2407)
542
+ addEvent(document, 'mouseup', docMouseUpHandler);
543
+ addEvent(chart, 'destroy', function () {
544
+ removeEvent(document, 'mouseup', docMouseUpHandler);
545
+ });
546
+
547
+
548
+ // create the items
549
+ each(items, function (item) {
550
+ if (item) {
551
+ var element = item.separator ?
552
+ createElement('hr', null, null, innerMenu) :
553
+ createElement(DIV, {
554
+ onmouseover: function () {
555
+ css(this, navOptions.menuItemHoverStyle);
556
+ },
557
+ onmouseout: function () {
558
+ css(this, menuItemStyle);
559
+ },
560
+ onclick: function (e) {
561
+ if (e) { // IE7
562
+ e.stopPropagation();
563
+ }
564
+ hide();
565
+ if (item.onclick) {
566
+ item.onclick.apply(chart, arguments);
567
+ }
568
+ },
569
+ innerHTML: item.text || chart.options.lang[item.textKey]
570
+ }, extend({
571
+ cursor: 'pointer'
572
+ }, menuItemStyle), innerMenu);
573
+
574
+
575
+ // Keep references to menu divs to be able to destroy them
576
+ chart.exportDivElements.push(element);
577
+ }
578
+ });
579
+
580
+ // Keep references to menu and innerMenu div to be able to destroy them
581
+ chart.exportDivElements.push(innerMenu, menu);
582
+
583
+ chart.exportMenuWidth = menu.offsetWidth;
584
+ chart.exportMenuHeight = menu.offsetHeight;
585
+ }
586
+
587
+ menuStyle = { display: 'block' };
588
+
589
+ // if outside right, right align it
590
+ if (x + chart.exportMenuWidth > chartWidth) {
591
+ menuStyle.right = (chartWidth - x - width - menuPadding) + PX;
592
+ } else {
593
+ menuStyle.left = (x - menuPadding) + PX;
594
+ }
595
+ // if outside bottom, bottom align it
596
+ if (y + height + chart.exportMenuHeight > chartHeight && button.alignOptions.verticalAlign !== 'top') {
597
+ menuStyle.bottom = (chartHeight - y - menuPadding) + PX;
598
+ } else {
599
+ menuStyle.top = (y + height - menuPadding) + PX;
600
+ }
601
+
602
+ css(menu, menuStyle);
603
+ chart.openMenu = true;
604
+ },
605
+
606
+ /**
607
+ * Add the export button to the chart
608
+ */
609
+ addButton: function (options) {
610
+ var chart = this,
611
+ renderer = chart.renderer,
612
+ btnOptions = merge(chart.options.navigation.buttonOptions, options),
613
+ onclick = btnOptions.onclick,
614
+ menuItems = btnOptions.menuItems,
615
+ symbol,
616
+ button,
617
+ symbolAttr = {
618
+ stroke: btnOptions.symbolStroke,
619
+ fill: btnOptions.symbolFill
620
+ },
621
+ symbolSize = btnOptions.symbolSize || 12;
622
+ if (!chart.btnCount) {
623
+ chart.btnCount = 0;
624
+ }
625
+
626
+ // Keeps references to the button elements
627
+ if (!chart.exportDivElements) {
628
+ chart.exportDivElements = [];
629
+ chart.exportSVGElements = [];
630
+ }
631
+
632
+ if (btnOptions.enabled === false) {
633
+ return;
634
+ }
635
+
636
+
637
+ var attr = btnOptions.theme,
638
+ states = attr.states,
639
+ hover = states && states.hover,
640
+ select = states && states.select,
641
+ callback;
642
+
643
+ delete attr.states;
644
+
645
+ if (onclick) {
646
+ callback = function (e) {
647
+ e.stopPropagation();
648
+ onclick.call(chart, e);
649
+ };
650
+
651
+ } else if (menuItems) {
652
+ callback = function () {
653
+ chart.contextMenu(
654
+ button.menuClassName,
655
+ menuItems,
656
+ button.translateX,
657
+ button.translateY,
658
+ button.width,
659
+ button.height,
660
+ button
661
+ );
662
+ button.setState(2);
663
+ };
664
+ }
665
+
666
+
667
+ if (btnOptions.text && btnOptions.symbol) {
668
+ attr.paddingLeft = Highcharts.pick(attr.paddingLeft, 25);
669
+
670
+ } else if (!btnOptions.text) {
671
+ extend(attr, {
672
+ width: btnOptions.width,
673
+ height: btnOptions.height,
674
+ padding: 0
675
+ });
676
+ }
677
+
678
+ button = renderer.button(btnOptions.text, 0, 0, callback, attr, hover, select)
679
+ .attr({
680
+ title: chart.options.lang[btnOptions._titleKey],
681
+ 'stroke-linecap': 'round'
682
+ });
683
+ button.menuClassName = options.menuClassName || PREFIX + 'menu-' + chart.btnCount++;
684
+
685
+ if (btnOptions.symbol) {
686
+ symbol = renderer.symbol(
687
+ btnOptions.symbol,
688
+ btnOptions.symbolX - (symbolSize / 2),
689
+ btnOptions.symbolY - (symbolSize / 2),
690
+ symbolSize,
691
+ symbolSize
692
+ )
693
+ .attr(extend(symbolAttr, {
694
+ 'stroke-width': btnOptions.symbolStrokeWidth || 1,
695
+ zIndex: 1
696
+ })).add(button);
697
+ }
698
+
699
+ button.add()
700
+ .align(extend(btnOptions, {
701
+ width: button.width,
702
+ x: Highcharts.pick(btnOptions.x, buttonOffset) // #1654
703
+ }), true, 'spacingBox');
704
+
705
+ buttonOffset += (button.width + btnOptions.buttonSpacing) * (btnOptions.align === 'right' ? -1 : 1);
706
+
707
+ chart.exportSVGElements.push(button, symbol);
708
+
709
+ },
710
+
711
+ /**
712
+ * Destroy the buttons.
713
+ */
714
+ destroyExport: function (e) {
715
+ var chart = e.target,
716
+ i,
717
+ elem;
718
+
719
+ // Destroy the extra buttons added
720
+ for (i = 0; i < chart.exportSVGElements.length; i++) {
721
+ elem = chart.exportSVGElements[i];
722
+
723
+ // Destroy and null the svg/vml elements
724
+ if (elem) { // #1822
725
+ elem.onclick = elem.ontouchstart = null;
726
+ chart.exportSVGElements[i] = elem.destroy();
727
+ }
728
+ }
729
+
730
+ // Destroy the divs for the menu
731
+ for (i = 0; i < chart.exportDivElements.length; i++) {
732
+ elem = chart.exportDivElements[i];
733
+
734
+ // Remove the event handler
735
+ removeEvent(elem, 'mouseleave');
736
+
737
+ // Remove inline events
738
+ chart.exportDivElements[i] = elem.onmouseout = elem.onmouseover = elem.ontouchstart = elem.onclick = null;
739
+
740
+ // Destroy the div by moving to garbage bin
741
+ discardElement(elem);
742
+ }
743
+ }
744
+ });
745
+
746
+
747
+ symbols.menu = function (x, y, width, height) {
748
+ var arr = [
749
+ M, x, y + 2.5,
750
+ L, x + width, y + 2.5,
751
+ M, x, y + height / 2 + 0.5,
752
+ L, x + width, y + height / 2 + 0.5,
753
+ M, x, y + height - 1.5,
754
+ L, x + width, y + height - 1.5
755
+ ];
756
+ return arr;
757
+ };
758
+
759
+ // Add the buttons on chart load
760
+ Chart.prototype.callbacks.push(function (chart) {
761
+ var n,
762
+ exportingOptions = chart.options.exporting,
763
+ buttons = exportingOptions.buttons;
764
+
765
+ buttonOffset = 0;
766
+
767
+ if (exportingOptions.enabled !== false) {
768
+
769
+ for (n in buttons) {
770
+ chart.addButton(buttons[n]);
771
+ }
772
+
773
+ // Destroy the export elements at chart destroy
774
+ addEvent(chart, 'destroy', chart.destroyExport);
775
+ }
776
+
777
+ });
778
+
779
+
780
+ }));