naver / billboard.js

📊 Re-usable, easy interface JavaScript chart library based on D3.js
https://naver.github.io/billboard.js/
MIT License
5.83k stars 351 forks source link

Charts' mouseover tooltips are not shown when using a mouse on a touchscreen laptop #3823

Closed cpeterso closed 3 months ago

cpeterso commented 3 months ago

Description

I have a Windows laptop with a touchscreen and an external monitor that is not a touchscreen. Billboard's chart tooltips do not show up when I mouse over a chart. Billboard seems to assume that "touchscreen means no mouse".

Steps to check or reproduce

  1. On a laptop with a touch screen, load https://naver.github.io/billboard.js/
  2. Using a mouse or touchpad (not the touchscreen), mouse over the bar chart.
  3. No tooltips! 😿
  4. Now tap the bar chart using the touchscreen.
  5. The tooltips appear as expected. 😸
cpeterso commented 3 months ago

I can reproduce this behavior in both Firefox 127 and Chrome 126 on Windows 11.

netil commented 3 months ago

Hi @cpeterso, the input type will be chosen according the user environment and it can't be supported in both ways simultaneously.

Try giving below option to force mouse support.

inputType: {
    mouse: true,
    touch: false
}
cpeterso commented 3 months ago

Thanks @netil! With your suggestion, tooltips now appear when using mouse on my touchscreen Windows laptop. As such, I will close this issue. 🎉

Could billboard.js use PointerEvents to abstract away the difference between mouse and touch events, allowing either or both to work on the same content?