我认为你有两个选择:
如果您在开始时不知道最小/最大值,则可以在legendItemClick中更改它们,如下所示:
plotOptions: {
series: {
events: {
legendItemClick: function() {
var temperatur = this.chart.series[0];
var taupunkt = this.chart.series[1];
var other = this.name=="Lufttemperatur"?taupunkt:temperatur;
var element = this;
if(this.name == "Lufttemperatur" || this.name == "Taupunkt") {
if(this.visible && !other.visible) {
//both will be invisible soon
this.chart.yAxis[0].update({
min:element.yAxis.min,
max:element.yAxis.max
});
} else {
//one will be visible
this.chart.yAxis[0].update({
min:null,
max:null
});
}
}
}
}
},
}
这将只设置最小值/最大值,如果没有你的一系列可见的一个,但删除它,如果你有一个可见的
FYI:第二个“图”是一个简单的HTML表格 - 无关highcharts – Neysor 2014-10-03 08:40:57