Jabba Laci a écrit :
 > Hi,
 >
 > Google has a very nice chart API:
 > http://code.google.com/apis/chart/
 > Example:
 > 
http://chart.apis.google.com/chart?cht=p3&chd=s:hW&chs=250x100&chl=Hello|World
 > Do you know how to integrate such charts in a PmWiki page?


   That api is really cool, the following code ads a pie chart in
totalcounter_1_9.php if added after line 816 :

% ------------ pie Chart using GoogleChart API ------------------
if (is_array($tar) && $tot)
        foreach ($tar as $pn => $cnt) {
                $sc = Round(100*$cnt/$tot);
                if ($sc>=3) {       # shows only >=3% count pages
                        $Page[] = $pn;
                        $Scor[] = $sc;
                        $mytot = $mytot+$sc;
                }
        };
$Page[] = "Other...";
$Scor[] = $tot-$mytot;
$html .= "<img 
src=\"http://chart.apis.google.com/chart?cht=p3&chd=t:".implode(",",$Scor)."&chs=350x100&chl=".implode("|",$Page)."\"/>";
% ---------------------------------------------------------------

http://www.pmwiki.org/wiki/Cookbook/TotalCounter

-- 
Nicolas Poulain
[EMAIL PROTECTED]
http://exomatik.net/

_______________________________________________
pmwiki-users mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-users

Reply via email to