-
Simple bar graph in VB
Hi,
firstly, i,m not sure i have posted this in the right place, so
aplogies if i havent.
Secondly, i am new to VB, so any help you can offer - please could you explain it clearly - thanks
my question is this.
how do i create a bar graph in VB?
i have a database. In this database is a table called patients.
Within patients is a field called gender, in which it speifies all
the male/female patients.
I want a graph which displays the number of male and female patients in the database.
How do i do this?
I thought maybe something with SQL like this, but it doesent work.
SELECT COUNT(gender) FROM patient WHERE gender = 'male'
UNION
SELECT COUNT(gender) FROM patient WHERE gender = 'female'
If you have any other ideas for codes, please (if possible), could
you post the complete code on here?
Many thanks!!
-
Graph
You can do in separate ways:
1. generate Excel graph using the data, but i think it is going to be too complecated for you.
So
2.use the picture box and draw the grap. Composed of lines
You can change the scale, color, so on. You will have to experiment.
If you want to resize - change the length of the lines.
You may find other ways
-
1 Attachment(s)
Do you want something like this?
-
hi laserman,
yes, that is exactly what i want. I know how to get that chart on to the form (MS Chart),
but i have no idea on the code for it/how to activate it, and the code for my problem, etc..
Many Thanks for your help!!:)
-
-
hi, thanks for that
tho i had akready "searched the forums" before i posted my question.
I looked at most of the replies there, and i really dont understand much of it.
I see some code present there in some posts, but i havent a clue where to start.
I read some posts say you need to make an array, or SQL, but i have no idea where to start...
Please help!:confused: :confused:
-
Just leaving now Alex,
Im sure someone will help you shortly.
Have a look at Mschart1.rowcount and those properties and have a fiddle there.
Cheers
-
thanks laserman, fingers crossed:wave: