[PHP][Jpgraph] Need Help pour faire des arrondis de courbe

Need Help pour faire des arrondis de courbe [PHP][Jpgraph] - PHP - Programmation

Marsh Posté le 17-09-2003 à 15:06:21    

voila mon pti code
 

Code :
  1. <?php
  2. include("./admin/kevin.inc.php" );
  3. include("./admin/connec.php" );
  4. include "./jpgraph/jpgraph.php";
  5. include "./jpgraph/jpgraph_line.php";
  6. include "./jpgraph/jpgraph_regstat.php";
  7. // Original data points
  8. $graphresult = mysql_query ("-----" ) or die ("la requete a echouee" );
  9. $graphr = @mysql_fetch_array($graphresult);
  10. $chaine = $graphr[TOTO];
  11. $chaine = str_replace(",", ".", $chaine);
  12. $ydata = explode("|", $chaine);
  13. $xdata = array();
  14. for ($i=0;$i<=120;$i++)
  15. {
  16. array_push($xdata,"$i" );
  17. }
  18. // Get the interpolated values by creating
  19. // a new Spline object.
  20. $spline = new Spline($xdata,$ydata);
  21. // For the new data set we want 40 points to
  22. // get a smooth curve.
  23. list($newx,$newy) = $spline->Get(40);
  24. // Create the graph
  25. $g = new Graph(690,433,"auto" );
  26. $g->SetScale('linlin');
  27. $g->SetMargin(50,20,40,40);
  28. $g->SetMarginColor('white');
  29. $g->img->SetAntiAliasing();
  30. // We need a linlin scale since we provide both
  31. // x and y coordinates for the data points.
  32. $g->yaxis->SetLabelmargin(4);
  33. $g->yaxis->SetTitlemargin(35);
  34. $g->xaxis->SetLabelFormat('%1.0f');
  35. $g->yaxis->SetLabelFormat('%1.2f');
  36. $g->yaxis->scale->SetGrace(10,10 );
  37. $g->yaxis->SetTickSide(SIDE_LEFT);
  38. $g->xaxis->SetTickSide(SIDE_DOWN);
  39. // And a line plot to stroke the smooth curve we got
  40. // from the original control points
  41. $lplot = new LinePlot($newy,$newx);
  42. $lplot->SetColor('red');
  43. // Add the plots to the graph and stroke
  44. $g->Add($lplot);
  45. $g->Stroke();
  46. ?>


 
Le resultat
 
http://assoslens.free.fr/essai.jpg
 
j aurais aimé avoir des arrondis sur les angles de la courbe, si qqn pouvait m aiguiller ?
 
thx


Message édité par nidosaur le 17-09-2003 à 16:49:00
Reply

Marsh Posté le 17-09-2003 à 15:06:21   

Reply

Marsh Posté le 17-09-2003 à 16:11:15    

:bounce:

Reply

Marsh Posté le 18-09-2003 à 09:04:16    

Si j'etais toi je poserais la question ici : http://jpgraph.fan-atics.com/

Reply

Marsh Posté le 18-09-2003 à 14:55:18    

Quand on trace un graphe correspondant à des données réelles, si ces données sont "anguleuses", le graphe le sera aussi.
 
Arrondir les angles, ça plonge le problème dans le domaine artistique. :)

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed