Set the function used to compute the datatip string.
datatipSetDisplay(curve_handle,fun)
datatipSetDisplay(curve_handle)
:tip_handle A handle on a datatip. :
:
Set the function used to format the text to be displayed at the datatip point.
x=`linspace`_(-1,1,1000);
`clf`_()
`plot`_(x,`sinc`_(20*x),x,1-x^2);
e=`gce`_();e=e.children;
d21=`datatipCreate`_(e(2),600);
d22=`datatipCreate`_(e(2),200);
d1=`datatipCreate`_(e(1),700);
function str=mydisplay(curve, pt, index)
str=`msprintf`_('sinc(%-0.2g)=%-0.2g', 20*pt(1),pt(2))
endfunction
datatipSetDisplay(e(2),mydisplay)
The display function can also be used to place tip text in different locations:
function str=infodisplay(curve, pt, index)
`xinfo`_(`msprintf`_('x=%0.2g,\t 1-x^2=%0.2g', pt(1),pt(2)))
str=''
endfunction
datatipSetDisplay(e(1),infodisplay) //tip text displayed in the info bar