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

Delphi Discussion :

Graphe Delphi à partir d'une table


Sujet :

Delphi

  1. #1
    Membre régulier
    Inscrit en
    Janvier 2007
    Messages
    107
    Détails du profil
    Informations personnelles :
    Âge : 40

    Informations forums :
    Inscription : Janvier 2007
    Messages : 107
    Points : 73
    Points
    73
    Par défaut Graphe Delphi à partir d'une table
    salut pour tous.
    comment faire un graphe depuis un table(stringgrid);
    merci d'avence.

  2. #2
    Membre expert
    Avatar de TicTacToe
    Inscrit en
    Septembre 2005
    Messages
    1 940
    Détails du profil
    Informations personnelles :
    Âge : 52

    Informations forums :
    Inscription : Septembre 2005
    Messages : 1 940
    Points : 3 575
    Points
    3 575
    Par défaut
    sur TChart

  3. #3
    Membre chevronné
    Avatar de Archimède
    Homme Profil pro
    Enseignant
    Inscrit en
    Avril 2005
    Messages
    1 644
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 59
    Localisation : France, Charente Maritime (Poitou Charente)

    Informations professionnelles :
    Activité : Enseignant
    Secteur : Enseignement

    Informations forums :
    Inscription : Avril 2005
    Messages : 1 644
    Points : 1 975
    Points
    1 975
    Par défaut
    ou alors tu t'en fais un...
    tiens un exemple tout à fait basique mais que tu peux améliorer...
    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
    unit UTraceur;
     
    interface
    uses graphics,Types;
     
    type
    TGrapheur=Class(TBitmap)
    private
    xo,yo:integer;
    public
    constructor create(largeur,hauteur:integer);
    procedure tracerepere(xopourcentage,yopourcentage,epaisseur:integer;axex,axey:string;couleur:Tcolor);
    Procedure tracecourbe(x,y:extended;maxx,maxy:integer);
    end;
    implementation
     
    constructor TGrapheur.create(largeur,hauteur:integer);
    begin
    inherited create;
    height:=hauteur;
    width:=largeur;
    end;
     
     
    procedure TGrapheur.tracerepere(xopourcentage,yopourcentage,epaisseur:integer;axex,axey:String;couleur:Tcolor);
    begin
    xo:=round(xopourcentage/100*Width);
    yo:=round(yopourcentage/100*height);
    with canvas do begin
    pen.width:=epaisseur;
    pen.color:=couleur;
    moveto(round(0.05*Width),yo);
    lineto(round(0.95*Width),yo);
    moveto(round(0.95*Width),yo);
    lineto(round(0.95*Width-width div 30),Round(yo-width div 80));
    moveto(round(0.95*Width),yo);
    lineto(round(0.95*Width-width div 30),Round(yo+width div 80));
    moveto(xo,width div 30);
    lineto(xo,height-width div 30);
    moveto(xo,width div 30);
    lineto(xo-width div 80,2*width div 30);
    moveto(xo,width div 30);
    lineto(xo+width div 80,2*width div 30);
    Font.Size:=width div 40;
    Textout(width-width div 10,yo+width div 80,axex);
    Textout(xo+width div 40,width div 30,axey);
    end;
    end;
     
    Procedure TGrapheur.tracecourbe(x,y:extended;maxx,maxy:integer);
    var GX,GY:integer;
    begin
    GX:=Round((width/Maxx)*x+xo);
    GY:=Round((-width/maxx)*y+yo);
    with canvas do begin
    moveto(-width div 100+GX,GY);
    lineto(width div 100+GX,GY);
    moveto(GX,GY-width div 100);
    lineto(GX,GY+width div 100);
    end;
    end;
     
    end.
    tu as une ébauche que tu peux largement améliorer...

Discussions similaires

  1. [Artichow] Comment créer un graphe à partir d'une table mysql avec deux colonnes
    Par Amel_B dans le forum Bibliothèques et frameworks
    Réponses: 5
    Dernier message: 24/12/2013, 15h50
  2. Calcul à partir d'une table
    Par Didi17 dans le forum Access
    Réponses: 1
    Dernier message: 28/10/2005, 08h37
  3. [HTML] construire un mailto à partir d'une table
    Par Kafi dans le forum Balisage (X)HTML et validation W3C
    Réponses: 4
    Dernier message: 08/09/2005, 16h01
  4. Réponses: 4
    Dernier message: 02/05/2005, 20h25
  5. Réponses: 9
    Dernier message: 07/10/2004, 19h41

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