Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

drawing a real time line chart 1

Status
Not open for further replies.

garwain

Programmer
Jan 30, 2002
461
CA
I have a program that captures data in real time from the serial port, and I need to find a way to plot the points onto a chart in real time. I've spent several hours trying to figure out the mschart component, without success.

I would appreciate it if someone could point me to an example that will actually plot each point and connect it to the previous.

My data would consist of a reading every 250ms of the elapsed time, and a pressure reading.

Unfortionatally I don't have any budget to purchase components, but if anyone knows of a free component for VB6 that will do this easier than mschart I'd be happy to try it.

Any suggestions are appreciated
 
I often use an ocx control that I found on the web called 'Graphlite'. By Sam Hugill (forgive my spelling if it is incorrect) I think. I can't remember where I got it but a search with Google should get you some results.

Take Care,

zemp

"Show me someone with both feet on the ground and I will show you someone who can't put their pants on."
 
garwain, have you found anything yet? I've been looking around for an almost identical project with no luck...

Sean
 
Using the chart control for doing a line plot is about this easy:

Dim myChartData(5, 1) As Variant ' 6 readings for 2 data series
Dim lp As Long

MSChart1.chartType = VtChChartType2dLine
For lp = 0 To 5
myChartData(lp, 0) = Rnd * 10
myChartData(lp, 1) = Rnd * 20
Next

MSChart1.Chartdata = myChartData
 
Thanks! Do you know how to stop it flickering when you update?

Sean
 
Sorry! I'll rephrase that a bit better. It's late and I'm tired. What i need to do is to read 2 values from an instrument on the RS-232 port (Done and working to a CSV) I now need to try and make it plot to a MSChart graph in realtime. I've got all the data in an array (up to 32 000 depending on scan size)

Thanks

Sean
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top