Detect mouseover of certain points within an HTML canvas?

前端 未结 7 1150
予麋鹿
予麋鹿 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 14:59

    This could be done using the method ctx.isPointInPath, but it is not implemented in ExCanvas for IE. But another solution would be to use HTML maps, like I did for this little library : http://phenxdesign.net/projects/phenx-web/graphics/example.htm you can get inspiration from it, but it is still a little buggy.

提交回复
热议问题