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

How to make Graph/Waveform plot name not editable by user

已解决!
转到解答

I just found out it is possible for user to edit the plot name on the Graph control. It is awkward since the user trying that might expect the software to somehow do something to the settings of the channel behind the plot.

 

I don't want to disable the plot legend since I use the visibility checkbox and other plot attributes.

 

Is there a way to block user typing something in there? It should just be an indicator or caption.

 

Also I noticed the Plot Attribute Change Event won't trigger on Plot rename, so I'd need to poll the property to determine if it got changed which is unlikely what I'm planning to do.

 

Cheers,

Jimmy

 

JICR_1-1581483922175.png

 

 

0 项奖励
1 条消息(共 16 条)
4,072 次查看

Try placing a transparent decoration over it.

0 项奖励
2 条消息(共 16 条)
4,069 次查看

Hum not sure, the Pane is resizable, the graph Fit to Pane... I have a feeling the decoration will not stick to the plot names.

0 项奖励
3 条消息(共 16 条)
4,027 次查看
解答
接受人 JICR

There is a way...

 

It's a hack, but works. But you can never go back.

 

See this idea.

 

EDIT: The community page has been deleted. I'll see if I can dig up the VI somewhere.

 

EDIT: here it is.

4 条消息(共 16 条)
4,023 次查看

Great hack, thanks a lot for harvesting the VI 🙂

 

I got worried that I would need to perform this for every plots, but no. It does it to every plots labels!

5 条消息(共 16 条)
4,003 次查看

Hi,

 

Thank you for the brilliant solution. I have tested this and it works wonderfully.

However, I have a question: Can I use this VI for disabling plot properties (See image)?

If yes, how does that work?
How can I do that?. I have not managed 😞


Thanks for your feedback

 

Muaadh

0 项奖励
6 条消息(共 16 条)
3,434 次查看

According to the context help, the Plot Legend is an array of clusters, each with a string (the plot name) and two booleans (one is the visibility checkbox). I guess that casting to a boolean reference instead of a string would do the job.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 项奖励
7 条消息(共 16 条)
3,426 次查看

Hi,

Thank you for your quick reply.

I have already tried this. It does not work 😞

 

Muaadh

0 项奖励
8 条消息(共 16 条)
3,424 次查看

I see. the problem is that this boolean cannot get the focus.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 项奖励
9 条消息(共 16 条)
3,422 次查看

It's possible to get the boolean reference but disabling it does nothing. The LabVIEW runtime seems to hook the mouse clicks in the boolean control area.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 项奖励
10 条消息(共 16 条)
3,409 次查看