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 :

[JPGraph] Affichage des valeurs nulles.


Sujet :

Bibliothèques et frameworks PHP

  1. #1
    Membre habitué
    Homme Profil pro
    Inscrit en
    Octobre 2011
    Messages
    281
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Octobre 2011
    Messages : 281
    Points : 161
    Points
    161
    Par défaut [JPGraph] Affichage des valeurs nulles.
    Bonjour,

    J'utilise la bibliothèque JPGraph pour faire des graphiques.
    Les données sont stockés dans un tableau.

    Mon problème est le suivant : Lorsque la valeur est nulle (=0), cela ne me trace pas la partie correspondante sur le graphe. Comment puis-je faire pour afficher cette portion de courbe ?

    Merci de votre aide.

  2. #2
    Membre éclairé Avatar de ypcman
    Homme Profil pro
    Retraité codeur !
    Inscrit en
    Janvier 2011
    Messages
    595
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Maine et Loire (Pays de la Loire)

    Informations professionnelles :
    Activité : Retraité codeur !
    Secteur : Aéronautique - Marine - Espace - Armement

    Informations forums :
    Inscription : Janvier 2011
    Messages : 595
    Points : 879
    Points
    879
    Par défaut
    Bonjour.
    Ne veux tu pas plutôt dire que tu as certaines valeurs qui n'existent pas ?
    Par exemple, sur un an, il te manque les valeurs pour mars et juin. Dans ce cas, si tu veux que ta courbe soit tracée de février à avril et de mai à juillet, tu dois remplacer les non-valeurs de mars et juin par "-".
    Participez vous aussi !
    Message utile
    Discussion résolue

  3. #3
    Membre habitué
    Homme Profil pro
    Inscrit en
    Octobre 2011
    Messages
    281
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Octobre 2011
    Messages : 281
    Points : 161
    Points
    161
    Par défaut
    Toutes mes valeurs viennent d'une base de données donc elles existent.

    Lorsque la valeur est 0 dans la bdd , cela ne m'affiche rien sur le graphe.

  4. #4
    Membre éclairé Avatar de ypcman
    Homme Profil pro
    Retraité codeur !
    Inscrit en
    Janvier 2011
    Messages
    595
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Maine et Loire (Pays de la Loire)

    Informations professionnelles :
    Activité : Retraité codeur !
    Secteur : Aéronautique - Marine - Espace - Armement

    Informations forums :
    Inscription : Janvier 2011
    Messages : 595
    Points : 879
    Points
    879
    Par défaut
    Bien vu.
    peux-tu :
    • faire un var_dump() du tableau que tu construis en sortie de requète et que tu envois pour visualisation et le poster ?
    • poster un graphe pour visualiser le pb ?

    Merci.
    Participez vous aussi !
    Message utile
    Discussion résolue

  5. #5
    Membre habitué
    Homme Profil pro
    Inscrit en
    Octobre 2011
    Messages
    281
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Octobre 2011
    Messages : 281
    Points : 161
    Points
    161
    Par défaut
    1. Voilà j'ai effectué un var_dump :

    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
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
     
    array
      0 => string '0' (length=1)
      1 => string '0' (length=1)
      2 => string '0' (length=1)
      3 => string '0' (length=1)
      4 => string '0' (length=1)
      5 => string '0' (length=1)
      6 => string '0' (length=1)
      7 => string '0' (length=1)
      8 => string '0' (length=1)
      9 => string '0' (length=1)
      10 => string '0' (length=1)
      11 => string '0' (length=1)
      12 => string '0' (length=1)
      13 => string '0' (length=1)
      14 => string '0' (length=1)
      15 => string '0' (length=1)
      16 => string '0' (length=1)
      17 => string '0' (length=1)
      18 => string '0' (length=1)
      19 => string '0' (length=1)
      20 => string '0' (length=1)
      21 => string '0' (length=1)
      22 => string '0' (length=1)
      23 => string '0' (length=1)
      24 => string '0' (length=1)
      25 => string '0' (length=1)
      26 => string '0' (length=1)
      27 => string '0' (length=1)
      28 => string '0' (length=1)
      29 => string '0' (length=1)
      30 => string '0' (length=1)
      31 => string '0' (length=1)
      32 => string '1.27' (length=4)
      33 => string '7.97' (length=4)
      34 => string '15.4' (length=4)
      35 => string '26.99' (length=5)
      36 => string '41.4' (length=4)
      37 => string '43.56' (length=5)
      38 => string '38.47' (length=5)
      39 => string '78.47' (length=5)
      40 => string '90.46' (length=5)
      41 => string '96.24' (length=5)
      42 => string '90.89' (length=5)
      43 => string '92.82' (length=5)
      44 => string '116.07' (length=6)
      45 => string '125.07' (length=6)
      46 => string '86' (length=2)
      47 => string '66.49' (length=5)
      48 => string '80.31' (length=5)
      49 => string '90.39' (length=5)
      50 => string '103.89' (length=6)
      51 => string '114.02' (length=6)
      52 => string '115.8' (length=5)
      53 => string '134.57' (length=6)
      54 => string '185.59' (length=6)
      55 => string '236.81' (length=6)
      56 => string '295.18' (length=6)
      57 => string '305.48' (length=6)
      58 => string '278.03' (length=6)
      59 => string '248.44' (length=6)
      60 => string '337.47' (length=6)
      61 => string '409.74' (length=6)
      62 => string '524.62' (length=6)
      63 => string '378.75' (length=6)
      64 => string '332.97' (length=6)
      65 => string '347.66' (length=6)
      66 => string '415.98' (length=6)
      67 => string '376.96' (length=6)
      68 => string '372.06' (length=6)
      69 => string '379.57' (length=6)
      70 => string '427.81' (length=6)
      71 => string '418.1' (length=5)
      72 => string '352.94' (length=6)
      73 => string '320.08' (length=6)
      74 => string '340.96' (length=6)
      75 => string '308.12' (length=6)
      76 => string '303.33' (length=6)
      77 => string '307.25' (length=6)
      78 => string '269.66' (length=6)
      79 => string '263.61' (length=6)
      80 => string '221.97' (length=6)
      81 => string '166.11' (length=6)
      82 => string '123.3' (length=5)
      83 => string '108.16' (length=6)
      84 => string '79.72' (length=5)
      85 => string '79.47' (length=5)
      86 => string '84.38' (length=5)
      87 => string '86.82' (length=5)
      88 => string '92.97' (length=5)
      89 => string '78.73' (length=5)
      90 => string '60.03' (length=5)
      91 => string '39.98' (length=5)
      92 => string '49.32' (length=5)
      93 => string '51.47' (length=5)
      94 => string '42.76' (length=5)
      95 => string '35.78' (length=5)
      96 => string '30.32' (length=5)
      97 => string '34.81' (length=5)
      98 => string '36.82' (length=5)
      99 => string '33.1' (length=4)
      100 => string '21.43' (length=5)
      101 => string '10.14' (length=5)
      102 => string '5.09' (length=4)
      103 => string '0.94' (length=4)
      104 => string '0' (length=1)
      105 => string '0' (length=1)
      106 => string '0' (length=1)
      107 => string '0' (length=1)
      108 => string '0' (length=1)
      109 => string '0' (length=1)
      110 => string '0' (length=1)
      111 => string '0' (length=1)
      112 => string '0' (length=1)
      113 => string '0' (length=1)
      114 => string '0' (length=1)
      115 => string '0' (length=1)
      116 => string '0' (length=1)
      117 => string '0' (length=1)
      118 => string '0' (length=1)
      119 => string '0' (length=1)
      120 => string '0' (length=1)
      121 => string '0' (length=1)
      122 => string '0' (length=1)
      123 => string '0' (length=1)
      124 => string '0' (length=1)
      125 => string '0' (length=1)
      126 => string '0' (length=1)
      127 => string '0' (length=1)
    2. Le graphique correspondant (voir pièce jointe)

    Comme vous pouvez le voir lorsque la valeur est '0' rien ne s'affiche sur le graphe.
    Images attachées Images attachées  

  6. #6
    Membre éclairé Avatar de ypcman
    Homme Profil pro
    Retraité codeur !
    Inscrit en
    Janvier 2011
    Messages
    595
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Maine et Loire (Pays de la Loire)

    Informations professionnelles :
    Activité : Retraité codeur !
    Secteur : Aéronautique - Marine - Espace - Armement

    Informations forums :
    Inscription : Janvier 2011
    Messages : 595
    Points : 879
    Points
    879
    Par défaut
    En fait, ceux ne sont pas les valeurs nulles mais celles qui se trouvent sous l'axe des X qui sont cachées par l'axe des X.
    Tu peux contourner la difficulté en rajoutant :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    $graph->yaxis->scale ->SetGrace(10, 10);
    $graph->xaxis->SetPos("min");
    $graph->xaxis->SetLabelSide(SIDE_DOWN);
    Ça décalera légèrement les valeurs nulles de l'axe des X
    Participez vous aussi !
    Message utile
    Discussion résolue

  7. #7
    Membre habitué
    Homme Profil pro
    Inscrit en
    Octobre 2011
    Messages
    281
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Octobre 2011
    Messages : 281
    Points : 161
    Points
    161
    Par défaut
    Merci de votre aide.

    J'ai utlilisé le code que vous m'avez donné et le résultat se trouve en pièce jointe.

    C'est exactement ce que je veux sauf que l'axe des Y comme à -50, j'aimerais qu'il commence à 0.
    Images attachées Images attachées  

Discussions similaires

  1. [2K8] NON AFFICHAGE DES VALEURS NULLES
    Par MELIGEO dans le forum SSAS
    Réponses: 0
    Dernier message: 18/06/2010, 15h18
  2. Pas d'affichage des valeurs nulles avec un COUNT
    Par phoenixz22 dans le forum Langage SQL
    Réponses: 13
    Dernier message: 30/05/2007, 18h39
  3. [SQL] Affichage des valeurs nulles dans un Count
    Par at_first dans le forum Access
    Réponses: 4
    Dernier message: 06/03/2007, 11h07
  4. NOT NULL enregistre des valeurs null
    Par tyberium dans le forum Langage SQL
    Réponses: 2
    Dernier message: 04/12/2006, 09h20
  5. Affichage des valeurs des variables avec tkprof
    Par hkhan13 dans le forum Oracle
    Réponses: 2
    Dernier message: 04/07/2006, 11h59

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