LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I plot data from excel in a XY graph

Labview experts,

 

I have a really simple problem in labview:

I have some data in excel: 2 columns with a certain number data. The two columns are related to each other. So I want to plot all the points in a x y graph. Coordinates point 1: (row1,col1) coordinates point 2: (row2,col2)...

 

Now i want, in a first step, import this data in labview and draw the X Y graph in labview.

So the points of the first column on the x axis and the data of the second column on the y axis.

 

that's how i do it now: Attachment

That's only working if i'm using a waveform graph, but i want a XY graph

 

Is there somebody with a solution,

 

Kind regards,

 

Jelle

 

 

 

0 Kudos
Message 1 of 26
(10,661 Views)

There are examples included with LabVIEW for plotting data to XY graph.

Message 2 of 26
(10,649 Views)

Yes, that's true.

 

But it's never working with my imported data out of excel...

 

Regards,

 

Jelle

 

Message 3 of 26
(10,645 Views)

Then you need to write LabVIEW code to get your data into the "format" required for XY graph.

 

 

0 Kudos
Message 4 of 26
(10,639 Views)

I typically make an Excel report template with the columns of data and the Plots pre-made. So when I drop in the data using the NI ADO driver for Excel, Excel automatacally updates the graphics. I don't have to do anything, but transfer the data into Excel. Creating the plots thru coding is time expensive and more complicated, when a simple graph ready to go in a template is so easy and fast.

0 Kudos
Message 5 of 26
(10,629 Views)

I have also the same problem.

 

And yes indeed I have to get my data in the correct format for XY graph.

 

But how can I use only the first column for the x axis and the second column for the Y axis.

 

Or in general if i have a read from measurement file (for instance an exel) how can i use only the first row of data of this excel?

 

 

0 Kudos
Message 6 of 26
(10,611 Views)

Hello,

 

Can you share an extract of your excel data?

This will allow me to put some simple code together to illustrate how it can be done.

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 7 of 26
(10,580 Views)

To setup a plot of XY from dual column data in excel, select the two column including the name header for both column and then select to insert a scatter plot with the points connected by lines and Voila you have a 2 axis plot with x and Y dimensions and including the title for the trace from the column header already formatted for you. If you select more than 2 columns then the first is the X dimension and the remaindre columns all become Y axis traces for multiple plot lines for each column. This is easy folks and basic excel functions for plotting. One the graph is created and displaying the data, clear the data and save as a template. Now when you call the template and stuff the columns of data into the table fields, excel automatically updates the plot and all you have to do after stuffing the data in is save the excel file. Task done. Good luck.

0 Kudos
Message 8 of 26
(10,569 Views)

Please find the attached screenshot .

 

I hope this will serve your purpose.

 

Thanks

 

0 Kudos
Message 9 of 26
(10,549 Views)

Hello Jelle,

 

If you need any more help, then please let us know!

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 10 of 26
(10,507 Views)