解决导出png pdf问题

This commit is contained in:
tanghao
2019-01-03 16:48:11 +08:00
parent a72d23536d
commit f6fe894e77
2 changed files with 42 additions and 6 deletions

View File

@@ -277,13 +277,9 @@ License: www.highcharts.com/license
downloadPNG: { downloadPNG: {
textKey: "downloadPNG", textKey: "downloadPNG",
onclick: function () { onclick: function () {
console.log(this)
console.log(chart_main)
this.legend.itemStyle.color='#000000' this.legend.itemStyle.color='#000000'
this.exportChartLocal() this.exportChartLocal()
this.legend.itemStyle.color='#ffffff' this.legend.itemStyle.color='#ffffff'
console.log('ok')
console.log(this)
} }
}, },
downloadJPEG: { downloadJPEG: {

View File

@@ -266,8 +266,23 @@
dataLabels: { dataLabels: {
enabled: true, enabled: true,
allowOverlap: true, // 允许数据标签重叠 allowOverlap: true, // 允许数据标签重叠
color:'#000000'
}, },
}, },
xAxis: [{
labels: {
style: {
color: '#000000'
}
}
}],
yAxis: [{
labels: {
style: {
color: '#000000'
}
}
}]
} }
}, },
buttons: { buttons: {
@@ -473,7 +488,7 @@
data: [pktNum,byteLen], data: [pktNum,byteLen],
});*/ });*/
}); });
var chart = Highcharts.chart('chart_3',{ var chart = Highcharts.chart('chart_3',{
chart: { chart: {
backgroundColor: 'rgba(255, 255, 255, 0)', backgroundColor: 'rgba(255, 255, 255, 0)',
plotBackgroundColor:null, plotBackgroundColor:null,
@@ -492,7 +507,32 @@
exporting: { exporting: {
allowHTML:true, allowHTML:true,
filename:'App'+addDateName(), filename:'App'+addDateName(),
buttons: exportingButton('#415262') buttons: exportingButton('#415262'),
chartOptions: {
plotOptions: {
series: {
dataLabels: {
enabled: true,
color:'#000000'
}
}
},
xAxis: [{
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
labels: {
style: {
color: '#000000'
}
}
}],
yAxis: [{
labels: {
style: {
color: '#000000'
}
}
}]
}
}, },
noData:{ noData:{
style: {//设置字体颜色 style: {//设置字体颜色