LabWindows/CVI

取消
显示结果 
搜索替代 
您的意思是: 

Labelling Plots

已解决!
转到解答

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

下载全部
0 项奖励
1 条消息(共 2 条)
3,624 次查看
解答
已被主题作者 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?
2 条消息(共 2 条)
3,603 次查看