03-13-2009 09:21 PM
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
Solved! Go to Solution.
03-14-2009 07:10 AM - edited 03-14-2009 07:13 AM
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.