Highcharts 的导出方式根据用户的交互使用图表的初始状态而不是最新状态。如果您显示/隐藏某些系列,然后导出图表,您仍然会得到所有系列,而不是图表实际显示的内容。
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'chart',
defaultSeriesType: 'line',
},
title: {
text: 'Expression Profile',
},
subtitle: {
text: 'Reference: act'
},
xAxis: {
categories: ['14das-seedling','25das-aerial','35das-aerial',
'42das-rosette','42das-stem','53das-stem',
'53das-inflores'],
title: {
text: 'Development stages',
margin:20
}
},
yAxis: {
title: {
text: 'Log10 act'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
legend: {
margin:20
},
tooltip: {
formatter: function() {
return '<b>mir'+ this.series.name +'</b><br/>'+
this.x +' <br/>log10:'+ this.y ;
}
},
series: [
{
name: '156a',
data: [-2.75607, -3.41066, -4.10053, -4.63856,
-4.73462,-4.6145,-3.90987]
},
{
name: '156b',
data: [-4.15935, -6.54969, -6.70229, -5.80646,
-5.68092,-5.38481,-5.96406]
},
{
name: '156c',
data: [-4.83317, -5.52142, -4.94995, -5.47179,
-4.97123,-4.86163,-5.12806]
},
{
name: '156d',
data: [0, -5.93499, -5.41856, -5.88918,
-6.70304,-5.69335,-5.39792]
},
{
name: '156e',
data: [-4.0707, -6.1185, -6.58353, -6.17734,
-6.84433,-5.4114,-5.37817]
},
{
name: '156f',
data: [-3.97561, -5.02619, -5.67834, -5.65722,
-5.76238,-4.51125,-5.30344]
},
{
name: '156g',
data: [-3.81589, -2.50758, -2.41623, -3.63983,
-3.73004,-2.90055,-3.61997]
},
{
name: '156h',
data: [-4.31169, -5.74017, -5.55419, -5.26679,
-5.01009,-4.99596,-5.68062]
}
]
});
});
这是我的小提琴:http: //jsfiddle.net/sherlock85/safKs/
是否可以导出图表的当前状态?
任何帮助,将不胜感激。