Issue with tooltip: mode 'index'
See original GitHub issuePlease check this code pen :- https://codepen.io/bhavin00-the-reactor/pen/abZqXWz
I used tooltip mode index. as I want only 1 tooltip item for each line, there is two line so I need 2 tooltip items (1 for each line).
When I used mode: index then It is displaying only 1 tooltip item for 1 line, but then there is issue with tooltip location some time…
I attached below image please check & help me to resolve this…
In above image, I am hovering before 3rd Jan place but tooltip is coming for 6th Jan…
Is there any other alternative right now. as It looks issue with mode: index
Expected Behavior
Current Behavior
Possible Solution
Steps to Reproduce
Context
Environment
- Chart.js version: 2.9.4
- Browser name and version: Chrome latest
- Link to your project:
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
How do I change the appearance of tooltips with mode: index ...
I want to change how Chart.js renders tooltips when using index mode. By default, Chart.js displays a line break between tooltips for each ......
Read more >Tooltip - Chart.js
If true, the tooltip mode applies only when the mouse position intersects with an element. If false, the mode will be applied at...
Read more >CM Tooltip (CMTG) - Extras - Performance and Debug Section
The performance of the Glossary Index Page is low, and you're not using it. Enable embedded mode? - This option was designed to...
Read more >Chart.js - Line Chart Tooltip Hover Mode - CodePen
Insecure Resource. The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https....
Read more >Z-Index - Stacks
.z-base, z-index: 0; .z-selected, z-index: 25; .z-active, z-index: 50; .z-dropdown, z-index: 1000; .z-popover, z-index: 2000; .z-tooltip, z-index: 3000;.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
index
mode works with the data index and for proper functionality each dataset has to have equal amount of data. The pen uses 2.7.3, but if you are really using 2.9.4 as you say, then you’d probably get the result you are looking for withmode: 'nearest', axis: 'x', intersect: false
edit: nvm, it only works correctly in v3.
Hey Guys,
I did 1 work around, I set,
mode: x
, so then there is many tooltipItems for same line,to get only 1 tooltipItem for each line, I customized tooltip.body.
Hope It will help someone.
I am closing this bug as It is already created. as per above message of @LeeLenaleee.