在 WPF 中的饼图上显示百分比
Hii
谁能告诉我如何在饼图上显示百分比...... 在鼠标悬停事件上可以看到百分比,但我不知道如何显示 饼图切片的百分比......
Hii
Can anyone tell me how can I show percentage on the piechart....
The percentage is seen on mouseover event but I dont know how to show
the percentage on the piechart's slices....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您想在图表本身上添加标签(而不是工具提示),请查看 WPF 大师 Bea Stollnitz 撰写的这篇精彩博客文章。
它展示了如何以多种不同的模式做到这一点,并不仅解释了如何做到这一点,还解释了原因。
If you are looking to put labels on the chart itself (instead of tooltip), take a look at this great blog post by WPF guru Bea Stollnitz.
It shows how to do this, in many different modes, and explains not only how, but why.
查看WPF 的 amCharts 捆绑包。饼图支持切片上的标签、外部连接的标签,并包含防止标签重叠的算法。
Take a look at amCharts Bundle for WPF. Pie chart supports labels on the slices, outside connected labels and includes an algorithm to prevent label overlapping.
我刚刚遵循了本教程(只是为了确保),默认情况下,我会在鼠标悬停时将每个切片的百分比作为工具提示。
如果您发布代码,我们也许能够发现它是否有问题。
I've just followed this tutorial (just to make sure) and I get the percentages of each slice as tooltip on mouse over by default.
If you post your code we might be able to spot if there's a problem with it.
您可以在 mx:PieSeries 中使用 labelFunction,并且 lableFunction 看起来像这样,
其中描述是您想要查看的标签。
如有任何问题,请随时提出。
You can use labelFunction in mx:PieSeries, and lableFunction look like that
Where description is the label that you want to see.
feel free to ask any question.