Detect mouseover of certain points within an HTML canvas?

前端 未结 7 1176
予麋鹿
予麋鹿 2020-12-02 14:45

I\'ve built an analytical data visualization engine for Canvas and have been requested to add tooltip-like hover over data elements to display detailed metrics for the data

7条回答
  •  孤街浪徒
    2020-12-02 15:07

    I would suggest overlaying an image map with proper coordinates set on the areas to match your canvas-drawn items. This way, you get tooltips AND a whole lot of other DOM/Browser functionality for free.

提交回复
热议问题