Bonjour
J'ai installé le plugin sdInteractiveChart pour sf en version 1.4
pas de pb pour générer un graphe en mode inline ($chart->inlineGraph)
par contre, pas moyen d'en sorti un en mode ajax ($chart->ajaxGraph)
J'ai suivi le fichier readme mais ne suis pas trop sûr de là où il faut mettre le code...
dans le template qui doit afficher le graphe :
dans la fonction executeLoadData() de projet/actions/actions.class.phpuse_helper('sdInteractiveChart');
$chart = InteractiveChart::newBarChart();
$chart->setWidthAndHeight('500', '320');
$chart->setDataColors(array('#990000', '#cd0000'));
$chart->setBaselineColor('#aaa');
$chart->setLegendPosition(LineGraph::$LEGEND_NONE);
$chart->ajaxGraph( url_for('projet/load_data'), array(), 'chart_div');
$chart->render();
J'ai essayé différentes configs... mais sans résultat, avec le echo dans un tempate, avec sfView::NONE...// The labels for each Bar.
$labels = array("Apples", "Oranges", "Pears", "Grapes");
// The Data
$data = array('Last Week' => array(1, 5, 3, 7), 'This Week' => array(8, 4, 5, 2));
use_helper('sdInteractiveChart');
// This line then outputs the JSON array to the browser.
echo InteractiveChart::generateJsonData($data, $labels, array());
Quelqu'un a utilisé ce plugin en mode ajax ?
Partager