zOrder for shape inside links

Is it possible to set zOrder for shape inside link? I have an issue when some links overlaps shapes from other links but i need that all shapes with percentage always be over the links.

Are you using 2.1.31 or later? If so, look at this:

Not sure that i can use this. I need that the percentage be over the links and under the nodes, also i have multiple shapes/panels in link to show depends of different conditions. Is it possible with labelTemplate?

You’ll need to put the Links in the “Background” Layer and add a Layer for the Adornments that are the labels for the Links. Nodes can continue to be in the default Layer, whose name is the empty string.

You’ll note that the label Adornments in that sample specify a layerName of “Foreground”. You just want another Layer that is behind the Nodes layer. Maybe something like:

  myDiagram.addLayerBefore($(go.Layer, { name: "Label" }), myDiagram.findLayer(""))

and then set { layerName: "Label" } on the labelTemplate.

You can put whatever you want in those labels.

Separate layers for links and labels works fine. Thanks.
But bindings like go.Binding('strokeWidth', 'isHighlighted', strokeWidth).ofObject() for shapes inside labelTemplate stop working. How can i fix it?

When using Adornments, regular data bindings work normally, but bindings that are .ofObject() refer to the Adornment, not to the adorned Part.

You’ll have to implement the changes in a Part.highlightedChanged event handler: https://gojs.net/latest/api/symbols/Part.html#highlightedChanged
Call Part.findAdornment to get the desired Adornment and call Panel.findObject to find the particular named object within the Adornment.

Works fine. Thanks for your help.