Welcome to Kap Lab Store

Topic "how can customize the positioning of tooltip"


4 Item(s)

per page
how can we use nodeTooltipPositionFunction method?
Please give some examples how to use this method.
Posted : 22 May 2013 07:55
I would like to know this as well. There seem to be no examples of how to use nodeTooltipPositionFunction.
Posted : 22 January 2014 23:12
Hello,
Here an example of how to use the nodeTooltipPositionFunction fucntion
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
			   xmlns:s="library://ns.adobe.com/flex/spark"
			   xmlns:mx="library://ns.adobe.com/flex/mx"
			   xmlns:diagrammer="fr.kapit.diagrammer.*"
			  >
 
	<fx:Script>
		<![CDATA[
			import fr.kapit.visualizer.renderers.DefaultTooltip;
 
			protected function nodeTooltipPositionFunction(node:DisplayObject,nodeTooltip:DisplayObject):Point{
 
				var defaultTooltip:DefaultTooltip=nodeTooltip as DefaultTooltip;
				if(defaultTooltip)
					defaultTooltip.update(); //use to force the width and the height computing of the defaultTooltipRenderer
 
				var point:Point=new Point();
				point.x=node.x+2*node.width;
				point.y=node.y;
				return point;
			}
 
		]]>
	</fx:Script>
 
	<fx:Declarations>
		<fx:XML id="dp" xmlns="">
 
			<graphml>
 
				<node id="n2" name="Jack" age="45"/>
 
				<node id="n3" name="Steeve" age="25"/>
 
				<node id="n4" name="Iyad" age="28"/>
 
				<node id="n5" name="Cyril" age="50"/>
 
			</graphml>
 
		</fx:XML>
	</fx:Declarations>
	<s:VGroup width="100%" height="100%">
		<diagrammer:Diagrammer
			id="vis"
			width="100%"
			height="100%"
			nodeLabelFields="name"
			dataProvider="{dp}"
			layout="hierarchicalCyclic"
			nodeTooltipFields="name"
			nodeTooltipPositionFunction="nodeTooltipPositionFunction"
			/>
	</s:VGroup>
 
</s:Application>
 
I wish it helps
Regards
Dhaou
Posted : 24 January 2014 18:30
I am using a custom node tooltip renderer, and trying to position the tooltips with nodeTooltipPositionFunction, as you showed in your example. I am trying to position the tooltip higher when the node gets closer to the bottom of the kalileo viewing area. When I try to modify the y position of the returned point, it seems that the node tooltip doesn't show up. Modifiying x worked for when the node gets closer to the right side of the viewing area, so I'm not sure what the problem would be.
Are you aware of anything that could cause this when using nodeTooltipPositionFunction, and custom Node Tooltip Renderers?

Also, it seems that when using nodeTooltipPositionFunction, sometimes the target area for popping up the node tooltip gets decreased to the top portion of the image (maybe 25 px or so). Is there a way to adjust or update/reset the target area for activating the node tooltip?
Posted : 02 April 2014 03:15

4 Item(s)

per page