Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

40 lines (27 sloc) 1.213 kb

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);

Jump to Line
Something went wrong with that request. Please try again.