Google Chart integration

(c) Ansgar Bockstiegel

Markup

Markup('gchart', 'directives', '/\\(:gchart(\\s+.*?)?:\\)/ei', 'Keep(gchart("$1"))');

function gchart($unparsed_args){
    $args = ParseArgs($unparsed_args);
    $out = '<img src="http://chart.apis.google.com/chart?';
    $out .= 'chs='.$args['xsize'].'x'.$args['ysize'];
    $out .= '&amp;';
    $out .= 'chd=s:'.$args['data'];
    $out .= '&amp;';
    $out .= 'cht='.$args['type'];
    $out .= '" />';
    return $out;
}

Markup in the wiki page

(:gchart type=lc xsize=150 ysize=50 data=justatest:)

See the Google Chart API

Last Modified January 10, 2008, at 11:42 PM by Steph


edit SideBar