2
所以我在单个页面上有多个高图。其中一些图(行)在一张图上包含多个系列。我遇到的问题是能够为一个或两个系列选择多个点。Highcharts - 多个Y轴
这里是什么,我试图做一些示例代码,但它给了我的问题......
function hc_json(series, hc_id) {
$('#' + hc_id).highcharts('StockChart', {
chart: {
events: { //Sets an event listener for the chart
/*
* If an event is registered it checks if the external zoom/selects are checked.
* If select is checked it gets the data points that were within the range at sets
* them as selected.
*/
selection: function(event) {
var mode = $('input[name=mode]:checked', '#' + hc_id + '_control').val();
if (mode != hc_id + '_zoom') {
for (var i = 0; i < this.series.length; i++)
{
console.log("Series: ", this.series);
console.log("Series length: ", this.series.length);
var points = this.series[i].points; // visible points
var xs = event.xAxis[0]; //There seems to be no min/max forxAxis[1]
$.each(points, function (i,p) {
if (p.x >= xs.min && p.x <= xs.max) {
console.log("Point:", p.x, "is selected");
p.select(true, true);
}
});
//return false;
}
return false;
}
},
},
因此,举例来说,我希望能够在图表上选择点一但我希望能够区分我想要选择的系列。我阅读了一些“可见”系列文章,但还没有弄清楚如何让一个系列可见或不可见。
太谢谢你了!这正是我所期待的! – cmircovich