novus / nvd3

A reusable charting library written in d3.js
http://nvd3.org/
Other
7.22k stars 2.15k forks source link

"elementClick" callback not working on iPad (iOS?) #1609

Open pauljoey opened 8 years ago

pauljoey commented 8 years ago

The elementClick callback for my discretebar and pie charts works great on desktop and on android 6.0 but does not get called in response to touch events on an iPad in either Chrome or inside of a UIWebView.

This is also observed in the demo http://nvd3.org/examples/stackedArea.html - tapping the graph does not select/expand the specific area.

rahulbm commented 7 years ago

@pauljoey I am also facing same issue. The nvd3 bar graph is not scrollable in iOS. Did you found any solution for this?

pauljoey commented 7 years ago

I believe we worked around it using the fastClick.js

https://github.com/ftlabs/fastclick

Dercetech commented 6 years ago

Hi, you can fix this by converting touch events into clicks. It's a hack but it's effective. Below is an example of Angular 5 / Ionic 3 snippet I wrote to allow touch events on my hybrid app using NVD3. Hope it helps.

EDIT: I posted the explanation on stackoverflow: https://stackoverflow.com/questions/48565707/nvd3-graphs-how-to-intercept-touch-events-in-callback