Solved

Chart

Posted on 2001-06-04
19
214 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
 

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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…

760 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now