Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1146 connectés 

  FORUM HardWare.fr
  Programmation
  PHP

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

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

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

n°516560
nidosaur
Hugh !^.
Posté le 17-09-2003 à 15:06:21  profilanswer
 

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
mood
Publicité
Posté le 17-09-2003 à 15:06:21  profilanswer
 

n°516616
nidosaur
Hugh !^.
Posté le 17-09-2003 à 16:11:15  profilanswer
 

:bounce:

n°516883
impulse
Posté le 18-09-2003 à 09:04:16  profilanswer
 

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

n°517185
Carbon_14
Posté le 18-09-2003 à 14:55:18  profilanswer
 

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. :)


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  PHP

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

 

Sujets relatifs
[PHP?] Redirection mais affichage html avant[PHP] insérer une image dans MySql
[PHP] Question toute bete sur GET[PHP]1 ptit coup de main pour une insertion dans un fichier svp [OK]
[PHP] pb retour de formulaire -> int neededlecture d'eeprom ( HELP)
[PHP] Afficher le résultat d'une grosse requête ?[PHP] Sauvegarder le résultat d'une requête dans un fichier excel ?
[PHP & MYSQL] Utiliser une fonction PHP dans un LONGTEXT MySQL ![ PHP ] PHP et Feuille de Style CSS
Plus de sujets relatifs à : [PHP][Jpgraph] Need Help pour faire des arrondis de courbe


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR