我已经搜索了很多,以找到一个使用MySQL表数据作为数据源生成Google Chart的好例子.我搜索了几天,并意识到使用PHP和MySQL的组合生成Google Chart(饼图,条形图,列,表)的示例很少.我终于设法让一个例子起作用了.
我之前收到过StackOverflow的很多帮助,所以这次我会回复一些.
我有两个例子; 一个使用Ajax而另一个不使用.今天,我只展示非Ajax示例.
用法:
Requirements: PHP, Apache and MySQL
Installation:
--- Create a database by using phpMyAdmin and name it "chart"
--- Create a table by using phpMyAdmin and name it "googlechart" and make
sure table has only two columns as I have used two columns. However,
you can use more than 2 columns if you like but you have to change the
code a little bit for that
--- Specify column names as follows: "weekly_task" and …