Articles in this section

How to show different tooltip for symbols in palette?

This article explains how to show different tooltips for symbols in the palette. The tooltip is textual content that is displayed while the mouse hovers over an element. With the help of the JavaScript Diagram, the tooltip is displayed in the diagram while dragging, resizing, rotating a node, and when the mouse hovers over any diagram element. The tooltip is also added to the symbol palette, and it will be displayed when the mouse hovers over the symbols of the palette. You can also show other content in the symbol palette’s tooltip instead of the node ID by using the node’s addInfo property. The addInfo property of a diagram node is used to store additional information on the node.

The following code shows how to set addInfo and tooltip for symbol palette: 

 
// Set HTML node
 
{ id: 'Node2', shape: { type: 'HTML', content: '<div> <input type="button" value="Node2" id="node" /> </div>' }, 
    addInfo:[{text: 'Close Open Tasks2'}] }, 
 
public getSymbolInfo(symbol: NodeModel): SymbolInfo { 
    return { fit: true, tooltip: symbol.addInfo ? symbol.addInfo[0].text: symbol.id }; 
  } 
 
//HTML 
<ejs-symbolpalette id="symbolpalette" [expandMode]='expandMode' [palettes]='palettes' width="100%" height="700px" [getSymbolInfo]='getSymbolInfo' [getNodeDefaults]='getSymbolDefaults'> 
  </ejs-symbolpalette>
 

In the above code sample, the addInfo property is used to store additional information about the node, and it is set as tooltip content. With the symbolInfo property of the symbol palette, you can set this tooltip content to the symbol tooltip. So, when you hover over the node, this content gets displayed as a tooltip for a node in the symbol palette.


Sample: https://stackblitz.com/edit/angular-9fihxl-8dt8jn?file=app.component.ts


Conclusion

We hope you enjoyed learning about how to show different tooltip for symbols in palette.

You can refer to our Javascript Diagram feature tour page to learn about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our Javascript Diagram Example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsBoldDesk Support or feedback portal. We are always happy to assist you!


Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied