gpt4 book ai didi

javascript - 转换数据以制作 Google 图表

转载 作者:行者123 更新时间:2023-11-29 21:03:01 24 4
gpt4 key购买 nike

我的汇总表中有这些数据:

REGIS_ID    VAC_NAME    LOC_DETAIL
1 Flu University
2 Flu University
3 Flu University
4 Flu Office
5 Flu School
6 Flu Office
7 Flu School
8 Flu School
9 Flu School
10 Flu School
11 Flu University
12 Flu University
13 Hepatitis-B School
14 Hepatitis-B School
15 Hepatitis-B School
16 Hepatitis-B Office
17 Hepatitis-B Office
18 Bird_Flu University
19 Bird_Flu University
20 Bird_Flu School
21 Bird_Flu School
22 Bird_Flu School
23 Bird_Flu Office
24 Bird_Flu Office
25 Bird_Flu University

所以我想像这样查询数据并将其转换为 PHP:

$dataTest = "['', 'Bird_Flu', 'Flu', 'Hepatitis-B'],
['School', 3, 5, 2],
['University', 3, 5, 3],
['Office', 2, 2, 2]";

为了制作 Google 图表:

Google Chart

我该怎么办?非常感谢。

最佳答案

我过去做过类似的事情,我只是使用代码以所需的格式构建字符串

//sudo code
$dataTest = ""
foreach(datarow)
{
$dataTest += "['School', 3, 5, 2],"
}

关于javascript - 转换数据以制作 Google 图表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37050466/

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