From 85e65a86ab7133085eeac11e46762118c3cdeab6 Mon Sep 17 00:00:00 2001 From: zhangwei Date: Sun, 30 Dec 2018 14:55:55 +0600 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E5=9B=BE=E6=A0=87=E7=9A=84?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=A2=9E=E5=8A=A0PNG=E5=92=8CPDF=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/dashboard/trafficActionTransList.jsp | 1 + .../WEB-INF/views/dashboard/trafficAppTypeList.jsp | 9 +++++++++ .../WEB-INF/views/dashboard/trafficBandwidthList.jsp | 1 + .../WEB-INF/views/dashboard/trafficDomainTrans.jsp | 1 + .../WEB-INF/views/dashboard/trafficIpActiveList.jsp | 3 ++- .../WEB-INF/views/dashboard/trafficPortActiveList.jsp | 1 + .../views/dashboard/trafficProtocolTypeList.jsp | 9 +++++++++ .../WEB-INF/views/dashboard/trafficWebTypeList.jsp | 11 +++++++++++ .../static/global/plugins/highcharts/js/exporting.js | 8 ++++---- 9 files changed, 39 insertions(+), 5 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp index 4ea77f05f..c56cee2b8 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp @@ -115,6 +115,7 @@ function showActionTransChart(xData,series){ menuItems: [ Highcharts.getOptions().exporting.buttons.contextButton.menuItems[0],// 打印 Highcharts.getOptions().exporting.buttons.contextButton.menuItems[1],// jpeg + 'downloadPNG','downloadPDF', Highcharts.getOptions().exporting.buttons.contextButton.menuItems[4],// excel Highcharts.getOptions().exporting.buttons.contextButton.menuItems[3],// cvs ] diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp index 0dcebbcfc..3aa94612a 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp @@ -356,6 +356,15 @@ function protocolTypeChart(rs){ scale:1, sourceWidth: 1280, sourceHeight: 500, + buttons: { + contextButton: { + menuItems: [ + Highcharts.getOptions().exporting.buttons.contextButton.menuItems[0],// 打印 + Highcharts.getOptions().exporting.buttons.contextButton.menuItems[1],// jpeg + 'downloadPNG','downloadPDF' + ] + } + } }, noData:{ style: {//设置字体颜色 diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp index 5bd6459ee..c2c1a9a07 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp @@ -293,6 +293,7 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ menuItems: [ Highcharts.getOptions().exporting.buttons.contextButton.menuItems[0],// 打印 Highcharts.getOptions().exporting.buttons.contextButton.menuItems[1],// jpeg + 'downloadPNG','downloadPDF', Highcharts.getOptions().exporting.buttons.contextButton.menuItems[4],// excel Highcharts.getOptions().exporting.buttons.contextButton.menuItems[3],// cvs ] diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp index 349c723ed..900278a3a 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp @@ -111,6 +111,7 @@ function showDomainTrans(xData,series){ menuItems: [ Highcharts.getOptions().exporting.buttons.contextButton.menuItems[0],// 打印 Highcharts.getOptions().exporting.buttons.contextButton.menuItems[1],// jpeg + 'downloadPNG','downloadPDF', Highcharts.getOptions().exporting.buttons.contextButton.menuItems[4],// excel Highcharts.getOptions().exporting.buttons.contextButton.menuItems[3],// cvs ] diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp index ecbf6e068..ada214487 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp @@ -194,8 +194,9 @@ function showIpActiveChart(xData,series){ menuItems: [ Highcharts.getOptions().exporting.buttons.contextButton.menuItems[0],// 打印 Highcharts.getOptions().exporting.buttons.contextButton.menuItems[1],// jpeg + 'downloadPNG','downloadPDF', Highcharts.getOptions().exporting.buttons.contextButton.menuItems[4],// excel - Highcharts.getOptions().exporting.buttons.contextButton.menuItems[3],// cvs + Highcharts.getOptions().exporting.buttons.contextButton.menuItems[3]// cvs ] } } diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp index 5ab6bb519..2b9c6f5cf 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp @@ -126,6 +126,7 @@ function showPortActiveChart(xData,series){ menuItems: [ Highcharts.getOptions().exporting.buttons.contextButton.menuItems[0],// 打印 Highcharts.getOptions().exporting.buttons.contextButton.menuItems[1],// jpeg + 'downloadPNG','downloadPDF', Highcharts.getOptions().exporting.buttons.contextButton.menuItems[4],// excel Highcharts.getOptions().exporting.buttons.contextButton.menuItems[3],// cvs ] diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp index 7cec1ad53..e79cd81a3 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp @@ -351,6 +351,15 @@ function protocolTypeChart(rs){ scale:1, sourceWidth: 1280, sourceHeight: 500, + buttons: { + contextButton: { + menuItems: [ + Highcharts.getOptions().exporting.buttons.contextButton.menuItems[0],// 打印 + Highcharts.getOptions().exporting.buttons.contextButton.menuItems[1],// jpeg + 'downloadPNG','downloadPDF' + ] + } + } }, noData:{ style: {//设置字体颜色 diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp index cead57a20..5744ab6c1 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp @@ -443,6 +443,17 @@ function webTypeChart(rs){ scale:1, sourceWidth: 1280, sourceHeight: 500, + buttons: { + contextButton: { + menuItems: [ + Highcharts.getOptions().exporting.buttons.contextButton.menuItems[0],// 打印 + Highcharts.getOptions().exporting.buttons.contextButton.menuItems[1],// jpeg + 'downloadPNG','downloadPDF', + Highcharts.getOptions().exporting.buttons.contextButton.menuItems[4],// excel + Highcharts.getOptions().exporting.buttons.contextButton.menuItems[3],// cvs + ] + } + } }, noData:{ style: {//设置字体颜色 diff --git a/src/main/webapp/static/global/plugins/highcharts/js/exporting.js b/src/main/webapp/static/global/plugins/highcharts/js/exporting.js index 20b9b35c3..3fd709679 100644 --- a/src/main/webapp/static/global/plugins/highcharts/js/exporting.js +++ b/src/main/webapp/static/global/plugins/highcharts/js/exporting.js @@ -7,10 +7,10 @@ License: www.highcharts.com/license */ (function(l){"object"===typeof module&&module.exports?module.exports=l:"function"===typeof define&&define.amd?define(function(){return l}):l("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(l){(function(g){var y=g.defaultOptions,z=g.doc,l=g.Chart,q=g.addEvent,I=g.removeEvent,C=g.fireEvent,t=g.createElement,D=g.discardElement,r=g.css,p=g.merge,u=g.pick,E=g.objectEach,x=g.extend,J=g.isTouchDevice,A=g.win,G=A.navigator.userAgent,F=g.SVGRenderer,H=g.Renderer.prototype.symbols,K=/Edge\/|Trident\/|MSIE /.test(G), -L=/firefox/i.test(G);x(y.lang,{printChart:"Print chart"/*,downloadPNG:"Download PNG image"*/,downloadJPEG:"Download image"/*,downloadPDF:"Download PDF document",downloadSVG:"Download SVG vector image"*/,contextButtonTitle:"Chart context menu"});y.navigation||(y.navigation={});p(!0,y.navigation,{buttonOptions:{theme:{},symbolSize:14,symbolX:12.5,symbolY:10.5,align:"right",buttonSpacing:3,height:22,verticalAlign:"top",width:24}});p(!0,y.navigation,{menuStyle:{border:"1px solid #999999",background:"#ffffff", +L=/firefox/i.test(G);x(y.lang,{printChart:"Print chart",downloadPNG:"Download PNG image",downloadJPEG:"Download JPG image",downloadPDF:"Download PDF document",downloadSVG:"Download SVG vector image",contextButtonTitle:"Chart context menu"});y.navigation||(y.navigation={});p(!0,y.navigation,{buttonOptions:{theme:{},symbolSize:14,symbolX:12.5,symbolY:10.5,align:"right",buttonSpacing:3,height:22,verticalAlign:"top",width:24}});p(!0,y.navigation,{menuStyle:{border:"1px solid #999999",background:"#ffffff", padding:"5px 0"},menuItemStyle:{padding:"0.5em 1em",color:"#333333",background:"none",fontSize:J?"14px":"11px",transition:"background 250ms, color 250ms"},menuItemHoverStyle:{background:"#335cad",color:"#ffffff"},buttonOptions:{symbolFill:"#666666",symbolStroke:"#666666",symbolStrokeWidth:3,theme:{padding:5}}});y.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:"printChart downloadJPEG".split(" ")}},menuItemDefinitions:{printChart:{textKey:"printChart",onclick:function(){this.print()}}/*,separator:{separator:!0},downloadPNG:{textKey:"downloadPNG",onclick:function(){this.exportChart()}}*/,downloadJPEG:{textKey:"downloadJPEG",onclick:function(){this.exportChart({type:"image/jpeg"})}},/*downloadPDF:{textKey:"downloadPDF",onclick:function(){this.exportChart({type:"application/pdf"})}},*/ -/*downloadSVG:{textKey:"downloadSVG",onclick:function(){this.exportChart({type:"image/svg+xml"})}}*/}};g.post=function(b,a,d){var c=t("form",p({method:"post",action:b,enctype:"multipart/form-data"},d),{display:"none"},z.body);E(a,function(a,b){t("input",{type:"hidden",name:b,value:a},null,c)});c.submit();D(c)};x(l.prototype,{sanitizeSVG:function(b,a){if(a&&a.exporting&&a.exporting.allowHTML){var d=b.match(/<\/svg>(.*?$)/);d&&d[1]&&(d='\x3cforeignObject x\x3d"0" y\x3d"0" width\x3d"'+a.chart.width+'" height\x3d"'+ +symbol:"menu",titleKey:"contextButtonTitle",menuItems:"printChart downloadJPEG".split(" ")}},menuItemDefinitions:{printChart:{textKey:"printChart",onclick:function(){this.print()}},separator:{separator:!0},downloadPNG:{textKey:"downloadPNG",onclick:function(){this.exportChart()}},downloadJPEG:{textKey:"downloadJPEG",onclick:function(){this.exportChart({type:"image/jpeg"})}},downloadPDF:{textKey:"downloadPDF",onclick:function(){this.exportChart({type:"application/pdf"})}}, +downloadSVG:{textKey:"downloadSVG",onclick:function(){this.exportChart({type:"image/svg+xml"})}}}};g.post=function(b,a,d){var c=t("form",p({method:"post",action:b,enctype:"multipart/form-data"},d),{display:"none"},z.body);E(a,function(a,b){t("input",{type:"hidden",name:b,value:a},null,c)});c.submit();D(c)};x(l.prototype,{sanitizeSVG:function(b,a){if(a&&a.exporting&&a.exporting.allowHTML){var d=b.match(/<\/svg>(.*?$)/);d&&d[1]&&(d='\x3cforeignObject x\x3d"0" y\x3d"0" width\x3d"'+a.chart.width+'" height\x3d"'+ a.chart.height+'"\x3e\x3cbody xmlns\x3d"http://www.w3.org/1999/xhtml"\x3e'+d[1]+"\x3c/body\x3e\x3c/foreignObject\x3e",b=b.replace("\x3c/svg\x3e",d+"\x3c/svg\x3e"))}b=b.replace(/zIndex="[^"]+"/g,"").replace(/symbolName="[^"]+"/g,"").replace(/jQuery[0-9]+="[^"]+"/g,"").replace(/url\(("|")(\S+)("|")\)/g,"url($2)").replace(/url\([^#]+#/g,"url(#").replace(/.*?$/, "\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(/ /g,"\u00a0").replace(/­/g,"\u00ad");this.ieSanitizeSVG&&(b=this.ieSanitizeSVG(b));return b},getChartHTML:function(){this.styledMode&&this.inlineStyles();return this.container.innerHTML},getSVG:function(b){var a,d,c,w,m,h=p(this.options,b);d=t("div",null,{position:"absolute",top:"-9999em",width:this.chartWidth+"px",height:this.chartHeight+"px"},z.body);c= this.renderTo.style.width;m=this.renderTo.style.height;c=h.exporting.sourceWidth||h.chart.width||/px$/.test(c)&&parseInt(c,10)||(h.isGantt?800:600);m=h.exporting.sourceHeight||h.chart.height||/px$/.test(m)&&parseInt(m,10)||400;x(h.chart,{animation:!1,renderTo:d,forExport:!0,renderer:"SVGRenderer",width:c,height:m});h.exporting.enabled=!1;delete h.data;h.series=[];this.series.forEach(function(a){w=p(a.userOptions,{animation:!1,enableMouseTracking:!1,showCheckbox:!1,visible:a.visible});w.isInternal|| @@ -31,4 +31,4 @@ e[d.nodeName]||(n=k.getElementsByTagName("svg")[0],w=k.createElementNS(d.namespa l=d.inlineWhitelist,h=d.unstyledElements,e={},n,k,d=z.createElement("iframe");r(d,{width:"1px",height:"1px",visibility:"hidden"});z.body.appendChild(d);k=d.contentWindow.document;k.open();k.write('\x3csvg xmlns\x3d"http://www.w3.org/2000/svg"\x3e\x3c/svg\x3e');k.close();a(this.container.querySelector("svg"));n.parentNode.removeChild(n)};H.menu=function(b,a,d,c){return["M",b,a+2.5,"L",b+d,a+2.5,"M",b,a+c/2+.5,"L",b+d,a+c/2+.5,"M",b,a+c-1.5,"L",b+d,a+c-1.5]};H.menuball=function(b,a,d,c){b=[];c=c/3- 2;return b=b.concat(this.circle(d-c,a,c,c),this.circle(d-c,a+c+4,c,c),this.circle(d-c,a+2*(c+4),c,c))};l.prototype.renderExporting=function(){var b=this,a=b.options.exporting,d=a.buttons,c=b.isDirtyExporting||!b.exportSVGElements;b.buttonOffset=0;b.isDirtyExporting&&b.destroyExport();c&&!1!==a.enabled&&(b.exportEvents=[],b.exportingGroup=b.exportingGroup||b.renderer.g("exporting-group").attr({zIndex:3}).add(),E(d,function(a){b.addButton(a)}),b.isDirtyExporting=!1);q(b,"destroy",b.destroyExport)}; q(l,"init",function(){var b=this;["exporting","navigation"].forEach(function(a){b[a]={update:function(d,c){b.isDirtyExporting=!0;p(!0,b.options[a],d);u(c,!0)&&b.redraw()}}})});l.prototype.callbacks.push(function(b){b.renderExporting();q(b,"redraw",b.renderExporting)})})(l)}); -//# sourceMappingURL=exporting.js.map \ No newline at end of file +// # sourceMappingURL=exporting.js.map