{"action":"created","issue":{"url":"https://api.github.com/repos/andredumas/techan.js/issues/52","labels_url":"https://api.github.com/repos/andredumas/techan.js/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/andredumas/techan.js/issues/52/comments","events_url":"https://api.github.com/repos/andredumas/techan.js/issues/52/events","html_url":"https://github.com/andredumas/techan.js/issues/52","id":56946339,"number":52,"title":"Index of mouse event always zero?","user":{"login":"prionkor","id":1277201,"avatar_url":"https://avatars.githubusercontent.com/u/1277201?v=3","gravatar_id":"","url":"https://api.github.com/users/prionkor","html_url":"https://github.com/prionkor","followers_url":"https://api.github.com/users/prionkor/followers","following_url":"https://api.github.com/users/prionkor/following{/other_user}","gists_url":"https://api.github.com/users/prionkor/gists{/gist_id}","starred_url":"https://api.github.com/users/prionkor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prionkor/subscriptions","organizations_url":"https://api.github.com/users/prionkor/orgs","repos_url":"https://api.github.com/users/prionkor/repos","events_url":"https://api.github.com/users/prionkor/events{/privacy}","received_events_url":"https://api.github.com/users/prionkor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-08T10:06:34Z","updated_at":"2015-02-09T10:48:53Z","closed_at":null,"body":"I am trying to add tooltip to chart. But It seem index for mouse enter event is always zero?\r\n\r\nThis is the code I am using: \r\n\r\n```\r\n        svg.append(\"g\")\r\n                .datum(data)\r\n                .attr(\"class\", \"candlestick\")\r\n                .on('mouseover', function(d, i){\r\n                    console.log('Index: ' + i );\r\n                    var d = d[i];\r\n                    tip.html(function(){\r\n                            var html = \"<strong>Date:</strong> \" + d.date + \"<br>\";\r\n                            html += \"<strong>Open: </strong> \" + d.open + \"<br>\";\r\n                            html += \"<strong>High: </strong> \" + d.high + \"<br>\";\r\n                            html += \"<strong>Low: </strong> \" + d.low + \"<br>\";\r\n                            html += \"<strong>Close: </strong> \" + d.close + \"<br>\";\r\n                            return html;\r\n                    })\r\n                    .style({\r\n                        left: d3.event.pageX + 20 + 'px', \r\n                        top: d3.event.pageY - 20 + 'px',\r\n                        display: 'block'\r\n                    });\r\n\r\n                })\r\n                .on('mouseout', function(){\r\n                    tip.style('display', 'none');\r\n                })\r\n                .call(candlestick);\r\n```\r\n\r\nJS fiddle http://jsfiddle.net/sisir/ghox8ewa/4/ (line #79)"},"comment":{"url":"https://api.github.com/repos/andredumas/techan.js/issues/comments/73489417","html_url":"https://github.com/andredumas/techan.js/issues/52#issuecomment-73489417","issue_url":"https://api.github.com/repos/andredumas/techan.js/issues/52","id":73489417,"user":{"login":"prionkor","id":1277201,"avatar_url":"https://avatars.githubusercontent.com/u/1277201?v=3","gravatar_id":"","url":"https://api.github.com/users/prionkor","html_url":"https://github.com/prionkor","followers_url":"https://api.github.com/users/prionkor/followers","following_url":"https://api.github.com/users/prionkor/following{/other_user}","gists_url":"https://api.github.com/users/prionkor/gists{/gist_id}","starred_url":"https://api.github.com/users/prionkor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prionkor/subscriptions","organizations_url":"https://api.github.com/users/prionkor/orgs","repos_url":"https://api.github.com/users/prionkor/repos","events_url":"https://api.github.com/users/prionkor/events{/privacy}","received_events_url":"https://api.github.com/users/prionkor/received_events","type":"User","site_admin":false},"created_at":"2015-02-09T10:48:53Z","updated_at":"2015-02-09T10:48:53Z","body":"Okey, if I understand correct we are now getting index of the hovered element on the dom and using it to get the data, right?"}}