如果动画设置为false chart.js之不显示在Android网页视图 [英] Chart.js not displaying on Android Webview if animation is set to false

查看:549
本文介绍了如果动画设置为false chart.js之不显示在Android网页视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的WebView 启用一个javascript使用 ChromeWebClient ,它们显示chart.js之饼的例子罚款。之后,我设置的选项动画:假的,那么停止显示图

I have a javascript enabled WebView with a ChromeWebClient and they display the Chart.Js pie example fine. After I set the options to animation: false, then stop displaying the chart.

var pieOptions = {
            animation : false
        }
        window.onload = function(){
            var ctx1 = document.getElementById("chart-area1").getContext("2d");
            window.myPie1 = new Chart(ctx1).Pie(pieData,pieOptions);

            var ctx2 = document.getElementById("chart-area2").getContext("2d");
            window.myPie2 = new Chart(ctx2).Pie(pieData);
        };

与残疾人的动画第一个饼图不显示,第二个呢。这两种显示在桌面版Chrome罚款。我使用Android 4.4.4设备的方式。攻丝后,情况发生在inanimated图应该是,它会显示自己(我猜清爽的触摸事件图表)。

The first pie chart with the disabled animation doesn't display, the second does. Both display fine on desktop Chrome. I am using an Android 4.4.4 device by the way. After tapping the are where the inanimated chart should be, it will display itself (I guess refreshing the chart with the touch event).

我缺少的东西,或这是一个错误吗?

Am I missing something or is this a bug?

推荐答案

我试过这个答案的Andr​​oid的WebView呈现空白/白并解决了这个问题。基本上我们告诉的WebView避免使用硬件渲染:

I tried this answer on Android WebView renders blank/white and it solved the problem. Basically we tell the WebView to avoid using hardware rendering:

webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

这篇关于如果动画设置为false chart.js之不显示在Android网页视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆