修复打印字体不显示问题以及格式化时间展示

This commit is contained in:
tanghao
2019-01-03 18:11:00 +08:00
parent 3c28bb7514
commit f7795f7172
10 changed files with 188 additions and 26 deletions

View File

@@ -190,6 +190,18 @@
},
min:0
},
tooltip: {
dateTimeLabelFormats: {
millisecond: '%Y-%m-%d %H:%M:%S',
second: '%Y-%m-%d %H:%M:%S',
minute: '%Y-%m-%d %H:%M:%S',
hour: '%Y-%m-%d %H:%M:%S',
day: '%Y-%m-%d %H:%M:%S',
week: '%Y-%m-%d %H:%M:%S',
month: '%Y-%m-%d %H:%M:%S',
year: '%Y-%m-%d %H:%M:%S'
}
},
credits : {//是否有highcharts水印
enabled : false
},

View File

@@ -162,6 +162,18 @@ function showActionTransChart(xData,series){
},
min:0
},
tooltip: {
dateTimeLabelFormats: {
millisecond: '%Y-%m-%d %H:%M:%S',
second: '%Y-%m-%d %H:%M:%S',
minute: '%Y-%m-%d %H:%M:%S',
hour: '%Y-%m-%d %H:%M:%S',
day: '%Y-%m-%d %H:%M:%S',
week: '%Y-%m-%d %H:%M:%S',
month: '%Y-%m-%d %H:%M:%S',
year: '%Y-%m-%d %H:%M:%S'
}
},
credits:{//是否有highcharts水印
enabled:false
},

View File

@@ -449,7 +449,17 @@ function protocolTypeChart(rs){
},
tooltip: {
headerFormat: '{series.name}<br>',
pointFormat: '{point.name}: <b>{point.percentage:.2f}%</b>'
pointFormat: '{point.name}: <b>{point.percentage:.2f}%</b>',
dateTimeLabelFormats: {
millisecond: '%Y-%m-%d %H:%M:%S',
second: '%Y-%m-%d %H:%M:%S',
minute: '%Y-%m-%d %H:%M:%S',
hour: '%Y-%m-%d %H:%M:%S',
day: '%Y-%m-%d %H:%M:%S',
week: '%Y-%m-%d %H:%M:%S',
month: '%Y-%m-%d %H:%M:%S',
year: '%Y-%m-%d %H:%M:%S'
}
},
series: [{
name: "App",

View File

@@ -158,6 +158,18 @@ function showDomainTrans(xData,series){
legend: {
enabled:false
},
tooltip: {
dateTimeLabelFormats: {
millisecond: '%Y-%m-%d %H:%M:%S',
second: '%Y-%m-%d %H:%M:%S',
minute: '%Y-%m-%d %H:%M:%S',
hour: '%Y-%m-%d %H:%M:%S',
day: '%Y-%m-%d %H:%M:%S',
week: '%Y-%m-%d %H:%M:%S',
month: '%Y-%m-%d %H:%M:%S',
year: '%Y-%m-%d %H:%M:%S'
}
},
plotOptions: {
series: {
lineWidth:1,

View File

@@ -250,8 +250,19 @@ function showIpActiveChart(xData,series){
}
},
tooltip: {
pointFormat: '<b><spring:message code="ip"/>:</b>{series.name} <b><spring:message code="count"/>:</b>{point.y}<br/>'
},
pointFormat: '<b><spring:message code="ip"/>:</b>{series.name} <b><spring:message code="count"/>:</b>{point.y}<br/>',
dateTimeLabelFormats: {
millisecond: '%Y-%m-%d %H:%M:%S',
second: '%Y-%m-%d %H:%M:%S',
minute: '%Y-%m-%d %H:%M:%S',
hour: '%Y-%m-%d %H:%M:%S',
day: '%Y-%m-%d %H:%M:%S',
week: '%Y-%m-%d %H:%M:%S',
month: '%Y-%m-%d %H:%M:%S',
year: '%Y-%m-%d %H:%M:%S'
}
},
yAxis: {
title: {
text: 'bytes'

View File

@@ -188,6 +188,18 @@ function showPortActiveChart(xData,series){
text: 'bytes'
}
},
tooltip: {
dateTimeLabelFormats: {
millisecond: '%Y-%m-%d %H:%M:%S',
second: '%Y-%m-%d %H:%M:%S',
minute: '%Y-%m-%d %H:%M:%S',
hour: '%Y-%m-%d %H:%M:%S',
day: '%Y-%m-%d %H:%M:%S',
week: '%Y-%m-%d %H:%M:%S',
month: '%Y-%m-%d %H:%M:%S',
year: '%Y-%m-%d %H:%M:%S'
}
},
credits:{//是否有highcharts水印
enabled:false
},

View File

@@ -442,8 +442,18 @@ function protocolTypeChart(rs){
},
tooltip: {
headerFormat: '{series.name}<br>',
pointFormat: '{point.name}: <b>{point.percentage:.2f}%</b>'
},
pointFormat: '{point.name}: <b>{point.percentage:.2f}%</b>',
dateTimeLabelFormats: {
millisecond: '%Y-%m-%d %H:%M:%S',
second: '%Y-%m-%d %H:%M:%S',
minute: '%Y-%m-%d %H:%M:%S',
hour: '%Y-%m-%d %H:%M:%S',
day: '%Y-%m-%d %H:%M:%S',
week: '%Y-%m-%d %H:%M:%S',
month: '%Y-%m-%d %H:%M:%S',
year: '%Y-%m-%d %H:%M:%S'
}
},
series: [{
name: "Protocol",
colorByPoint: true,

View File

@@ -535,7 +535,17 @@ function webTypeChart(rs){
},
tooltip: {
headerFormat: '{series.name}<br>',
pointFormat: '{point.name}: <b>{point.percentage:.2f}%</b>'
pointFormat: '{point.name}: <b>{point.percentage:.2f}%</b>',
dateTimeLabelFormats: {
millisecond: '%Y-%m-%d %H:%M:%S',
second: '%Y-%m-%d %H:%M:%S',
minute: '%Y-%m-%d %H:%M:%S',
hour: '%Y-%m-%d %H:%M:%S',
day: '%Y-%m-%d %H:%M:%S',
week: '%Y-%m-%d %H:%M:%S',
month: '%Y-%m-%d %H:%M:%S',
year: '%Y-%m-%d %H:%M:%S'
}
},
series: [{
name: "Domain",

View File

@@ -285,9 +285,11 @@ License: www.highcharts.com/license
downloadJPEG: {
textKey: "downloadJPEG",
onclick: function () {
this.legend.itemStyle.color='#000000'
this.exportChartLocal({
type: "image/jpeg"
})
this.legend.itemStyle.color='#ffffff'
}
},
downloadSVG: {

View File

@@ -4,10 +4,66 @@
chart: {
events: {
beforePrint: function () {
chart_main.xAxis[0].update({
labels:{
style:{
color:'#000000'
}
}
})
chart_3.xAxis[0].update({
labels:{
style:{
color:'#000000'
}
}
})
chart_main.yAxis[0].update({
labels:{
style:{
color:'#000000'
}
}
})
chart_3.yAxis[0].update({
labels:{
style:{
color:'#000000'
}
}
})
$('.highcharts-legend text').css('color','#000000');
$('.highcharts-legend text').css('fill','#000000');
},
afterPrint: function () {
chart_3.xAxis[0].update({
labels:{
style:{
color:'#ffffff'
}
}
})
chart_main.xAxis[0].update({
labels:{
style:{
color:'#ffffff'
}
}
})
chart_main.yAxis[0].update({
labels:{
style:{
color:'#ffffff'
}
}
})
chart_3.yAxis[0].update({
labels:{
style:{
color:'#ffffff'
}
}
})
$('.highcharts-legend text').css('color','#ffffff');
$('.highcharts-legend text').css('fill','#ffffff');
}
@@ -67,6 +123,9 @@
allowHTML:true,
filename:'Protocol-Type'+addDateName(),
chartOptions: {
chart:{
backgroundColor: 'rgba(255, 255, 255, 1)'
},
plotOptions: {
series: {
dataLabels: {
@@ -240,7 +299,7 @@
data: [pktNum,byteLen],
});*/
});
var chart = Highcharts.chart('chart_main', {
chart_main = Highcharts.chart('chart_main', {
chart: {
backgroundColor: 'rgba(255, 255, 255, 0)',
plotBackgroundColor:null,
@@ -268,25 +327,25 @@
series: {
dataLabels: {
enabled: true,
allowOverlap: true, // 允许数据标签重叠
color:'#000000'
},
},
xAxis: [{
labels: {
style: {
color: '#000000'
}
color:'#000000'
}
}],
yAxis: [{
labels: {
style: {
color: '#000000'
}
}
},
xAxis: [{
categories: xData,
labels: {
style: {
color: '#000000'
}
}]
}
}
}],
yAxis: [{
labels: {
style: {
color: '#000000'
}
}
}]
},
buttons: {
contextButton: {
@@ -491,7 +550,7 @@
data: [pktNum,byteLen],
});*/
});
var chart = Highcharts.chart('chart_3',{
chart_3 = Highcharts.chart('chart_3',{
chart: {
backgroundColor: 'rgba(255, 255, 255, 0)',
plotBackgroundColor:null,
@@ -524,7 +583,7 @@
}
},
xAxis: [{
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
categories: xData,
labels: {
style: {
color: '#000000'
@@ -691,6 +750,9 @@ function echart_2(rs){
allowHTML:true,
filename:'BS'+addDateName(),
chartOptions: {
chart:{
backgroundColor: 'rgba(255, 255, 255, 1)'
},
plotOptions: {
series: {
dataLabels: {
@@ -844,6 +906,9 @@ function echart_5(rs){
allowHTML:true,
filename:'BS'+addDateName(),
chartOptions: {
chart:{
backgroundColor: 'rgba(255, 255, 255, 1)'
},
plotOptions: {
series: {
dataLabels: {
@@ -992,6 +1057,9 @@ function echart_4(rs){
allowHTML:true,
filename:'Website'+addDateName(),
chartOptions: {
chart:{
backgroundColor: 'rgba(255, 255, 255, 1)'
},
plotOptions: {
series: {
dataLabels: {
@@ -1139,6 +1207,9 @@ function echart_6(rs){
allowHTML:true,
filename:'Website'+addDateName(),
chartOptions: {
chart:{
backgroundColor: 'rgba(255, 255, 255, 1)'
},
plotOptions: {
series: {
dataLabels: {