charts - ReferenceError: google 未在 drawChart 中定义
问题描述
我已将 arrayToDataTable 与调用“内部”的数据一起使用。现在,我正在尝试在函数“外部”定义数据(timeAndNote),就像这样。但我得到一个参考错误:google is not defined at drawChart
var timeAndNote = [
['time','note']
[-3, 83],
[-2, 60.5],
[-1, 66],
[0, 67]
];
drawChart(timeAndNote);
function drawChart(array) {
var data = google.visualization.arrayToDataTable(array, true);
var options = {
title: 'note vs time',
curveType: 'function',
legend: { position: 'bottom' },
vAxis: {
ticks: [
---removed ---
]
}
};
var chart = new google.visualization.LineChart(document.getElementById('curve_chart'));
chart.draw(data, options);
}
谁能告诉我这是什么意思?
解决方案
推荐阅读
- php - 为什么 WordPress 仍然说我的 PHP 最大输入变量尚未更新?
- java - Android Studio 的手机模拟器无法读取你的本地文件系统:URL.openStream throws FileNotFoundException
- nlp - 洗牌两个文本文件中的行对
- excel - 如何将数据透视表的总计除以固定数字?
- python - 定义一个函数,该函数接受两个参数,包括名称(字符串)和出生日期(日期)
- c# - 如何将字符串的“纯”文本粘贴到 int 中?C#
- php - 编译失败:偏移量不支持 POSIX 整理元素
- google-sheets - Google 表格:带有 CountBlank 的 ArrayFormula
- python - 如何在不同的表之间进行转换和连接?
- python - 使用 Jinja/Flask 将 python 字典键/值插入 javascript 列表