флот-чарты - внешний выбор баров - PullRequest
3 голосов
/ 24 мая 2011

Я использую flot http://code.google.com/p/flot/ и хотел бы выделить конкретную полосу в серии, когда пользователь наводит курсор на ссылку, кто-нибудь знает, как это сделать?

Приветствия

Тим

1 Ответ

4 голосов
/ 24 мая 2011

Что вам нужно, это 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);
});
...