不能设置为空值的属性'溢出' [英] cannot set property 'overflow' of null

查看:179
本文介绍了不能设置为空值的属性'溢出'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

webView.getSettings().setJavaScriptEnabled(true);

web视图加载这个网站code:

webView loads this html code:

<html>
    <head>
        <script type='text/javascript' src='https://www.google.com/jsapi'></script>
        <script type='text/javascript'>
            google.load('visualization', '1', {packages: ['corechart']});
            google.setOnLoadCallback(drawChart);
            function drawChart() {
                var data = google.visualization.arrayToDataTable([
                    ['Year', 'Sales', 'Expenses'],
                    ['2004', 1000, 400],
                    ['2005', 1170, 460],
                    ['2006', 660, 1120],
                    ['2007', 1030, 540]
                ]);
                var options = {title: 'Company Performance'};
                var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
                chart.draw(data, options);
            }
        </script>
    </head>
    <body>
        <div id='chart_div' style='width: 900px; height: 500px;'></div>
    </body>
</html>

这是从谷歌的例子可视化code:折线图

web视图显示的文字不能设置为空值的属性'溢出'
如何解决这个问题?

webView shows text cannot set property 'overflow' of null How fix it?

推荐答案

你指的是从JavaScript抛出的错误,我想(否则应用程序会崩溃)?

The error you are referring to is thrown from javascript, i guess (otherwise the app would crash)?

什么Android操作系统版本是你想做到这一点呢?如果是2.x的,你不会跑远,除非你的谷歌图表使用备用渲染器如的 canVg (我知道highcharts使用canvg成功为),因为的WebView不知道SVG。

What Android OS Version are you trying to do this on? If it's 2.x, you won't get far unless your Google Chart uses a fallback renderer such as CanVg (i know highcharts uses canvg with success for that), because the WebView doesn't know svg.

这篇关于不能设置为空值的属性'溢出'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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