用 Google Chart API 幫你畫圖表!

如果你不太會用 GDImageMagick 將表格的數值轉成圖形的話
可以使用 Google Chart API 看看!

利用網址的參數帶入
http://chart.apis.google.com/chart?
chs=200x125
&chd=s:helloWorld
&cht=lc
&chxt=x,y
&chxl=0:|Mar|Apr|May|June|July|1:||50+Kb
參數意義:
  • http://chart.apis.google.com/chart? 為這個 API 的位置
  • & 為區隔各參數的符號
  • chs=200x125 設定這張圖檔的大小
  • chd=s:helloWorld 圖表的數據
  • cht=lc 設定圖表呈現的樣式
  • chxt=x,y 指定 x-軸和 y-軸的座標軸為必填欄位
  • chxl=0:|Mar|Apr|May|June|July|1:||50+Kbx-軸和 y-軸的座標軸

可得到這樣的結果:










目前僅提供五種樣式:

我比較期待 Google API 能夠提供像是 Google Analytics 用 Flash 產生的圖表方式 :p

Comments

Popular posts from this blog

CentOS7 如何新增/移除 Rich Rule for firewalld

mac 安裝 mtr

Howto use Postman test Cors