拉斐尔饼图
我正在尝试创建饼图并在此处自定义示例: 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可能对您有用:
重叠问题通常可以通过使用以下方法来解决:
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.