Problem with Yiiopenflashchart

Hi

I am newbie to yii framework.I am doing dynamic chart using open flash chart.I download yiiopenflashchart and configure to my server.The broblem is the chart always find the data file from var/www/html/data-files/area-point-objects.txt.

In my view file

My code like this

		$flashChart = Yii::createComponent('application.extensions.yiiopenflashchart.EOFC2');


                    $flashChart->begin('SteppChart');


                    $flashChart->render(500, 400);  

I want to genarate data from my postgres database.

Please guide me.

Thanks in advance.

Regards

Ask1024

The problem is you are not telling the chart what data to use (with ->setData) , read the documentation on how to do so on the extension page.

Alex,

Try something along the lines of this


<?php

$flashChart = Yii::createComponent('application.extensions.openflashchart2.EOFC2');

 

$flashChart->begin();

$flashChart->setTitle('Sample Chart');

$flashChart->axis('y',array('range' => array(0, 100, 10)));

$flashChart->setStackColours(array('#0000ff','#ff0000','#00FF00'));

$flashChart->setData(array(

    array(80,10,10),

    array(60,20,20),

    array(40,30,30),

    array(20,40,40),

));

$flashChart->renderData('bar_stack');

//$flashChart->render(300,300);

$flashChart->setData(array(50,30,2,4),'{n}',false,'stuff','chart2');

$flashChart->renderData('line',array(),'stuff','chart2');

$flashChart->render(400,400,'chart2','chartDomId');

echo '<div id="chartDomId"></div>';

for more examples look at the developer’s website examples .

the syntax doesn’t differ that much from the original