LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Labelling Plots

Solved!
Go to solution

Hello All,

 

I apologize for my lack of knowledge. I'm new to the CVI UI Interface. I've managed to create the UI and graph the data using the scripts below to flush the chart and the legend.

 

DeleteGraphPlot (panelHandle, PANEL_GRAPH, -1, VAL_IMMEDIATE_DRAW);
ClearLegend(panelHandle,PANEL_GRAPH);
PlotXY (panelHandle, PANEL_GRAPH, xPos, VinWave, 360, VAL_DOUBLE, VAL_DOUBLE, VAL_THIN_LINE, VAL_EMPTY_SQUARE, VAL_SOLID, 1, VAL_RED);
PlotXY (panelHandle, PANEL_GRAPH, xPos, VoutWave, 360, VAL_DOUBLE, VAL_DOUBLE, VAL_THIN_LINE, VAL_EMPTY_SQUARE, VAL_SOLID, 1, VAL_BLUE);

 

Where I'm stuck is I cannot seem to find the code to label the generated plot lines. I couldn't find any parameters to label them in the UI editor, or with code.

As well, each time I run the function, the plot labels increment further. What command am I missing to reset the plots? Thanks in advance! Greatly appreciated!

 

-Bryan

Labwindows/CVI 8.5

Download All
0 Kudos
Message 1 of 2
(3,175 Views)
Solution
Accepted by topic author XBrav

To label a plot in the legend you must use

 SetPlotAttribute (panelHandle, controlID, plotID, ATTR_PLOT_LG_TEST, "your text");

cally labels it with If you do not set the plot legend, the system automatically labels it "Plot "+ plotID.

 

When you discard a plot, the corresponding legend is automatically discarded also.

 

You cannot reset the plot IDs: they always increase as well as plots are added to the graph and are never reused even if some plot is deleted.See this post from Luis G that explains this point a little.

Message Edited by Roberto Bozzolo on 03-14-2009 01:13 PM


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 2
(3,154 Views)