views:

26

answers:

0

Using jQuery's flot, there's a way to allow items to be selected by hovering over them. In the options, grid[mouseActiveRadius] may be set to a number to indicate the desired length of the radius of the selection circle.

For instance, if you set it to 10, then any mouse hover event will highlight the closest point in a 10 pixel radius circle.

However, I wish to instead tell flot to hover the point that's the closest in the x direction (instead of the closest point period).

EG in this example: point 1 is obviously a lot closer to x than point 2, but I still want flot to select point 2 since it is closer in the x direction.

           x
1







          2

Is there a way to do this with plugins/built in functionality, or do I need to write a function extending flot's default behavior?