Need Visual Basic Strip Chart Object - Page 1
Forum section: electronics / general

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: June 01, 2011, 10:17:09 pm
content: My son is working on a project to monitor water levels in a tank. An MCU and sensor collect the water level information and send it to a PC over a serial line. He's displaying the water level as numerical values in a Visual Basic program, but would like to display it as a graph that constantly updates and scrolls to the left as more data come in.Anyone know of a strip chart object compatible with Visual Basic Express 2010?

author: deef
author_rank: Newbie
timestamp: June 02, 2011, 12:30:46 am
content: I've had quite a bit of success embedding Excel charts in VB.net. If you have MS Office installed, this is a pretty straight forward method of graphically plotting the data. Embedding Office Objects makes stylizing the chart and adding/removing data easy. Not to mention it wouldn't surprise me if the standard methods of regression analysis (trendline) were included as well.I've embedded both graphs and spreadsheets hooked into a .PDF export function.You can add these Excel "controls" to your toolbox by choosing the appropriate .Net Framework controls. For example:"Right Click Toolbar" > Choose Items > ".Net Framework Controls" > Microsoft.Office.Tools.Excel > Chart"Right Click Toolbar" > Choose Items > ".Net Framework Controls" > Microsoft.Office.Tools.Excel > ChartSheet"Right Click Toolbar" > Choose Items > ".Net Framework Controls" > Microsoft.Office.Tools.Excel > Workbook (For a spreadsheet).Now, these items will only be accessible if MS Office is installed.As for the "scrolling" nature you're describing, I'd simply set the extents of the chart up with an array that is refreshed at some kind of periodic timer -- or on a "new data" event of some kind.

author: PeterG
author_rank: Frequent Contributor
timestamp: June 02, 2011, 04:12:09 am
content: I have used this control a few times. It is easy to customize as well.http://www.codeproject.com/KB/vb/tracker.aspxRegards

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: June 02, 2011, 11:10:04 pm
content: Quote from: PeterG on June 02, 2011, 04:12:09 amLooks just like the Task Manager performance display. Is there source code available for this control? It looks like all the interesting stuff is done in a DLL.I need to slow it way down. My updates are only once per minute, and the slowest speed setting seems to be around one update per second.

author: PeterG
author_rank: Frequent Contributor
timestamp: June 03, 2011, 12:37:54 am
content: There is a link to download the source on the page.You could remove the timer and use an event to trigger an update of the display.Regards

author: Mechatrommer
author_rank: Super Contributor
timestamp: June 03, 2011, 01:05:40 am
content: since i'm an oldtimer, i dont have to suggest to you. but i suggest that you suggest your son to build his own control, that will be more fun, more control and do whatever you want. if you have to use others control, then you have to know how to workaround it, such as storing your data in memory and keep updating the same data every second for that 1 minute. here's my graph control that i build for myself, its not good, but it can demonstrate how to diy control. it got nothing except drawing lines, but once you got the grasp, you can add "sweet and sour" to it, text label etc. need alot of translation though i think from vb6 to vb express. FWIW.

author: strantor
author_rank: Contributor
timestamp: September 28, 2011, 10:24:40 am
content: Hey, sorry to sign up here just to necropost, but in the link in post # 2 by PeterG do you know if there's a way to have more than one line on the chart? I figured out how to change the speed on it with a separate trackbar, but I need at least 3 traces on the plot.

author: PeterG
author_rank: Frequent Contributor
timestamp: September 28, 2011, 10:47:43 am
content: It has been a while since i played with that control. You should be able to adapt t to draw 3 traces. If not you can search the website for other controls.Regards