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

Bubble Chart Tooltip Functionality

Hi,

I am having an issue in showing the tooptip on bubble chart. Please find the attached code. I am binding a list to chart from controller. In the bubble chart i am showing the short version of the function name ('ShortFunction') as text. Now, I want to display the actual name ('Function') in tooltip. Any idea how it can be done? or should i invoke javascript function only to call to controller again and display the result as tooltip?

Thanks,
Karthick

Attachment: BubbleChartToolTip_6bd1689e.zip

4 Replies

DD Dharanidharan Dharmasivam Syncfusion Team December 13, 2017 10:52 AM UTC

Hi Karthick, 

Thanks for using our products. 

We have analyzed your query with thee provided code snippet. Your requirement can be achieved by using  tooltipInitialize event. This event will be triggered before the tooltip renders and you can able customize the text in this with respect to your requirement. Find the code snippet below to achieve this requirement. 

ASP.NET MVC: 

@(Html.EJ().Chart("container") 
//... 
.ToolTipInitialize("tooltipInitialize") 
) 
 
function tooltipInitialize(sender) { 
        var model = @Html.Raw(Json.Encode(Model)), 
            pointIndex = sender.data.pointIndex; 
        //By default depends upon the x values in series.points, the point collection will get sorted, so we need to sort your data source also with respect to x value(XBusinessValue) which is obtained from controller. 
        model = model.sort(sortNumber); 
        textCollection = sender.data.currentText.split("<br/>"); 
        textCollection[0] = model[pointIndex].Function; 
        sender.data.currentText = textCollection.join(); 
    } 
//Method to sort your data source 
    function sortNumber(a,b) { 
       return parseInt(a.XBusinessValue) - parseInt(b.XBusinessValue); 
    } 


Screenshot: 
 

Sample for reference can be find from below link. 
 
Kindly revert us, if you have any concerns. 

Thanks, 
Dharani. 



DD Dharanidharan Dharmasivam Syncfusion Team December 13, 2017 11:10 AM UTC

Hi Karthick, 

Kindly ignore the previously updated sample. Find the sample with respect to your requirement from below link. 


Dharani. 



KA Karthick December 14, 2017 12:15 PM UTC

Hi Dharani,

Thanks a lot for your help. It worked. 

Thanks,
Karthick


DD Dharanidharan Dharmasivam Syncfusion Team December 15, 2017 04:38 AM UTC

Hi Karthick, 

Thanks for the update. 

Kindly revert us, if you need further assistance. 

Dharani. 



Loader.
Live Chat Icon For mobile
Up arrow icon