gpt4 book ai didi

javascript - Google 可视化 API - 错误 : Unknown header type: 1

转载 作者:行者123 更新时间:2023-12-03 07:26:08 25 4
gpt4 key购买 nike

当我尝试在 WAMP 服务器上加载网站时,出现以下错误:

Error: Unknown header type: 1
https://www.google.com/uds/api/visualization/1.0/c3581c99759b4a64cb69ca21ab634266/format+en,default+en,ui+en,corechart+en.I.js
Line 171

这是我的代码:

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>SO Q#</title>
<style type="text/css">
html {
height: 100%;
width: 100%
}
body {
height: 100%;
width: 100%;
margin: 0;
padding: 0
}
#chart {
height: 100%;
width: 100%
}
</style>
<script language="javascript" type="text/javascript" src="https://www.google.com/jsapi"></script>
<script language="javascript" src="../js/jquery.js"></script>
<script language="javascript" src="../js/jquery.csv.js"></script>
<script language="javascript" type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
$.get("https://docs.google.com/spreadsheet/pub?key=0Ao6fMN9Cw0GPdFVtZ29iYmd1cmRORU0yemYxUjE3OVE&single=true&gid=0&output=csv", function(csvString) {
var arrayData = $.csv.toArrays(csvString, {onParseValue: $.csv.hooks.castToScalar});
var data = new google.visualization.arrayToDataTable(arrayData);
var view = new google.visualization.DataView(data);
view.setColumns([0,1]);
var options = {
title: "A Chart from a CSV!",
legend: 'none'
};
var chart = new google.visualization.PieChart(document.getElementById('chart'));
chart.draw(view, options);
});
}
</script>
</head>
<body>
<div id="chart"></div>
<script>
</script>
</body>
</html>

谁能告诉我这个错误是从哪里来的?

最佳答案

该文件的标题不适合饼图。将其更改为类似的内容

Name,Work
Jochen,2
Peter,5
Hans,2
Detlef,3
Jürgen,4
Andreas,6
Martin,4

关于javascript - Google 可视化 API - 错误 : Unknown header type: 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20260664/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com