We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Tooltip Position

Hi,

How can I fix the position of the tooltip to the top right of the chart?
Like this example:



Kind regards
Dan

1 Reply

DD Dharanidharan Dharmasivam Syncfusion Team November 22, 2016 12:32 PM UTC

Hi Daniel, 

Thanks for using Syncfusion product.  

We have analyzed your query. Your requirement can be achieved through chartMouseMove event. In this event, we have obtained x and y values of the chart and assigned to tooltip positions. Kindly find the code snippet below, 
 
Code Snippet: 
[JS] 
$("#container").ejChart( 
        { 
         //... 
         chartMouseMove: "chartMouseMove" 
        }); 
 
function chartMouseMove() { 
       if (document.getElementsByClassName("tooltipDivcontainer").length > 0) { 
           var ele = $("#" + this.svgObject.id + "_ChartArea")[0]; 
           var left = parseFloat(ele.getAttribute("x")) + parseFloat(ele.getAttribute("width")) - 150; 
           var top = parseFloat(ele.getAttribute("y")) + 20; 
           document.getElementsByClassName("tooltipDivcontainer")[0].style.left = left + "px"; 
           document.getElementsByClassName("tooltipDivcontainer")[0].style.top = top + "px"; 
       } 
} 

Screenshot: 
 
For your reference we have attached the sample. Kindly find the sample from below location, 
  
Thanks, 
Dharani. 


Loader.
Up arrow icon