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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

cutomizing tool tip

Thread ID:

Created:

Updated:

Platform:

Replies:

145912 Jul 12,2019 08:07 PM UTC Jul 15,2019 01:26 PM UTC ASP.NET MVC - EJ 2 2
loading
Tags: Chart
Gideon Keys
Asked On July 12, 2019 08:07 PM UTC

I have a multiple series line chart, and I was wondering if there is a way to customize the tooltip so when I hover over a point I can add a comment about the point. Then I will save the comment to my database so next time I look at this graph I can see the comment I left. Wasn't sure if this is possible? Right now my tooltip displays the x and y values for the point I'm hovering over.

Here is my code in the view:

<div>
            @Html.EJS().Chart("stdDevAsic").PrimaryXAxis(px => px.Title("Image Number").
                                         ValueType(Syncfusion.EJ2.Charts.ValueType.Category)).Series(series =>
                                         {
                                             for (var i = 0; i < countAsic; i++)
                                             {
                                                 series.Type(
                                               Syncfusion.EJ2.Charts.ChartSeriesType.Line
                                           ).DataSource(ViewBag.StandardDeviationAsic[i]).Name(ViewBag.AsicNames[i]).XName("ImageNumber").YName("Value").Add();
                                             }
                                         }
                                         ).PrimaryYAxis(py => py.Title("Value")).Title("Standard Deviation of Asics").Tooltip(tt => tt.Enable(true)).ZoomSettings(z => z.EnableMouseWheelZooming(true)).Render()
        </div>

Thanks.

Kalaimathi Chellaiah [Syncfusion]
Replied On July 15, 2019 08:28 AM UTC

Hi Team,

We are validating the requested requirement and we will update the status on or before 6:00PM IST (July 15, 2019).

Thanks,
Kalai.
 


Kalaimathi Chellaiah [Syncfusion]
Replied On July 15, 2019 01:26 PM UTC

Hi Gideon, 
 
Greetings from Syncfusion. 
 
We have analyzed your query. We can achieve your requirement using tooltipRender event. Using this event we can customize the tooltip text and assign it to the args.text. This event fires when hovering over on the chart point. We have prepared a sample based on your requirement. Please find below sample and code snippet, 
 
Code Snippet: 
var tooltipRender = function (args) { 
            if (args.series.index == 0) { 
                args.text = "<b>Series 1 Text</b><br/>" + args.point.x + ':' + args.point.y; 
 
            } else if (args.series.index == 1) { 
                args.text = "<b>Series 2 Text</b><br/>" +  args.point.x + ':' + args.point.y; 
            } else { 
                args.text = "<b>Series 3 Text</b><br/>" + args.point.x + ':' + args.point.y; 
            } 
        } 
 
Screenshot: 
 
 
 
Kindly check the above sample and revert us, if you have any queries. 
 
Regards, 
Kalai. 
 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon