You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Sam, I was implementing same feature to lock tooltip when user click inside uPlot and i want to share my solution.
funtioninitTooltip(){// first we make variable to track if tooltip should be lockedletlocked=false;// initalize tooltip pluginconsttooltip={init: (u)=>{// initialize overlay like yours// add click listener on u.overu.over.addEventListener("click",()=>{// toogle locked variablelocked=!locked;// here to lock uPlot, user cannot interact to uPlot instance until lock is released (next click).// this is from option uPlot.Cursor after initializationu.cursor._lock=locked;})},setCursor: (u)=>{if(locked)return;// the rest of your update function}}returntooltip;}
How to make the tooltip stick to points
<!doctype html>
<title>Measure / Datums</title>The text was updated successfully, but these errors were encountered: