FusionCharts extension for Yii
JavaScript PHP
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Charts
FusionCharts
js
README.md

README.md

YiiFusioncharts

FusionCharts extension for Yii

Installation:

  • copy FusionCharts folder to protected/Extentsion folder on Yii project

  • copy FusionCharts.js file to js folder

  • copy Charts folder to root directory

  • add 'application.extensions.FusionCharts.*' to import module in Yii config file.

  • add js file to the project by calling: Yii::app()->clientScript->registerScriptFile("/js/FusionCharts.js", CClientScript::POS_HEAD );

  • example of using FusionChart:

    $sql = "SELECT date, sum(download) downloads" ." FROM download" ." where date >= ".$startdate ." and date < ".$enddate ." group by date" ." order by date" ."";

$command = $connection->createCommand($sql);

$rows = $command->queryAll();

$strXML2 = "";

$fusionChart2 = new FusionCharts;

foreach ($rows as $row){ $strXML2 .= "<set name='".date('d/m/Y', $row['date']). "' value='".$row['downloads']."' color='" .FusionChartUtils::getFCColor($count++) . "'></set>"; }

$strXML2 .= "";

echo $fusionChart2->renderChart("/FusionCharts/FCF_Column3D.swf", "", $strXML2, "Downloads Graph", 600, 400);