Welcome Guest, Not a member yet? Register   Sign In
Graphing with FusionCharts
#1

[eluser]Jbeasley6651[/eluser]
Hello,

I am trying to get fusioncharts (free flash charts) working in code igniter.

I have followed an offsite tutorial and have gotten the graphing to work, except i can't assign a name to a value. I know i have to pass a name, but i don't know how to do it, i have tried many things, none of which i can get to work.

Screen Shot Here

current working controller that produces the graph in the image

Code:
function mychart(){
        $this->load->plugin( 'fusion' );
        $FC =  FusionCharts("Column3D","520","200");
        $arrData = array(200, 400, 200, 300);  
        foreach( $arrData as $i=>$arrData){  
        $FC->addChartData( $arrData);  
        var_dump($arrData, $i);
         }  
        $strParam="numberSuffix=%; formatNumberScale=0; decimalPrecision=0; xAxisName=Integrated Process Average Score; animation=1";
        $FC->setChartParams($strParam);
        $FC->setChartMessage("ChartNoDataText=Chart Data not provided; PBarLoadingText=Please Wait.The chart is loading...");
        //my changes start here
        echo '[removed][removed]';
        echo $FC->renderChart(false,false);
        
        $this->load->view('chart/chart_view');
    }

I really need to know how to pass the name with the value.

You can view the library below, it's 2000 lines so i did a paste instead of putting it here. BTW, do we have a paste bin for CI?
Code Pasted Here

Thanks in advance,

Jbeasley
#2

[eluser]cahva[/eluser]
Have you actually checked the manual? Smile
(had to tinyurl that. CI forum gave me that its blacklisted..)

"Using With PHP Class"
|
+-- "Charting Data from Array"

From that example you should put your code like this:
Code:
$arrData[0][0] = 'Name';
$arrData[1][0] = 'Name 2';
$arrData[2][0] = 'Name 3';
$arrData[3][0] = 'Name 4';

$arrData[0][1] = 200;
$arrData[1][1] = 400;
$arrData[2][1] = 200;
$arrData[3][1] = 300;

Should work. Never used that so dunno Wink
#3

[eluser]Jbeasley6651[/eluser]
This make sense, but what i kept overlooking was that i have to change it to

$FC->addChartDataFromArray( $arrData);

and soon it will be addfromdatabase

instead of $FC->addChartData( $arrData);

I'm going to post this all in the code igniter wiki after i finish my project this week with it and know it better.

I am combining it will the simple stats plugin to graph out the stats so there will be a simple analytics script for people to use.
#4

[eluser]tmcallister[/eluser]
[quote author="Jbeasley6651" date="1247008867"]
I'm going to post this all in the code igniter wiki after i finish my project this week with it and know it better.
[/quote]

Yes - please post your findings. I am starting to integrate fusion charts into a CI project today. Love to hear what you find
#5

[eluser]Jbeasley6651[/eluser]
you can get the version of fusion charts working in ci here.

Keep in mind (if you are dragging and droping this into your build) that i move my applications and assets folders out of the system folder.


o5media.com/share/graphs.zip

Let me know if it helps or if you have questions.

Thanks,

Jbeasley




Theme © iAndrew 2016 - Forum software by © MyBB