'Displaying number of PWD(y-axis) in every purok(x-axis)
Hey guys, Im trying to make a column chart using the purok and status column. How can you show the PWD and Pregnant as a bar with label and count also? thankyou in advance
The table name is PWDPregnant | columnName "status" is for PWD/Pregnant. | columnName "purok" is for Pepsi/Coke.
Dim dt As New DataTable
Using pwdcon As New OleDbConnection(con.ConnectionString),
cmd As New OleDbCommand("SELECT purok, status, COUNT(*) As RecCount FROM PWDPregnant GROUP BY purok, status ORDER BY purok", con)
If con.State = ConnectionState.Closed Then
con.Open()
End If
Using reader = cmd.ExecuteReader
dt.Load(reader)
End Using
End Using
Chart5.Series("PWD").XValueMember = "purok"
Chart5.Series("PWD").YValueMembers = "status"
Chart5.Series("PWD").Label = "#AXISLABEL #VALY"
Chart5.Series("Pregnant").YValueMembers = "status"
Chart5.Series("Pregnant").Label = "#AXISLABEL #VALY"
Chart5.DataSource = dt.DefaultView
Chart5.DataBind()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
