Salut tout le monde
Gentelman ..
Mes chers amis .. svp .. si vous pouvez m'aider a finir ce cauchemar .
J'ai deux Tables Access : TBL_SECTOR qui possede 2 champs ( SECTOR_Id de type AutoNumber - SECTOR_Name de type Texte ) .. remplit de cette maniere
Nom : p_1212rn9iv1.jpg
Affichages : 217
Taille : 45,6 Ko
Deuxieme Table nommee ( TBL_ADHERENT possede 3 champs ADHERENT_Id de type AutoNumber - ADHERENT_Sector de type texte - ADHERENT_Sexe de type texte ) .. de cette maniere ..
Nom : p_12126bphs1.jpg
Affichages : 267
Taille : 88,8 Ko
Dans ma ZedGraph je veux afficher le nombre de Feminin et Masculin de chaque Secteur ..
Lorsque j'enregistre un nouveau adherent dans ma Table2 ( TBL_ADHERENT ) je choisis son activité ( ADHERENT_Sector ) par ComboBox1 deja remplit par Table1 ( TBL_SECTOR ) ..
Ce que je veux avoir par exemple : COMPUTER s'affichera son nombre de masculin et son nombre de Feminin .. j'ai beaucoup essaye mais j'obtient toujours que le Bleu 'Masculin ' comme l'indique cette image :
Nom : p_1212oli7r1.jpg
Affichages : 220
Taille : 113,7 Ko
Voici tout mon code utilise :
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
Imports ZedGraph
Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Call Create_Zed_Graph()
    End Sub
    Private Sub Create_Zed_Graph()
        Panel1.Controls.Clear()
        Dim zg1 = New ZedGraphControl()
        zg1.Location = New Point(0, 0)
        zg1.Size = New Size(Panel1.Size.Width, Panel1.Size.Height)
        zg1.Enabled = False
        Panel1.Controls.Add(zg1)
        Dim mypane As GraphPane = zg1.GraphPane
 
        mypane.Title.Text = "PYRAMIDE DES AGES"
        mypane.XAxis.Title.Text = "SECTEUR"
        mypane.YAxis.Title.Text = "NOMBRE ADHERENT"
 
        Dim N As Integer
        Try
            OpenConnect()
            my_command.CommandText = "SELECT COUNT(*) FROM TBL_SECTOR"
            N = my_command.ExecuteScalar() - 1
        Catch ex As Exception
            Message(ex.Message)
        Finally
            my_connection.Close()
        End Try
        Dim myClassesNames(N) As String, myClassesRented(N) As Integer, myClassesAvailabe(N) As Integer
        Dim i = -1
        Try
            OpenConnect()
            Dim currentClassID As Long
            Dim dr As OleDb.OleDbDataReader
            my_command.CommandText = "SELECT * FROM TBL_SECTOR"
            dr = my_command.ExecuteReader()
            Dim cmd As New OleDb.OleDbCommand("SELECT * FROM x", my_connection)
            While dr.Read()
                i = i + 1
                currentClassID = dr.GetInt32(0)
                myClassesNames(i) = dr.GetString(1)
                cmd.CommandText = "SELECT COUNT(ADHERENT_Id) FROM TBL_ADHERENT WHERE ADHERENT_Sexe= 'Masculin' And ADHERENT_Sector = 'COMPUTER'"
                myClassesAvailabe(i) = cmd.ExecuteScalar()
                cmd.CommandText = "SELECT COUNT(*) FROM TBL_ADHERENT WHERE ADHERENT_Sexe='Feminin' And ADHERENT_Sector = 'COMPUTER'"
                myClassesRented(i) = cmd.ExecuteScalar()
            End While
            dr.Close()
            cmd.Dispose()
            cmd = Nothing
        Catch ex As Exception
            Message(ex.Message)
        Finally
            my_connection.Close()
        End Try
        Dim yRented As PointPairList = New PointPairList()
        Dim yAvailable As PointPairList = New PointPairList()
        For i = 0 To myClassesNames.Length - 1
            If myClassesNames(i) <> Nothing Then
                yAvailable.Add(New PointPair(0, myClassesAvailabe(i)))
                yRented.Add(New PointPair(0, myClassesRented(i)))
            End If
        Next
        Dim mybar As BarItem
        Dim mybar2 As BarItem
 
        mybar = mypane.AddBar("NOMBRE MASCULIN", yRented, Color.Blue)
        mybar2 = mypane.AddBar("NOMBRE FEMININ", yAvailable, Color.Red)
 
        mybar.Bar.Fill = New Fill(Color.Blue, Color.Blue, Color.Blue)
        mybar2.Bar.Fill = New Fill(Color.Red, Color.Red, Color.Red)
        mypane.XAxis.Scale.TextLabels = myClassesNames
        mypane.XAxis.Type = AxisType.Text
        mypane.Chart.Fill = New Fill(Panel1.BackColor)
        mypane.Fill = New Fill(Panel1.BackColor)
        mypane.BarSettings.Type = BarType.Stack
        zg1.AxisChange()
    End Sub
End Class
Merci beaucoup d'avance pour l'aide
Amicalement
MADA