Saturday, March 13, 2010

How to implement Open Flash Chart 2 on Symfony

Programmer Question

I'm trying to use Open Flash Chart 2 on my symfony project by including the ofc2 library on one of my controller's action.



Unfortunately it doesn't work. When i call the action it prints nothing :'(



There is a plugin for this, but it uses an outdated version of OFC.



Anyone have had any success showing Open Flash Chart 2 on their site?



Here's how my controller's actions file looks:



<?php

class chartActions extends sfActions{

public function executeTestChartData(sfWebRequest $request){
$this->getResponse()->setHttpHeader('Content-Type','text/plain');

include('/cidat/lib/php-ofc-library/open-flash-chart.php');

$title = new title( date("D M d Y") );

$bar = new bar();
$bar->set_values( array(9,8,7,6,5,4,3,2,1) );

$chart = new open_flash_chart();
$chart->set_title( $title );
$chart->add_element( $bar );

$output = $chart->toPrettyString();

return $this->renderText($output);
}
}

?>


Thanks in advance,



Vic



Find the answer here

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails