IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Bibliothèques et frameworks PHP Discussion :

[Artichow] Call to undefined method Graph::getDrawer()


Sujet :

Bibliothèques et frameworks PHP

  1. #1
    Membre habitué
    Inscrit en
    Janvier 2007
    Messages
    201
    Détails du profil
    Informations personnelles :
    Âge : 79

    Informations forums :
    Inscription : Janvier 2007
    Messages : 201
    Points : 154
    Points
    154
    Par défaut [Artichow] Call to undefined method Graph::getDrawer()
    Bonjour à toutes et à tous

    J'ai fait un copié/collé de l'exemple de la grille en bleu cité sur le site Artichow et j'ai l'erreur :
    Fatal error: Call to undefined method Graph::getDrawer() in C:\www\Tsa2\Test1artichow.php on line 8
    La ligne 8 est : $drawer = $graph->getDrawer();
    La même erreur avec 1.1.0 et 2.0-alpha.
    Je suis sous php5 et j'ai bien l'extension php_gd2.
    Bien sur j'ai signalé le problème sur http://www.artichow.org/mantis/view.php?id=46
    mais je n'ai pas de réponse.
    Bien cordialement,

  2. #2
    Membre averti Avatar de Sekigawa
    Profil pro
    Développeur Web
    Inscrit en
    Mars 2008
    Messages
    432
    Détails du profil
    Informations personnelles :
    Âge : 37
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Mars 2008
    Messages : 432
    Points : 359
    Points
    359
    Par défaut
    Salut remplace $drawer = $graph->getDrawer(); par $graph->draw("TonGraph.png");
    Cookie : Anciennement petit gâteau sucré, qu'on acceptait avec plaisir. Aujourd'hui : petit fichier informatique drôlement salé, qu'il faut refuser avec véhémence.

  3. #3
    Membre habitué
    Inscrit en
    Janvier 2007
    Messages
    201
    Détails du profil
    Informations personnelles :
    Âge : 79

    Informations forums :
    Inscription : Janvier 2007
    Messages : 201
    Points : 154
    Points
    154
    Par défaut
    Merci Sekigawa, mais maintenant j'ai :
    Fatal error: Call to a member function line() on a non-object in C:\www\Tsa2\Test1artichow.php on line 8
    Il doit me manquer quelque chose !!
    Voici mon source :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    31
    32
    33
    34
     
    <?php
       require_once "Artichow-php5/Graph.class.php";
       require_once "Artichow-php5/LinePlot.class.php";
       $graph = new Graph(400, 30);
       $graph->border->hide();
       $drawer = $graph->draw("BeloGraph.png");   
       for($i = 7; $i < 400; $i += 15) {
          $drawer->line(
             new Color(0, 0, 0),
             new Line(
                new Point($i, 0),
                new Point($i, 30)
             )
          );
       }
       for($i = 7; $i < 30; $i += 15) {
          $drawer->line(
             new Color(0, 0, 0),
             new Line(
                new Point(0, $i),
                new Point(400, $i)
             )
          );
       }
        $drawer->filledRectangle(
          new Color(0, 100, 200, 50),
          new Line(
             new Point(0, 0),
             new Point(400, 30)
          )
       );
        $graph->draw();
    ?>

  4. #4
    Membre averti Avatar de Sekigawa
    Profil pro
    Développeur Web
    Inscrit en
    Mars 2008
    Messages
    432
    Détails du profil
    Informations personnelles :
    Âge : 37
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Mars 2008
    Messages : 432
    Points : 359
    Points
    359
    Par défaut
    quand tu fais graph->draw() précise la parenthèse
    Cookie : Anciennement petit gâteau sucré, qu'on acceptait avec plaisir. Aujourd'hui : petit fichier informatique drôlement salé, qu'il faut refuser avec véhémence.

  5. #5
    Membre habitué
    Inscrit en
    Janvier 2007
    Messages
    201
    Détails du profil
    Informations personnelles :
    Âge : 79

    Informations forums :
    Inscription : Janvier 2007
    Messages : 201
    Points : 154
    Points
    154
    Par défaut
    Heu... Que dois-je comprendre par
    précise la parenthèse
    ?
    Et mon erreur est sur line(... et non pas draw.
    En tous cas, merci.

  6. #6
    Membre habitué
    Inscrit en
    Janvier 2007
    Messages
    201
    Détails du profil
    Informations personnelles :
    Âge : 79

    Informations forums :
    Inscription : Janvier 2007
    Messages : 201
    Points : 154
    Points
    154
    Par défaut Eureka, merci Google
    En faisant une recherche sur getDrawer, la page http://artichow.org/forum/read.php?2,3226,3229
    m'a dit que getDrawer était devenue getDriver.
    Elémentaire mon cher Watson.
    Donc voici le source qui fonctionne bien :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    31
    32
    33
    34
    35
     
    <?php
       require_once "Artichow-php5/Graph.class.php";
       require_once "Artichow-php5/LinePlot.class.php";
       $graph = new Graph(400, 30);
       $graph->border->hide();
    //   $drawer = $graph->draw("BeloGraph.png"); 
    $drawer = $graph->getDriver();  
       for($i = 7; $i < 400; $i += 15) {
          $drawer->line(
             new Color(0, 0, 0),
             new Line(
                new Point($i, 0),
                new Point($i, 30)
             )
          );
       }
       for($i = 7; $i < 30; $i += 15) {
          $drawer->line(
             new Color(0, 0, 0),
             new Line(
                new Point(0, $i),
                new Point(400, $i)
             )
          );
       }
        $drawer->filledRectangle(
          new Color(0, 100, 200, 50),
          new Line(
             new Point(0, 0),
             new Point(400, 30)
          )
       );
        $graph->draw();
    ?>

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [PHP 5.2] Fatal error: Call to undefined method DateTime::sub()
    Par made_in_france dans le forum Langage
    Réponses: 2
    Dernier message: 31/01/2011, 09h39
  2. [sfGuard] Call to undefined method myUser::setReferer
    Par jylac dans le forum Plugins
    Réponses: 3
    Dernier message: 11/06/2010, 00h13
  3. [1.x] Call to undefined method CommandeForm::save()
    Par sacricri dans le forum Symfony
    Réponses: 5
    Dernier message: 09/01/2010, 16h24
  4. [PDO] Call to undefined method PDOStatement::lastinsertid()
    Par megacool dans le forum PHP & Base de données
    Réponses: 1
    Dernier message: 18/10/2008, 15h32
  5. Réponses: 0
    Dernier message: 25/02/2008, 17h28

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo