# Hover event does not contain points

**URL:** <https://community.plotly.com/t/hover-event-does-not-contain-points/3655>\
**Category:** plotly.js\
**Created:** [March 16, 2017, 2:11pm UTC](https://community.plotly.com/t/hover-event-does-not-contain-points/3655 "2017-03-16T14:11:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![heartmax](https://avatars.discourse-cdn.com/v4/letter/h/e0b2c6/32.png) [@heartmax](https://community.plotly.com/u/heartmax)\
**Post date:** [March 16, 2017, 2:11pm UTC](https://community.plotly.com/t/hover-event-does-not-contain-points/3655/1 "2017-03-16T14:11:30Z")

</div>

Hi,

I need the x-axis values, when hovering over my plotly chart. According to the plotly docs ([https://plot.ly/javascript/hover-events/](https://plot.ly/javascript/hover-events/)) the hover event callback should contain the field “points” from which I should get the x value.

But if you look at this basic example you can see that the callback does not contain the field “points”. Also other fields like “data” are undefined:  
[https://jsfiddle.net/c1kt3r82/158/](https://jsfiddle.net/c1kt3r82/158/)

What am I doing wrong? 🙂

Thanks in advance,  
Max

---

<div class="post-metadata">

**Author:** ![etienne](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/etienne/32/17_2.png) [@etienne](https://community.plotly.com/u/etienne)\
**Post date:** [March 16, 2017, 2:51pm UTC](https://community.plotly.com/t/hover-event-does-not-contain-points/3655/2 "2017-03-16T14:51:06Z")

</div>

See [https://jsfiddle.net/c1kt3r82/159/](https://jsfiddle.net/c1kt3r82/159/)

Using jQuery syntax, the first argument in the event callback is the jQuery event object, the second is the plotly event data:

```auto
 tester.on('plotly_hover', function(_, data){
  	console.log(data)
  });

```

should work as intended.

---

<div class="post-metadata">

**Author:** ![heartmax](https://avatars.discourse-cdn.com/v4/letter/h/e0b2c6/32.png) [@heartmax](https://community.plotly.com/u/heartmax)\
**Post date:** [March 16, 2017, 3:00pm UTC](https://community.plotly.com/t/hover-event-does-not-contain-points/3655/3 "2017-03-16T15:00:48Z")

</div>

Awesome, thank you, Etienne!  
That saved my day 👍
