前の記事 ≪:jQueryベースのLightBoxクローン「prettyPhoto」
次の記事 ≫:2008年4月17日 管理人のブックマーク

GoogleChartsAPIをPHPから簡単に使える「GoogChart」

2008年04月17日-はてなブックマーク

スポンサード リンク
[PR] 英単語を忘却曲線アプリを使って超効率よく記憶する方法
Charts with PHP and Google Charts API // Notebook // Ludwig P.
Just yesterday I found out about the Google Charts API and I was impressed by this excellent service but noticed that creating multiple charts got pretty messy, especially if I wanted to edit the data later on.

GoogleChartsAPIをPHPから簡単に使える「GoogChart」。
Google Chart API にまつわるサービスや各種ライブラリ」で色々と紹介しましたが新しいライブラリが出た模様です。

以下のように、直感的なコードでグラフ描画用の画像が呼び出せます。

$data = array(
'IE7' => 22,
'IE6' => 30.7,
'IE5' => 1.7,
'Firefox' => 36.5,
'Mozilla' => 1.1,
'Safari' => 2,
'Opera' => 1.4,
);
$chart = new googChart();
$chart->setChartAttrs( array(
'type' => 'pie',
'data' => $data,
'size' => array( 300, 200 )
));
echo $chart;

画像の出力例)


これもなかなか便利に使えそうですね。
他のライブラリと比較して使いやすいものを利用しましょう。

関連の記事検索:google, google charts, php
スポンサード リンク

By.KJ : 2008年04月17日 12:06 livedoor Readerで購読 Twitterに投稿

間違いの指摘をしていただける方はメール、あるいはTwitter/FBでお願いします(クリック)