Quantcast
Channel: LabWindows/CVI topics
Viewing all articles
Browse latest Browse all 5361

bar graph first data point problem

$
0
0

I've got a problem with a graph control and plotting with vertical bar style for displaying data histograms.

 

My big goal here is to plot the data points successively as they arrive via the serial port.  These points take a while, a little over a second each.

 

I didn't find a better way of doing this with the limitations of a graph control, so here's how I did it:

1) have a timer collect the data (up to you to use asynch, multi-thread, etc)

2) when we get a new data point, pack into a local array (x and y values)

3) delete previous plots and display all data points up to this index as a new plot

 

So this works well enough, except on the very first data point.  My x values happen to be integers (but they may not be), and my first point should be 1, but the graph shows 20 something. 

 

bad first pointbad first pointall points after first are goodall points after first are good

I've attached the project if you want to observe...

 


Viewing all articles
Browse latest Browse all 5361

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>