![]() |
Install FusionChart on CI as plugin Plugin - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Install FusionChart on CI as plugin Plugin (/showthread.php?tid=13193) |
Install FusionChart on CI as plugin Plugin - El Forum - 11-14-2008 [eluser]Amjith or Cool Coder[/eluser] Hi, Note: Please delete space between the links of fusionchart. eg: you will find space after http: (http: //). http: //www.fusioncharts.com/free/Overview.asp?gMenuItemId=2 If you feels difficult to use it, Please follow below steps. 1. Download Fusionchart http: //www.fusioncharts.com/free/Download.asp?gMenuItemId=5 2. Unzip, Folder 3. Copy folder 'Charts' to root of your CI Project 4. If you are using .htaccess , open file and add Charts 'RewriteCond' , example will be Code: RewriteCond $1 ^(index\.php|Charts) You will find a list of folders showing php examples on how to create fusion charts. Its really helpful for development. Before we can add a plugin module to the CI a. add a new file 'fusionchart_pi.php' on your CI Project folder 'system/plugins/' add this lines of code to that file Code: <?php 7. Call plugin on your controller ($this->load->plugin('fusionchart')) 8. Add javascript to your view 9. On your view file, Code: <?php echo renderChart(site_url("Charts/FCF_Line.swf"), $XML_DATA, "", "chart1", 230, 130);?> $XML_DATA is the variable where xml data is stored as file. for reference regarding XML formats please refer http: //www.fusioncharts.com/free/docs/?gMenuItemId=19 10 You are done. Thanks and hope everything works good. My next post will be of creating Fusionchart library on CI. Install FusionChart on CI as plugin Plugin - El Forum - 11-14-2008 [eluser]Iverson[/eluser] Great post. I did it differently but this looks cool too. But using "<?=" is a big no-no in the CI community! :bug: Install FusionChart on CI as plugin Plugin - El Forum - 11-14-2008 [eluser]Amjith or Cool Coder[/eluser] [quote author="Iverson" date="1226693511"]Great post. I did it differently but this looks cool too. But using "<?=" is a big no-no in the CI community! :bug:[/quote] dude, thanks for notification. i have changed it. Install FusionChart on CI as plugin Plugin - El Forum - 03-17-2009 [eluser]Iverson[/eluser] [quote author="Amjith or Cool Coder" date="1226664378"] Code: <?php My next post will be of creating Fusionchart library on CI.[/quote] This code is REALLY not CI-ish. Nor is it copy and "pastable". I will try to rewrite it and post this later. Install FusionChart on CI as plugin Plugin - El Forum - 03-17-2009 [eluser]Iverson[/eluser] Nevermind. This is giving me a headache. Install FusionChart on CI as plugin Plugin - El Forum - 11-25-2009 [eluser]baradji[/eluser] I try since 7 days to show my data in fusioncharts with codeigniter.it isn’t work. but it work when use without codeigniter. this is whats I make 1) I copie FusionChats in my repository libraries of my root application of codeigniter 2) in my controller,you are class DevicesStat extends Controller{ function DevicesStat (){ // load controller parent parent::Controller(); // Charger un model de devicestat $this->load->model(‘mod_stat/DevicesByTypeMod’); function byTypeGraphe(){ // charger le plugin de fudion chart $this->load->library(‘fusioncharts’); // store data for being displayed on view file $data[‘devices’]=$this->DevicesByTypeMod->getDevices(); //pour afficher le topten des equipements par type $data[‘nbDevices’]=$this->DevicesByTypeMod->getNbDevices(); $data[‘title’]=‘equipements par type’; $data[‘header’]=‘Liste des équipements par type’; // load ‘users_view’ view $this->load->view(‘mod_stat/devicesByType_viewGraphe’,$data); //pour afficher le graphique 2) in my model class DevicesByTypeMod extends Model{ function DevicesByTypeMod(){ // call the Model constructor parent::Model(); // load database class and connect to MySQL $this->load->database(); } public function getDevices() { $sql=“SELECT COUNT( * ) AS Nombre_postes,dc.DeviceCategory_Description AS type_device FROM device d LEFT JOIN devicecategory dc ON d.DeviceCategory_ID = dc.DeviceCategory_ID LEFT JOIN nmid n on d.device_id = n.object_id WHERE n.nmid_statusinappliance = ‘Active’ GROUP BY d.DeviceCategory_ID ORDER BY Nombre_postes DESC”; $devices=$this->db->query($sql); return $devices->result_array(); 3) in my view deviceByType_viewGraphe.php - I include the file include(“system/application/libraries/FusionCharts/Code/PHP/Includes/FusionCharts.php”); I call the javascript file [removed][removed] <style type=“text/css”> - $strXML = “<chart caption=‘Nombre de postes ’ subCaption=’ par type’ pieSliceDepth=‘40’ showBorder=‘1’ formatNumberScale=‘0’ numberSuffix=’ postes’>”; // Fetch all devices records foreach($devices as $device) { $strXML .= “<set label=’” . $device[‘type_device’] . ”’ value=’” . $device[‘Nombre_postes’] . ”’ >”; } //Finally, close <chart> element $strXML .= “</chart>”; echo renderChart($typeGraphique, “”, $strXML, “FactorySum”, 1200, 1000, false, false); ————————————————————————- but in the result, I have no graph, but a simple word “Chart” :hehe: Can somebody help me quickly, I’m very worry Thx Install FusionChart on CI as plugin Plugin - El Forum - 01-28-2010 [eluser]naim[/eluser] I have the same bug also. Anybody? Plz. Install FusionChart on CI as plugin Plugin - El Forum - 01-28-2010 [eluser]baradji[/eluser] I resolved the problem with base_url() this is my code: $strXML = "<chart caption='Equipements par Model: ".$nbre_ligne." modèles' xAxisName='Model Equipement' yAxisName='Nombre' pieSliceDepth='40' showBorder='1' formatNumberScale='0' numberSuffix='' slantLabels = '1' labelDisplay = 'ROTATE'>"; // Fetch all devices records foreach($devices as $device) $strXML .= "<set label='" . $device->model . "' value='" . $device->Nombre_postes . "' link='".base_url()."index.php/devicesStat/byModelListe/" . $device->Model_ID . "' />"; $strXML .= "</chart>"; //Create the chart - Pie 3D Chart with data from $strXML $typeGraphique = base_url()."system/application/libraries/FusionCharts/Code/FusionCharts/Column3D.swf"; echo renderChart($typeGraphique, "", $strXML, "FactorySum", 1100, 600, false, false); |