flot charts – 外部选择栏

我正在使用flot http://code.google.com/p/flot/,并希望在用户将鼠标hover在链接上时突出显示该系列中的特定栏,有人知道该怎么做吗?

干杯,

蒂姆

你正在寻找的东西是highlight ,它在API.txt中有记录 :

 highlight(series, datapoint) Highlight a specific datapoint in the data series. You can either specify the actual objects, eg if you got them from a "plotclick" event, or you can specify the indices, eg 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); });