Solved

Chart

Posted on 2001-06-04
19
223 Views
Last Modified: 2010-05-02
I have a constant stream of numbers going into a listbox.
Could anyone kindly give me some code to graph those numbers and show them like a cardiograph screen
0
Comment
Question by:leachim
  • 9
  • 9
19 Comments
 
LVL 3

Expert Comment

by:Maxim10553
ID: 6152774
the best way to do this would be to create the basic graph in Excel, use Excel'S COM to update the graph
dynamically according to your input, and view the updated graph in an OLE container on your VB app.
0
 
LVL 3

Expert Comment

by:Maxim10553
ID: 6152811
hey, why did you change your name and post this question again? you could of just added added comments to your original question. unbelivable. for experts the original question is here. this is a dup

http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20129440&jsessionid=64578989954224301
0
 

Author Comment

by:leachim
ID: 6152819
Maxim i have drawn an ole object on the form then browsed to my xl.app which has a cell that recieves  a stream information plots it to a chart but when i run the form it shows only the last update it doesnot  update
where am i going wrong?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:leachim
ID: 6152882
Maxim i have a colleague i suspect is using the same medium for our ongoing problem
sorry to have inconvenienced you
0
 
LVL 3

Expert Comment

by:Maxim10553
ID: 6152890
dim xl as excel.application
use this code as a template, you will need to change the values, hope this helps

'open
set xl = createobject("excel.application")
xl.Workbooks.Open "C:/Temp.xls"

'create the link to your ole container and the excel graph
OLE1.CreateLink "C:/Temp.xls", "chart1"

'do this for the cells you need to update
xl.workbooks("temp.xls").worksheets("sheet1").cells(1,1) = yourstreaminput
0
 

Author Comment

by:leachim
ID: 6152920
Maxim it works lovely thanks but it answers only part of my question
my quest is to manipulate the graph so as to achieve a hospital cardiograph visual effect
sadly the graph in xl does not achieve this for me
could i ask you for any more pointers
Thanks for your help so far
0
 
LVL 3

Expert Comment

by:Maxim10553
ID: 6152975
Looked around for an ocx you could possible use, the only one i found was here http://adcsoft.hypermart.net/products/infoscope/screenshots.shtml but you need VC++ installed. I think you could acutally create the cardigraph in Excel, and actually simulate the data constantly changing.
0
 

Author Comment

by:leachim
ID: 6152997
Maxim we dont have vc++ installed so will call it quits for now
much appreciation to you for ongoing help
0
 
LVL 3

Accepted Solution

by:
Maxim10553 earned 50 total points
ID: 6156194
leachim, i have done my best to answer your question. Unless you build a custom Active Control in VB to simulate a cardiograph or build a plotted grid in Excel to call from your application, there really is no way around this.
0
 

Author Comment

by:leachim
ID: 6156228
Maxim thanks for your hard work on my behalf
what i will do now is search for a book on the subject and take it from there a book that shows how to manipulate pic.line  x1 blah blah etc.
thanks again
0
 
LVL 3

Expert Comment

by:Maxim10553
ID: 6156265
if i get a chance today i will try to simulate a cardiograph in excel. I believe you want the graph to represent a constant stream similar to the cardiographs in hospitals, correct?
0
 

Author Comment

by:leachim
ID: 6156303
THATS CORRECT I WOULD BE VERY GRATEFUL
0
 
LVL 3

Expert Comment

by:Maxim10553
ID: 6156430
hey, can you give me some sample data from your input stream that you want plotted. it would help me greatly, and please label the data, thanks
0
 

Author Comment

by:leachim
ID: 6156486
Maxim i have data coming in very quickly to a textbox
the values have a margin of 2 up and 2 below
the figures coming in are floating point between 0.5 and 9
Thanks again
0
 
LVL 3

Expert Comment

by:Maxim10553
ID: 6161364
ok i have some working code, last thing i need to know is how the data is coming in. You have 2 streams right? give me the code for the data coming in and sample values and i will implement them in my code and give it to you.
0
 

Author Comment

by:leachim
ID: 6162732
Maxim i am so grateful for your help
I have only one stream of data coming in and in comes into a textbox at the rate a thousand a second
Draw a text box and
set this timer to 1

Private Sub Timer1_Timer()
text1.Text = Rnd * (9)
End Sub

Thanks again
0
 
LVL 3

Expert Comment

by:Maxim10553
ID: 6164373
just tested it and found out it is defintely too much data being processed for VB/Access to handle. Updating the graph every 1/1000 of a second will cause it to flicker way too much. If you are going to do this with VB and Excel you need to slow the data coming in down to maybe to 10 new values a second instead of 1000, sorry, i can still give you the source if you want it.
0
 

Author Comment

by:leachim
ID: 6167697
Maxim i am much obliged for your time and research
gratitude and thanks from
leachim and colleagues
0
 

Expert Comment

by:costello
ID: 6400316
Force accepting Maxim's answer.

costello
Community Support Moderator @ Experts-Exchange
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question