Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Chart

Posted on 2001-06-04
19
222 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

856 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