Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/221.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 安卓网络视图和谷歌图表_Javascript_Android_Android Webview_Google Pie Chart - Fatal编程技术网

Javascript 安卓网络视图和谷歌图表

Javascript 安卓网络视图和谷歌图表,javascript,android,android-webview,google-pie-chart,Javascript,Android,Android Webview,Google Pie Chart,嗨,我需要你的帮助,从谷歌的piechart。 我遵循了这一点,但它不起作用。 如果您测试这段代码,您可以看到图例和柱状图彼此相差很远。 我希望他们彼此更靠近。我该怎么做 还有一件事:它的高度似乎是固定的,所以如果我在这个图表中添加更多的行,它就会被隐藏…为什么 <html><head> <script type="text/javascript" src="https://www.google.com/jsapi"></script><sc

嗨,我需要你的帮助,从谷歌的piechart。 我遵循了这一点,但它不起作用。 如果您测试这段代码,您可以看到图例和柱状图彼此相差很远。 我希望他们彼此更靠近。我该怎么做

还有一件事:它的高度似乎是固定的,所以如果我在这个图表中添加更多的行,它就会被隐藏…为什么

<html><head>
<script type="text/javascript" src="https://www.google.com/jsapi"></script><script type="text/javascript">
google.load("visualization", "1.0", {"packages":["corechart"]});

google.setOnLoadCallback(drawChart0);
function drawChart0() {
var data = new google.visualization.DataTable();
data.addColumn("string", "ITEM");
data.addColumn("number", "VALUE"); 
data.addRows([`
    <!-- If I add more rows here some of them gets hidden...why? -->
["'Test1'", 4.5],
["'Test2'", 21.2],
["'Test3'", 31.4],
["'Test4'", 0.0],
["'Test5'", 31.4],
["'Test6'", 0.0],
["'Test7'", 11.5]]);

var options = {
"title":"My Piechart test",
titleTextStyle: {color: 'black', fontName: 'Arial', fontSize: '12', fontWidth: 'normal',bold: true},
sliceVisibilityThreshold:0,
is3D: true,
<!-- I want to have both legend and piechart beside each other -->
legend: {position: 'left',width:"100%",height:"100%"},
<!-- If I dont use "top", I can not see the title -->
chartArea:{left:2,top:20,position: 'left',width:"100%",height:"200%"}
};

var chart = new google.visualization.PieChart(document.getElementById("chart_div0"));chart.draw(data, options);}

</script></head><body>
<div id="chart_div0"></div>
</body></html>

load(“可视化”、“1.0”、“包”:[“corechart”]});
setOnLoadCallback(drawChart0);
函数drawChart0(){
var data=new google.visualization.DataTable();
data.addColumn(“字符串”、“项”);
数据。添加列(“数字”、“值”);
data.addRows([`
[“'Test1',4.5],
[“'Test2'”,21.2],
[“'Test3'”,31.4],
[“'Test4'”,0.0],
[“'Test5'”,31.4],
[“'Test6'”,0.0],
[“'Test7'”,11.5]];
变量选项={
“标题”:“我的Piechart测试”,
titleTextStyle:{color:'black',fontName:'Arial',fontSize:'12',fontWidth:'normal',bold:true},
切片可见性阈值:0,
is3D:是的,
图例:{位置:“左”,宽度:“100%”,高度:“100%”,
图表区:{左:2,顶部:20,位置:'左',宽度:'100%,高度:'200%'
};
var chart=new google.visualization.PieChart(document.getElementById(“chart_div0”);chart.draw(数据,选项);}
我使用webView.loadDataWithBaseURL(null,contentHTML,“text/html”,“utf-8”,null)将此代码发送到一个webView中; 我不认为webview是错误的,因为如果您尝试这个html代码,您实际上可以看到问题也存在。所以我专注于html代码本身


提前感谢您的帮助:)

您是否设法显示了它?