How to display an image icon on Node

hey can any one tell me that how can add an image icon on Node …
using this but it’s not working…
scope.myDiagram.nodeTemplateMap.add("Node", // the default category (go.Node, “Spot”, nodeStyle(),
(go.Panel, "Auto", (go.Picture, {
source: “/Views/HtmlCont/img1.png”,
desiredSize: new go.Size(150, 50),
imageStretch: go.GraphObject.Fill
{ contextMenu: (go.Adornment) }, (go.Shape, “RoundedRectangle”,
{ fill: “#00A9C9”, stroke: null, name: “SHAPE” }, new go.Binding(“fill”, “color”),

                new go.Binding("figure", "figure")),
                    font: "bold 9pt Helvetica, Arial, sans-serif",
                    stroke: lightText,
                    margin: 8,
                    minSize: new go.Size(160, NaN),
                    maxSize: new go.Size(160, NaN),
                    //wrap: go.TextBlock.WrapFit,
                    textAlign: "center",
                    editable: false,
                new go.Binding("text").makeTwoWay()),
                     toolTip:  // define a tooltip for each node that displays the color as text
                       $(go.Adornment, "Auto",
                         $(go.Shape, { fill: "#CCFFCC" }),
                         $(go.TextBlock, { margin: 4 },
                           new go.Binding("text", "", diagramNodeInfo))
                       )  // end of Adornment
            // four named ports, one on each side:
            makePort("T", go.Spot.Top, false, true),
            makePort("L", go.Spot.Left, true, true),
            makePort("R", go.Spot.Right, true, true),
            makePort("B", go.Spot.Bottom, true, false)


It’s hard to tell from the lack of formatting of all of your code, but it appears that you are trying to use a Picture as the border of an “Auto” Panel. Is that what you intended?

There are many examples of the use of Picture in various kinds of nodes. Just search for “go.Picture”, both in the samples and in the Introduction pages.

I think you want to learn better how to use Panels. Please re-read and

no i just want to use a Picture inside the node (left-align) before Text

Why don’t you start from a node template such as the one given in ?

I also recommend reading:

Here’s an example that doesn’t use Picture, but it uses three different node templates for the same data, one each in three different Diagrams: