Welcome Guest, Not a member yet? Register   Sign In
fusioncharts plugin
#2

[eluser]Mike Ryan[/eluser]
Hi,

Correct - you just need to pass the chart data to a view and echo it.

Create this function in your controller:

Code:
function mychart(){
    $this->load->plugin( 'fusion' );
    $FC =  FusionCharts("Column3D","520","200");
    $arrData = array( 500, 269, 254, 895, 633);
    foreach( $arrData as $i=>$data ){
        $FC->addChartData( $arrData );
    }
    $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
    $data['chart'] = $FC->renderChart(false,false);
    $this->load->view('chart_test');
}

The most basic view would look like this:

Code:
//file: chart_test.php
echo $chart

I haven't used this plugin myself, but the above code should get a basic chart on the page... or at least an error message ;-)

If it doesn't work, post any error messages or output and I'll take a look. btw, amCharts is a nice Flash charts package, I found it very easy to integrate with CI, including some cool stuff like automatic updates via ajax.


Messages In This Thread
fusioncharts plugin - by El Forum - 04-14-2009, 04:47 PM
fusioncharts plugin - by El Forum - 04-16-2009, 08:57 AM
fusioncharts plugin - by El Forum - 04-17-2009, 08:36 AM
fusioncharts plugin - by El Forum - 04-18-2009, 09:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB