chart: {
events: {
selection: function (event) {
event.preventDefault();
event.xAxis[0].axis.chart.series[0].points.forEach(function (point) {
point.select(true, true);
})
}
},
zoomType: 'x'
},
示例是here,但我刚刚选择了这些点。
答案 0 :(得分:5)
您可以创建一个与选择填充完全相同的绘图带。
selection: function (e) {
e.preventDefault();
var axis = this.xAxis[0];
axis.removePlotBand('selection-plot-band');
axis.addPlotBand({
color: Highcharts.color('#335cad').setOpacity(0.25).get() //use Highcharts.Color in version 4,
from: e.xAxis[0].min,
to: e.xAxis[0].max,
id: 'selection-plot-band',
zIndex: 6
});
}