LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to insert a Legend control to Word doc.

Hi,
I am trying to create a Word document. I have been able to insert tables, graph and text using sample programs provided by CVI.
I, however am not able to insert a legend along with the graph.
I did try to consider a legend control just as a graph control and insert it the way I insert the graph, but it didn't work well.
Please help.
0 Kudos
Message 1 of 2
(14,147 Views)
In CVI there is not an option to insert a legend into a graph or stripchart, as there is in LabView. I checked into why this was not an option, and discovered implementing that feature into CVI is very difficult, while in this case, relatively simple in LabView.

This does not mean that you cannot put a legand into your graph in CVI. A way to do this is to simply inset another graph below the graph you already have. Turn off the grids, and stretch it out long and thin. Then go into the properties, and select the left Y-Axis properties. Make sure the setting is checked for "Use Label Strings" and "Show Labels" Then click on the button that allows you to edit label strings. When you get to the next screen, press on "Below" under "Insert New Item". Now it is up to
you have many pairs you want. In my test case, I wanted three plots, so I made three value pairs with the numeric values of 10.00, 50.00, and 90.00 so they would be nice and spaced out. Then I made their corresponding strings "Plot One" "Plot Two" and "Plot Three". Once done, you can make a straight line plot in three different colors to those y-values in your code. This serves as a "sorta" legend.

Then you should be able to place this legand right into your word document with the same format of calls that was used in the wordrpt.prj under C:\Program Files\National Instruments\MeasurementStudio\CVI\samples\activex\word
0 Kudos
Message 2 of 2
(14,147 Views)