饼图悬停/点击事件 [英] Pie Chart hover/click event

查看:139
本文介绍了饼图悬停/点击事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在项目中使用饼图图钉,我们成功实施。我们有一个要求,我们需要在悬停时显示一些数据或点击任何饼图区域(饼图的橙色部分),如下例所示:

We use pie chart pushpin in our project and we successfully implement. we have one requirement where we need to show some data on hover or click on any pie chart area (orange part of pie chart) like below example:

我们使用下面的链接在bing map上实现饼图:

we use below link to implement pie chart on bing map:

http://bingmapsv8samples.azurewebsites.net/#Scaled%20Pie%20Chart%20Pushpins

http://bingmapsv8samples.azurewebsites.net/#Scaled%20Pie%20Chart%20Pushpins

提前致谢。

推荐答案

在这种情况下,饼图图钉是单个图像,因此为了确定单击了哪个饼图,您需要计算从饼图中心到鼠标单击的角度点,然后检查你的数据,看看这个
将落入哪个切片。
In this case the pie chart pushpins are a single image, so in order to determine which slice of pie was clicked you woud need to calculate the angle from the center of the pie chart to the mouse click point, then check your data to see which slice this would fall into.


这篇关于饼图悬停/点击事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆