<?
require('class_new.php3');
$graph=new graph(500,400); //width and height of the graph
srand(time());
$im=time();
$graph->filename="images/graph".$im.".gif";
$graph->datay=array();
$graph->nbz=5; //number of z on axe (one less than number of line because line
start at 0)
$graph->nbcourbe=6; //number of lines
$graph->nbdonnee=19;
$graph->nbx=20; // nnmber of x on axe
$graph->nby=35; // number of y on axe
$graph->labelX=array(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20);
$graph->labelY=array
(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,3
1,32,33,34,35,36,37,38,39,40);
$graph->labelZ=array("courbe 1","courbe 2","courbe 3","courbe 4","courbe 5","courbe
6");
$graph->titre="GRAPH 3D";
$graph->titre_labelY="Label des Y";
$graph->titre_labelX="Label des X";
$graph->diago='oui'; // 'non' if you don't want diagonal
//$graph->color (number of surface (start from 0), red, green, blue)
$graph->coloris (0,245,197,197);
$graph->coloris (1,245,211,163);
$graph->coloris (2,252,180,76);
$graph->coloris (3,252,105,76);
$graph->coloris (4,205,85,65);
//$graph->lignecolor (number of line(start from 0), red, green ,blue)
//attention there is one more line color than surface color
$graph->lignecolor(0,11,25,157);
$graph->lignecolor(1,17,36,219);
$graph->lignecolor(2,103,116,239);
$graph->lignecolor(3,152,161,242);
$graph->lignecolor(4,204,208,248);
$graph->lignecolor(5,229,231,253);
//générateur aléatoire de courbe
// il faut de préférence mettre les courbes à petites valeur en premier pour aller
dans un ordre
croissant
for ($ne=0;$ne<19;$ne++) {
$num[0]=rand(0,35);
$num[1]=rand(0,35);
$num[2]=rand(0,35);
$num[3]=rand(0,35);
$num[4]=rand(0,35);
$num[5]=rand(0,35);
sort($num);
$graph->datay[0][$ne]=$num[0];
unset($graph->datay[0][6]); // to see what's passing when a data is not define
$graph->datay[1][$ne]=$num[1];
$graph->datay[2][$ne]=$num[2];
unset($graph->datay[2][12]); // to see what's passing when a data is not define
$graph->datay[3][$ne]=$num[3];
$graph->datay[4][$ne]=$num[4];
$graph->datay[5][$ne]=$num[5];
};
$graph->create_graph();
$graph->create(); // create image
echo"<table width=750><tr><td align=center><img src=\"/images/graph$im.gif\"
width=500
height=400></td></tr></table>";
$graph->destroy(); // destroy image
?>
Latest ver at : http://alti.free.fr/alti/php |