Flot图表 - 外部选择条形图

3
我正在使用flot http://code.google.com/p/flot/,希望当用户悬停在链接上时,可以突出显示系列中的特定条形图。请问有人知道如何实现吗?
谢谢,
Tim
1个回答

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);
});

如何获取高亮区域的data.label值? - Oki Erie Rinaldi
它能否在不重新加载页面的情况下更新图表?例如,是否有一个按钮来更新图表数据。 - Oki Erie Rinaldi
@OkiErieRinaldi - 当然可以 - 请查看flot网站主页上的图表。 - Ryley

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接