We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6611805 commit 194261aCopy full SHA for 194261a
Chart.js
@@ -852,7 +852,7 @@ window.Chart = function(context){
852
}
853
854
855
- if (window.Touch) {
+ if (is_touch_device()) {
856
context.canvas.ontouchstart = function(e) {
857
e.offsetX = e.targetTouches[0].clientX - position.x;
858
e.offsetY = e.targetTouches[0].clientY - position.y;
@@ -1508,4 +1508,9 @@ window.Chart = function(context){
1508
// Provide some basic currying to the user
1509
return data ? fn( data ) : fn;
1510
};
1511
+
1512
+ function is_touch_device() {
1513
+ return !!('ontouchstart' in window) // works on most browsers
1514
+ || !!('onmsgesturechange' in window); // works on ie10
1515
+ };
1516
0 commit comments