LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create chart in excel through labview?

I have seen some examples for plotting data to excel, however none do exactly what I need. These examples plot the data as a 'data range' the first column is your x values and all columns after are your y values. I have multiple samples of data which each contain a column of x values and a column of corresponding y values. How can I plot multiple series of these samples on the same chart?
Any help is greatly appreciated.
0 Kudos
Message 1 of 4
(3,534 Views)
If you know how to plot your chart manually in Excel, you can use that and record a macro and save it on a worksheet.

In your program you can write your data to the saved worksheet and then call on the macro and it will do the job for you.

I'm including VI's for calling a macro from Labview
0 Kudos
Message 2 of 4
(3,534 Views)
I have looked into using this approach, the problem is the number of data points in each sample can vary widely, where as your macro example uses a predefined range of data. I can have the macro select these samples with varying amounts of data using sendkeys commands but I can't get this selection to be used when in the chart wizard to add a series of data.
0 Kudos
Message 3 of 4
(3,534 Views)
Perhaps I didn't understand you but if it is the way I understood then maybe this could help.

I had a similar problem and I solved it the following way.

The trick is that you write your data to Excel always in the same way, i.e you use columns 1,2 and 3 for your x values and column 4 for your Y values.

Then you write your own sub routine within the macro you recorded (I don't know if you are introduced to VB, but even if you dont it shouldn't be too hard), this way you'll know exactly where your data is and how much data you have.

After that you change the recorded values in the seriescollection to the ones you get from your own routine.

I hope this will help you.
0 Kudos
Message 4 of 4
(3,534 Views)