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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to dynamically customize trackball tooltip text?

Platform: JavaScript |
Control: ejChart |
Published Date: May 23, 2015 |
Last Revised Date: July 1, 2019

Essential Chart supports customizing tooltip text in Trackball dynamically by using Chart’s trackToolTip event. Refer Chart events for more information about the events available in Chart.  Refer TrackToolTip event for more information about the arguments available in the track tooltip event handler.

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

JS

<div id="container"></div>
<script type="text/javascript">    
    //Event handler for trackToolTip event
    function trackTooltip(sender) {        
        if (sender.data.serIndex == 0) {           
            sender.data.currentText = "Customized trackball tooltip";
        }
    }
    $(function () {                
        $("#container").ejChart({
            trackToolTip: 'trackTooltip',
            commonSeriesOptions: {                
                type: 'line',
                dashArray: '10, 5',                
            },
            crosshair: {
                type: 'trackball',
                visible:true
            }
        });
    });
</script>

Screenshot

The following screenshot displays chart with customized trackball tooltip.

Customization of trackball tooltip text

Figure 1: Output

JS Playground sample link: Trackball tooltip customization

 

ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

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

Up arrow icon

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