Results 1 to 5 of 5

Thread: Drawing graph

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    3
    hey... can anyone tell me how to make a program that can draw a graph using vb? i am doing a program that is supposed to calculated datas base on an equation and then show the results on a graph. something like an experiment.
    thanx anyway.

  2. #2
    Frenzied Member wengang's Avatar
    Join Date
    Mar 2000
    Location
    Beijing, China
    Posts
    1,604
    sorry to jump into your post but I've toyed with that idea myself. Well, I got bored with it before I got frustrated.

    Anyway, follow this link for a good idea of how to get started.

    http://www.planetsourcecode.com/xq/A...s/ShowCode.htm


    good luck
    Wen Gang, Programmer
    VB6, QB, HTML, ASP, VBScript, Visual C++, Java

  3. #3
    Guest
    the MS Chart control does graphs almost exclusively.

  4. #4
    Fanatic Member THEROB's Avatar
    Join Date
    Oct 2000
    Location
    I'm cold and there are wolves after me
    Posts
    575

    OLE

    Hi you can draw a graph with Excel using an OLE control.

    You will need to place an OLE on your form then link it to an Excel chart. Go into the chart and define the blank cells that the chart will be drawn on - just like in Excell.

    then define the variables

    Set graf = Me![OLE1].object.Charts("Chart1")
    Set shet = Me![OLE1].object.Sheets("Sheet1")

    To setup the OLE:
    With OLE2
    .Format = "CF_TEXT"
    .SizeMode = vbOLESizeStretch
    End With

    To define the chart type:
    graf.ChartType = xlXYScatterLines

    To define the title and label of axes
    graf.ChartWizard _
    Title:="TITLE OF GRAPH", HasLegend:=False, CategoryTitle:="X AXIS", ValueTitle:="Y AXIS"

    To set a value:
    she.Cells(X, Y).Value = VALUE


    For more information see excel macro help.



  5. #5

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    3
    hey.. thanx anyway..
    this is my first time i am using this msg thing..
    never expect it to have so much reply!!!
    i am overwhelm!
    thanx!!!

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