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

Langage PHP Discussion :

erreur sur un code d'artichow


Sujet :

Langage PHP

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Profil pro
    Inscrit en
    Mai 2007
    Messages
    87
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2007
    Messages : 87
    Par défaut erreur sur un code d'artichow
    bonsoir j'ai récuperer ce code sur le site d'artichow, et quand je le lance il m'in dique une erreur : Parse error: parse error, expecting `'('' in c:\program files\easyphp1-8\www\graph\artichow-php4+5\examples\test1.php on line 52
    D'où provient cette erreur, merci pour votre aide

    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
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    <?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(300, 175);
    $graph->setAntiAliasing(TRUE);
     
    $x = array(
        3, 1, 5, 6, 3, 8, 6
    );
     
    $plot = new LinePlot($x);
     
    $plot->grid->setNoBackground();
     
    $plot->title->set("Filled line and marks");
    $plot->title->setFont(new Tuffy(10));
    $plot->title->setBackgroundColor(new Color(255, 255, 255, 25));
    $plot->title->border->show();
    $plot->title->setPadding(3, 3, 3, 3);
    $plot->title->move(-20, 25);
     
    $plot->setSpace(4, 4, 10, 0);
    $plot->setPadding(25, 15, 10, 18);
     
    $plot->setBackgroundGradient(
        new LinearGradient(
            new Color(210, 210, 210),
            new Color(255, 255, 255),
            0
        )
    );
     
    $plot->setColor(new Color(0, 0, 150, 20));
     
    $plot->setFillGradient(
        new LinearGradient(
            new Color(150, 150, 210),
            new Color(245, 245, 245),
            0
        )
    );
     
    $plot->mark->setType(Mark::CIRCLE);
    $plot->mark->border->show();
     
    $y = array(
        'Lundi',
        'Mardi',
        'Mercredi',
        'Jeudi',
        'Vendredi',
        'Samedi',
        'Dimanche'
    );
     
    $plot->xAxis->setLabelText($y);
    $plot->xAxis->label->setFont(new Tuffy(7));
     
    $graph->add($plot);
    $graph->draw();
    ?>

  2. #2
    Membre émérite Avatar de Korko Fain
    Profil pro
    Étudiant
    Inscrit en
    Août 2005
    Messages
    632
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Août 2005
    Messages : 632
    Par défaut
    essaye en améliorant la lisibilité ainsi :
    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
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    <?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(300, 175);
    $graph->setAntiAliasing(TRUE);
     
    $x = array(
        3, 1, 5, 6, 3, 8, 6
    );
     
    $plot = new LinePlot($x);
     
    $plot->grid->setNoBackground();
     
    ($plot->title)->set("Filled line and marks");
    ($plot->title)->setFont(new Tuffy(10));
    ($plot->title)->setBackgroundColor(new Color(255, 255, 255, 25));
    (($plot->title)->border)->show();
    ($plot->title)->setPadding(3, 3, 3, 3);
    ($plot->title)->move(-20, 25);
     
    $plot->setSpace(4, 4, 10, 0);
    $plot->setPadding(25, 15, 10, 18);
     
    $plot->setBackgroundGradient(
        new LinearGradient(
            new Color(210, 210, 210),
            new Color(255, 255, 255),
            0
        )
    );
     
    $plot->setColor(new Color(0, 0, 150, 20));
     
    $plot->setFillGradient(
        new LinearGradient(
            new Color(150, 150, 210),
            new Color(245, 245, 245),
            0
        )
    );
     
    ($plot->mark)->setType(Mark::CIRCLE);
    (($plot->mark)->border)->show();
     
    $y = array(
        'Lundi',
        'Mardi',
        'Mercredi',
        'Jeudi',
        'Vendredi',
        'Samedi',
        'Dimanche'
    );
     
    ($plot->xAxis)->setLabelText($y);
    (($plot->xAxis)->label)->setFont(new Tuffy(7));
     
    $graph->add($plot);
    $graph->draw();
    ?>
    Mais j'y crois pas trop. J'avoue que là je comprend pas. Il attend une parenthese à la ligne :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    $plot->mark->setType(Mark::CIRCLE);
    Mais il ne la trouve pas...

  3. #3
    Membre Expert
    Inscrit en
    Janvier 2005
    Messages
    2 291
    Détails du profil
    Informations forums :
    Inscription : Janvier 2005
    Messages : 2 291
    Par défaut
    J'ai testé ce code chez moi et ca marche sans probleme. Quelle version de PHP utilises_tu?

  4. #4
    Membre émérite Avatar de Korko Fain
    Profil pro
    Étudiant
    Inscrit en
    Août 2005
    Messages
    632
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Août 2005
    Messages : 632
    Par défaut
    Ah il est peut etre sous php4 ! Pour ça qu'il aime pas les objets imbriqués ^^

Discussions similaires

  1. Message d'erreur sur un code
    Par FCL31 dans le forum VBA Access
    Réponses: 2
    Dernier message: 12/09/2007, 15h55
  2. EXCEL/ VBA Erreur sur le code VBA : rediriger l’erreur
    Par hiline6 dans le forum Macros et VBA Excel
    Réponses: 1
    Dernier message: 28/12/2006, 17h28
  3. [Visual Web] Erreur sur le code
    Par diamonds dans le forum NetBeans
    Réponses: 8
    Dernier message: 16/12/2006, 14h24
  4. [Erreur sur un code pris sur ce forum]
    Par Nigo dans le forum Réseau
    Réponses: 8
    Dernier message: 15/04/2006, 19h35
  5. erreur sur un code source basique
    Par helix_tp dans le forum Langage
    Réponses: 4
    Dernier message: 23/01/2006, 22h55

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