拉斐尔饼图

发布于 2024-11-26 12:31:14 字数 198 浏览 7 评论 0原文

我正在尝试创建饼图并在此处自定义示例: http://raphaeljs.com/pie.html< /a>

我需要从标签到切片绘制线条,但 IE 给我带来了麻烦,我不知道如何处理重叠的线条和标签。

以前有人这样做过吗?

I am trying to create a pie chart and am customizing the example here: http://raphaeljs.com/pie.html

I need to draw lines from the labels to the slices but IE is giving me trouble and I'm not sure what to do about overlapping lines and labels.

Has anyone done this before?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

゛时过境迁 2024-12-03 12:31:14

这可能对您有用:

重叠问题通常可以通过使用以下方法来解决:

a) raphael 元素上的“.toFront()”,该元素应出现在前台
b) 标签处的“.getBBox()”并使用其参数来确定起点。

这些函数可以在 raphaeljs 参考文献中查找。

当您尝试连接元素时,.getBBox() 应该是一个很好的开始方式。您可以轻松计算出其测量值,并使用这些值(x、y、宽度、高度)来计算路径的入口点

,从而更容易避免任何重叠。但请记住,最终的 SVG 元素直接放置在 dom 中,因此意味着可以分层工作。
重叠/部分隐藏的元素通常会为您提供巨大的动画潜力,并且使用起来并不是一件坏事。

this maybe useful to you:

Overlapping issues can usually be solved by using:

a) ".toFront()" on the raphael element, that should appear in foreground
b) ".getBBox()" at your label and use its parameters to figure out the starting point.

those functions can be looked up in the raphaeljs reference.

.getBBox() should be a good way to start, when you try to connect elements. you can easily figure out its meassurements and use those values (x,y,width,height) to calculate the entry point of your path

that makes it easier to avoid any overlapping at all. but keep in mind the end SVG elements are directly placed within the dom and therefor are meant to work in layers.
overlapping / partially hiding elements often offer you a great animation potential and are not really a bad thing to work with.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文