|
by
George Martin
Start ı How
I Did It ı Background Painting ı Data
Plotting ı Sources and PDF
Back in July, I talked about creating
a simple data logger with a serial port to interface to a data-acquisition
device using Visual Basic (VB). Remember that we could save the data
to a file and I said you could load that file into a spreadsheet program
and create a graph? At the time, I planned to plot the data on the
screen as it was acquired, but when the time for my next column came
about, I couldnıt figure it out. Well, I finally figured it out.
I actually came up with several possible
solutions. I could use MSChart, which is part of the VB package. Itıs
hundreds of kilobytes of code in size. Although it works fine for
plotting small amounts of static data, it didnıt feel like a good
match for the large amounts of dynamic data that I could be dealing
with. It has too much in some areas and too little in others. Besides,
with what Iıve already published, you could use a spreadsheet and
publish gorgeous graphs. Graph32 is another tool recently released
with VB, and is somewhat smaller than MSChart, but it still feels
wrong.
I could purchase a charting package.
If it was just me and I was under the gun to get a project done on
time, I would probably take this path. But, fortunately, Iıve got
some flexibility about when I need to be finished.
What I need is a lean, mean charting
routine, one where you can see, understand, and even modify the code
to suit your specific application. Monitoring a battery-charging circuit
is different than monitoring a joystick force-position curve.
Two articles helped me zero in on what
Iım about to present. Ward Hittıs "Write a Lean Chart Control"
(Visual Basic Programmers Journal, June 1998) described the
exact software I was looking for. However, he offers a GraphLite ActiveX
control with no source code. So, I now knew it was possible, which
was a big advantage.
In Chris Barlowıs article, "Make
Forms Look Good on Paper" (Visual Basic Programmers Journal,
July 99), he covers the basics of getting lines, curves, and text
onto a form and out to the printer. Eureka! All the pieces just fell
into place.
NEXT
Circuit Cellar provides up-to-date information for engineers. Visit
www.circuitcellar.com for
more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com
or subscribe online.
ıCircuit Cellar, the Magazine for Computer Applications. Posted with
permission. |