The problem is while the text is “”,there stil has a panel.So how can I hide the panel while the text is “”?thanks.
The Grafcet sample, Grafcet Diagrams, has an example of what you want – just a simple Binding of the visible property on the “text” property:
$(go.TextBlock, // only visible when there is text
. . .,
new go.Binding("visible", "text", function(t) { return t !== ""; }))