我修改了你的代码:
myDiagram.nodeTemplate =
$(go.Node, "Spot",
{
locationObjectName: "ICON", locationSpot: go.Spot.Center,
movable: false
},
$(go.Panel, "Auto",
{
name: "ICON", background: "white",
portId: "", cursor: "pointer",
fromSpot: new go.Spot(0.5, 1, 0, 20)
},
$(go.Shape, "Circle",
{ strokeWidth: 4, width: 75, height: 75, margin: 5 },
new go.Binding("fill", "color"),
new go.Binding("stroke", "strokeColor")),
$(go.Picture, "https://msdnshared.blob.core.windows.net/media/2017/05/icon.png",
{ width: 25, height: 25, background: "white" })
),
$(go.TextBlock,
{
alignment: go.Spot.Bottom, alignmentFocus: go.Spot.Top,
margin: 5, font: '14px "Open Sans", sans-serif'
},
new go.Binding("text", "name")),
$(go.TextBlock,
{
alignment: go.Spot.Right, alignmentFocus: go.Spot.Left,
font: '14px "Open Sans", sans-serif'
},
new go.Binding("text", "status"))
);