Hi,
Closed now!
I try to use tool tips for my diagram ,and this what i found.
Below code I just provide my sample template to you, could help to tell me, what I was wrong?
myDiagram.nodeTemplateMap.add("", // the default category
$go(go.Node, “Spot”, nodeStyle(),
// the main object is a Panel that surrounds a TextBlock with a rectangular Shape
$go(go.Panel, “Auto”,
$go(go.Shape, “Rectangle”,
{
fill: “#666666”, stroke: null
},
new go.Binding(“figure”, “figure”)),
$go(go.TextBlock,
{
font: “bold 11pt Helvetica, Arial, sans-serif”,
//stroke: lightText,
margin: 8,
stroke: "#F3EFE8",
overflow: go.TextBlock.OverflowEllipsis,//go.TextBlock.OverflowClip,//go.TextBlock.OverflowEllipsis,
width: 150,
wrap: go.TextBlock.None,// go.TextBlock.WrapDesiredSize,//go.TextBlock.WrapFit,
editable: false,<span style="line-height: 1.4;"> </span>
mouseOver: function (e,obj) {
},
mouseLeave: function (e) {
alert('a');
<span style="line-height: 1.4;">},</span>
doubleClick: function (e) {
win.center();
win.open();
}
},
new go.Binding("text", "text").makeTwoWay())
),
{ // this tooltip Adornment is shared by all nodes
toolTip:
$(go.Adornment, "Auto",
$(go.Shape, { fill: "#FFFFCC" }),
$(go.TextBlock, { margin: 4 }, // the tooltip shows the result of calling nodeInfo(data)
new go.Binding("text", "", linkInfo))
)
},
// 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)
));
function linkInfo(d) { // Tooltip info for a link data object
return "Link:\nfrom " + d.from + " to " + d.to;
}
Thanks for response.