Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chart.js tooltip at any point on the chart

How do I get chart.js tooltip to work in the following way:

example : http://watchstocks.herokuapp.com/

I need the tooltip at any point on the graph, not just on a data point

like image 208
Karthik Narayan Avatar asked Jan 27 '26 18:01

Karthik Narayan


1 Answers

You can achieve a similar result using the tootip position property (the documentation includes an example of implementing a custom positioner if you prefer):

options: {
    tooltips: {
        position: 'nearest'
    }
}

See the Chart.js samples page for a demo.

Examples with more elaborate interactions are also available.

like image 128
timclutton Avatar answered Jan 31 '26 02:01

timclutton