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.
Unfortunately, activation email could not send to your email. Please try again.

Tooltip Position

Thread ID:

Created:

Updated:

Platform:

Replies:

127514 Nov 21,2016 04:30 AM Nov 22,2016 07:32 AM JavaScript 1
loading
Tags: ejChart
Daniel Journo
Asked On November 21, 2016 04:30 AM

Hi,

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



Kind regards
Dan

Dharanidharan Dharmasivam [Syncfusion]
Replied On November 22, 2016 07:32 AM

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. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;