简体   繁体   English

d3.js中的奶酪图

[英]Cheese diagram in d3.js

How would you implement this with d3.js: 您将如何使用d3.js实现此目标:

在此处输入图片说明

I started with sunburst diagram, but how to handle pics around circle? 我从森伯斯特图开始,但是如何处理圆周围的图片呢? How to rotate them? 如何旋转它们? etc. (assume each cheese has its png pic) 等等(假设每种奶酪都有其png图片)

To add images, you can use the SVG image tag . 要添加图像,可以使用SVG image标签 The elements added in this way can be translated and rotated in the usual manner. 以此方式添加的元素可以按通常的方式平移和旋转。 The code you're going to need is essentially the same as for a pie chart with rotated labels, for which you should be able to find plenty of examples. 您将需要的代码与带有旋转标签的饼图基本相同,为此您应该能够找到很多示例。

Here's a quick and dirty modified pie chart example that demonstrates the technique. 这是一个快速而肮脏的修改后的饼图示例 ,演示了该技术。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM