0

这是使用 google API 构建饼图的方式:

https://google-developers.appspot.com/chart/interactive/docs/basic_preparing_data

一切看起来都很简单,但是如果我通过 php 函数将数据放入 html 文档的正文中,我该如何实现呢?

我的数据看起来像这样......数据集1:

male:4
female:2
?:15 

数据集 2:

Array
(
    [26] => 2
    [] => 15
    [18] => 1
    [28] => 1
    [22] => 1
    [21] => 1
)

那么如何在 google API javascript 中获取这些变量var data 呢?

4

1 回答 1

0

无需帮助,我只是将脚本粘贴到正文中并通过 php 回显所需的数据。

于 2013-03-16T05:26:17.030 回答