• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Install FusionChart on CI as plugin Plugin

#6
[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


Messages In This Thread
Install FusionChart on CI as plugin Plugin - by El Forum - 11-14-2008, 12:06 AM
Install FusionChart on CI as plugin Plugin - by El Forum - 11-14-2008, 08:11 AM
Install FusionChart on CI as plugin Plugin - by El Forum - 11-14-2008, 10:16 AM
Install FusionChart on CI as plugin Plugin - by El Forum - 03-17-2009, 11:00 AM
Install FusionChart on CI as plugin Plugin - by El Forum - 03-17-2009, 11:05 AM
Install FusionChart on CI as plugin Plugin - by El Forum - 11-25-2009, 03:44 AM
Install FusionChart on CI as plugin Plugin - by El Forum - 01-28-2010, 07:46 AM
Install FusionChart on CI as plugin Plugin - by El Forum - 01-28-2010, 08:31 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.