diff --git a/index.php b/index.php index f07d10b2..a22362ba 100644 --- a/index.php +++ b/index.php @@ -219,15 +219,48 @@ } ] }; + var isMobile = { + Windows: function() { + return /IEMobile/i.test(navigator.userAgent); + }, + Android: function() { + return /Android/i.test(navigator.userAgent); + }, + BlackBerry: function() { + return /BlackBerry/i.test(navigator.userAgent); + }, + iOS: function() { + return /iPhone|iPad|iPod/i.test(navigator.userAgent); + }, + any: function() { + return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Windows()); + } + }; + var animate = !isMobile.any(); var ctx = document.getElementById("queryOverTimeChart").getContext("2d"); - timeLineChart = new Chart(ctx).Line(chartData, {pointDot : false, legendTemplate : "" - }); + timeLineChart = new Chart(ctx).Line(chartData, + { + pointDot : false, + legendTemplate : "", + animation : animate + } + ); ctx = document.getElementById("queryTypeChart").getContext("2d"); - queryTypeChart = new Chart(ctx).Doughnut([],{ legendTemplate : "" }); + queryTypeChart = new Chart(ctx).Doughnut([], + { + legendTemplate : "", + animation : animate + } + ); ctx = document.getElementById("forwardDestinationChart").getContext("2d"); - forwardDestinationChart = new Chart(ctx).Doughnut([],{ legendTemplate : "" }); + forwardDestinationChart = new Chart(ctx).Doughnut([], + { + legendTemplate : "", + animation : animate + } + ); var radarChartData = { labels: [], @@ -241,7 +274,7 @@ ] }; ctx = document.getElementById("topClientsChart").getContext("2d"); - topClientsChart = new Chart(ctx).Radar(radarChartData, {}); + topClientsChart = new Chart(ctx).Radar(radarChartData, {animation : animate}); });