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