Results 1 to 12 of 12

Thread: [RESOLVED] Hello need help creating a chart (with or without vbRichClient5)

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Resolved [RESOLVED] Hello need help creating a chart (with or without vbRichClient5)

    Hi there folks, I am trying to create a chart in a picturebox, or is there a good free control out there?
    I don't mind using vbRichClient5 if Olaf has a minute to show me a quick example... the numbers I would to update every 10-15seconds and I would like to update it to the chart right away, making a real time chart.

    Here is a quick example to show you what are the numbers for, its to bid/sell.
    I got everything working but I want to make my own live chart.
    All I need is a quick demo or example of a regular chart (lines up/down).
    The price range of the chart would be about 10$

    Name:  app.jpg
Views: 354
Size:  26.6 KB

    Name:  app1.jpg
Views: 320
Size:  9.9 KB

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    13,278

    Re: Hello need help creating a chart (with or without vbRichClient5)

    My first thought here would be to use a image control or picture box within a picturebox and then use the Line method to draw the line, Probably have to scroll to the left as it updates. Not sure about how to handle the stuff that has scrolled off screen possibly might be good to use two picture or image controls that are the size of the view port and when one of them is completely out of view clear it. Totally untried but in theory I would think it should work.

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: Hello need help creating a chart (with or without vbRichClient5)

    I will have a look if it looks good with lines and a picturebox, not very familiar with charts, but when i get a chance I'll give it a go thanks DataMiser, any more advice or examples are welcome.

  4. #4
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,120

    Re: Hello need help creating a chart (with or without vbRichClient5)

    There are some nice examples of vbRC5 charts in the codebank if you care to search there...
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: Hello need help creating a chart (with or without vbRichClient5)

    Quote Originally Posted by ColinE66 View Post
    There are some nice examples of vbRC5 charts in the codebank if you care to search there...
    I knew I saw charts of Olaf before but wasn't sure, I tried searching I couldn't find the post that has the charts... a link to that thread would be awsome

  6. #6
    PowerPoster
    Join Date
    Feb 2006
    Posts
    21,432

    Re: Hello need help creating a chart (with or without vbRichClient5)

    What's wrong with using an MSChart?

    Name:  sshot.png
Views: 284
Size:  6.3 KB


    BTW:

    The scrollbar is invisible until a "plotful" of data points (50 here) have been exceeded. So don't panic if you run it and don't immediately see the scrollbar.
    Attached Files Attached Files
    Last edited by dilettante; Apr 13th, 2015 at 06:44 AM.

  7. #7

    Thread Starter
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: Hello need help creating a chart (with or without vbRichClient5)

    Quote Originally Posted by dilettante View Post
    While many fear its complex object model, what's wrong with using an MSChart? At least it's documented.

    Of course if you don't read documentation I guess that hardly matters.

    Name:  sshot.png
Views: 284
Size:  6.3 KB


    BTW:

    The scrollbar is invisible until a "plotful" of data points (50 here) have been exceeded. So don't panic if you run it and don't immediately see the scrollbar.
    Thanks Dilettante I will look into your example it looks exactly what i need.

  8. #8
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,120

    Re: Hello need help creating a chart (with or without vbRichClient5)

    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  9. #9
    PowerPoster
    Join Date
    Jun 2013
    Posts
    4,930

    Re: Hello need help creating a chart (with or without vbRichClient5)

    Well, in addition to Colins Links, here another one, which demonstrates a "live-rendering" of a Sinus-Wave
    (the rendering of the upper part in the Demo is the more interesting one, for simple x/y-Polygon-Outputs):
    http://www.vbforums.com/showthread.p...=1#post4790893

    And as for the current scenario ("Prices with a Time-Tag")... I've just uploaded an appropriate
    Charting-Demo which covers that topic quite nicely, into the Code-Bank:
    http://www.vbforums.com/showthread.p...for-x-y-Plots)



    Olaf

  10. #10
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,120

    Re: Hello need help creating a chart (with or without vbRichClient5)

    Oops. Just noticed you were looking for a line-graph. My links were probably not that helpful! Sorry...
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  11. #11
    PowerPoster
    Join Date
    Feb 2006
    Posts
    21,432

    Re: Hello need help creating a chart (with or without vbRichClient5)

    Here's a simplistic approach that does everything in VB6, i.e. it doesn't rely on any dependencies at all. It just has a UserControl that contains a PictureBox, and draws everything within the UserControl's logic.

    Name:  sshot.png
Views: 304
Size:  5.5 KB

    This one doesn't support scrolling, though that could be added easily enough. It just plots from left to right until the plot "fills up" and from there the plot "travels" to the left to make more room on the right.

    It probably needs a little tweaking and might have a bug or two yet, but it should be close.


    Reposted. Fixed a small glitch that kept the blue dotted lines from lining up well with the black tickmarks.

    Reposted again. Removed leftover Debug.Print statement from early testing.
    Attached Files Attached Files
    Last edited by dilettante; Apr 13th, 2015 at 10:48 PM.

  12. #12

    Thread Starter
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: Hello need help creating a chart (with or without vbRichClient5)

    Thanks Schmidt and Dilettante this post is resolved for sure, I just don't have time at the moment but I will definitely use one of those approach.

    I did have a quick look and it doesn't seem too complicated to change for my needs, thanks again guys I will post if I need some information about something.

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