Chartjs-How to disable chartjs tooltip on mibile devices and small screens?

2👍

Tooltips can be disabled in the options as shown below (see Tooltip Configuration):

option: 
    tooltips: {
        enabled: false
    }
    ...
}

Instead of using a hard coded value false, you may obtain the value from a function that returns true or false depending on the screen size.

option: 
    tooltips: {
        enabled: window.screen.width > 400
    }
    ...
}

I’ve no experience in creating web apps for mobile devices. Therefore
400 is probably not the right choice. The following answer should help
finding the appropriate function: https://stackoverflow.com/a/11381730/2358409

Leave a comment