Skip to content

How to show tooltips on line chart without hovering the single point #9828

Answered by kurkle
DavideViolante asked this question in Q&A
Discussion options

You must be logged in to vote

Take a look at https://www.chartjs.org/docs/latest/samples/tooltip/interactions.html

Edit: not shown in the sample, but you can further adjust the interactions with axis: 'x' | 'y' | 'xy'.
I usually end up using:

new Chart(ctx, {
  data: {...},
  options: {
    interaction: {
      mode: 'nearest',
      axis: 'x',
      intersect: false
    }
  }
});

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@AliDarrudi67
Comment options

Answer selected by DavideViolante
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@LeeLenaleee
Comment options

@harsh-hcah
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants