Single Series FusionChart XML


$q = "select KdKat as kode, short as nama from g3n_kategori";
$db = new MysqlImproved_Driver;
$ar = $db->datashet();

// constructor
$fc = new FusionCharts('Pie3D', 400, 300, true);
//setting path
// setting parameter
$fc->setChartParams("caption=Factory Sales;subCaption=Year 2007;bgColor=ffccff");

// add chart data
foreach($ar as $var=>$val){
    $fc->addChartData($val['kode'], "name=".$val['nama'].";color=ff0000;link=");

//change header
header('Content-type: text/xml');
// make it out
print $fc->getXML();



Published by


just to remember what i had known :)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s