Grand probleme?

  • Auteur de la discussion Auteur de la discussion foudhq
  • Date de début Date de début
Nouveau WRInaute
Voici un script php qui affiche un grahpe
Code:
<?php
/*
 * This work is hereby released into the Public Domain.
 * To view a copy of the public domain dedication,
 * visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
 * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
 *
 */

require_once "../LinePlot.class.php";

$graph = new Graph(700, 300);

// Set title
$graph->title->set('HEllo');
$graph->title->setFont(new Tuffy(12));
$graph->title->setColor(new DarkRed);

$plot = new LinePlot(array(5, 3, 4, 7, 6, 5, 8, 4, 7,8,5,51,66,77,88,99,100,11111));

// Change plot size and position
$plot->setSize(0.76, 1);
$plot->setCenter(0.38, 0.5);

$plot->setPadding(30, 15, 38, 25);
$plot->setColor(new Orange());
$plot->setFillColor(new LightOrange(80));

// Change grid style
$plot->grid->setType(LINE_DASHED);
voici un script php qui trace 

// Add customized  marks
$plot->mark->setType(MARK_STAR);
$plot->mark->setFill(new MidRed);
$plot->mark->setSize(6);

// Change legend
$plot->legend->setPosition(1, 0.5);
$plot->legend->setAlign(LEGEND_LEFT);
$plot->legend->shadow->smooth(TRUE);

$plot->legend->add($plot, 'My line', LEGEND_MARK);

$graph->add($plot);
$graph->draw();
?>
Mais losque je place dans une page html il n'affiche rien c a d comme sa :
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?php
/*
 * This work is hereby released into the Public Domain.
 * To view a copy of the public domain dedication,
 * visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
 * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
 *
 */

require_once "../LinePlot.class.php";

$graph = new Graph(700, 300);

// Set title
$graph->title->set('HEllo');
$graph->title->setFont(new Tuffy(12));
$graph->title->setColor(new DarkRed);

$plot = new LinePlot(array(5, 3, 4, 7, 6, 5, 8, 4, 7,8,5,51,66,77,88,99,100,11111));

// Change plot size and position
$plot->setSize(0.76, 1);
$plot->setCenter(0.38, 0.5);

$plot->setPadding(30, 15, 38, 25);
$plot->setColor(new Orange());
$plot->setFillColor(new LightOrange(80));

// Change grid style
$plot->grid->setType(LINE_DASHED);

// Add customized  marks
$plot->mark->setType(MARK_STAR);
$plot->mark->setFill(new MidRed);
$plot->mark->setSize(6);

// Change legend
$plot->legend->setPosition(1, 0.5);
$plot->legend->setAlign(LEGEND_LEFT);
$plot->legend->shadow->smooth(TRUE);

$plot->legend->add($plot, 'My line', LEGEND_MARK);

$graph->add($plot);
$graph->draw();
?>
</body>
</html>
SVp aidez moi

merci d'avance :!:
 
WRInaute occasionnel
C'est pas une histoire d'image ce truc ?
Du genre il faut appeler le script dans une balise html img.

C'est quoi LinePlot ca vient d'ou ?
 
WRInaute accro
Tu dis que ça n'affiche rien : tu as des messages d'erreurs ? Tu es sur que ton include est bon (c'est à dire que tu remontes au bon dossier) ?
 
WRInaute discret
Bonsoir,

K2pi a raison, quand tu utilise Artichow il faut d'abord créer le fichier php qui contient le code du graphe (on l'appelle image.php par exemple).

Et ensuite dans ta page tu traites le fichier comme une image:

Code:
<img src="chemin vers ton répertoire/image.php" alt="graphique"  style="border:0; width:700px; height:300px">

A+

Jean-Denis
 
WRInaute discret
Oui, ce script ressemble à Artichow ou Jpgraph : Classes PHP destinés à générer des graphiques .. Assez simpa à utiliser :)
 
Nouveau WRInaute
%%%le page est bien sauvgarde .php
%%%D'abode j'explique mon objectif ce quoi?
C'est de faire un courbe en temps reel ,donc l'idee ce de faire un courbe avec artichow et faire l'actulisation automatique a chaque seconde puisque le valeur son reccupere de BD que son taille change chaque seconde.
Concernat ce code elle ne permet pas de l'actulise a chque fois automatque
Code:
[color=#FF4080]<img src="chemin vers ton répertoire/image.php" alt="graphique"  style="border:0; width:700px; height:300px">[/color]
Si l'un de vous peut me aide
Finalemeent je vous remerci
:?:
 

➡️ Offre MyRankingMetrics ⬅️

pré-audit SEO gratuit avec RM Tech (+ avis d'expert)
coaching offert aux clients (avec Olivier Duffez ou Fabien Faceries)

Voir les détails ici

coaching SEO
Discussions similaires
Haut