flot图表 - 外部选择条 [英] flot charts - externally selecting bars

查看:139
本文介绍了flot图表 - 外部选择条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用flot http://code.google.com/p/flot/

I'm using flot http://code.google.com/p/flot/ and would like to highlight a particular bar in the series when the user hovers over a link, does anyone know how to do that?

干杯,

Tim

推荐答案

您正在寻找的是突出显示,其记录在 API.txt

The thing you're looking for is highlight, which is documented in the 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).


所以你的代码看起来像这样:

So your code would look something like this:

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

这篇关于flot图表 - 外部选择条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆