Articles in this section
Category / Section

How to customize the trackball tooltip text dynamically in ASP.NET MVC Charts?

3 mins read

Essential Chart supports customizing tooltip text in trackball dynamically by using TrackToolTip event of Chart. Refer to Chart events for more information about the events available in  ASP.NET MVC Chart and also refer to TrackToolTip event for more information about the arguments available in the track tooltip event handler.

The event handler receives an object containing cancel, data, model and type properties. You can use the currentText property present in data property of the argument to customize the trackball tooltip text. The following code example illustrates the same.

CSHTML

@(Html.EJ().Chart("container")
    .TrackToolTip("trackTooltip")
    .Crosshair(trackball=>
        trackball.Type(CrosshairType.Trackball).Visible(true))
    .CommonSeriesOptions(options=>
        options.Type(SeriesType.Line)
            .DashArray("5,5")
            ) 
)
<script type="text/javascript">    
    //Event handler for TrackToolTip event
    function trackTooltip(sender) {        
        if (sender.data.serIndex == 0) {           
            sender.data.currentText = "Customized trackball tooltip";
        }
    }
</script>

The following screenshot displays the Chart with customized trackball tooltip.

Customized the trackball tooltip text dynamically in ASP.NET MVC Chart

Figure 1: Chart with customized trackball tooltip

Conclusion

 

Hope you enjoyed learning about how to customize the trackball tooltip text dynamically.

You can refer to our ASP.NET MVC Charts feature tour page to learn about its other groundbreaking feature representations. You can explore our ASP.NET MVC Chart documentation to understand how to present and manipulate data.

For current customers, you can check out our ASP.NET MVC components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our ASP.NET MVC Chart and other ASP.NET MVC components.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!

 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied