FVANCOP / ChartNew.js

MIT License
420 stars 142 forks source link

How to get which bar and its index I am hovering? #365

Closed tom10271 closed 8 years ago

tom10271 commented 9 years ago

Supposedly I can bind event to canvas then I can get the bar I am hovering by: var bars = chart.getBarsAtEvent(evt); in original Chart.js. How to do it with ChartNew.js?

Besides, there is no way for developer to get the index of bar hovering, is it provided in ChartNew.js?

FVANCOP commented 9 years ago

Not sure that I understand what you want but check following :

See Samples\mouse_detect_position.html (this is a new sample; You will have to redownload the last version of ChartNew.zip). see also Samples\annotateFunction.html

Documentation associated : https://github.com/FVANCOP/ChartNew.js/wiki/100_020_Annotations#annotatefunctionin https://github.com/FVANCOP/ChartNew.js/wiki/100_095_Mouse_Actions