2011-05-24 80 views

回答

4

你正在尋找的東西是highlight,這是記錄在API.txt

highlight(series, datapoint) 

Highlight a specific datapoint in the data series. You can either 
specify the actual objects, e.g. if you got them from a 
"plotclick" event, or you can specify the indices, e.g. 
highlight(1, 3) to highlight the fourth point in the second series 
(remember, zero-based indexing). 

所以,你的代碼看起來是這樣的這個:

//before this, $.plot has been called and assigned to "plot" 
$('#mylink').mouseover(function(){ 
    plot.highlight(1,3); 
}).mouseout(function(){ 
    plot.unhighlight(1,3); 
}); 
+0

我怎樣才能得到高亮區域的data.label值? – 2014-01-24 09:05:55

+0

是否可以更新圖表而無需重新加載頁面?例如有一個更新圖表數據的按鈕。 – 2014-01-24 09:45:55

+0

@OkiErieRinaldi - 它當然可以 - 在[flot網站](http://www.flotcharts.org/)的首頁查看圖表。 – Ryley 2014-01-24 16:10:05