我正在尝试使用此示例https://developers.google.com/chart/interactive/docs/php_example创建类似于此示例的图表。我只修改了sampleData.json中的数据,现在读取了......
{
"cols": [
{"id":"","label":"Topping","pattern":"","type":"string"},
{"id":"","label":"Slices","pattern":"","type":"number"}
],
"rows": [
{"c":[{"v":"1-2 times","f":null},{"v":300,"f":null}]},
{"c":[{"v":"3-4 times","f":null},{"v":12,"f":null}]},
{"c":[{"v":"5-6 times","f":null},{"v":146,"f":null}]},
{"c":[{"v":"7-8 times","f":null},{"v":202,"f":null}]},
{"c":[{"v":"9 or more","f":null},{"v":9,"f":null}]}
]
}
当我使用Safari和Firefox打开exampleUsingPHP.html时,页面为空白。我还尝试使用此示例http://code.runnable.com/VTTnV-SzcQU_aNH1/google-charts-php-example。当我将文件复制到桌面并打开html文件时,这也不起作用。我无法弄清楚为什么html页面是空白的,因为从终端运行getData.php会返回数据,所有脚本都通过CDN运行。这是一个jQuery问题,如果可以通过CDN运行jQuery来解决这个问题吗?