Results 1 to 8 of 8

Thread: Simple bar graph in VB

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Posts
    7

    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!!

  2. #2
    Junior Member
    Join Date
    Apr 2004
    Posts
    22

    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

  3. #3
    Fanatic Member laserman's Avatar
    Join Date
    Jan 2002
    Location
    Wales U.K
    Posts
    775
    Do you want something like this?
    Attached Images Attached Images  

  4. #4

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Posts
    7
    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!!

  5. #5
    Fanatic Member laserman's Avatar
    Join Date
    Jan 2002
    Location
    Wales U.K
    Posts
    775

  6. #6

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Posts
    7
    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!

  7. #7
    Fanatic Member laserman's Avatar
    Join Date
    Jan 2002
    Location
    Wales U.K
    Posts
    775
    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

  8. #8

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Posts
    7
    thanks laserman, fingers crossed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width