par
jay64 » 15 sept. 2008, 23:47
Ok, je comprends presque tout, merci. En adaptant, j'ai donc ceci :
<?php
$RefMatch = 1;
require_once "../Artichow/BarPlot.class.php";
require_once('../Connections/connection_top_stats.php');
mysql_select_db($database_connection_top_stats, $connection_top_stats);
$resultat = mysql_query("SELECT Texte, COUNT(*) as Occurences FROM Votes WHERE IdMatch = '$RefMatch' GROUP BY Texte ORDER BY Texte");
$values = array();
$nombres = array();
while ($resultat && $row = mysql_fetch_array($resultat))
{
$values[] = $row["Texte"];
$nombres[] = $row["Occurences"];
}
$graph = new Graph(400, 400);
$graph->setAntiAliasing(TRUE);
//$values = array(19, 42, 15, -25, 3);
$plot = new BarPlot($values);
$plot->setBarColor(
new Color(250, 230, 180)
);
$plot->setSpace(5, 5, NULL, NULL);
$plot->barShadow->setSize(3);
$plot->barShadow->setPosition(Shadow::RIGHT_TOP);
$plot->barShadow->setColor(new Color(180, 180, 180, 10));
$plot->barShadow->smooth(TRUE);
$graph->add($plot);
$graph->draw();
?>
Le hic, c'est que maintenant, j'ai l'erreur suivante :
Parse error: syntax error, unexpected ')', expecting '(' in /homepages/15/d256505805/htdocs/graphiques/detail_note_match.php on line 29
et en pluc, je ne vois pas où se joue le lien sur le graphique entre note et occurences
Ok, je comprends presque tout, merci. En adaptant, j'ai donc ceci :
[php]
<?php
$RefMatch = 1;
require_once "../Artichow/BarPlot.class.php";
require_once('../Connections/connection_top_stats.php');
mysql_select_db($database_connection_top_stats, $connection_top_stats);
$resultat = mysql_query("SELECT Texte, COUNT(*) as Occurences FROM Votes WHERE IdMatch = '$RefMatch' GROUP BY Texte ORDER BY Texte");
$values = array();
$nombres = array();
while ($resultat && $row = mysql_fetch_array($resultat))
{
$values[] = $row["Texte"];
$nombres[] = $row["Occurences"];
}
$graph = new Graph(400, 400);
$graph->setAntiAliasing(TRUE);
//$values = array(19, 42, 15, -25, 3);
$plot = new BarPlot($values);
$plot->setBarColor(
new Color(250, 230, 180)
);
$plot->setSpace(5, 5, NULL, NULL);
$plot->barShadow->setSize(3);
$plot->barShadow->setPosition(Shadow::RIGHT_TOP);
$plot->barShadow->setColor(new Color(180, 180, 180, 10));
$plot->barShadow->smooth(TRUE);
$graph->add($plot);
$graph->draw();
?>
[/php]
Le hic, c'est que maintenant, j'ai l'erreur suivante :
[quote]Parse error: syntax error, unexpected ')', expecting '(' in /homepages/15/d256505805/htdocs/graphiques/detail_note_match.php on line 29[/quote]
et en pluc, je ne vois pas où se joue le lien sur le graphique entre note et occurences