Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2004
    Posts
    19

    Question Unanswered: Ploting Graph from Visual Basic

    hello guys

    need some help regarding some visual basic stuff

    can anyone tell me is there anyway that i can plot graph using visual basic?? like i want to open a note pad or an excel spreadsheet from visual basic and then by a click of a button .. a graph would be plot out?? can it be done??


    thanks alot for the help if any

    regards

  2. #2
    Join Date
    Nov 2004
    Posts
    5
    Code:
    'Lets assume that, after retreving the values of the 3 fields that you want to
    'be displayed on a graph their values are:
    a=100
    b=300
    c=600
    'Get the % of each of these values:
    total=a+b+c
    cent_a=a/total * 100
    cent_b=b/total * 100
    cent_c=c/total * 100
    'The form has 3 image boxes that have a progress bar kind of graphic in them.
    'Their names are image_a for the field 'a', image_b for the field 'b', 
    'and image_c for the field 'c':
    
    image_a.height=cent_a
    image_b.height=cent_b
    image_c.height=cent_c
    Hope that helped

  3. #3
    Join Date
    Nov 2004
    Posts
    19

    Exclamation Plotting graph using VB with data from Note pad or MS excel

    hmm hope it helps.. but can anyone else help me? yr help would certainly be most appreciated

    regards

  4. #4
    Join Date
    Nov 2004
    Posts
    108

    Talking Copy/Paste Macro...sometimes cheating is good

    you need to add a reference to excel in your project first then you may add a spreadsheet to your form and then you should be able by using excel's features to plot a grafic.

    Here is a shortcut:
    Open Excel
    Go to Tools\Macro\Record
    then create a graphic and save macro
    then go to Tools\Macro\Visual Basic Editor and see the commands that were use to create the graphic copy the code and pasted on your VB code
    Now your problem is almost solved but you'll still have to do some minor modifications
    to err is human ; to really mess things up requires a computer

Posting Permissions

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